1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
7 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
9 DEF VAR account-group
AS CHAR NO-UNDO.
10 DEF VAR by-code
AS LOGI
NO-UNDO.
11 DEF VAR by-group
AS LOGI
NO-UNDO.
12 DEF VAR by-name
AS LOGI
NO-UNDO.
13 DEF VAR all-records
AS LOGI
NO-UNDO INITIAL No.
14 DEF VAR preview
AS LOGI
NO-UNDO INIT Yes.
17 DEF VAR user-name
AS CHAR NO-UNDO.
18 {inc
/username.i
"user-name"}
19 DEF VAR timeStamp
AS CHAR FORMAT "X(44)" NO-UNDO.
20 timeStamp
= STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
22 DEF VAR default-font
AS CHAR NO-UNDO INITIAL "courier,normal,fixed,cpi,18,lpi,9".
24 /* _UIB-CODE-BLOCK-END
*/
28 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
30 /* ******************** Preprocessor Definitions
******************** */
32 &Scoped-define PROCEDURE-TYPE Procedure
36 /* _UIB-PREPROCESSOR-BLOCK-END
*/
41 /* *********************** Procedure Settings
************************ */
43 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
44 /* Settings for
THIS-PROCEDURE
48 Add Fields to
: Neither
49 Other Settings
: CODE-ONLY
COMPILE
51 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
53 /* ************************* Create Window
************************** */
55 &ANALYZE-SUSPEND _CREATE-WINDOW
56 /* DESIGN Window definition
(used by the UIB
)
57 CREATE WINDOW Procedure
ASSIGN
60 /* END WINDOW DEFINITION
*/
66 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
67 /* ************************* Included-Libraries
*********************** */
69 {inc
/method
/m-txtrep.i
}
71 /* _UIB-CODE-BLOCK-END
*/
76 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
79 /* *************************** Main Block
*************************** */
83 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
85 RUN pclrep-start
( preview
, "reset,portrait,tm,2,a4,lm,6," + default-font
).
93 /* _UIB-CODE-BLOCK-END
*/
97 /* ********************** Internal Procedures
*********************** */
99 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE coa-listing Procedure
100 PROCEDURE coa-listing
:
101 /*------------------------------------------------------------------------------
105 ------------------------------------------------------------------------------*/
107 IF account-group
= "ALL" THEN DO:
109 FOR EACH ChartOfAccount
NO-LOCK WHERE (all-records
OR ChartOfAccount.UpdateTo
<> ""):
112 ELSE IF by-group
THEN
113 FOR EACH AccountGroup
NO-LOCK BY AccountGroup.SequenceCode
:
114 RUN each-account-group.
117 FOR EACH ChartOfAccount
NO-LOCK WHERE (all-records
OR ChartOfAccount.UpdateTo
<> "")
118 BY ChartOfAccount.Name
:
123 FIND FIRST AccountGroup
WHERE AccountGroup.AccountGroupCode
= account-group
125 IF NOT AVAILABLE AccountGroup
THEN RETURN.
128 FOR EACH ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountGroupCode
= AccountGroup.AccountGroupCode
129 AND (all-records
OR ChartOfAccount.UpdateTo
<> ""):
132 ELSE IF by-group
THEN
133 RUN each-account-group.
135 FOR EACH ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountGroupCode
= AccountGroup.AccountGroupCode
136 AND (all-records
OR ChartOfAccount.UpdateTo
<> "")
137 BY ChartOfAccount.Name
:
145 /* _UIB-CODE-BLOCK-END
*/
149 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-account-group Procedure
150 PROCEDURE each-account-group
:
151 /*------------------------------------------------------------------------------
155 ------------------------------------------------------------------------------*/
157 RUN pclrep-line
( "Helvetica,Point,8,Proportional,Bold", AccountGroup.AccountGroupCode
+ " - " + AccountGroup.Name
).
158 RUN pclrep-line
( default-font
, "~n" ).
160 FOR EACH ChartOfAccount
OF AccountGroup
NO-LOCK:
164 RUN pclrep-line
( default-font
, "~n" ).
168 /* _UIB-CODE-BLOCK-END
*/
172 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-coa Procedure
174 /*------------------------------------------------------------------------------
176 ------------------------------------------------------------------------------*/
177 IF NOT all-records
AND TRIM( ChartOfAccount.UpdateTo
, ", " ) = "" THEN RETURN.
179 RUN pclrep-line
( default-font
,
180 STRING( ChartOfAccount.AccountCode
, "9999.99" ) + SPC
( 4 ) +
181 STRING( ChartOfAccount.Name
, "X(50)" ) + SPC
( 4 ) +
182 STRING( ChartOfAccount.UpdateTo
, "X(12)" ) + SPC
( 4 ) +
183 STRING( ChartOfAccount.HighVolume
, "Y/N" )
188 /* _UIB-CODE-BLOCK-END
*/
192 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
193 PROCEDURE inst-page-footer
:
194 /*------------------------------------------------------------------------------
195 Purpose
: Print any page footer
196 ------------------------------------------------------------------------------*/
200 /* _UIB-CODE-BLOCK-END
*/
204 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-header Procedure
205 PROCEDURE inst-page-header
:
206 /*------------------------------------------------------------------------------
207 Purpose
: Print any page header
208 ------------------------------------------------------------------------------*/
210 RUN pclrep-line
( "univers,Point,7,bold,Proportional", TimeStamp
).
211 RUN pclrep-line
( "univers,Point,12,bold,Proportional", FILL( " ", 30) + "Chart Of Account Listing " +
212 ( IF by-code
THEN "by Account Code" ELSE
213 IF by-group
THEN "by Account Group" ELSE
214 IF by-name
THEN "by Account Name" ELSE "" ) +
215 ( IF account-group
<> "ALL" THEN " (" + account-group
+ ")" ELSE "" )
218 RUN pclrep-line
( default-font
, "").
219 RUN pclrep-line
( default-font
+ ",Bold",
220 STRING( "Code", "X(7)" ) + SPC
( 4 ) +
221 STRING( "Name", "X(50)" ) + SPC
(4) +
222 STRING( "Updates", "X(10)" ) + SPC
(4) +
223 STRING( "Volume" ) + "~n"
228 /* _UIB-CODE-BLOCK-END
*/
232 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
233 PROCEDURE parse-parameters
:
234 /*------------------------------------------------------------------------------
238 ------------------------------------------------------------------------------*/
240 DEF VAR i
AS INT NO-UNDO.
241 DEF VAR token
AS CHAR NO-UNDO.
243 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
244 token
= ENTRY( i
, report-options
, "~n" ).
245 CASE ENTRY( 1, token
):
246 WHEN "Account" THEN ASSIGN account-group
= ENTRY( 2, token
).
247 WHEN "Preview" THEN preview
= ENTRY( 2, token
) = "Yes".
248 WHEN "AllRecords" THEN all-records
= Yes.
250 CASE ENTRY( 2, token
):
251 WHEN "Account" THEN by-code
= Yes.
252 WHEN "Group" THEN by-group
= Yes.
253 WHEN "Name" THEN by-name
= Yes.
261 /* _UIB-CODE-BLOCK-END
*/