Really, this should be it, for the passing income.
[capital-apms-progress.git] / trigger / crcrdtor.p
blobe63cadd788aa3bbb264fc5b84f9d25244b071201
1 TRIGGER PROCEDURE FOR CREATE OF Creditor.
3 DEF BUFFER LastCreditor FOR Creditor.
4 DEF VAR creditor-no AS INT NO-UNDO.
6 FIND LAST LastCreditor NO-LOCK NO-ERROR.
7 IF AVAILABLE(LastCreditor) AND LastCreditor.CreditorCode >= 99999 THEN DO:
8 FIND LAST LastCreditor WHERE LastCreditor.CreditorCode < 30000 NO-LOCK NO-ERROR.
9 IF AVAILABLE(LastCreditor) AND LastCreditor.CreditorCode = 29999 THEN DO:
10 FIND LAST LastCreditor WHERE LastCreditor.CreditorCode < 90000 NO-LOCK NO-ERROR.
11 /* sort this one out when we need to */
12 END.
13 END.
14 creditor-no = IF AVAILABLE LastCreditor THEN LastCreditor.CreditorCode + 1 ELSE 1.
16 ASSIGN Creditor.CreditorCode = creditor-no.