Really, this should be it, for the passing income.
[capital-apms-progress.git] / process / one-off / cofa-ird.p
blob24e11c9cbe3e438ef14a6f96e1653b00eb8d2ddd
1 DEF VAR first-month AS INT NO-UNDO.
2 DEF VAR last-month AS INT NO-UNDO.
4 DEF TEMP-TABLE Account-List NO-UNDO
5 FIELD AccountCode AS DECIMAL
7 INDEX ac-code IS PRIMARY AccountCode.
9 FIND FIRST Month WHERE Month.StartDate >= DATE( 4,1,95) NO-LOCK.
10 first-month = Month.MonthCode.
11 FIND LAST Month WHERE Month.StartDate >= DATE( 4,1,95) NO-LOCK.
12 last-month = Month.MonthCode.
14 FOR EACH Company NO-LOCK, EACH AccountBalance NO-LOCK
15 WHERE AccountBalance.EntityType = "L"
16 AND AccountBalance.EntityCode = Company.CompanyCode
17 AND AccountBalance.MonthCode >= first-month
18 AND AccountBalance.MonthCode <= last-month
19 AND NOT CAN-FIND( Account-List WHERE Account-List.AccountCode = AccountBalance.AccountCode ):
20 CREATE Account-List.
21 Account-List.AccountCode = AccountBalance.AccountCode.
22 END.
24 OUTPUT TO cofa-ird.txt KEEP-MESSAGES.
25 FOR EACH AccountGroup NO-LOCK, EACH ChartOfAccount NO-LOCK OF AccountGroup
26 WHERE CAN-FIND( Account-List OF ChartOfAccount)
27 BREAK BY AccountGroup.SequenceCode:
29 IF FIRST-OF(AccountGroup.SequenceCode) THEN DO:
30 PUT UNFORMATTED STRING( AccountGroup.AccountGroupCode, "X(4)") + " "
31 + STRING( AccountGroup.Name, "X(50)") SKIP.
32 END.
34 PUT UNFORMATTED " " STRING( ChartOfAccount.AccountCode, "9999.99") + " "
35 + ChartOfAccount.Name SKIP.
37 IF LAST-OF(AccountGroup.SequenceCode) THEN DO:
38 PUT SKIP(1).
39 END.
41 END.
42 OUTPUT CLOSE.