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
):
21 Account-List.AccountCode
= AccountBalance.AccountCode.
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.
34 PUT UNFORMATTED " " STRING( ChartOfAccount.AccountCode
, "9999.99") + " "
35 + ChartOfAccount.Name
SKIP.
37 IF LAST-OF(AccountGroup.SequenceCode
) THEN DO: