/* tr-c-efr.p - Update trigger for emp-fringe */ TRIGGER PROCEDURE FOR WRITE OF emp-fringe NEW emp-fringe OLD old-fringe. /* Include Commons */ {common.i} DEFINE VARIABLE gotAChange AS LOGICAL INITIAL FALSE NO-UNDO. DEFINE VARIABLE iterator AS INTEGER NO-UNDO. /* Assign user, date & time of update */ ASSIGN emp-fringe.upd-date = TODAY emp-fringe.upd-time = STRING(TIME, "HH:MM:SS") emp-fringe.upd-user-name = menu-user. ON WRITE OF fringe-period OVERRIDE DO: END. /* If anything real changes, flag the period as needing recalc'd */ IF emp-fringe.annual-obligation <> old-fringe.annual-obligation OR emp-fringe.cur-employee-obligation <> old-fringe.cur-employee-obligation OR emp-fringe.cur-employer-cost <> old-fringe.cur-employer-cost OR emp-fringe.deduct-id <> old-fringe.deduct-id OR emp-fringe.end-date <> old-fringe.end-date OR emp-fringe.fringe-active <> old-fringe.fringe-active OR emp-fringe.fringe-code-id <> old-fringe.fringe-code-id OR emp-fringe.fringe-covered <> old-fringe.fringe-covered OR emp-fringe.period-obligation <> old-fringe.period-obligation OR emp-fringe.start-date <> old-fringe.start-date OR emp-fringe.proj-employer-cost <> old-fringe.proj-employer-cost THEN gotAChange = TRUE. DO iterator = 1 TO 10: IF emp-fringe.employee-acct-mask[iterator] <> old-fringe.employee-acct-mask[iterator] THEN gotAChange = TRUE. END. IF gotAChange THEN DO: FIND fringe-period EXCLUSIVE-LOCK WHERE fringe-period.payroll-year = emp-fringe.payroll-year AND fringe-period.fringe-period-id = emp-fringe.fringe-period-id. ASSIGN fringe-period.needs-recalc = TRUE fringe-period.needs-repush = TRUE. END. /* Go back */ RETURN.