Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / one-off / integchk.p
blob6825eef691f45049b3e9fb7d6099b456ac122a08
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /* The report options are:
5 * Entity-Type,<T> - only entity type "<T>" is examined
6 * Entity-Range,<e1>,<en> - only entities in the range <e1> to <en> are checked
7 * Action,<action> - <action> may be "Fix" or "Check"
8 * Preview - causes report to be previewed
9 */
10 DEF INPUT PARAMETER report-options AS CHAR NO-UNDO.
12 DEF VAR fix-action AS CHAR INITIAL "Check" NO-UNDO.
13 DEF VAR preview AS LOGICAL NO-UNDO INITIAL No.
14 DEF VAR month-1 AS INT NO-UNDO INITIAL -99999.
15 DEF VAR month-n AS INT NO-UNDO INITIAL 99999.
16 DEF VAR entity-t AS CHAR NO-UNDO INITIAL "".
17 DEF VAR entity-1 AS INT NO-UNDO INITIAL 0.
18 DEF VAR entity-n AS INT NO-UNDO INITIAL 99999.
19 DEF VAR file-name AS CHAR NO-UNDO INITIAL "".
20 DEF VAR exporting AS LOGI NO-UNDO.
21 DEF VAR check-TBS AS LOGI NO-UNDO INITIAL No.
22 DEF VAR check-Cr AS LOGI NO-UNDO INITIAL No.
23 DEF VAR check-Db AS LOGI NO-UNDO INITIAL No.
24 DEF VAR check-batches AS LOGI NO-UNDO INITIAL No.
25 DEF VAR batch-1 AS INT NO-UNDO INITIAL -99999.
26 DEF VAR batch-n AS INT NO-UNDO INITIAL 99999.
27 DEF VAR test-sub-bal AS LOGI NO-UNDO INITIAL No.
28 DEF VAR test-no-gl AS LOGI NO-UNDO INITIAL No.
29 DEF VAR test-no-sub AS LOGI NO-UNDO INITIAL No.
30 DEF VAR test-groups AS LOGI NO-UNDO INITIAL No.
31 RUN parse-parameters.
33 DEF VAR act-total AS DECIMAL NO-UNDO.
34 DEF VAR actt-total AS DECIMAL NO-UNDO.
35 DEF VAR acb-total AS DECIMAL NO-UNDO.
36 DEF VAR cls-total AS DECIMAL NO-UNDO.
37 DEF VAR act-missing AS CHAR NO-UNDO.
39 /* formatting stuff */
40 DEF VAR column-head AS CHAR NO-UNDO INITIAL "".
41 DEF VAR need-header AS LOGI NO-UNDO INITIAL Yes.
42 DEF VAR base-font AS CHAR NO-UNDO INITIAL "Courier,cpi,19,lpi,8,Fixed,Normal".
43 DEF VAR section-font AS CHAR NO-UNDO INITIAL "univers,Point,8,bold,Proportional".
44 DEF VAR user-name AS CHAR NO-UNDO.
45 {inc/username.i "user-name"}
47 {inc/ofc-this.i}
48 {inc/ofc-acct.i "DEBTORS" "sundry-debtors"}
49 {inc/ofc-acct.i "CREDITORS" "sundry-creditors"}
50 DEF VAR creditor-company AS INT NO-UNDO.
51 creditor-company = OfficeControlAccount.EntityCode.
53 DEF VAR timeStamp AS CHAR FORMAT "X(44)" NO-UNDO.
54 timeStamp = STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
56 DEF TEMP-TABLE GL-Bal NO-UNDO
57 FIELD CompanyCode AS INT FORMAT ">>999" LABEL " Coy"
58 FIELD AccountCode AS INT FORMAT "9999.99" LABEL "Account"
59 FIELD MonthCode AS INT
60 FIELD Balance AS DEC FORMAT ">>>,>>>,>>9.99CR" LABEL " Tnt Sum".
62 DEF TEMP-TABLE IC-Bal NO-UNDO
63 FIELD CompanyCode AS INT FORMAT ">>999" LABEL " Coy"
64 FIELD MonthCode AS INT
65 FIELD Amount AS DEC.
67 DEF TEMP-TABLE DoneIt NO-UNDO
68 FIELD KeyDone AS CHAR
69 INDEX XPKDone IS UNIQUE PRIMARY KeyDone.
71 /* _UIB-CODE-BLOCK-END */
72 &ANALYZE-RESUME
75 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
77 /* ******************** Preprocessor Definitions ******************** */
79 &Scoped-define PROCEDURE-TYPE Procedure
83 /* _UIB-PREPROCESSOR-BLOCK-END */
84 &ANALYZE-RESUME
87 /* ************************ Function Prototypes ********************** */
89 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD accttran-error Procedure
90 FUNCTION accttran-error RETURNS CHARACTER
91 ( INPUT error-text AS CHAR ) FORWARD.
93 /* _UIB-CODE-BLOCK-END */
94 &ANALYZE-RESUME
97 /* *********************** Procedure Settings ************************ */
99 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
100 /* Settings for THIS-PROCEDURE
101 Type: Procedure
102 Allow:
103 Frames: 0
104 Add Fields to: Neither
105 Other Settings: CODE-ONLY COMPILE
107 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
109 /* ************************* Create Window ************************** */
111 &ANALYZE-SUSPEND _CREATE-WINDOW
112 /* DESIGN Window definition (used by the UIB)
113 CREATE WINDOW Procedure ASSIGN
114 HEIGHT = .33
115 WIDTH = 39.43.
116 /* END WINDOW DEFINITION */
118 &ANALYZE-RESUME
122 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
123 /* ************************* Included-Libraries *********************** */
125 {inc/method/m-txtrep.i}
126 {inc/null.i}
128 /* _UIB-CODE-BLOCK-END */
129 &ANALYZE-RESUME
133 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
136 /* *************************** Main Block *************************** */
137 OUTPUT TO VALUE(txtrep-print-file) KEEP-MESSAGES PAGE-SIZE 0.
139 RUN pclrep-start( preview, "reset,portrait,tm,2,a4,lm,6,courier,cpi,18,lpi,9").
141 IF check-TBS THEN DO:
143 DEF VAR ledger-t AS DEC INITIAL 0 NO-UNDO.
144 DEF VAR ledger-b AS DEC INITIAL 0 NO-UNDO.
145 DEF VAR ledger-s AS DEC INITIAL 0 NO-UNDO.
147 column-head = " Account Month Acct Balance Trans. Value ".
148 RUN check-missing-balances( (fix-action = "Fix") ).
149 /* RUN check-missing-summaries( (fix-action = "Fix") ). */
150 RUN check-account-balances( (fix-action = "Fix") ).
151 RUN check-account-summaries( (fix-action = "Fix") ).
153 RUN pclrep-down-by(2).
154 RUN pclrep-line( base-font, "GL Totals: Summary = " + STRING( ledger-s, "->>,>>>,>>>,>>9.99") ).
155 RUN pclrep-line( base-font, " Balances = " + STRING( ledger-b, "->>,>>>,>>>,>>9.99") ).
156 RUN pclrep-line( base-font, " Transactions = " + STRING( ledger-b, "->>,>>>,>>>,>>9.99") ).
157 END.
158 IF check-db THEN RUN check-tenants.
159 IF check-cr THEN RUN check-creditors.
161 IF check-batches THEN
162 RUN check-batch-intercompany.
165 OUTPUT CLOSE.
166 RUN view-output-file ( preview ).
168 /* _UIB-CODE-BLOCK-END */
169 &ANALYZE-RESUME
172 /* ********************** Internal Procedures *********************** */
174 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-account-balances Procedure
175 PROCEDURE check-account-balances :
176 /*------------------------------------------------------------------------------
177 Purpose:
178 ------------------------------------------------------------------------------*/
179 DEF INPUT PARAMETER fix-it AS LOGICAL NO-UNDO.
181 DEF VAR month-text AS CHAR NO-UNDO.
182 RUN new-section( "Checking account balance records" ).
184 FOR EACH AccountBalance NO-LOCK WHERE AccountBalance.EntityType BEGINS entity-t
185 AND AccountBalance.EntityCode >= entity-1
186 AND AccountBalance.EntityCode <= entity-n
187 AND AccountBalance.MonthCode >= month-1
188 AND AccountBalance.MonthCode <= month-n
189 BY AccountBalance.EntityType BY AccountBalance.EntityCode
190 BY AccountBalance.AccountCode BY AccountBalance.MonthCode:
192 actt-total = 0.
193 FOR EACH AcctTran NO-LOCK OF AccountBalance:
194 actt-total = actt-total + AcctTran.Amount.
195 END.
196 IF actt-total <> AccountBalance.Balance THEN DO:
197 FIND Month WHERE Month.MonthCode = AccountBalance.MonthCode NO-LOCK.
198 month-text = SUBSTRING( STRING( Month.StartDate, "99/99/9999" ), 4, 7).
199 RUN test-headers.
200 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5 &6",
201 AccountBalance.EntityType,
202 STRING(AccountBalance.EntityCode, "99999"),
203 STRING(AccountBalance.AccountCode, "9999.99"),
204 month-text,
205 STRING( AccountBalance.Balance, ">>>,>>>,>>>,>>9.99CR"),
206 STRING( actt-total, ">>>,>>>,>>>,>>9.99CR") )).
207 IF fix-it THEN DO:
208 RUN set-account-balance( AccountBalance.EntityType,
209 AccountBalance.EntityCode, AccountBalance.AccountCode,
210 AccountBalance.MonthCode, actt-total ).
211 END.
212 END.
214 IF AccountBalance.EntityType = "L" THEN ASSIGN
215 ledger-t = ledger-t + actt-total
216 ledger-b = ledger-b + AccountBalance.Balance.
218 END.
220 END PROCEDURE.
222 /* _UIB-CODE-BLOCK-END */
223 &ANALYZE-RESUME
226 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-account-summaries Procedure
227 PROCEDURE check-account-summaries :
228 /*------------------------------------------------------------------------------
229 Purpose:
230 ------------------------------------------------------------------------------*/
231 DEF INPUT PARAMETER fix-it AS LOGICAL NO-UNDO.
233 RUN new-section( "Checking account summary records" ).
235 FOR EACH AccountSummary NO-LOCK WHERE AccountBalance.EntityType BEGINS entity-t
236 AND AccountSummary.EntityCode >= entity-1
237 AND AccountSummary.EntityCode <= entity-n
238 BY AccountSummary.EntityType
239 BY AccountSummary.EntityCode
240 BY AccountSummary.AccountCode:
242 acb-total = 0.
243 FOR EACH AccountBalance NO-LOCK OF AccountSummary:
244 acb-total = acb-total + AccountBalance.Balance.
245 END.
246 IF AccountSummary.EntityType <> "J" THEN RUN check-chart-of-accounts( fix-it ).
247 IF acb-total <> AccountSummary.Balance THEN DO:
248 RUN test-headers.
249 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5",
250 AccountSummary.EntityType,
251 STRING(AccountSummary.EntityCode, "99999"),
252 STRING(AccountSummary.AccountCode, "9999.99"),
253 STRING( AccountSummary.Balance, ">>>,>>>,>>>,>>9.99CR"),
254 STRING( acb-total, ">>>,>>>,>>>,>>9.99CR") )).
255 IF fix-it THEN DO:
256 RUN set-account-summary( AccountSummary.EntityType,
257 AccountSummary.EntityCode, AccountSummary.AccountCode, acb-total ).
258 END.
259 END.
261 IF AccountSummary.EntityType = "L" THEN ASSIGN
262 ledger-b = ledger-b + acb-total
263 ledger-s = ledger-s + AccountSummary.Balance.
265 END.
267 END PROCEDURE.
269 /* _UIB-CODE-BLOCK-END */
270 &ANALYZE-RESUME
273 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-batch-intercompany Procedure
274 PROCEDURE check-batch-intercompany :
275 /*------------------------------------------------------------------------------
276 Purpose:
277 ------------------------------------------------------------------------------*/
278 DEF VAR batch-total AS DEC NO-UNDO.
279 DEF VAR n-bad AS INT NO-UNDO INITIAL 0.
281 column-head = " Account Month Acct Balance Trans. Value ".
282 RUN new-section( "Checking batches" ).
284 FOR EACH Batch WHERE Batch.BatchCode >= batch-1
285 AND Batch.BatchCode <= batch-n NO-LOCK:
286 FOR EACH IC-Bal: DELETE IC-Bal. END.
287 batch-total = 0.
288 FOR EACH AcctTran OF Batch NO-LOCK:
289 IF AcctTran.EntityType = "L" THEN DO:
290 batch-total = batch-total + AcctTran.Amount.
291 FIND IC-Bal WHERE IC-Bal.CompanyCode = AcctTran.EntityCode
292 AND IC-Bal.MonthCode = AcctTran.MonthCode NO-LOCK NO-ERROR.
293 IF NOT AVAILABLE(IC-Bal) THEN CREATE IC-Bal.
294 IC-Bal.CompanyCode = AcctTran.EntityCode.
295 IC-Bal.MonthCode = AcctTran.MonthCode.
296 IC-Bal.Amount = IC-Bal.Amount + AcctTran.Amount .
297 END.
298 IF INDEX( "LPJTCF", AcctTran.EntityType ) = 0 THEN accttran-error( "Unknown Entity Type '" + AcctTran.EntityType + "'").
299 IF AcctTran.EntityCode < 1 OR AcctTran.EntityCode > 99999 OR AcctTran.EntityCode = ? THEN
300 accttran-error( "Bad entity code '" + null-str(STRING(AcctTran.EntityCode),"?") + "'").
301 IF AcctTran.AccountCode < 0.01 OR AcctTran.AccountCode > 9999.99 OR AcctTran.EntityCode = ? THEN
302 accttran-error( "Bad account code '" + null-str(STRING(AcctTran.AccountCode),"?") + "'").
303 END.
304 FOR EACH IC-Bal WHERE IC-Bal.Amount <> 0:
305 RUN test-headers.
306 RUN pclrep-line( base-font, SUBSTITUTE( "Batch &1 bad intercompany for ledger &2, month &3 ",
307 Batch.BatchCode, IC-Bal.CompanyCode, IC-Bal.MonthCode) ).
308 END.
309 IF batch-total <> 0 THEN DO:
310 n-bad = n-bad + 1.
311 RUN test-headers.
312 RUN pclrep-line( base-font, SUBSTITUTE( "Batch &1 intercompany does not balance.",
313 Batch.BatchCode) ).
314 END.
316 IF (fix-action = "Fix")
317 AND CAN-FIND( FIRST IC-Bal WHERE IC-Bal.Amount <> 0)
318 THEN
319 RUN fix-batch-intercompany(Batch.BatchCode).
320 END.
322 RUN pclrep-line( base-font, SUBSTITUTE(" &1 unbalanced batches found", n-bad) ).
324 END PROCEDURE.
326 /* _UIB-CODE-BLOCK-END */
327 &ANALYZE-RESUME
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-chart-of-accounts Procedure
331 PROCEDURE check-chart-of-accounts :
332 /*------------------------------------------------------------------------------
333 Purpose: Check if the account is in the chart of accounts
334 ------------------------------------------------------------------------------*/
335 DEF INPUT PARAMETER fix-it AS LOGICAL NO-UNDO.
337 IF AccountSummary.Balance <> 0 AND NOT CAN-FIND( ChartOfAccount OF AccountSummary ) THEN DO:
338 RUN test-headers.
339 IF fix-it THEN DO:
340 CREATE ChartOfAccount.
341 ASSIGN
342 ChartOfAccount.AccountCode = AccountSummary.AccountCode
343 ChartOfAccount.AccountGroupCode = "ZZZZ"
344 ChartOfAccount.HighVolume = no
345 ChartOfAccount.Name = "Unknown (" + STRING( AccountSummary.AccountCode, "9999.99") + ")"
347 RUN pclrep-line( base-font, SUBSTITUTE( "No ChartOfAccount record for account &1 - account added.",
348 AccountSummary.AccountCode) ).
349 END.
350 ELSE
351 RUN pclrep-line( base-font, SUBSTITUTE( "No ChartOfAccount record for account &1 .",
352 AccountSummary.AccountCode) ).
353 END.
355 END PROCEDURE.
357 /* _UIB-CODE-BLOCK-END */
358 &ANALYZE-RESUME
361 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-creditors Procedure
362 PROCEDURE check-creditors :
363 /*------------------------------------------------------------------------------
364 Purpose:
365 ------------------------------------------------------------------------------*/
367 IF test-sub-bal THEN RUN creditor-versus-gl.
368 IF test-no-gl THEN RUN no-gl-consequence( "C", sundry-creditors ).
369 IF test-no-sub THEN RUN gl-not-consequence( "C", sundry-creditors).
371 IF test-groups THEN DO:
372 column-head = " Batch Doc # Amount Creditor Account ".
373 RUN new-section( "Scan for groups of Creditor transactions which do not add to zero" ).
374 need-header = check-TBS OR check-db OR test-sub-bal OR test-no-gl OR test-no-sub.
375 FOR EACH Creditor NO-LOCK BY Creditor.CreditorCode:
376 RUN test-closed-groups( "C", Creditor.CreditorCode, sundry-creditors).
377 END.
378 END.
380 END PROCEDURE.
382 /* _UIB-CODE-BLOCK-END */
383 &ANALYZE-RESUME
386 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-missing-balances Procedure
387 PROCEDURE check-missing-balances :
388 /*------------------------------------------------------------------------------
389 Purpose:
390 ------------------------------------------------------------------------------*/
391 DEF INPUT PARAMETER fix-it AS LOGICAL NO-UNDO.
393 DEF VAR code AS CHAR NO-UNDO.
394 DEF VAR month-text AS CHAR NO-UNDO.
396 RUN clear-done.
397 FOR EACH AcctTran WHERE AcctTran.EntityType BEGINS entity-t
398 AND AcctTran.EntityCode >= entity-1
399 AND AcctTran.EntityCode <= entity-n
400 AND AcctTran.MonthCode >= month-1
401 AND AcctTran.MonthCode <= month-n
402 AND NOT CAN-FIND( AccountBalance OF AcctTran ) NO-LOCK:
404 IF NOT fix-it THEN DO:
405 code = AcctTran.EntityType + STRING(AcctTran.EntityCode)
406 + STRING(AcctTran.AccountCode) + STRING(AcctTran.MonthCode).
407 IF CAN-FIND( DoneIt WHERE DoneIt.KeyDone = code ) THEN NEXT.
408 CREATE DoneIt.
409 DoneIt.KeyDone = code.
410 END.
411 FIND Month WHERE Month.MonthCode = AcctTran.MonthCode NO-LOCK NO-ERROR.
412 month-text = (IF AVAILABLE(Month) THEN SUBSTRING( STRING( Month.StartDate, "99/99/9999" ), 4, 7) ELSE "Month" + STRING(AcctTran.MonthCode) + " missing").
413 RUN test-headers.
414 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5",
415 AcctTran.EntityType,
416 STRING(AcctTran.EntityCode, "99999"),
417 STRING(AcctTran.AccountCode, "9999.99"),
418 month-text,
419 " monthly balance record is missing") ).
420 IF fix-it THEN DO:
421 RUN set-account-balance( AcctTran.EntityType, AcctTran.EntityCode,
422 AcctTran.AccountCode, AcctTran.MonthCode, 0).
423 END.
424 END.
425 END PROCEDURE.
427 /* _UIB-CODE-BLOCK-END */
428 &ANALYZE-RESUME
431 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-missing-summaries Procedure
432 PROCEDURE check-missing-summaries :
433 /*------------------------------------------------------------------------------
434 Purpose:
435 ------------------------------------------------------------------------------*/
436 DEF INPUT PARAMETER fix-it AS LOGICAL NO-UNDO.
438 DEF VAR code AS CHAR NO-UNDO.
440 RUN clear-done.
441 FOR EACH AccountBalance WHERE AccountBalance.EntityType BEGINS entity-t
442 AND AccountBalance.EntityCode >= entity-1
443 AND AccountBalance.EntityCode <= entity-n
444 AND NOT CAN-FIND( AccountSummary OF AccountBalance ) NO-LOCK:
446 IF NOT fix-it THEN DO:
447 code = AccountBalance.EntityType + STRING(AccountBalance.EntityCode)
448 + STRING(AccountBalance.AccountCode) + STRING(AccountBalance.MonthCode).
449 IF CAN-FIND( DoneIt WHERE DoneIt.KeyDone = code ) THEN NEXT.
450 CREATE DoneIt.
451 DoneIt.KeyDone = code.
452 END.
453 RUN test-headers.
454 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5",
455 AccountBalance.EntityType,
456 STRING(AccountBalance.EntityCode, "99999"),
457 STRING(AccountBalance.AccountCode, "9999.99"),
458 " ",
459 " account summary record is missing") ).
460 IF fix-it THEN DO:
461 RUN set-account-summary( AccountBalance.EntityType, AccountBalance.EntityCode,
462 AccountBalance.AccountCode, 0).
463 END.
464 END.
465 END PROCEDURE.
467 /* _UIB-CODE-BLOCK-END */
468 &ANALYZE-RESUME
471 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE check-tenants Procedure
472 PROCEDURE check-tenants :
473 /*------------------------------------------------------------------------------
474 Purpose:
475 ------------------------------------------------------------------------------*/
477 IF test-sub-bal THEN RUN tenant-versus-gl.
478 IF test-no-gl THEN RUN no-gl-consequence( "T", sundry-debtors ).
479 IF test-no-sub THEN RUN gl-not-consequence( "T", sundry-debtors).
481 IF test-groups THEN DO:
482 column-head = " Batch Doc # Amount Tenant Account ".
483 RUN new-section( "Scan for groups of Tenant transactions which do not add to zero").
484 need-header = check-TBS OR test-sub-bal OR test-no-gl OR test-no-sub.
485 FOR EACH Tenant NO-LOCK BY Tenant.TenantCode:
486 RUN test-closed-groups( "T", Tenant.TenantCode, sundry-debtors).
487 END.
488 END.
490 END PROCEDURE.
492 /* _UIB-CODE-BLOCK-END */
493 &ANALYZE-RESUME
496 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE clear-done Procedure
497 PROCEDURE clear-done :
498 /*------------------------------------------------------------------------------
499 Purpose: Clear the "DoneIt" table
500 ------------------------------------------------------------------------------*/
501 FOR EACH DoneIt: DELETE DoneIt. END.
502 END PROCEDURE.
504 /* _UIB-CODE-BLOCK-END */
505 &ANALYZE-RESUME
508 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE creditor-versus-gl Procedure
509 PROCEDURE creditor-versus-gl :
510 /*------------------------------------------------------------------------------
511 Purpose:
512 ------------------------------------------------------------------------------*/
514 FIND Company WHERE Company.CompanyCode = creditor-company NO-LOCK.
516 FOR EACH Creditor NO-LOCK:
517 FIND FIRST AccountBalance WHERE AccountBalance.EntityType = "C"
518 AND AccountBalance.EntityCode = Creditor.CreditorCode
519 NO-LOCK NO-ERROR.
521 IF AVAILABLE(AccountBalance) THEN DO:
522 FOR EACH AccountBalance WHERE AccountBalance.EntityType = "C"
523 AND AccountBalance.EntityCode = Creditor.CreditorCode
524 NO-LOCK:
525 FIND GL-Bal WHERE GL-Bal.CompanyCode = Company.CompanyCode
526 AND GL-Bal.AccountCode = AccountBalance.AccountCode
527 AND GL-Bal.MonthCode = AccountBalance.MonthCode NO-ERROR.
528 IF NOT AVAILABLE(GL-Bal) THEN DO:
529 CREATE GL-Bal.
530 GL-Bal.CompanyCode = Company.CompanyCode.
531 GL-Bal.MonthCode = AccountBalance.MonthCode.
532 GL-Bal.AccountCode = AccountBalance.AccountCode.
533 END.
534 GL-Bal.Balance = GL-Bal.Balance + AccountBalance.Balance .
535 END.
536 END.
537 END.
539 DEF VAR gb-tot LIKE GL-Bal.Balance NO-UNDO.
540 DEF VAR ab-tot LIKE GL-Bal.Balance NO-UNDO.
542 DEF VAR acb-Balance AS CHAR FORMAT "X(17)" NO-UNDO LABEL " GL Balance".
544 column-head = "Company Account Month Cred Balance GL Balance".
545 RUN new-section( "Scan for GL Creditors Control where balance <> sum of Creditors of that company").
547 FOR EACH GL-Bal WHERE GL-Bal.Balance <> 0:
548 FIND FIRST Month OF GL-Bal NO-LOCK.
549 FIND AccountBalance WHERE AccountBalance.EntityType = "L"
550 AND AccountBalance.EntityCode = GL-Bal.CompanyCode
551 AND AccountBalance.AccountCode = GL-Bal.AccountCode
552 AND AccountBalance.MonthCode = GL-Bal.MonthCode
553 NO-LOCK NO-ERROR.
555 acb-Balance = (IF AVAILABLE(AccountBalance) THEN STRING( AccountBalance.Balance, ">>>,>>>,>>9.99CR") ELSE "not on file").
556 IF NOT AVAILABLE(AccountBalance) OR GL-Bal.Balance <> AccountBalance.Balance THEN DO:
557 RUN test-headers.
558 RUN pclrep-line( base-font, SUBSTITUTE( " &1 &2 &3 &4 &5",
559 STRING( GL-Bal.CompanyCode, "99999"),
560 STRING( GL-Bal.AccountCode, "9999.99"),
561 SUBSTR( STRING(Month.StartDate, "99/99/9999"), 4),
562 STRING( GL-Bal.Balance, ">>>,>>>,>>>,>>9.99CR"),
563 acb-Balance )).
564 gb-tot = gb-tot + GL-Bal.Balance .
565 IF AVAILABLE(AccountBalance) THEN ab-tot = ab-tot + AccountBalance.Balance.
566 END.
567 END.
570 DEF VAR line AS CHAR NO-UNDO.
571 DEF VAR under AS CHAR NO-UNDO.
573 line = FILL(" ",22) + "&1 &2".
574 under = " " + FILL("-",15) + " ".
575 RUN pclrep-line( base-font, SUBSTITUTE( line, under, under) ).
576 RUN pclrep-line( base-font, SUBSTITUTE( line,
577 STRING( gb-tot, ">>>,>>>,>>>,>>9.99CR"),
578 STRING( ab-tot, ">>>,>>>,>>>,>>9.99CR") )).
580 END PROCEDURE.
582 /* _UIB-CODE-BLOCK-END */
583 &ANALYZE-RESUME
586 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE fix-batch-intercompany Procedure
587 PROCEDURE fix-batch-intercompany :
588 /*------------------------------------------------------------------------------
589 Purpose:
590 ------------------------------------------------------------------------------*/
591 DEF INPUT PARAMETER batch-code AS INT NO-UNDO.
593 DEF BUFFER tmp_Batch FOR Batch.
594 RUN new-section( "Fixing intercompany for batch" + STRING(batch-code) ).
595 FIND tmp_Batch WHERE tmp_Batch.BatchCode = batch-code NO-LOCK NO-ERROR.
597 DO TRANSACTION:
598 FIND LAST Document OF tmp_Batch EXCLUSIVE-LOCK NO-ERROR.
599 IF AVAILABLE(Document) AND Document.DocumentType = "ICOA" THEN DO:
600 FOR EACH AcctTran OF Document:
601 AcctTran.Amount = 0.
602 END.
603 FOR EACH AcctTran OF Document:
604 DELETE AcctTran.
605 END.
606 DELETE Document.
607 END.
609 /* now we just create a "NewBatch" and tell the system it is only partly-posted */
610 FIND NewBatch WHERE NewBatch.BatchCode = batch-code NO-LOCK NO-ERROR.
611 IF NOT AVAILABLE(NewBatch) THEN DO:
612 CREATE NewBatch.
613 BUFFER-COPY tmp_Batch TO NewBatch.
614 NewBatch.BatchType = "PART," + STRING(batch-code).
615 MESSAGE "Batch" batch-code "is now 'part-posted' - please complete update".
616 END.
617 ELSE IF NewBatch.BatchType BEGINS "PART" THEN
618 MESSAGE "Batch" batch-code "is already 'part-posted' - please complete update".
619 ELSE
620 MESSAGE "Batch" batch-code "is not updated! Status:" NewBatch.BatchType.
622 END.
624 END PROCEDURE.
626 /* _UIB-CODE-BLOCK-END */
627 &ANALYZE-RESUME
630 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE gl-not-consequence Procedure
631 PROCEDURE gl-not-consequence :
632 /*------------------------------------------------------------------------------
633 Purpose:
634 ------------------------------------------------------------------------------*/
635 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
636 DEF INPUT PARAMETER ac AS DEC NO-UNDO.
638 DEF BUFFER ConsOfTran FOR AcctTran.
639 DEF VAR a-total AS DEC NO-UNDO INITIAL 0.
640 DEF VAR m-total AS DEC NO-UNDO INITIAL 0.
641 DEF VAR g-total AS DEC NO-UNDO INITIAL 0.
643 column-head = " Batch Doc # Amount Company Account ".
644 RUN new-section( "Scan for " + et + "/" + STRING(ac,"9999.99")
645 + " control account transactions which are not consequential postings").
647 FOR EACH Company NO-LOCK,
648 EACH AcctTran NO-LOCK WHERE AcctTran.EntityType = "L"
649 AND AcctTran.EntityCode = Company.CompanyCode
650 AND AcctTran.AccountCode = ac:
651 FIND FIRST ConsOfTran WHERE ConsOfTran.BatchCode = AcctTran.BatchCode
652 AND ConsOfTran.DocumentCode = AcctTran.DocumentCode
653 AND ConsOfTran.TransactionCode < AcctTran.TransactionCode
654 AND ConsOfTran.EntityType = et
655 AND ConsOfTran.AccountCode = AcctTran.AccountCode
656 AND ConsOfTran.Amount = AcctTran.Amount
657 NO-LOCK NO-ERROR.
658 IF NOT AVAILABLE(ConsOfTran) THEN DO:
659 RUN test-headers.
660 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5 &6 &7",
661 STRING( AcctTran.BatchCode, ">>>>9"),
662 STRING( AcctTran.DocumentCode, ">>>>9"),
663 STRING( AcctTran.Amount, ">,>>>,>>>,>>9.99CR"),
664 STRING( AcctTran.EntityCode, "99999"),
665 STRING( AcctTran.AccountCode, "9999.99"),
666 STRING( AcctTran.Reference, "X(14)"),
667 AcctTran.Description ) ).
668 g-total = g-total + AcctTran.Amount .
669 END.
670 END.
672 RUN pclrep-line( base-font, FILL(" ",16) + FILL( "-", 12) ).
673 RUN pclrep-line( base-font, FILL(" ",12) + STRING( g-total, ">,>>>,>>>,>>9.99CR") ).
675 END PROCEDURE.
677 /* _UIB-CODE-BLOCK-END */
678 &ANALYZE-RESUME
681 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
682 PROCEDURE inst-page-footer :
683 /*------------------------------------------------------------------------------
684 Purpose: Print any page footer
685 ------------------------------------------------------------------------------*/
687 END PROCEDURE.
689 /* _UIB-CODE-BLOCK-END */
690 &ANALYZE-RESUME
693 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-header Procedure
694 PROCEDURE inst-page-header :
695 /*------------------------------------------------------------------------------
696 Purpose: Print any page header
697 ------------------------------------------------------------------------------*/
698 DEF VAR line AS CHAR NO-UNDO.
700 RUN pclrep-line( "univers,Point,7,bold,Proportional", TimeStamp).
701 RUN pclrep-line( "", "" ).
702 RUN pclrep-line( "univers,Point,12,bold,Proportional",
703 FILL(" ",40) + "System Integrity Report" ).
705 RUN pclrep-line( "univers,Point,7,normal,Proportional", "").
706 RUN pclrep-line( "univers,Point,9,normal,Proportional", hdr-run-description ).
708 RUN pclrep-line( "", "" ).
709 need-header = Yes.
710 RUN test-headers.
712 END PROCEDURE.
714 /* _UIB-CODE-BLOCK-END */
715 &ANALYZE-RESUME
718 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE new-section Procedure
719 PROCEDURE new-section :
720 /*------------------------------------------------------------------------------
721 Purpose:
722 ------------------------------------------------------------------------------*/
723 DEF INPUT PARAMETER section-header AS CHAR NO-UNDO.
725 RUN pclrep-down-by(1.4).
726 RUN pclrep-line( section-font, section-header ).
727 need-header = Yes.
729 END PROCEDURE.
731 /* _UIB-CODE-BLOCK-END */
732 &ANALYZE-RESUME
735 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE no-gl-consequence Procedure
736 PROCEDURE no-gl-consequence :
737 /*------------------------------------------------------------------------------
738 Purpose:
739 ------------------------------------------------------------------------------*/
740 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
741 DEF INPUT PARAMETER ac AS DEC NO-UNDO.
743 DEF BUFFER CoyTran FOR AcctTran.
745 column-head = " Batch Doc # Amount Tenant Account ".
746 RUN new-section( "Scan for " + et + "/" + STRING(ac,"9999.99")
747 + " control account transactions where there is no consequential posting to the GL").
749 FOR EACH AcctTran NO-LOCK WHERE AcctTran.EntityType = et:
750 FIND FIRST CoyTran WHERE CoyTran.BatchCode = AcctTran.BatchCode
751 AND CoyTran.DocumentCode = AcctTran.DocumentCode
752 AND CoyTran.TransactionCode > AcctTran.TransactionCode
753 AND CoyTran.EntityType = "L"
754 AND CoyTran.AccountCode = AcctTran.AccountCode
755 AND CoyTran.Amount = AcctTran.Amount
756 NO-LOCK NO-ERROR.
757 IF NOT AVAILABLE(CoyTran) THEN DO:
758 RUN test-headers.
759 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5 &6 &7",
760 STRING( AcctTran.BatchCode, ">>>>9"),
761 STRING( AcctTran.DocumentCode, ">>>>9"),
762 STRING( AcctTran.Amount, ">,>>>,>>>,>>9.99CR"),
763 STRING( AcctTran.EntityCode, "99999"),
764 STRING( AcctTran.AccountCode, "9999.99"),
765 STRING( AcctTran.Reference, "X(14)"),
766 AcctTran.Description ) ).
767 END.
768 END.
770 END PROCEDURE.
772 /* _UIB-CODE-BLOCK-END */
773 &ANALYZE-RESUME
776 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
777 PROCEDURE parse-parameters :
778 /*------------------------------------------------------------------------------
779 Purpose:
780 ------------------------------------------------------------------------------*/
781 DEF VAR i AS INT NO-UNDO.
782 DEF VAR token AS CHAR NO-UNDO.
783 DEF VAR attrib-desc AS CHAR NO-UNDO.
785 {inc/showopts.i "report-options"}
787 DO i = 1 TO NUM-ENTRIES( report-options, "~n" ):
789 token = ENTRY( i, report-options, "~n" ).
790 CASE( ENTRY( 1, token ) ):
792 WHEN "Action" THEN fix-action = ENTRY( 2, token ).
793 WHEN "Preview" THEN preview = Yes.
794 WHEN "Check-TBS" THEN check-tbs = Yes.
795 WHEN "Check-CR" THEN check-cr = Yes.
796 WHEN "Check-Db" THEN check-db = Yes.
797 WHEN "Test-Sub-Bal" THEN test-sub-bal = Yes.
798 WHEN "Test-No-GL" THEN test-no-gl = Yes.
799 WHEN "Test-No-Sub" THEN test-no-sub = Yes.
800 WHEN "Test-Groups" THEN test-groups = Yes.
802 WHEN "Export" THEN ASSIGN
803 exporting = Yes
804 file-name = ENTRY( 2, token ) .
806 WHEN "Check-Batches" THEN ASSIGN
807 check-batches = Yes
808 batch-1 = INT( ENTRY( 2, token ))
809 batch-n = INT( ENTRY( 3, token )).
811 WHEN "Month-Range" THEN ASSIGN
812 month-1 = INT( ENTRY( 2, token ))
813 month-n = INT( ENTRY( 3, token )).
815 WHEN "Entity-Type" THEN
816 entity-t = SUBSTRING( ENTRY( 2, token ), 1, 1).
818 WHEN "Entity-Range" THEN ASSIGN
819 entity-1 = INT( ENTRY( 2, token ))
820 entity-n = INT( ENTRY( 3, token )).
822 END CASE.
823 END.
825 END PROCEDURE.
827 /* _UIB-CODE-BLOCK-END */
828 &ANALYZE-RESUME
831 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE set-account-balance Procedure
832 PROCEDURE set-account-balance :
833 /*------------------------------------------------------------------------------
834 Purpose:
835 ------------------------------------------------------------------------------*/
836 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
837 DEF INPUT PARAMETER ec AS INT NO-UNDO.
838 DEF INPUT PARAMETER ac AS DEC NO-UNDO.
839 DEF INPUT PARAMETER mc AS INT NO-UNDO.
840 DEF INPUT PARAMETER amt AS DEC NO-UNDO.
842 DEF BUFFER acb FOR AccountBalance.
844 IF et = "X" THEN RETURN.
846 DO TRANSACTION:
847 FIND acb EXCLUSIVE-LOCK WHERE acb.EntityType = et AND acb.EntityCode = ec
848 AND acb.AccountCode = ac AND acb.MonthCode = mc NO-ERROR.
849 IF NOT AVAILABLE(acb) THEN DO:
850 CREATE acb.
851 ASSIGN acb.EntityType = et acb.EntityCode = ec
852 acb.AccountCode = ac acb.MonthCode = mc.
853 END.
854 acb.Balance = amt.
855 END.
857 END PROCEDURE.
859 /* _UIB-CODE-BLOCK-END */
860 &ANALYZE-RESUME
863 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE set-account-summary Procedure
864 PROCEDURE set-account-summary :
865 /*------------------------------------------------------------------------------
866 Purpose:
867 ------------------------------------------------------------------------------*/
868 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
869 DEF INPUT PARAMETER ec AS INT NO-UNDO.
870 DEF INPUT PARAMETER ac AS DEC NO-UNDO.
871 DEF INPUT PARAMETER amt AS DEC NO-UNDO.
873 DEF BUFFER acs FOR AccountSummary.
874 IF et = "X" THEN RETURN.
876 DO TRANSACTION:
877 FIND acs EXCLUSIVE-LOCK WHERE acs.EntityType = et
878 AND acs.EntityCode = ec AND acs.AccountCode = ac NO-ERROR.
879 IF NOT AVAILABLE(acs) THEN DO:
880 CREATE acs.
881 ASSIGN acs.EntityType = et acs.EntityCode = ec acs.AccountCode = ac.
882 END.
883 acs.Balance = amt.
884 END.
886 END PROCEDURE.
888 /* _UIB-CODE-BLOCK-END */
889 &ANALYZE-RESUME
892 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE tenant-versus-gl Procedure
893 PROCEDURE tenant-versus-gl :
894 /*------------------------------------------------------------------------------
895 Purpose:
896 ------------------------------------------------------------------------------*/
898 FOR EACH Tenant NO-LOCK:
899 FIND FIRST AccountBalance WHERE AccountBalance.EntityType = "T"
900 AND AccountBalance.EntityCode = Tenant.TenantCode
901 NO-LOCK NO-ERROR.
903 IF AVAILABLE(AccountBalance) THEN DO:
904 IF Tenant.EntityType = "L" THEN
905 FIND Company WHERE Company.CompanyCode = Tenant.EntityCode NO-LOCK.
906 ELSE DO:
907 FIND Property WHERE Property.PropertyCode = Tenant.EntityCode NO-LOCK.
908 FIND Company OF Property NO-LOCK.
909 END.
910 FOR EACH AccountBalance WHERE AccountBalance.EntityType = "T"
911 AND AccountBalance.EntityCode = Tenant.TenantCode
912 NO-LOCK:
913 FIND GL-Bal WHERE GL-Bal.CompanyCode = Company.CompanyCode
914 AND GL-Bal.AccountCode = AccountBalance.AccountCode
915 AND GL-Bal.MonthCode = AccountBalance.MonthCode NO-ERROR.
916 IF NOT AVAILABLE(GL-Bal) THEN DO:
917 CREATE GL-Bal.
918 GL-Bal.CompanyCode = Company.CompanyCode.
919 GL-Bal.MonthCode = AccountBalance.MonthCode.
920 GL-Bal.AccountCode = AccountBalance.AccountCode.
921 END.
922 GL-Bal.Balance = GL-Bal.Balance + AccountBalance.Balance .
923 END.
924 END.
925 END.
927 DEF VAR gb-tot LIKE GL-Bal.Balance NO-UNDO.
928 DEF VAR ab-tot LIKE GL-Bal.Balance NO-UNDO.
930 DEF VAR acb-Variance LIKE GL-Bal.Balance NO-UNDO.
931 DEF VAR acb-Balance AS CHAR FORMAT "X(17)" NO-UNDO LABEL " GL Balance".
933 column-head = "Company Account Month Tenant Balance GL Balance Variance".
934 RUN new-section( "Scan for GL Sundry debtors where balance <> sum of tenants of properties of that company").
936 FOR EACH GL-Bal WHERE GL-Bal.Balance <> 0
937 BY GL-Bal.MonthCode BY GL-Bal.CompanyCode BY GL-Bal.AccountCode:
938 FIND FIRST Month OF GL-Bal NO-LOCK.
939 FIND AccountBalance WHERE AccountBalance.EntityType = "L"
940 AND AccountBalance.EntityCode = GL-Bal.CompanyCode
941 AND AccountBalance.AccountCode = GL-Bal.AccountCode
942 AND AccountBalance.MonthCode = GL-Bal.MonthCode
943 NO-LOCK NO-ERROR.
945 acb-Balance = (IF AVAILABLE(AccountBalance) THEN STRING( AccountBalance.Balance, ">>>,>>>,>>9.99CR") ELSE "not on file").
946 acb-Variance = (IF AVAILABLE(AccountBalance) THEN AccountBalance.Balance ELSE 0).
947 IF NOT AVAILABLE(AccountBalance) OR GL-Bal.Balance <> AccountBalance.Balance THEN DO:
948 acb-Variance = GL-Bal.Balance - acb-Variance.
949 RUN test-headers.
950 RUN pclrep-line( base-font, SUBSTITUTE( " &1 &2 &3 &4 &5 &6",
951 STRING( GL-Bal.CompanyCode, "99999"),
952 STRING( GL-Bal.AccountCode, "9999.99"),
953 SUBSTR( STRING(Month.StartDate, "99/99/9999"), 4),
954 STRING( GL-Bal.Balance, ">>>,>>>,>>>,>>9.99CR"),
955 STRING( acb-Balance, "X(20)"),
956 STRING( acb-Variance, ">>>,>>>,>>>,>>9.99CR") )).
957 gb-tot = gb-tot + GL-Bal.Balance .
958 IF AVAILABLE(AccountBalance) THEN ab-tot = ab-tot + AccountBalance.Balance.
959 END.
960 END.
963 DEF VAR line AS CHAR NO-UNDO.
964 DEF VAR under AS CHAR NO-UNDO.
966 line = FILL(" ",23) + "&1 &2 &3".
967 under = " " + FILL("-",15) + " ".
968 RUN pclrep-line( base-font, SUBSTITUTE( line, under, under, under) ).
969 RUN pclrep-line( base-font, SUBSTITUTE( line,
970 STRING( gb-tot, ">>>,>>>,>>>,>>9.99CR"),
971 STRING( ab-tot, ">>>,>>>,>>>,>>9.99CR"),
972 STRING( gb-tot - ab-tot, ">>>,>>>,>>>,>>9.99CR") )).
974 END PROCEDURE.
976 /* _UIB-CODE-BLOCK-END */
977 &ANALYZE-RESUME
980 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE test-closed-groups Procedure
981 PROCEDURE test-closed-groups :
982 /*------------------------------------------------------------------------------
983 Purpose:
984 ------------------------------------------------------------------------------*/
985 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
986 DEF INPUT PARAMETER ec AS INT NO-UNDO.
987 DEF INPUT PARAMETER ac AS DEC NO-UNDO.
989 DEF VAR group-total LIKE AcctTran.Amount NO-UNDO.
991 FOR EACH ClosingGroup WHERE ClosingGroup.EntityType = et
992 AND ClosingGroup.EntityCode = ec
993 AND ClosingGroup.AccountCode = ac
994 AND ClosingGroup.ClosedStatus = "F" NO-LOCK:
995 group-total = 0.0 .
996 FOR EACH AcctTran OF ClosingGroup NO-LOCK:
997 group-total = group-total + AcctTran.Amount .
998 END.
999 IF group-total <> 0.0 THEN DO:
1000 RUN test-headers.
1001 FOR EACH AcctTran OF ClosingGroup NO-LOCK:
1002 RUN pclrep-line( base-font, SUBSTITUTE( "&1 &2 &3 &4 &5 &6 &7",
1003 STRING( AcctTran.BatchCode, ">>>>9"),
1004 STRING( AcctTran.DocumentCode, ">>>>9"),
1005 STRING( AcctTran.Amount, ">,>>>,>>>,>>9.99CR"),
1006 STRING( AcctTran.EntityCode, "99999"),
1007 STRING( AcctTran.AccountCode, "9999.99"),
1008 STRING( AcctTran.Reference, "X(14)"),
1009 AcctTran.Description ) ).
1010 END.
1011 RUN pclrep-line( base-font, FILL(" ",30) + "Total for group " + STRING( group-total, ">,>>>,>>>,>>9.99CR") ).
1012 RUN pclrep-down-by(1.2).
1013 IF fix-action = "Fix" THEN DO:
1014 DEF BUFFER ClGroup FOR ClosingGroup.
1015 FIND ClGroup WHERE RECID(ClGroup) = RECID(ClosingGroup) EXCLUSIVE-LOCK.
1016 FOR EACH AcctTran OF ClGroup EXCLUSIVE-LOCK:
1017 AcctTran.ClosedState = "O".
1018 AcctTran.ClosingGroup = ?.
1019 END.
1020 DELETE ClGroup.
1021 END.
1022 END.
1023 END.
1025 END PROCEDURE.
1027 /* _UIB-CODE-BLOCK-END */
1028 &ANALYZE-RESUME
1031 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE test-headers Procedure
1032 PROCEDURE test-headers :
1033 /*------------------------------------------------------------------------------
1034 Purpose:
1035 ------------------------------------------------------------------------------*/
1036 IF need-header THEN DO:
1037 RUN pclrep-line( base-font + ",bold", column-head ).
1038 need-header = No.
1039 END.
1041 END PROCEDURE.
1043 /* _UIB-CODE-BLOCK-END */
1044 &ANALYZE-RESUME
1047 /* ************************ Function Implementations ***************** */
1049 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION accttran-error Procedure
1050 FUNCTION accttran-error RETURNS CHARACTER
1051 ( INPUT error-text AS CHAR ) :
1052 /*------------------------------------------------------------------------------
1053 Purpose: Display an error to do with a particular transaction
1054 Notes:
1055 ------------------------------------------------------------------------------*/
1056 DEF VAR line AS CHAR NO-UNDO.
1057 line = STRING(AcctTran.BatchCode,"99999") + "-"
1058 + STRING(AcctTran.DocumentCode,"99999") + "-"
1059 + STRING(AcctTran.TransactionCode,"99999") + " "
1060 + AcctTran.EntityType + " "
1061 + STRING(AcctTran.EntityCode,"99999") + " "
1062 + STRING(AcctTran.AccountCode,"9999.99") + " "
1063 + error-text .
1064 RUN pclrep-line( base-font, line).
1066 RETURN "". /* Function return value. */
1068 END FUNCTION.
1070 /* _UIB-CODE-BLOCK-END */
1071 &ANALYZE-RESUME