1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
6 NOTE
: this is written for a PCL5 compatible printer
7 ------------------------------------------------------------------------*/
9 &SCOPED-DEFINE max-vouchers 20 /* Max that will fit in the remittance */
10 &SCOPED-DEFINE address-line 4 /* Begin the address in the this line of the remittance window */
11 &SCOPED-DEFINE message-line 17 /* Begin the message line at this line */
13 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
14 DEF VAR bank-account
LIKE Cheque.BankAccountCode
NO-UNDO.
15 DEF VAR cheque-from
LIKE Cheque.ChequeNo
NO-UNDO.
16 DEF VAR cheque-to
LIKE Cheque.ChequeNo
NO-UNDO.
17 DEF VAR msg-text
AS CHAR NO-UNDO.
18 DEF VAR gst-applies
AS LOGI
NO-UNDO.
19 DEFINE VARIABLE payment-style
AS CHARACTER INITIAL ''
NO-UNDO.
20 DEFINE VARIABLE bankimport-directory
AS CHARACTER INITIAL ''
NO-UNDO.
24 IF LENGTH(bankimport-directory
) > 0 THEN DO:
25 RUN process
/report
/remittance.p
( report-options
).
30 gst-applies
= Office.GST
<> ?.
31 {inc
/ofc-set-l.i
"Cheque-Usage-Summaries" "do-usage-summary"}
34 DEF VAR ln
AS DEC INIT 0.00 NO-UNDO.
36 /* Line definitions
*/
38 DEF VAR date-in-words
AS CHAR NO-UNDO.
39 DEF VAR creditor-address
AS CHAR NO-UNDO.
41 DEF VAR reset-page
AS CHAR NO-UNDO.
42 DEF VAR half-line
AS CHAR NO-UNDO. half-line
= CHR(27) + "=".
43 DEF VAR cheque-font
AS CHAR NO-UNDO.
44 DEF VAR overrun-font
AS CHAR NO-UNDO.
45 DEF VAR line-printer
AS CHAR NO-UNDO.
47 DEF VAR rows
AS DEC NO-UNDO.
48 DEF VAR cols
AS DEC NO-UNDO.
50 DEF VAR page-no
AS INT NO-UNDO.
51 DEF VAR voucher-details
AS CHAR NO-UNDO.
52 DEF VAR n-vouchers
AS INT NO-UNDO.
54 /* HP Printer Bin Assignments
*/
56 &SCOPED-DEFINE PRIORITY 0 /* Prioirty - Manual Feed, Tray2, Tray3 */
57 &SCOPED-DEFINE TRAY_2 1 /* Tray 2 only */
58 &SCOPED-DEFINE MANUAL_FEED_A4 2 /* Manual Feed A$ Tray 1 */
59 &SCOPED-DEFINE MANUAL_FEED_ENV 3 /* Maunal Feed Envelope Tray 1 */
60 &SCOPED-DEFINE PRIORITY_2 4 /* Priority - Tray2, Tray3 */
61 &SCOPED-DEFINE TRAY_3 5 /* Tray 3 only */
63 {inc
/ofc-set.i
"TrayForCheques" "cheque-tray"}
64 IF NOT AVAILABLE(OfficeSetting
) THEN cheque-tray
= "{&MANUAL_FEED_A4}" .
65 {inc
/ofc-set.i
"TrayForPlain" "plain-tray"}
66 IF NOT AVAILABLE(OfficeSetting
) THEN plain-tray
= "{&TRAY_2}" .
68 /* _UIB-CODE-BLOCK-END
*/
72 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
74 /* ******************** Preprocessor Definitions
******************** */
76 &Scoped-define PROCEDURE-TYPE Procedure
77 &Scoped-define DB-AWARE no
81 /* _UIB-PREPROCESSOR-BLOCK-END
*/
85 /* ************************ Function Prototypes
********************** */
87 &IF DEFINED(EXCLUDE-switch-bin) = 0 &THEN
89 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD switch-bin Procedure
90 FUNCTION switch-bin
RETURNS CHARACTER
91 ( INPUT bin-id
AS INT ) FORWARD.
93 /* _UIB-CODE-BLOCK-END
*/
99 /* *********************** Procedure Settings
************************ */
101 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
102 /* Settings for
THIS-PROCEDURE
106 Add Fields to
: Neither
107 Other Settings
: CODE-ONLY
COMPILE
109 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
111 /* ************************* Create Window
************************** */
113 &ANALYZE-SUSPEND _CREATE-WINDOW
114 /* DESIGN Window definition
(used by the UIB
)
115 CREATE WINDOW Procedure
ASSIGN
118 /* END WINDOW DEFINITION
*/
122 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
123 /* ************************* Included-Libraries
*********************** */
125 {inc
/method
/m-sysmgr.i
}
126 {inc
/method
/m-txtrep.i
}
129 /* _UIB-CODE-BLOCK-END
*/
136 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
139 /* *************************** Main Block
*************************** */
141 DEF VAR preview
AS LOGI
INIT No
NO-UNDO.
143 RUN get-control-strings.
144 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
149 RUN view-output-file
( preview
).
151 /* _UIB-CODE-BLOCK-END
*/
155 /* ********************** Internal Procedures
*********************** */
157 &IF DEFINED(EXCLUDE-carriage-return) = 0 &THEN
159 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE carriage-return Procedure
160 PROCEDURE carriage-return
:
161 /*------------------------------------------------------------------------------
165 ------------------------------------------------------------------------------*/
171 /* _UIB-CODE-BLOCK-END
*/
176 &IF DEFINED(EXCLUDE-cheque-details) = 0 &THEN
178 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cheque-details Procedure
179 PROCEDURE cheque-details
:
180 /*------------------------------------------------------------------------------
184 ------------------------------------------------------------------------------*/
186 DEF VAR date-in-words
AS CHAR NO-UNDO.
187 DEF VAR sum-in-words
AS CHAR NO-UNDO.
188 DEF VAR i
AS INT NO-UNDO.
190 RUN date-to-word
( Cheque.Date
, OUTPUT date-in-words
).
191 RUN amount-to-word
( Cheque.Amount
, OUTPUT sum-in-words
).
192 RUN word-wrap
( sum-in-words
, 60, OUTPUT sum-in-words
).
193 SUBSTR( sum-in-words
, 1, 1 ) = CAPS( SUBSTR( sum-in-words
, 1, 1 ) ).
195 PUT CONTROL line-printer.
RUN pcl-moveto
( 96, 8 ).
PUT CONTROL cheque-font.
196 PUT UNFORMATTED Cheque.PayeeName.
198 PUT CONTROL line-printer.
RUN pcl-moveto
( 91, 101 ).
PUT CONTROL cheque-font.
199 PUT UNFORMATTED date-in-words.
201 PUT CONTROL line-printer.
RUN pcl-moveto
( 100,105 ).
PUT CONTROL cheque-font.
202 PUT UNFORMATTED STRING( Cheque.Amount
, "$>>,>>>,>>9.99" ).
204 DO i
= 1 TO NUM-ENTRIES( sum-in-words
, "~n" ):
205 PUT CONTROL line-printer.
RUN pcl-moveto
( 102 + ( i
- 1 ) * 1.5, 5 ).
PUT CONTROL cheque-font.
206 PUT UNFORMATTED ENTRY( i
, sum-in-words
, "~n" ).
211 /* _UIB-CODE-BLOCK-END
*/
216 &IF DEFINED(EXCLUDE-each-cheque) = 0 &THEN
218 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-cheque Procedure
219 PROCEDURE each-cheque
:
220 /*------------------------------------------------------------------------------
224 ------------------------------------------------------------------------------*/
227 switch-bin
( INTEGER(cheque-tray
) ).
229 RUN get-creditor-address.
230 RUN get-voucher-details.
233 RUN print-advice
( 15, 10, "" ).
234 RUN remittance-header.
235 RUN print-advice
( 56, 10, msg-text
).
240 IF n-vouchers
> {&max-vouchers} THEN RUN print-secondary-advice.
244 /* _UIB-CODE-BLOCK-END
*/
249 &IF DEFINED(EXCLUDE-get-bank-account) = 0 &THEN
251 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-bank-account Procedure
252 PROCEDURE get-bank-account
:
253 /*------------------------------------------------------------------------------
257 ------------------------------------------------------------------------------*/
259 FIND FIRST BankAccount
WHERE BankAccount.BankAccountCode
= bank-account
261 IF NOT AVAILABLE BankAccount
THEN RETURN "FAIL".
265 /* _UIB-CODE-BLOCK-END
*/
270 &IF DEFINED(EXCLUDE-get-control-strings) = 0 &THEN
272 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-control-strings Procedure
273 PROCEDURE get-control-strings
:
274 /*------------------------------------------------------------------------------
275 Purpose
: Get all control strings for this report
278 ------------------------------------------------------------------------------*/
280 RUN make-control-string
( "PCL", "reset,portrait,a4,tm,0,lm,6",
281 OUTPUT reset-page
, OUTPUT rows
, OUTPUT cols
).
283 RUN make-control-string
( "PCL", "LinePrinter,lpi,9.54",
284 OUTPUT line-printer
, OUTPUT rows
, OUTPUT cols
).
286 RUN make-control-string
( "PCL", "Courier,cpi,12",
287 OUTPUT cheque-font
, OUTPUT rows
, OUTPUT cols
).
289 RUN make-control-string
( "PCL", "Proportional,times,bold,point,18",
290 OUTPUT overrun-font
, OUTPUT rows
, OUTPUT cols
).
294 /* _UIB-CODE-BLOCK-END
*/
299 &IF DEFINED(EXCLUDE-get-creditor-address) = 0 &THEN
301 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-creditor-address Procedure
302 PROCEDURE get-creditor-address
:
303 /*------------------------------------------------------------------------------
307 ------------------------------------------------------------------------------*/
309 DEF VAR i
AS INT NO-UNDO.
310 DEF VAR addr_string
AS CHAR NO-UNDO.
312 creditor-address
= "".
314 FIND FIRST Voucher
WHERE
315 Voucher.BankAccountCode
= Cheque.BankAccountCode
AND
316 Voucher.ChequeNo
= Cheque.ChequeNo
319 FIND FIRST Creditor
OF Voucher
NO-LOCK.
320 RUN process
/getaddr.p
( "C", Creditor.CreditorCode
, "PYMT,POST,MAIN",
321 OUTPUT creditor-address
).
325 /* _UIB-CODE-BLOCK-END
*/
330 &IF DEFINED(EXCLUDE-get-voucher-details) = 0 &THEN
332 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-voucher-details Procedure
333 PROCEDURE get-voucher-details
:
334 /*------------------------------------------------------------------------------
338 ------------------------------------------------------------------------------*/
340 voucher-details
= "".
343 FOR EACH Voucher
NO-LOCK WHERE
344 Voucher.BankAccountCode
= Cheque.BankAccountCode
AND
345 Voucher.ChequeNo
= Cheque.ChequeNo
BREAK BY Voucher.VoucherSeq
:
347 voucher-details
= voucher-details
+ IF voucher-details
= "" THEN "" ELSE "~n".
349 voucher-details
= voucher-details
+
350 STRING( Voucher.Date
, "99/99/99" ) + "|" +
351 STRING( Voucher.VoucherSeq
, ">>99999" ) + "|" +
352 STRING( Voucher.InvoiceReference
, "X(15)" ) + "|" +
353 STRING( Voucher.GoodsValue
+ Voucher.TaxValue
, ">>,>>>,>>9.99CR" ).
357 n-vouchers
= NUM-ENTRIES( voucher-details
, "~n" ).
361 /* _UIB-CODE-BLOCK-END
*/
366 &IF DEFINED(EXCLUDE-page-feed) = 0 &THEN
368 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE page-feed Procedure
369 PROCEDURE page-feed
:
370 /*------------------------------------------------------------------------------
374 ------------------------------------------------------------------------------*/
377 page-no
= page-no
+ 1.
381 /* _UIB-CODE-BLOCK-END
*/
386 &IF DEFINED(EXCLUDE-parse-parameters) = 0 &THEN
388 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
389 PROCEDURE parse-parameters
:
390 /*------------------------------------------------------------------------------
394 ------------------------------------------------------------------------------*/
395 DEF VAR i
AS INT NO-UNDO.
396 DEF VAR token
AS CHAR NO-UNDO.
398 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
399 token
= ENTRY( i
, report-options
, "~n" ).
400 CASE( ENTRY( 1, token
) ):
401 WHEN "BankAccount" THEN bank-account
= TRIM(ENTRY(2,token
)).
402 WHEN "Message" THEN msg-text
= REPLACE( SUBSTRING(token
,9), CHR(7), "~n").
404 WHEN "ChequeRange" THEN ASSIGN
405 cheque-from
= INT(ENTRY(2,token
))
406 cheque-to
= INT(ENTRY(3,token
)).
408 WHEN "PaymentStyle" THEN payment-style
= ENTRY(2,token
).
410 WHEN "WriteBankImportFileTo" THEN bankimport-directory
= ENTRY(2,token
).
417 /* _UIB-CODE-BLOCK-END
*/
422 &IF DEFINED(EXCLUDE-payment-header) = 0 &THEN
424 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE payment-header Procedure
425 PROCEDURE payment-header
:
426 /*------------------------------------------------------------------------------
430 ------------------------------------------------------------------------------*/
432 PUT CONTROL line-printer.
433 RUN pcl-moveto
( 5, 113 ).
434 PUT UNFORMATTED STRING( Cheque.ChequeNo
, "999999" ).
435 RUN pcl-moveto
( 7, 109 ).
436 PUT UNFORMATTED STRING( Cheque.Date
, "99/99/9999" ).
440 /* _UIB-CODE-BLOCK-END
*/
445 &IF DEFINED(EXCLUDE-print-advice) = 0 &THEN
447 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-advice Procedure
448 PROCEDURE print-advice
:
449 /*------------------------------------------------------------------------------
451 ------------------------------------------------------------------------------*/
452 DEF INPUT PARAMETER base-row
AS DEC NO-UNDO.
453 DEF INPUT PARAMETER base-col
AS DEC NO-UNDO.
454 DEF INPUT PARAMETER msg-text
AS CHAR NO-UNDO.
456 DEF VAR i
AS INT NO-UNDO.
457 DEF VAR voucher-line
AS CHAR NO-UNDO.
458 DEF VAR voucher-base
AS DEC NO-UNDO.
460 /* Print the address
*/
462 DO i
= 1 TO NUM-ENTRIES( creditor-address
, "~n" ):
463 RUN pcl-moveto
( base-row
+ i
- 1 + {&address-line}, base-col ).
464 PUT UNFORMATTED ENTRY( i
, creditor-address
, "~n" ).
467 /* Print the details
*/
469 IF n-vouchers
> {&max-vouchers} THEN
471 RUN pcl-moveto
( base-row
+ 3, base-col
+ 60 ).
472 PUT CONTROL overrun-font.
473 PUT UNFORMATTED "SEE ATTACHED SHEET".
474 PUT CONTROL line-printer.
479 /* Print the vouchers
*/
481 voucher-base
= base-col
+ 55.
483 DO i
= 1 TO NUM-ENTRIES( voucher-details
, "~n" ):
484 RUN pcl-moveto
( base-row
+ i
- 1, voucher-base
).
485 voucher-line
= ENTRY( i
, voucher-details
, "~n" ).
487 ENTRY( 1, voucher-line
, "|" ) SPACE(7)
488 ENTRY( 2, voucher-line
, "|" ) SPACE(10)
489 ENTRY( 3, voucher-line
, "|" ) SPACE(2)
490 ENTRY( 4, voucher-line
, "|" ).
495 /* Print the total
*/
496 PUT CONTROL line-printer.
497 RUN pcl-moveto
( base-row
+ 21, base-col
+ 103 ).
498 PUT UNFORMATTED STRING( Cheque.Amount
, ">>,>>>,>>9.99CR" ).
500 /* Print the message
*/
502 IF msg-text
<> "" THEN
503 DO i
= 1 TO NUM-ENTRIES( msg-text
, "~n" ):
504 RUN pcl-moveto
( base-row
+ {&message-line} + i - 1, base-col ).
505 PUT UNFORMATTED ENTRY( i
, msg-text
, "~n" ).
510 /* _UIB-CODE-BLOCK-END
*/
515 &IF DEFINED(EXCLUDE-print-cheques) = 0 &THEN
517 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-cheques Procedure
518 PROCEDURE print-cheques
:
519 /*------------------------------------------------------------------------------
521 ------------------------------------------------------------------------------*/
523 RUN get-bank-account.
524 IF RETURN-VALUE = 'FAIL'
THEN RETURN.
526 FOR EACH Cheque
NO-LOCK WHERE
527 Cheque.BankAccountCode
= BankAccount.BankAccountCode
AND
528 Cheque.ChequeNo
>= cheque-from
AND
529 Cheque.ChequeNo
<= cheque-to
AND NOT Cheque.Cancelled
:
531 FIND FIRST Voucher
WHERE Voucher.BankAccountCode
= Cheque.BankAccountCode
532 AND Voucher.ChequeNo
= Cheque.ChequeNo
NO-LOCK NO-ERROR.
534 IF Voucher.PaymentStyle
= payment-style
THEN
539 IF do-usage-summary
<> No
THEN RUN print-usage-summary.
543 /* _UIB-CODE-BLOCK-END
*/
548 &IF DEFINED(EXCLUDE-print-secondary-advice) = 0 &THEN
550 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-secondary-advice Procedure
551 PROCEDURE print-secondary-advice
:
552 /*------------------------------------------------------------------------------
556 ------------------------------------------------------------------------------*/
560 DEF VAR a-pn
AS INT NO-UNDO INIT 1.
561 DEF VAR a-ln
AS INT NO-UNDO.
562 DEF VAR i
AS INT NO-UNDO.
563 DEF VAR voucher-line
AS CHAR NO-UNDO.
565 RUN secondary-advice-header
( a-pn
).
567 DO i
= 1 TO NUM-ENTRIES( voucher-details
, "~n" ):
569 voucher-line
= ENTRY( i
, voucher-details
, "~n" ).
570 PUT UNFORMATTED SPACE(10)
571 ENTRY( 1, voucher-line
, "|" ) SPACE(9)
572 ENTRY( 2, voucher-line
, "|" ) SPACE(7)
573 ENTRY( 3, voucher-line
, "|" ) SPACE(4)
574 ENTRY( 4, voucher-line
, "|" ).
579 IF a-ln
>= {&PAGE-LINES} THEN
584 RUN secondary-advice-header
( a-pn
).
591 SPACE( 50 ) " " FILL( "-", 13 ) SKIP
592 SPACE( 50 ) "Total " STRING( Cheque.Amount
, ">>,>>>,>>9.99" ) SKIP
593 SPACE( 50 ) " " FILL( "=", 13 ) SKIP.
599 /* _UIB-CODE-BLOCK-END
*/
604 &IF DEFINED(EXCLUDE-print-usage-summary) = 0 &THEN
606 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-usage-summary Procedure
607 PROCEDURE print-usage-summary
:
608 /*------------------------------------------------------------------------------
612 ------------------------------------------------------------------------------*/
614 DEF VAR s-ln
AS INT NO-UNDO.
615 DEF VAR s-pn
AS INT INIT 1 NO-UNDO.
616 DEF VAR summary-total
AS DEC NO-UNDO.
617 DEF VAR page-lines
AS INT NO-UNDO.
619 RUN usage-summary-header
( s-pn
, OUTPUT page-lines
).
621 FOR EACH Cheque
NO-LOCK WHERE
622 Cheque.BankAccountCode
= bank-account
AND
623 Cheque.ChequeNo
>= cheque-from
AND
624 Cheque.ChequeNo
<= cheque-to
,
625 FIRST Creditor
OF Cheque
NO-LOCK:
628 STRING( Cheque.ChequeNo
, "999999" ) SPACE(5)
629 STRING( Cheque.CreditorCode
, ">>>>>9" ) SPACE(3)
630 STRING( Creditor.Name
, "X(50)" ) SPACE(9)
631 STRING( Cheque.Amount
, ">,>>>,>>>,>>9.99" ).
634 summary-total
= summary-total
+ Cheque.Amount.
637 IF s-ln
>= page-lines
THEN
642 RUN usage-summary-header
( s-pn
, OUTPUT page-lines
).
648 SPACE(80) "---------------" SKIP
649 SPACE(79) STRING( summary-total
, ">,>>>,>>>,>>9.99" ) SKIP
650 SPACE(80) "===============".
652 /* eject page and decisively set back to internal bin
*/
654 switch-bin
( INTEGER(plain-tray
) ).
659 /* _UIB-CODE-BLOCK-END
*/
664 &IF DEFINED(EXCLUDE-remittance-header) = 0 &THEN
666 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE remittance-header Procedure
667 PROCEDURE remittance-header
:
668 /*------------------------------------------------------------------------------
672 ------------------------------------------------------------------------------*/
674 RUN pcl-moveto
( 46, 109 ).
675 PUT UNFORMATTED STRING( Cheque.Date
, "99/99/9999" ).
676 RUN pcl-moveto
( 47.5, 113 ).
677 PUT UNFORMATTED STRING( Cheque.ChequeNo
, "999999" ).
681 /* _UIB-CODE-BLOCK-END
*/
686 &IF DEFINED(EXCLUDE-reset-page) = 0 &THEN
688 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE reset-page Procedure
689 PROCEDURE reset-page
:
690 /*------------------------------------------------------------------------------
694 ------------------------------------------------------------------------------*/
696 PUT CONTROL reset-page.
701 /* _UIB-CODE-BLOCK-END
*/
706 &IF DEFINED(EXCLUDE-secondary-advice-header) = 0 &THEN
708 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE secondary-advice-header Procedure
709 PROCEDURE secondary-advice-header
:
710 /*------------------------------------------------------------------------------
714 ------------------------------------------------------------------------------*/
716 DEF INPUT PARAMETER page-no
AS INT NO-UNDO.
718 DEF VAR head-font
AS CHAR NO-UNDO.
721 switch-bin
( INTEGER(plain-tray
) ).
723 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,18", OUTPUT head-font
, OUTPUT rows
, OUTPUT cols
).
725 PUT CONTROL line-printer.
728 PUT CONTROL head-font.
729 PUT UNFORMATTED SPACE(30) "Remittance Advice".
732 PUT CONTROL line-printer.
733 PUT UNFORMATTED SPACE(8) "Cheque No: " + STRING( Cheque.ChequeNo
, ">>>>999999" ).
RUN skip-line
(1).
734 PUT UNFORMATTED SPACE(8) "Payment Date: " + STRING( Cheque.Date
, "99/99/9999" ).
RUN skip-line
(1).
735 PUT UNFORMATTED SPACE(8) "Page: " + STRING( page-no
, ">>>>>>>>>9" ).
RUN skip-line
(2).
736 PUT UNFORMATTED SPACE(12) "Date" SPACE(8)
739 "Amount".
RUN skip-line
(2).
743 /* _UIB-CODE-BLOCK-END
*/
748 &IF DEFINED(EXCLUDE-skip-line) = 0 &THEN
750 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE skip-line Procedure
751 PROCEDURE skip-line
:
752 /*------------------------------------------------------------------------------
756 ------------------------------------------------------------------------------*/
758 DEF INPUT PARAMETER n
AS DEC NO-UNDO.
760 DEF VAR int-part
AS INT NO-UNDO.
761 DEF VAR dec-part
AS DEC NO-UNDO.
763 int-part
= TRUNCATE( n
, 0 ).
764 IF int-part
< 0 THEN RETURN.
765 dec-part
= n
- int-part.
766 IF int-part
= 0 AND dec-part
= 0 THEN RETURN.
768 /* Need to have this like the following
- do not touch
*/
769 IF int-part
<> 0 THEN PUT CONTROL FILL( CHR(10), int-part
).
770 IF dec-part
<> 0 THEN PUT CONTROL half-line.
778 /* _UIB-CODE-BLOCK-END
*/
783 &IF DEFINED(EXCLUDE-usage-summary-header) = 0 &THEN
785 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE usage-summary-header Procedure
786 PROCEDURE usage-summary-header
:
787 /*------------------------------------------------------------------------------
791 ------------------------------------------------------------------------------*/
795 DEF INPUT PARAMETER page-no
AS INT NO-UNDO.
796 DEF OUTPUT PARAMETER page-lines
AS INT NO-UNDO.
798 DEF VAR user-name
AS CHAR NO-UNDO.
799 DEF VAR date-font
AS CHAR NO-UNDO.
800 DEF VAR head-font
AS CHAR NO-UNDO.
801 DEF VAR bank-font
AS CHAR NO-UNDO.
803 page-lines
= {&PAGE-LINES}.
805 switch-bin
( INTEGER(plain-tray
) ).
807 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,8", OUTPUT date-font
, OUTPUT rows
, OUTPUT cols
).
808 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,18", OUTPUT head-font
, OUTPUT rows
, OUTPUT cols
).
809 RUN make-control-string
( "PCL", "Proportional,Times,Bold,Point,8", OUTPUT bank-font
, OUTPUT rows
, OUTPUT cols
).
810 RUN get-username
IN sys-mgr
( OUTPUT user-name
).
812 PUT CONTROL line-printer.
RUN skip-line
(4).
813 PUT CONTROL date-font.
815 PUT UNFORMATTED "Printed at " + STRING( TIME, "HH:MM:SS" ) + ", " + STRING( TODAY, "99/99/9999" ) + " for " + user-name.
817 PUT UNFORMATTED SPACE( 180 ) "Page " + STRING(page-no
).
820 PUT CONTROL head-font.
821 PUT UNFORMATTED SPACE(26) "Cheque Usage Summary".
824 IF AVAILABLE BankAccount
THEN
826 PUT CONTROL bank-font.
828 "(L" + STRING( BankAccount.CompanyCode
, "9999" ) + " - " +
829 STRING( BankAccount.AccountCode
, "9999.99" ) + ") " +
830 BankAccount.BankName
+ ", " +
831 BankAccount.BankBranchName
+ ", " +
832 BankAccount.AccountName
+ " " +
833 "(" + STRING( BankAccount.BankAccount
) + ")".
834 PUT CONTROL line-printer.
836 page-lines
= page-lines
- 3.
848 /* _UIB-CODE-BLOCK-END
*/
853 /* ************************ Function Implementations
***************** */
855 &IF DEFINED(EXCLUDE-switch-bin) = 0 &THEN
857 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION switch-bin Procedure
858 FUNCTION switch-bin
RETURNS CHARACTER
859 ( INPUT bin-id
AS INT ) :
860 /*------------------------------------------------------------------------------
863 ------------------------------------------------------------------------------*/
865 DEF VAR bin-ctrl
AS CHAR NO-UNDO.
866 DEF VAR rows
AS DEC NO-UNDO.
867 DEF VAR cols
AS DEC NO-UNDO.
869 RUN make-control-string
( "PCL", "bin," + STRING( bin-id
), OUTPUT bin-ctrl
,
870 OUTPUT rows
, OUTPUT cols
).
871 PUT CONTROL bin-ctrl.
873 RETURN "".
/* Function return value.
*/
877 /* _UIB-CODE-BLOCK-END
*/