1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
15 ------------------------------------------------------------------------*/
17 &SCOPED-DEFINE trn-per-page 43
19 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
21 DEF VAR from-tenant
LIKE Tenant.TenantCode
NO-UNDO.
22 DEF VAR to-tenant
LIKE Tenant.TenantCode
NO-UNDO.
23 DEF VAR open-only
AS LOGI
NO-UNDO.
24 DEF VAR active-only
AS LOGI
NO-UNDO.
25 DEF VAR prop-code
LIKE Property.PropertyCode
NO-UNDO.
26 DEF VAR from-month
LIKE Month.MonthCode
NO-UNDO.
27 DEF VAR to-month
LIKE Month.MonthCode
NO-UNDO.
28 DEF VAR summarise-part
AS LOGI
NO-UNDO.
29 DEF VAR show-zeroes
AS LOGI
NO-UNDO.
32 DEF VAR logo-codes
AS CHAR NO-UNDO.
35 DEF VAR ln
AS DEC INIT 0.00 NO-UNDO.
37 /* Line definitions
*/
39 DEF VAR statement-total
AS DEC NO-UNDO.
41 DEF VAR title-line
AS CHAR EXTENT 4 NO-UNDO.
42 DEF VAR title-address
AS CHAR EXTENT 4 NO-UNDO.
43 DEF VAR date-in-words
AS CHAR NO-UNDO.
45 DEF VAR client-code
AS CHAR NO-UNDO.
46 DEF VAR entity-type
AS CHAR NO-UNDO.
47 DEF VAR entity-code
AS INT NO-UNDO.
48 DEF VAR tenant-address
AS CHAR EXTENT 7 NO-UNDO.
49 DEF VAR office-address
AS CHAR EXTENT 5 NO-UNDO.
50 DEF VAR trn-line
AS CHAR NO-UNDO.
51 DEF VAR trn-no
AS INT NO-UNDO.
52 DEF VAR regarding
AS CHAR NO-UNDO.
54 DEF VAR reset-page
AS CHAR NO-UNDO.
55 DEF VAR half-line
AS CHAR NO-UNDO. half-line
= CHR(27) + "=".
56 DEF VAR line-printer
AS CHAR NO-UNDO.
57 DEF VAR tenant-address-font
AS CHAR NO-UNDO.
58 DEF VAR header-font
AS CHAR NO-UNDO.
59 DEF VAR re-font
AS CHAR NO-UNDO.
60 DEF VAR trn-font
AS CHAR NO-UNDO.
61 DEF VAR remittance-title-font
AS CHAR NO-UNDO.
62 DEF VAR remittance-font
AS CHAR NO-UNDO.
63 DEF VAR remittance-prompt
AS CHAR NO-UNDO.
64 DEF VAR remittance-font-bold
AS CHAR NO-UNDO.
65 DEF VAR id-font
AS CHAR NO-UNDO.
67 DEF VAR total-line-printed
AS LOGI
NO-UNDO.
70 {inc
/ofc-acct.i
"DEBTORS" "sundry-debtors"}
72 {inc
/ofc-set-l.i
"Statement-IsTaxInvoice" "is-tax-invoice"}
74 DEF VAR gst-applies
AS LOGI
NO-UNDO.
75 gst-applies
= Office.GST
<> ?.
77 {inc
/ofc-set.i
"GST-Number" "gst-number"}
78 IF NOT AVAILABLE(OfficeSetting
) THEN
79 gst-number
= REPLACE( STRING( Office.GSTNo
, ">99,999,999"),",","-") .
80 {inc
/ofc-set.i
"GST-Number-Name" "gst-number-name"}
81 IF NOT AVAILABLE(OfficeSetting
) THEN
82 gst-number-name
= "GST NO.".
84 DEF VAR user-name
AS CHAR NO-UNDO.
85 DEF VAR print-id
AS CHAR NO-UNDO.
86 {inc
/username.i
"user-name"}
87 print-id
= STRING( TODAY, "99/99/9999" ) + " " + STRING( TIME, "HH:MM" ) + " " +
90 /* _UIB-CODE-BLOCK-END
*/
94 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
96 /* ******************** Preprocessor Definitions
******************** */
98 &Scoped-define PROCEDURE-TYPE Procedure
99 &Scoped-define DB-AWARE no
103 /* _UIB-PREPROCESSOR-BLOCK-END
*/
108 /* *********************** Procedure Settings
************************ */
110 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
111 /* Settings for
THIS-PROCEDURE
115 Add Fields to
: Neither
116 Other Settings
: CODE-ONLY
COMPILE
118 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
120 /* ************************* Create Window
************************** */
122 &ANALYZE-SUSPEND _CREATE-WINDOW
123 /* DESIGN Window definition
(used by the UIB
)
124 CREATE WINDOW Procedure
ASSIGN
127 /* END WINDOW DEFINITION
*/
131 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
132 /* ************************* Included-Libraries
*********************** */
134 {inc
/method
/m-txtrep.i
}
135 {inc
/method
/m-hpgl.i
}
139 /* _UIB-CODE-BLOCK-END
*/
146 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
149 /* *************************** Main Block
*************************** */
151 RUN get-control-strings.
152 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
154 RUN statement-of-account.
157 RUN view-output-file
( no
).
159 /* _UIB-CODE-BLOCK-END
*/
163 /* ********************** Internal Procedures
*********************** */
165 &IF DEFINED(EXCLUDE-carriage-return) = 0 &THEN
167 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE carriage-return Procedure
168 PROCEDURE carriage-return
:
169 /*------------------------------------------------------------------------------
173 ------------------------------------------------------------------------------*/
179 /* _UIB-CODE-BLOCK-END
*/
184 &IF DEFINED(EXCLUDE-each-closing-group) = 0 &THEN
186 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-closing-group Procedure
187 PROCEDURE each-closing-group
:
188 /*------------------------------------------------------------------------------
190 ------------------------------------------------------------------------------*/
191 DEF VAR grp-amount
AS DEC NO-UNDO INITIAL 0.
192 DEF VAR dispDate
AS CHAR NO-UNDO.
193 DEF VAR dispReference
AS CHAR NO-UNDO.
194 DEF VAR dispDescription
AS CHAR NO-UNDO.
196 FIND LAST AcctTran
NO-LOCK OF ClosingGroup
NO-ERROR.
197 IF NOT AVAILABLE(AcctTran
) THEN RETURN.
199 ASSIGN dispDate
= STRING( ClosingGroup.Date
, "99/99/9999" )
200 dispReference
= "CG " + STRING( ClosingGroup.ClosingGroup
)
201 dispDescription
= (IF ClosingGroup.Description
<> ""
202 THEN ClosingGroup.Description
203 ELSE AcctTran.Description
) .
205 IF dispDescription
= "" THEN DO:
206 FIND Document
NO-LOCK OF AcctTran.
207 IF dispDescription
= "" THEN dispDescription
= Document.Description.
210 DEF BUFFER AltTran
FOR AcctTran.
211 FOR EACH AltTran
NO-LOCK OF ClosingGroup
:
212 grp-amount
= grp-amount
+ AltTran.Amount.
215 RUN next-transaction.
217 PUT UNFORMATTED dispDate
SPACE(3)
218 STRING( dispReference
, "X(12)" ) SPACE(3)
219 STRING( dispDescription
, "X(50)" ) SPACE(4)
220 STRING( grp-amount
, ">,>>>,>>>,>>9.99CR" ).
223 statement-total
= statement-total
+ grp-amount.
228 /* _UIB-CODE-BLOCK-END
*/
233 &IF DEFINED(EXCLUDE-each-tenant) = 0 &THEN
235 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-tenant Procedure
236 PROCEDURE each-tenant
:
237 /*------------------------------------------------------------------------------
241 ------------------------------------------------------------------------------*/
243 &SCOPED-DEFINE tran-clause AcctTran.EntityType = 'T' AND ~
244 AcctTran.EntityCode
= Tenant.TenantCode
AND ~
245 AcctTran.AccountCode
= sundry-debtors
247 &SCOPED-DEFINE by-clause BY AcctTran.EntityType ~
248 BY AcctTran.EntityCode ~
249 BY AcctTran.AccountCode~
251 BY AcctTran.BatchCode ~
252 BY AcctTran.DocumentCode ~
253 BY AcctTran.TransactionCode
255 FIND AccountSummary
WHERE AccountSummary.EntityType
= "T"
256 AND AccountSummary.EntityCode
= Tenant.TenantCode
257 AND AccountSummary.AccountCode
= sundry-debtors
258 AND AccountSummary.Balance
<> 0
260 IF (prop-code
<> ?
OR from-tenant
<> to-tenant
)
261 AND NOT AVAILABLE(AccountSummary
) THEN RETURN.
263 RUN get-tenant-details.
265 total-line-printed
= No.
268 IF from-month
= ?
OR to-month
= ?
OR summarise-part
THEN DO:
269 FOR EACH AcctTran
NO-LOCK WHERE {&tran-clause} AND
270 (AcctTran.ClosingGroup
= ?
OR
271 (IF summarise-part
THEN No
ELSE ((AcctTran.ClosedState
= "P") OR NOT open-only
) ))
273 RUN each-transaction.
275 IF summarise-part
THEN DO:
276 FOR EACH ClosingGroup
NO-LOCK
277 WHERE ClosingGroup.EntityType
= "T"
278 AND ClosingGroup.EntityCode
= Tenant.TenantCode
279 AND ClosingGroup.AccountCode
= sundry-debtors
280 AND ClosingGroup.ClosedStatus
= "P"
281 BY ClosingGroup.EntityType
BY ClosingGroup.EntityCode
282 BY ClosingGroup.AccountCode
BY ClosingGroup.Date
:
283 RUN each-closing-group.
288 FOR EACH AcctTran
NO-LOCK WHERE {&tran-clause} AND
289 AcctTran.MonthCode
>= from-month
AND
290 AcctTran.monthCode
<= to-month
AND
291 (AcctTran.ClosingGroup
= ?
OR AcctTran.ClosedState
= "P" OR NOT open-only
)
293 RUN each-transaction.
297 RUN print-remittance.
302 /* _UIB-CODE-BLOCK-END
*/
307 &IF DEFINED(EXCLUDE-each-transaction) = 0 &THEN
309 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-transaction Procedure
310 PROCEDURE each-transaction
:
311 /*------------------------------------------------------------------------------
315 ------------------------------------------------------------------------------*/
317 DEF VAR trn-ref
AS CHAR NO-UNDO.
318 DEF VAR trn-desc
AS CHAR NO-UNDO.
319 RUN next-transaction.
321 IF AcctTran.Reference
= "" OR AcctTran.Description
= "" THEN DO:
322 FIND FIRST Document
OF AcctTran
NO-LOCK.
323 trn-ref
= IF AcctTran.Reference
<> "" THEN AcctTran.Reference
324 ELSE Document.Reference.
325 trn-desc
= IF AcctTran.Description
<> "" THEN AcctTran.Description
326 ELSE Document.Description.
329 trn-ref
= AcctTran.Reference
330 trn-desc
= AcctTran.Description .
333 STRING( AcctTran.Date
, "99/99/9999" ) SPACE(3)
334 STRING( trn-ref
, "X(12)" ) SPACE(3)
335 STRING( trn-desc
, "X(50)" ) SPACE(4)
336 STRING( AcctTran.Amount
, ">,>>>,>>>,>>9.99CR" ).
339 statement-total
= statement-total
+ AcctTran.Amount.
343 /* _UIB-CODE-BLOCK-END
*/
348 &IF DEFINED(EXCLUDE-get-client-address) = 0 &THEN
350 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-client-address Procedure
351 PROCEDURE get-client-address
:
352 /*------------------------------------------------------------------------------
354 ------------------------------------------------------------------------------*/
355 DEF INPUT PARAMETER client-code
AS CHAR NO-UNDO.
357 DEF VAR i
AS INT NO-UNDO.
358 DEF VAR client-address
AS CHAR NO-UNDO INITIAL "".
360 FIND Client
WHERE Client.ClientCode
= client-code
NO-LOCK NO-ERROR.
361 IF NOT AVAILABLE(Client
) THEN RETURN.
363 client-address
= TRIM( REPLACE(Client.RemittanceAddress
, CHR(13), "") ).
364 IF client-address
= ?
OR client-address
= "" THEN RETURN.
367 IF i
<= NUM-ENTRIES( client-address
, "~n" ) THEN
368 ASSIGN office-address
[i
] = ENTRY( i
, client-address
, "~n" ) NO-ERROR.
370 office-address
[i
] = "".
372 IF office-address
[i
] = ?
THEN office-address
[i
] = "".
377 /* _UIB-CODE-BLOCK-END
*/
382 &IF DEFINED(EXCLUDE-get-control-strings) = 0 &THEN
384 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-control-strings Procedure
385 PROCEDURE get-control-strings
:
386 /*------------------------------------------------------------------------------
387 Purpose
: Get all control strings for this report
388 ------------------------------------------------------------------------------*/
390 DEF VAR rows
AS DEC NO-UNDO.
391 DEF VAR cols
AS DEC NO-UNDO.
393 RUN make-control-string
( "PCL", "reset,portrait,a4,tm,0,lm,6",
394 OUTPUT reset-page
, OUTPUT rows
, OUTPUT cols
).
396 RUN make-control-string
( "PCL", "LinePrinter,lpi,9.54",
397 OUTPUT trn-font
, OUTPUT rows
, OUTPUT cols
).
399 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,10",
400 OUTPUT tenant-address-font
, OUTPUT rows
, OUTPUT cols
).
402 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,16",
403 OUTPUT header-font
, OUTPUT rows
, OUTPUT cols
).
405 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,11",
406 OUTPUT re-font
, OUTPUT rows
, OUTPUT cols
).
408 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,16",
409 OUTPUT remittance-title-font
, OUTPUT rows
, OUTPUT cols
).
411 RUN make-control-string
( "PCL", "Times,Proportional,point,9,normal,lpi,7",
412 OUTPUT remittance-font
, OUTPUT rows
, OUTPUT cols
).
414 RUN make-control-string
( "PCL", "Times,Proportional,point,8,normal,lpi,7",
415 OUTPUT remittance-prompt
, OUTPUT rows
, OUTPUT cols
).
417 RUN make-control-string
( "PCL", "Times,Proportional,point,10,bold",
418 OUTPUT remittance-font-bold
, OUTPUT rows
, OUTPUT cols
).
420 RUN make-control-string
( "PCL", "Times,Proportional,Point,4,Normal",
421 OUTPUT id-font
, OUTPUT rows
, OUTPUT cols
).
425 /* _UIB-CODE-BLOCK-END
*/
430 &IF DEFINED(EXCLUDE-get-office-address) = 0 &THEN
432 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-office-address Procedure
433 PROCEDURE get-office-address
:
434 /*------------------------------------------------------------------------------
436 ------------------------------------------------------------------------------*/
437 DEF VAR i
AS INT NO-UNDO.
439 FIND FIRST Office
WHERE Office.ThisOffice
NO-LOCK.
443 office-address
[i
] = ENTRY( i
, Office.StreetAddress
, CHR(10) )
444 office-address
[i
] = REPLACE( office-address
[i
], CHR(13), "" )
446 IF office-address
[i
] = ?
THEN office-address
[i
] = "".
451 /* _UIB-CODE-BLOCK-END
*/
456 &IF DEFINED(EXCLUDE-get-tenant-details) = 0 &THEN
458 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-tenant-details Procedure
459 PROCEDURE get-tenant-details
:
460 /*------------------------------------------------------------------------------
462 ------------------------------------------------------------------------------*/
465 IF Tenant.EntityType
= 'P'
THEN
467 /* Note
: find fails if lease is not unique
- this is deliberate
! */
468 FIND TenancyLease
WHERE TenancyLease.TenantCode
= Tenant.TenantCode
NO-LOCK NO-ERROR.
469 IF AVAILABLE(TenancyLease
) THEN DO:
470 regarding
= TenancyLease.AreaDescription.
471 IF regarding
= ?
THEN regarding
= "".
474 FIND FIRST Property
WHERE Property.PropertyCode
= Tenant.EntityCode
476 IF AVAILABLE Property
THEN
477 regarding
= (IF regarding
<> "" THEN TRIM(regarding
) + ", " ELSE "")
479 + (IF Property.Name
<> Property.StreetAddress
THEN ", " + Property.StreetAddress
ELSE "" ) .
482 ELSE IF Tenant.EntityType
= 'L'
THEN
484 FIND FIRST Company
WHERE Company.CompanyCode
= Tenant.EntityCode
486 IF AVAILABLE Company
THEN regarding
= Company.LegalName.
489 entity-type
= Tenant.EntityType.
490 entity-code
= Tenant.EntityCode.
491 client-code
= get-entity-client
( Tenant.EntityType
, Tenant.EntityCode
).
492 RUN get-client-address
( client-code
).
494 DEF VAR addr
AS CHAR NO-UNDO.
495 DEF VAR i
AS INT NO-UNDO.
497 RUN process
/getaddr.p
( "T", Tenant.TenantCode
, "BILL", OUTPUT addr
).
498 DO i
= 1 TO 7: tenant-address
[i
] = "".
END.
499 DO i
= 1 TO NUM-ENTRIES( addr
, CHR(10) ):
500 tenant-address
[i
] = ENTRY( i
, addr
, CHR(10) ).
505 /* _UIB-CODE-BLOCK-END
*/
510 &IF DEFINED(EXCLUDE-next-transaction) = 0 &THEN
512 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE next-transaction Procedure
513 PROCEDURE next-transaction
:
514 /*------------------------------------------------------------------------------
518 ------------------------------------------------------------------------------*/
522 IF trn-no
>= {&trn-per-page} THEN
524 RUN print-remittance.
531 /* _UIB-CODE-BLOCK-END
*/
536 &IF DEFINED(EXCLUDE-page-feed) = 0 &THEN
538 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE page-feed Procedure
539 PROCEDURE page-feed
:
540 /*------------------------------------------------------------------------------
544 ------------------------------------------------------------------------------*/
550 /* _UIB-CODE-BLOCK-END
*/
555 &IF DEFINED(EXCLUDE-page-header) = 0 &THEN
557 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE page-header Procedure
558 PROCEDURE page-header
:
559 /*------------------------------------------------------------------------------
563 ------------------------------------------------------------------------------*/
570 PUT CONTROL header-font.
571 IF ( is-tax-invoice
) THEN DO:
572 PUT UNFORMATTED SPACE(26) "INVOICE / STATEMENT".
574 PUT UNFORMATTED SPACE(36) "Tax Invoice".
577 PUT UNFORMATTED SPACE(26) "STATEMENT OF ACCOUNT".
579 PUT UNFORMATTED FILL( '_'
, 64).
583 PUT UNFORMATTED "RE: ".
584 PUT CONTROL STRING( regarding
, "X(100)" ).
586 PUT CONTROL trn-font.
590 /* _UIB-CODE-BLOCK-END
*/
595 &IF DEFINED(EXCLUDE-parse-parameters) = 0 &THEN
597 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
598 PROCEDURE parse-parameters
:
599 /*------------------------------------------------------------------------------
601 ------------------------------------------------------------------------------*/
602 DEF VAR n-tenant
AS INT NO-UNDO.
603 DEF VAR n-property
AS INT NO-UNDO.
604 DEF VAR type-of
AS CHAR NO-UNDO.
605 DEF VAR range-of
AS CHAR NO-UNDO.
608 type-of
= ENTRY( 1, report-options
).
609 n-property
= INT( ENTRY( 2, report-options
)).
610 n-tenant
= INT( ENTRY( 3, report-options
)).
612 IF type-of
= "All" THEN
613 ASSIGN from-tenant
= 0 to-tenant
= 99999 prop-code
= ?.
614 ELSE IF type-of
= "Tenant" THEN
615 ASSIGN from-tenant
= n-tenant to-tenant
= n-tenant prop-code
= ?.
616 ELSE IF type-of
= "Range" THEN
617 ASSIGN from-tenant
= n-property to-tenant
= n-tenant prop-code
= ?.
618 ELSE IF type-of
= "Property" THEN
619 ASSIGN from-tenant
= ? to-tenant
= ? prop-code
= n-property.
621 range-of
= ENTRY( 4, report-options
).
622 open-only
= (ENTRY( 5, report-options
) = "Yes").
623 active-only
= (ENTRY( 6, report-options
) = "Yes").
624 from-month
= INT( ENTRY( 7, report-options
)).
625 to-month
= INT( ENTRY( 8, report-options
)).
626 summarise-part
= (ENTRY( 9, report-options
) = "Yes").
627 show-zeroes
= (ENTRY( 10, report-options
) = "Yes").
629 IF summarise-part
THEN open-only
= Yes.
630 IF open-only
OR range-of
<> "Range" THEN ASSIGN from-month
= ? to-month
= ?.
634 /* _UIB-CODE-BLOCK-END
*/
639 &IF DEFINED(EXCLUDE-print-address) = 0 &THEN
641 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-address Procedure
642 PROCEDURE print-address
:
643 /*------------------------------------------------------------------------------
647 ------------------------------------------------------------------------------*/
649 DEF VAR i
AS INT NO-UNDO.
652 PUT CONTROL tenant-address-font.
655 PUT UNFORMATTED tenant-address
[i
].
656 IF i
= 2 AND gst-applies
AND is-tax-invoice
THEN DO:
657 PUT UNFORMATTED CHR(13) SPACE( 124 ) gst-number-name
658 CHR(13) SPACE( 140 ) gst-number.
660 ELSE IF i
= 4 THEN PUT UNFORMATTED CHR(13) SPACE(140) STRING( date-in-words
, "X(20)" ).
666 /* _UIB-CODE-BLOCK-END
*/
671 &IF DEFINED(EXCLUDE-print-remittance) = 0 &THEN
673 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-remittance Procedure
674 PROCEDURE print-remittance
:
675 /*------------------------------------------------------------------------------
677 ------------------------------------------------------------------------------*/
678 DEF VAR amount-due
AS CHAR NO-UNDO.
680 PUT CONTROL trn-font.
681 RUN pcl-moveto
( 92, 11 ).
RUN carriage-return.
684 PUT UNFORMATTED print-id.
686 PUT CONTROL remittance-font.
687 PUT UNFORMATTED FILL(' '
,20) + "Activity occurring after " + date-in-words
+ " will appear on your next statement." .
689 PUT CONTROL remittance-title-font.
690 PUT UNFORMATTED FILL( '_ '
, 48 ).
RUN skip-line
(2).
691 PUT UNFORMATTED "Remittance Advice".
693 PUT CONTROL remittance-font.
695 PUT UNFORMATTED "Please return this portion with your cheque, payable to:".
698 FIND Client
WHERE Client.ClientCode
= client-code
NO-LOCK NO-ERROR.
699 IF AVAILABLE(Client
) AND Client.Name
<> Client.LegalName
AND Client.LegalName
<> ?
AND Client.LegalName
<> "" THEN
700 PUT CONTROL remittance-font-bold Client.LegalName remittance-font.
701 ELSE IF AVAILABLE(Client
) THEN
702 PUT CONTROL remittance-font-bold Client.Name remittance-font.
705 DEF VAR i
AS INT NO-UNDO.
707 PUT UNFORMATTED office-address
[i
].
RUN skip-line
(1).
710 DEF VAR remittance-codes
AS CHAR NO-UNDO.
711 amount-due
= IF total-line-printed
THEN TRIM( STRING( statement-total
, ">,>>>,>>>,>>9.99CR" ) ) ELSE "".
714 RUN hpgl-moveto
( 110, 50 ).
715 RUN hpgl-text
( remittance-prompt
, "Our Ref:" ).
716 RUN hpgl-move-relative
( 20, 0 ).
717 RUN hpgl-text
( remittance-font
, "T" + STRING( Tenant.TenantCode
, "99999" ) ).
718 RUN hpgl-move-relative
( 25, 0 ).
719 RUN hpgl-text
( remittance-prompt
, "Date:" ).
720 RUN hpgl-move-relative
( 10, 0 ).
721 RUN hpgl-text
( remittance-font
, STRING( TODAY, "99/99/9999" ) ).
722 RUN hpgl-move-relative
( -55, -18 ).
723 RUN hpgl-text
( remittance-prompt
, "From:" ).
724 RUN hpgl-move-relative
( 20, 0 ).
725 RUN hpgl-text
( remittance-font
, Tenant.Name
).
726 RUN hpgl-move-relative
( -20, -4 ).
727 RUN hpgl-text
( remittance-prompt
, "Re:" ).
728 RUN hpgl-move-relative
( 20, 0 ).
729 RUN hpgl-text
( remittance-font
, regarding
).
730 RUN hpgl-move-relative
( -20, -4 ).
731 RUN hpgl-text
( remittance-prompt
, "Amount Due:" ).
732 RUN hpgl-move-relative
( 20, 0 ).
733 RUN hpgl-text
( remittance-font
, amount-due
).
734 RUN hpgl-move-relative
( -20, -6 ).
735 RUN hpgl-text
( remittance-prompt
, "Amount Paid:" ).
737 RUN hpgl-get-codes
( yes
, no
, OUTPUT remittance-codes
).
738 PUT CONTROL remittance-codes.
742 /* _UIB-CODE-BLOCK-END
*/
747 &IF DEFINED(EXCLUDE-print-title) = 0 &THEN
749 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-title Procedure
750 PROCEDURE print-title
:
751 /*------------------------------------------------------------------------------
753 ------------------------------------------------------------------------------*/
756 RUN client-logo
( entity-type
, entity-code
, client-code
).
757 RUN client-address
( entity-type
, entity-code
, client-code
).
758 RUN hpgl-get-codes
( yes
, yes
, OUTPUT logo-codes
).
759 PUT CONTROL logo-codes.
763 /* _UIB-CODE-BLOCK-END
*/
768 &IF DEFINED(EXCLUDE-reset-page) = 0 &THEN
770 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE reset-page Procedure
771 PROCEDURE reset-page
:
772 /*------------------------------------------------------------------------------
776 ------------------------------------------------------------------------------*/
778 PUT CONTROL reset-page.
784 /* _UIB-CODE-BLOCK-END
*/
789 &IF DEFINED(EXCLUDE-skip-line) = 0 &THEN
791 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE skip-line Procedure
792 PROCEDURE skip-line
:
793 /*------------------------------------------------------------------------------
797 ------------------------------------------------------------------------------*/
799 DEF INPUT PARAMETER n
AS DEC NO-UNDO.
801 DEF VAR int-part
AS INT NO-UNDO.
802 DEF VAR dec-part
AS DEC NO-UNDO.
804 int-part
= TRUNCATE( n
, 0 ).
805 IF int-part
< 0 THEN RETURN.
806 dec-part
= n
- int-part.
807 IF int-part
= 0 AND dec-part
= 0 THEN RETURN.
809 /* Need to have this like the following
- do not touch
*/
810 IF int-part
<> 0 THEN PUT CONTROL FILL( CHR(10), int-part
).
811 IF dec-part
<> 0 THEN PUT CONTROL half-line.
819 /* _UIB-CODE-BLOCK-END
*/
824 &IF DEFINED(EXCLUDE-skip-to-line) = 0 &THEN
826 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE skip-to-line Procedure
827 PROCEDURE skip-to-line
:
828 /*------------------------------------------------------------------------------
832 ------------------------------------------------------------------------------*/
834 DEF INPUT PARAMETER line-no
AS DEC NO-UNDO.
836 DEF VAR int-part
AS INT NO-UNDO.
837 DEF VAR dec-part
AS DEC NO-UNDO.
839 int-part
= TRUNCATE( line-no
- ln
, 0 ).
840 IF int-part
< 0 THEN RETURN.
841 dec-part
= ( line-no
- ln
) - int-part.
842 IF int-part
= 0 AND dec-part
= 0 THEN RETURN.
844 IF int-part
<> 0 THEN PUT CONTROL FILL( CHR(10), int-part
).
845 IF dec-part
<> 0 THEN PUT CONTROL half-line.
853 /* _UIB-CODE-BLOCK-END
*/
858 &IF DEFINED(EXCLUDE-statement-of-account) = 0 &THEN
860 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE statement-of-account Procedure
861 PROCEDURE statement-of-account
:
862 /*------------------------------------------------------------------------------
866 ------------------------------------------------------------------------------*/
868 RUN get-control-strings.
869 RUN get-office-address.
870 RUN date-to-word
( TODAY, OUTPUT date-in-words
).
872 IF prop-code
<> ?
THEN DO:
873 FOR EACH Tenant
NO-LOCK WHERE (NOT(active-only
) OR Tenant.Active
)
874 AND Tenant.EntityType
= 'P'
AND Tenant.EntityCode
= prop-code
875 BY Tenant.TenantCode
:
880 FOR EACH Tenant
NO-LOCK WHERE (NOT(active-only
) OR Tenant.Active
)
881 AND Tenant.TenantCode
>= from-tenant
AND Tenant.TenantCode
<= to-tenant
882 BY Tenant.TenantCode
:
890 /* _UIB-CODE-BLOCK-END
*/
895 &IF DEFINED(EXCLUDE-total-line) = 0 &THEN
897 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE total-line Procedure
898 PROCEDURE total-line
:
899 /*------------------------------------------------------------------------------
903 ------------------------------------------------------------------------------*/
906 RUN next-transaction.
908 PUT UNFORMATTED SPACE(86) "------------".
RUN skip-line
(1).
911 STRING( statement-total
, ">,>>>,>>>,>>9.99CR" ).
RUN skip-line
(1).
912 PUT UNFORMATTED SPACE(86) "============".
RUN skip-line
(1).
914 total-line-printed
= Yes.
918 /* _UIB-CODE-BLOCK-END
*/