OBJECT Codeunit 3 G/L Account-Indent { OBJECT-PROPERTIES { Date=; Time=; Version List=; } PROPERTIES { OnRun=BEGIN IF NOT CONFIRM( Text000 + Text001 + Text002 + Text003,TRUE) THEN EXIT; Indent; END; } CODE { VAR Text000@1000 : TextConst 'ENU="This function updates the indentation of all the G/L accounts in the chart of accounts. "'; Text001@1001 : TextConst 'ENU="All accounts between a Begin-Total and the matching End-Total are indented one level. "'; Text002@1002 : TextConst 'ENU=The Totaling for each End-total is also updated.'; Text003@1003 : TextConst 'ENU=\\Do you want to indent the chart of accounts?'; Text004@1004 : TextConst 'ENU=Indenting the Chart of Accounts #1##########'; Text005@1005 : TextConst 'ENU=End-Total %1 is missing a matching Begin-Total.'; GLAcc@1006 : Record 15; Window@1007 : Dialog; AccNo@1008 : ARRAY [10] OF Code[20]; i@1009 : Integer; PROCEDURE Indent@1(); BEGIN Window.OPEN(Text004); WITH GLAcc DO IF FIND('-') THEN REPEAT Window.UPDATE(1,"No."); IF "Account Type" = "Account Type"::"End-Total" THEN BEGIN IF i < 1 THEN ERROR( Text005, "No."); Totaling := AccNo[i] + '..' + "No."; i := i - 1; END; Indentation := i; MODIFY; IF "Account Type" = "Account Type"::"Begin-Total" THEN BEGIN i := i + 1; AccNo[i] := "No."; END; UNTIL NEXT = 0; Window.CLOSE; END; PROCEDURE RunICAccountIndent@4(); BEGIN IF NOT CONFIRM( Text000 + Text001 + Text003,TRUE) THEN EXIT; IndentICAccount; END; PROCEDURE IndentICAccount@2(); VAR ICGLAcc@1000 : Record 410; BEGIN Window.OPEN(Text004); WITH ICGLAcc DO IF FIND('-') THEN REPEAT Window.UPDATE(1,"No."); IF "Account Type" = "Account Type"::"End-Total" THEN BEGIN IF i < 1 THEN ERROR( Text005, "No."); i := i - 1; END; Indentation := i; MODIFY; IF "Account Type" = "Account Type"::"Begin-Total" THEN BEGIN i := i + 1; AccNo[i] := "No."; END; UNTIL NEXT = 0; Window.CLOSE; END; BEGIN END. } }