Update Fast Formula for Allowances Based on Employee Criteria

Using the Fast Formulas task, replace the text in the earnings element formula for this newly created element Prime de Presence au bureau with the code shown and recompile the formula.

The sample formula shown here calculates the prime de presence au bureau by multiplying one tenth of the daily Salaire de Base (= Monthly SALAIRE_DE_BASE / 21,67) by the nombre de jours au bureau input value (=10 days in this example). This balance holds the value for this assignment.

  • FORMULA NAME: PRIME_DE_PRESENCE_AU_BUREAU_EARN
  • FORMULA TYPE: Payroll
  • DESCRIPTION: This is a sample formula for processing a unit x rate earning element. The formula assumes that that units (in this case, the number of days in the office) are available in element entries.
  • Formula Results: l_value Direct Result for Earnings Pay Value.
/* Default for Database Items  */

              DEFAULT FOR SALAIRE_DE_BASE_ASG_RUN is 0

/* Default for Inputs  */

              DEFAULT for pay_value is 0
              DEFAULT for DAYS is 0
              DEFAULT for rate is 0

              INPUTS ARE        Days
                               
                
/* Declarations */ 
               l_value            = 0              
               l_nombre_de_jours_au_bureau = 0
               l_rate             = 0
             
                 SET_INPUT('BASE',0)
                EXECUTE('CALL_CALC_VALUE')
                l_amount = GET_OUTPUT('DED_AMOUNT',0)

l_nombre_de_jours_au_bureau = Days
l_log = PAY_INTERNAL_LOG_WRITE('(l_nombre_de_jours_au_bureau : '||TO_CHAR(l_nombre_de_jours_au_bureau))

l_monthly_earnings = SALAIRE_DE_BASE_ASG_RUN
l_rate= l_monthly_earnings/21.67/10 * l_amount
l_prime_de_presence_au_bureau = l_monthly_earnings/21.67/10 * l_amount * l_nombre_de_jours_au_bureau
l_log = PAY_INTERNAL_LOG_WRITE(' l_prime_de_presence_au_bureau : '||TO_CHAR(l_prime_de_presence_au_bureau ))
l_log = PAY_INTERNAL_LOG_WRITE(' l_rate : '||TO_CHAR(l_rate ))

l_value = l_prime_de_presence_au_bureau
return l_value
/* End Formula Text */