Add blank column, rename column.
[capital-apms-progress.git] / process / report / coalistg.p
blobeedf97a76291c95eb5bf98e0ee026cd57474750e
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
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.
15 RUN parse-parameters.
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 */
25 &ANALYZE-RESUME
28 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
30 /* ******************** Preprocessor Definitions ******************** */
32 &Scoped-define PROCEDURE-TYPE Procedure
36 /* _UIB-PREPROCESSOR-BLOCK-END */
37 &ANALYZE-RESUME
41 /* *********************** Procedure Settings ************************ */
43 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
44 /* Settings for THIS-PROCEDURE
45 Type: Procedure
46 Allow:
47 Frames: 0
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
58 HEIGHT = .43
59 WIDTH = 35.86.
60 /* END WINDOW DEFINITION */
62 &ANALYZE-RESUME
66 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
67 /* ************************* Included-Libraries *********************** */
69 {inc/method/m-txtrep.i}
71 /* _UIB-CODE-BLOCK-END */
72 &ANALYZE-RESUME
76 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
79 /* *************************** Main Block *************************** */
81 RUN parse-parameters.
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).
87 RUN coa-listing.
89 OUTPUT CLOSE.
91 RUN pclrep-finish.
93 /* _UIB-CODE-BLOCK-END */
94 &ANALYZE-RESUME
97 /* ********************** Internal Procedures *********************** */
99 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE coa-listing Procedure
100 PROCEDURE coa-listing :
101 /*------------------------------------------------------------------------------
102 Purpose:
103 Parameters: <none>
104 Notes:
105 ------------------------------------------------------------------------------*/
107 IF account-group = "ALL" THEN DO:
108 IF by-code THEN
109 FOR EACH ChartOfAccount NO-LOCK WHERE (all-records OR ChartOfAccount.UpdateTo <> ""):
110 RUN each-coa.
111 END.
112 ELSE IF by-group THEN
113 FOR EACH AccountGroup NO-LOCK BY AccountGroup.SequenceCode:
114 RUN each-account-group.
115 END.
116 ELSE IF by-name THEN
117 FOR EACH ChartOfAccount NO-LOCK WHERE (all-records OR ChartOfAccount.UpdateTo <> "")
118 BY ChartOfAccount.Name:
119 RUN each-coa.
120 END.
121 END.
122 ELSE DO:
123 FIND FIRST AccountGroup WHERE AccountGroup.AccountGroupCode = account-group
124 NO-LOCK NO-ERROR.
125 IF NOT AVAILABLE AccountGroup THEN RETURN.
127 IF by-code THEN
128 FOR EACH ChartOfAccount NO-LOCK WHERE ChartOfAccount.AccountGroupCode = AccountGroup.AccountGroupCode
129 AND (all-records OR ChartOfAccount.UpdateTo <> ""):
130 RUN each-coa.
131 END.
132 ELSE IF by-group THEN
133 RUN each-account-group.
134 ELSE IF by-name THEN
135 FOR EACH ChartOfAccount NO-LOCK WHERE ChartOfAccount.AccountGroupCode = AccountGroup.AccountGroupCode
136 AND (all-records OR ChartOfAccount.UpdateTo <> "")
137 BY ChartOfAccount.Name:
138 RUN each-coa.
139 END.
141 END.
143 END PROCEDURE.
145 /* _UIB-CODE-BLOCK-END */
146 &ANALYZE-RESUME
149 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-account-group Procedure
150 PROCEDURE each-account-group :
151 /*------------------------------------------------------------------------------
152 Purpose:
153 Parameters: <none>
154 Notes:
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:
161 RUN each-coa.
162 END.
164 RUN pclrep-line( default-font, "~n" ).
166 END PROCEDURE.
168 /* _UIB-CODE-BLOCK-END */
169 &ANALYZE-RESUME
172 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-coa Procedure
173 PROCEDURE each-coa :
174 /*------------------------------------------------------------------------------
175 Purpose:
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" )
186 END PROCEDURE.
188 /* _UIB-CODE-BLOCK-END */
189 &ANALYZE-RESUME
192 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
193 PROCEDURE inst-page-footer :
194 /*------------------------------------------------------------------------------
195 Purpose: Print any page footer
196 ------------------------------------------------------------------------------*/
198 END PROCEDURE.
200 /* _UIB-CODE-BLOCK-END */
201 &ANALYZE-RESUME
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"
226 END PROCEDURE.
228 /* _UIB-CODE-BLOCK-END */
229 &ANALYZE-RESUME
232 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
233 PROCEDURE parse-parameters :
234 /*------------------------------------------------------------------------------
235 Purpose:
236 Parameters: <none>
237 Notes:
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.
249 WHEN "Sort" THEN
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.
254 END CASE.
255 END CASE.
257 END.
259 END PROCEDURE.
261 /* _UIB-CODE-BLOCK-END */
262 &ANALYZE-RESUME