DBA Data[Home] [Help]

TRIGGER: APPS.SSP_ERN_T1

Source

Description
ssp_ern_t1
AFTER UPDATE
OF AVERAGE_EARNINGS_AMOUNT
ON SSP_EARNINGS_CALCULATIONS
FOR EACH ROW
Type
AFTER EACH ROW
Event
UPDATE
Column
When

old.average_earnings_amount <> new.average_earnings_amount
    
Referencing
REFERENCING NEW AS NEW OLD AS OLD
Body
DECLARE
BEGIN
if hr_general.g_data_migrator_mode <> 'Y' then
 if ssp_ssp_pkg.ssp_is_installed
  then
    if
       -- the change in amount crosses the NI LEL boundary
       ((:old.average_earnings_amount
                   < ssp_smp_support_pkg.NI_lower_earnings_limit (:old.effective_date)
           and :new.average_earnings_amount
                         >= ssp_smp_support_pkg.NI_lower_earnings_limit (:new.effective_date))
      or  ((:old.average_earnings_amount
                        >= ssp_smp_support_pkg.NI_lower_earnings_limit (:old.effective_date)
           and :new.average_earnings_amount
                              < ssp_smp_support_pkg.NI_lower_earnings_limit
			      (:new.effective_date))))
    then

      -- Recalculate SSP only if the change will affect entitlement
      ssp_ssp_pkg.earnings_control (:new.person_id, :new.effective_date);

    end if;

    -- Recalculate SMP in all cases where the amount changes
    ssp_smp_pkg.earnings_control (:new.person_id, :new.effective_date);

  end if;
end if;
END;