1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
15 ------------------------------------------------------------------------*/
16 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
18 DEF VAR tenant-code
LIKE Tenant.TenantCode
NO-UNDO.
19 DEF VAR bank-account
LIKE BankAccount.BankAccountCode
NO-UNDO.
20 DEF VAR commence-date
AS DATE NO-UNDO.
22 {inc
/ofc-set-l.i
"Use-Rent-Charges" "use-rent-charges"}
26 DEF VAR fixed-codes
AS CHAR NO-UNDO.
27 DEF VAR section-codes
AS CHAR EXTENT 4 NO-UNDO.
29 DEF VAR variable-codes
AS CHAR NO-UNDO.
30 DEF VAR prt-ctrl
AS CHAR NO-UNDO.
31 DEF VAR rows
AS INT NO-UNDO.
32 DEF VAR cols
AS INT NO-UNDO.
34 DEF VAR payee-particulars
AS CHAR NO-UNDO.
35 DEF VAR gst-applies
AS LOGI
NO-UNDO.
36 DEF VAR tax-applicable
AS LOGI
NO-UNDO.
38 DEF VAR user-name
AS CHAR NO-UNDO.
39 DEF VAR print-id
AS CHAR NO-UNDO.
40 DEF VAR total-per-month
AS DEC NO-UNDO.
43 FIND Month
WHERE Month.StartDate
<= commence-date
AND Month.EndDate
>= commence-date
NO-LOCK.
44 DEF VAR commence-month-start
AS DATE NO-UNDO.
45 DEF VAR commence-month-end
AS DATE NO-UNDO.
46 commence-month-start
= Month.StartDate.
47 commence-month-end
= Month.EndDate.
49 /* _UIB-CODE-BLOCK-END
*/
53 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
55 /* ******************** Preprocessor Definitions
******************** */
57 &Scoped-define PROCEDURE-TYPE Procedure
61 /* _UIB-PREPROCESSOR-BLOCK-END
*/
65 /* ************************ Function Prototypes
********************** */
67 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD get-expected-dc Procedure
68 FUNCTION get-expected-dc
RETURNS DECIMAL
69 ( /* parameter-definitions
*/ ) FORWARD.
71 /* _UIB-CODE-BLOCK-END
*/
74 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD get-expected-dc-rentalspace Procedure
75 FUNCTION get-expected-dc-rentalspace
RETURNS DECIMAL
76 ( /* parameter-definitions
*/ ) FORWARD.
78 /* _UIB-CODE-BLOCK-END
*/
81 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD include-lease Procedure
82 FUNCTION include-lease
RETURNS LOGICAL
83 ( INPUT lease-code
AS INT ) FORWARD.
85 /* _UIB-CODE-BLOCK-END
*/
89 /* *********************** Procedure Settings
************************ */
91 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
92 /* Settings for
THIS-PROCEDURE
96 Add Fields to
: Neither
97 Other Settings
: CODE-ONLY
COMPILE
99 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
101 /* ************************* Create Window
************************** */
103 &ANALYZE-SUSPEND _CREATE-WINDOW
104 /* DESIGN Window definition
(used by the UIB
)
105 CREATE WINDOW Procedure
ASSIGN
108 /* END WINDOW DEFINITION
*/
114 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
115 /* ************************* Included-Libraries
*********************** */
117 {inc
/method
/m-txtrep.i
}
118 {inc
/method
/m-hpgl.i
}
122 /* _UIB-CODE-BLOCK-END
*/
127 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
130 /* *************************** Main Block
*************************** */
131 {inc
/username.i
"user-name"}
132 print-id
= STRING( TODAY, "99/99/9999" ) + " " + STRING( TIME, "HH:MM" ) + " " +
135 gst-applies
= Office.GST
<> ?.
137 RUN make-control-string
( "PCL", "reset,portrait,tm,0,a4,lm,0,courier,cpi,18,lpi,9",
138 OUTPUT prt-ctrl
, OUTPUT rows
, OUTPUT cols
).
139 RUN output-control-file
( prt-ctrl
).
140 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
145 RUN view-output-file
( No
).
147 /* _UIB-CODE-BLOCK-END
*/
151 /* ********************** Internal Procedures
*********************** */
153 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ap-form Procedure
155 /*------------------------------------------------------------------------------
159 ------------------------------------------------------------------------------*/
162 DEF VAR i
AS INT NO-UNDO.
164 PUT CONTROL section-codes
[i
].
168 RUN variable-replacements.
169 PUT CONTROL variable-codes.
171 RUN make-control-string
( "PCL", "eject", OUTPUT prt-ctrl
, OUTPUT rows
, OUTPUT cols
).
172 PUT CONTROL prt-ctrl.
176 /* _UIB-CODE-BLOCK-END
*/
180 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE edit-box Procedure
182 /*------------------------------------------------------------------------------
186 ------------------------------------------------------------------------------*/
191 DEF INPUT PARAMETER sequence-string
AS CHAR NO-UNDO.
193 DEF VAR n
AS INT NO-UNDO.
194 DEF VAR i
AS INT NO-UNDO.
195 DEF VAR j
AS INT NO-UNDO.
196 DEF VAR k
AS INT NO-UNDO.
198 RUN hpgl-set-line-width
( 0.25 ).
200 DO i
= 1 TO NUM-ENTRIES( sequence-string
):
202 ASSIGN n
= INT( ENTRY( i
, sequence-string
) ) NO-ERROR.
204 IF ERROR-STATUS:ERROR OR n
= 0 THEN
206 RUN hpgl-move-relative
( {&box-w}, 0 ).
211 RUN hpgl-box-relative
( {&box-w}, {&box-h} ).
212 RUN hpgl-move-relative
( {&box-w}, 0 ).
218 RUN hpgl-move-relative
( {&box-w} * k * -1, 0 ).
222 /* _UIB-CODE-BLOCK-END
*/
226 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-fixed-codes Procedure
227 PROCEDURE get-fixed-codes
:
228 /*------------------------------------------------------------------------------
232 ------------------------------------------------------------------------------*/
236 /* The constant parts of the page
*/
244 /* _UIB-CODE-BLOCK-END
*/
248 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-tenant-details Procedure
249 PROCEDURE get-tenant-details
:
250 /*------------------------------------------------------------------------------
254 ------------------------------------------------------------------------------*/
256 DEF VAR entity-name
AS CHAR NO-UNDO.
258 FIND Tenant
WHERE Tenant.TenantCode
= tenant-code
NO-LOCK.
259 entity-name
= Tenant.Name.
261 IF Tenant.EntityType
= "P" THEN DO:
262 FIND Property
WHERE Property.PropertyCode
= Tenant.EntityCode
NO-LOCK NO-ERROR.
263 IF AVAILABLE Property
THEN entity-name
= Property.Name.
265 ELSE IF Tenant.EntityType
= "L" THEN DO:
266 FIND Company
WHERE Company.CompanyCode
= Tenant.EntityCode
NO-LOCK NO-ERROR.
267 IF AVAILABLE Company
THEN entity-name
= Company.LegalName.
270 total-per-month
= get-expected-dc
().
272 payee-particulars
= Tenant.EntityType
+ STRING( Tenant.EntityCode
, "99999")
273 + "/T" + STRING( Tenant.TenantCode
, "99999").
274 payee-particulars
= CAPS( payee-particulars
).
278 /* _UIB-CODE-BLOCK-END
*/
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-variables Procedure
283 PROCEDURE get-variables
:
284 /*------------------------------------------------------------------------------
286 ------------------------------------------------------------------------------*/
288 RUN hpgl-moveto
( 160, 228 ).
289 RUN hpgl-text
( "Times,Proportional,Point,12,Bold", "@TodaysDate@" ).
291 RUN hpgl-moveto
( 59, 201.5 ).
292 RUN hpgl-text
( hpgl-last-font
, "@CommenceDate@" ).
293 RUN hpgl-move-relative
( 81, 0 ).
294 RUN hpgl-text
( hpgl-last-font
, "@Frequency@" ).
295 RUN hpgl-move-relative
( -88, -16.5 ).
296 RUN hpgl-text
( "Times,Proportional,Point,10,Bold", "@DollarAmount@" ).
297 RUN hpgl-move-relative
( 40, 0 ).
298 RUN hpgl-text
( "Times,Proportional,Point,7,Bold", "@AmountInWords@" ).
300 RUN hpgl-moveto
( 109, 173 ).
301 RUN hpgl-text
( "Courier,Fixed,cpi,8,Bold", "@PayeeName@" ).
303 RUN hpgl-moveto
( 109, 160 ).
304 RUN hpgl-text
( "Courier,Fixed,cpi,8,Bold", "@PayeeAccount@" ).
306 RUN hpgl-moveto
( 93, 153 ).
307 RUN hpgl-text
( "Times,Proportional,Point,10,Bold", "@BankBranch@" ).
309 RUN hpgl-moveto
( 28.5, 78 ).
310 RUN hpgl-text
( "Courier,Fixed,cpi,8,Bold", "@PayeeParticulars@" ).
312 RUN hpgl-get-codes
( no
, yes
, OUTPUT variable-codes
).
317 /* _UIB-CODE-BLOCK-END
*/
321 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
322 PROCEDURE parse-parameters
:
323 /*------------------------------------------------------------------------------
325 ------------------------------------------------------------------------------*/
326 DEF VAR token
AS CHAR NO-UNDO.
327 DEF VAR i
AS INT NO-UNDO.
329 {inc
/showopts.i
"report-options"}
331 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
332 token
= ENTRY( i
, report-options
, "~n" ).
334 CASE ENTRY( 1, token
):
335 WHEN "TenantCode" THEN tenant-code
= INT( ENTRY(2,token
) ).
336 WHEN "BankAccount" THEN bank-account
= ENTRY(2,token
).
337 WHEN "UseRentalSpaces" THEN use-rent-charges
= No.
338 WHEN "Commencing" THEN commence-date
= DATE( ENTRY(2,token
)).
344 /* _UIB-CODE-BLOCK-END
*/
348 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE replace-payee-details Procedure
349 PROCEDURE replace-payee-details
:
350 /*------------------------------------------------------------------------------
354 ------------------------------------------------------------------------------*/
356 DEF VAR name-codes
AS CHAR NO-UNDO.
357 DEF VAR account-codes
AS CHAR NO-UNDO.
358 DEF VAR particular-codes
AS CHAR NO-UNDO.
359 DEF VAR move-relative
AS CHAR NO-UNDO.
360 DEF VAR payee-name
AS CHAR NO-UNDO.
361 DEF VAR payee-account
AS CHAR NO-UNDO.
363 DEF VAR i
AS INT NO-UNDO.
364 DEF VAR j
AS INT NO-UNDO.
366 RUN hpgl-move-relative
( 4, 0).
367 RUN hpgl-get-codes
( no
, yes
, OUTPUT move-relative
).
371 FIND FIRST BankAccount
WHERE BankAccount.BankAccountCode
= bank-account
373 IF NOT AVAILABLE BankAccount
THEN RETURN.
375 payee-name
= CAPS( SUBSTR( BankAccount.AccountName
, 1, 20 ) ).
376 DO i
= 1 TO LENGTH( payee-name
):
377 name-codes
= name-codes
+ SUBSTRING( payee-name
, i
, 1) + move-relative .
382 payee-account
= STRING( BankAccount.BankAccount
, "999-999-9999-99999" ).
383 DO i
= 1 TO NUM-ENTRIES( payee-account
, "-" ):
384 DO j
= 1 TO LENGTH( ENTRY( i
, payee-account
, "-") ):
385 account-codes
= account-codes
+ SUBSTR( ENTRY( i
, payee-account
, "-" ), j
, 1 ) + move-relative.
387 account-codes
= account-codes
+ move-relative.
390 /* Payee Particulars
*/
392 DO i
= 1 TO LENGTH( payee-particulars
):
393 particular-codes
= particular-codes
+ SUBSTR( payee-particulars
, i
, 1 ) + move-relative.
396 hpgl-codes
= variable-codes.
397 RUN hpgl-replace
( "@PayeeName@", name-codes
).
398 RUN hpgl-replace
( "@PayeeName2@", BankAccount.AccountName
).
399 RUN hpgl-replace
( "@PayeeAccount@", account-codes
).
400 RUN hpgl-replace
( "@PayeeParticulars@", particular-codes
).
401 RUN hpgl-replace
( "@BankBranch@", BankAccount.BankName
+ ", " + BankAccount.BankBranchName
).
402 RUN hpgl-get-codes
( no
, yes
, OUTPUT variable-codes
).
406 /* _UIB-CODE-BLOCK-END
*/
410 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-1 Procedure
411 PROCEDURE section-1
:
412 /*------------------------------------------------------------------------------
414 ------------------------------------------------------------------------------*/
416 RUN hpgl-moveto
( 20, 268).
417 RUN hpgl-set-line-width
( 1 ).
418 RUN hpgl-box-relative
( 126, 15 ).
420 RUN hpgl-move-relative
( 1, 11 ).
421 RUN hpgl-text
( "Times,Proportional,Point,8,Normal", "TO: The Manager," ).
422 RUN hpgl-move-relative
( 0, -7 ).
423 RUN hpgl-set-line-width
( 0.1 ).
424 RUN hpgl-line-relative
( 124, 0 ).
425 RUN hpgl-move-relative
( -124 + 42, -3 ).
426 RUN hpgl-text
( hpgl-last-font
, "(Insert Name of Bank and Branch)" ).
427 RUN hpgl-move-relative
( -43, -1 ).
429 RUN hpgl-set-line-width
( 1 ).
430 RUN hpgl-move-relative
( 0, -13.5 ).
431 RUN hpgl-box-relative
( 126, 10 ).
432 RUN hpgl-move-relative
( 1, 6 ).
433 RUN hpgl-text
( "Times,Proportional,Point,6,Normal", "07" ).
434 RUN hpgl-move-relative
( 3, 0 ).
435 RUN hpgl-text
( "Times,Proportional,Point,8,Normal", "NAME OF ACCOUNT:" ).
436 RUN hpgl-move-relative
( -4, -6 ).
438 RUN hpgl-move-relative
( 0, -30.5 ).
439 RUN hpgl-box-relative
( 68, 27 ).
441 RUN hpgl-set-line-width
( 0.5 ).
443 /* Account Number Edit Boxes
*/
445 RUN hpgl-move-relative
( 3, 12 ).
447 RUN hpgl-move-relative
( 0.5, 1.5 ).
448 RUN hpgl-text
( "Times,Proportional,Point,12,Bold", "A" ).
449 RUN hpgl-move-relative
( -0.5, -5 ).
450 RUN hpgl-text
( "Times,Proportional,Point,6,Normal", "N - New" ).
451 RUN hpgl-move-relative
( 0, -2 ).
452 RUN hpgl-text
( hpgl-last-font
, "C - Change" ).
453 RUN hpgl-move-relative
( 0, 5.5 ).
455 RUN hpgl-move-relative
( 29, 3.25 ).
456 RUN edit-box
( "3, ,3" ).
457 RUN hpgl-move-relative
( -8, 4 ).
458 RUN hpgl-text
( hpgl-last-font
, "Payer's" ).
459 RUN hpgl-move-relative
( 0, -2 ).
460 RUN hpgl-text
( hpgl-last-font
, "Account" ).
461 RUN hpgl-move-relative
( 0, -2 ).
462 RUN hpgl-text
( hpgl-last-font
, "Number" ).
463 RUN hpgl-move-relative
( 8, 7.3 ).
464 RUN hpgl-text
( hpgl-last-font
, "Bank" ).
465 RUN hpgl-move-relative
( 12, 0 ).
466 RUN hpgl-text
( hpgl-last-font
, "Branch" ).
467 RUN hpgl-move-relative
( -12, -7.3 ).
469 RUN hpgl-move-relative
( -12, -13 ).
471 RUN hpgl-move-relative
( 1, 1.5 ).
472 /* RUN hpgl-text
( "Times,Proportional,Point,12,Bold", "0" ).
*/
473 RUN hpgl-move-relative
( -1, -1.5 + 7.3 ).
474 RUN hpgl-text
( "Times,Proportional,Point,6,Normal", "Account Number" ).
475 RUN hpgl-move-relative
( 0, -7.3 ).
477 RUN hpgl-move-relative
( 16, 3.25 ).
478 RUN hpgl-line-relative
( 4, 0 ).
480 RUN hpgl-move-relative
( 0, -3.25 ).
482 RUN hpgl-move-relative
( 0, 7.3 ).
483 /* RUN hpgl-text
( hpgl-last-font
, "Suffix" ).
*/
484 RUN hpgl-move-relative
( 0, -7.3 ).
487 /* Office use only stuff
*/
489 RUN hpgl-move-relative
( 89, 57 - 26 ).
490 RUN hpgl-set-line-width
( 0.5 ).
491 RUN hpgl-box-relative
( 55, 26 ).
493 RUN hpgl-move-relative
( 9, 21 ).
494 RUN hpgl-text
( "Times,Proportional,Point,12,Bold", "AUTHORITY FOR" ).
495 RUN hpgl-move-relative
( -7, -4 ).
496 RUN hpgl-text
( hpgl-last-font
, "AUTOMATIC PAYMENTS" ).
497 RUN hpgl-move-relative
( 9, -11 ).
498 RUN hpgl-text
( "Times,Proportional,Point,10,Normal", "(Not to operate as an" ).
499 RUN hpgl-move-relative
( -3, -3 ).
500 RUN hpgl-text
( hpgl-last-font
, "assignment or agreement)" ).
501 RUN hpgl-move-relative
( -8, -3 ).
503 RUN hpgl-move-relative
( 0, -13 ).
504 RUN hpgl-box-relative
( 55, 11 ).
505 RUN hpgl-box-relative
( 40, 11 ).
506 RUN hpgl-box-relative
( 21, 11 ).
508 RUN hpgl-move-relative
( 1, 8 ).
509 RUN hpgl-text
( "Times,Proportional,Point,7,Normal", "Date Received:" ).
510 RUN hpgl-move-relative
( 21, 0 ).
511 RUN hpgl-text
( hpgl-last-font
, "Recorded By:" ).
512 RUN hpgl-move-relative
( 19, 0 ).
513 RUN hpgl-text
( hpgl-last-font
, "Checked By:" ).
514 RUN hpgl-move-relative
( -41, -8 ).
516 RUN hpgl-move-relative
( 0, -20 ).
517 RUN hpgl-box-relative
( 55, 18 ).
518 RUN hpgl-move-relative
( 1, 15 ).
519 RUN hpgl-text
( "Times,Proportional,Point,7,Normal", "Date:" ).
521 RUN hpgl-get-codes
( no
, yes
, OUTPUT section-codes
[1] ).
525 /* _UIB-CODE-BLOCK-END
*/
529 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-2 Procedure
530 PROCEDURE section-2
:
531 /*------------------------------------------------------------------------------
535 ------------------------------------------------------------------------------*/
537 RUN hpgl-moveto
( 20, 209).
538 RUN hpgl-text
( "Time,Proportional,Point,8,Normal",
539 "Please effect this Automatic Payment by debiting my/our account. Details are:-" ).
541 RUN hpgl-move-relative
( 0, -8 ).
542 RUN hpgl-text
( hpgl-last-font
, "COMMENCING DATE:" ).
543 RUN hpgl-move-relative
( 90, 0 ).
544 RUN hpgl-text
( hpgl-last-font
, "FREQUENCY:" ).
545 RUN hpgl-move-relative
( -52, -1 ).
546 RUN hpgl-set-line-width
( 0.5 ).
547 RUN hpgl-box-relative
( 43, 5.5 ).
549 RUN hpgl-move-relative
( -2.5, 3.25 ).
550 RUN hpgl-text
( "Time,Proportional,Point,6,Normal", "04" ).
551 RUN hpgl-move-relative
( 2.5 + 81, -3.25 ).
552 RUN hpgl-box-relative
( 65, 5.5 ).
553 RUN hpgl-move-relative
( -2.5, 3.25 ).
554 RUN hpgl-text
( hpgl-last-font
, "05" ).
555 RUN hpgl-move-relative
( 2.5 - 119, -3.25 + 1 ).
557 RUN hpgl-move-relative
( 0, -10 ).
558 RUN hpgl-text
( "Time,Proportional,Point,8,Normal", "AMOUNT:" ).
559 RUN hpgl-move-relative
( 30, 0 ).
560 RUN hpgl-text
( hpgl-last-font
, "Amount" ).
561 RUN hpgl-move-relative
( 40, 0 ).
562 RUN hpgl-text
( hpgl-last-font
, "Amount in Words" ).
563 RUN hpgl-move-relative
( -70, 0 - 7.5 ).
565 RUN hpgl-box-relative
( 184, 5.5 ).
566 RUN hpgl-box-relative
( 70, 5.5 ).
567 RUN hpgl-box-relative
( 30, 5.5 ).
569 RUN hpgl-move-relative
( 1, 3.5 ).
570 RUN hpgl-text
( "Times,Proportional,Point,6,Normal", "(i)" ).
571 RUN hpgl-move-relative
( 3, 0 ).
572 RUN hpgl-text
( hpgl-last-font
, "When Amount" ).
573 RUN hpgl-move-relative
( 0, -2 ).
574 RUN hpgl-text
( hpgl-last-font
, "is constant" ).
575 RUN hpgl-move-relative
( 23.5, 1.5 ).
576 RUN hpgl-text
( hpgl-last-font
, "03" ).
577 RUN hpgl-move-relative
( -27.5, -3 ).
579 RUN hpgl-move-relative
( 0, -6 ).
580 RUN hpgl-text
( "Times,Proportional,Point,10,Normal", "UNTIL" ).
581 RUN hpgl-move-relative
( 14, 0 ).
582 RUN hpgl-text
( "Times,Proportional,Point,12,Bold", "Further Notice" ).
583 RUN hpgl-move-relative
( 30, 0 ).
584 RUN hpgl-text
( "Times,Proportional,Point,10,Normal", "PAY TO:" ).
585 RUN hpgl-move-relative
( -44 + 70, -27 ).
587 RUN hpgl-box-relative
( 114, 30 ).
588 RUN hpgl-move-relative
( 3, 25 ).
589 RUN hpgl-text
( "Times,Proportional,Point,6,Normal", "Payee's" ).
590 RUN hpgl-move-relative
( 0, -2 ).
591 RUN hpgl-text
( hpgl-last-font
, "Name" ).
593 RUN hpgl-move-relative
( 13, 2 ).
594 RUN hpgl-text
( hpgl-last-font
, "19" ).
595 RUN hpgl-move-relative
( 2.5, -4 ).
596 RUN edit-box
( "20" ).
597 RUN hpgl-move-relative
( 0, -13 ).
598 RUN edit-box
( "3, ,3, ,4, ,5" ).
599 RUN hpgl-move-relative
( -15.5, 4 ).
600 RUN hpgl-text
( hpgl-last-font
, "Payee's" ).
601 RUN hpgl-move-relative
( 0, -2 ).
602 RUN hpgl-text
( hpgl-last-font
, "Account" ).
603 RUN hpgl-move-relative
( 0, -2 ).
604 RUN hpgl-text
( hpgl-last-font
, "Number" ).
606 RUN hpgl-move-relative
( 13, 4 ).
607 RUN hpgl-text
( hpgl-last-font
, "18" ).
608 RUN hpgl-move-relative
( 2.5, 3.3 ).
609 RUN hpgl-text
( hpgl-last-font
, "Bank" ).
610 RUN hpgl-move-relative
( 16, 0 ).
611 RUN hpgl-text
( hpgl-last-font
, "Branch" ).
612 RUN hpgl-move-relative
( 16, 0 ).
613 RUN hpgl-text
( hpgl-last-font
, "Payee's Account Number" ).
615 RUN hpgl-get-codes
( no
, yes
, OUTPUT section-codes
[2] ).
619 /* _UIB-CODE-BLOCK-END
*/
623 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-3 Procedure
624 PROCEDURE section-3
:
625 /*------------------------------------------------------------------------------
629 ------------------------------------------------------------------------------*/
631 RUN hpgl-moveto
( 20, 138).
632 RUN hpgl-text
( "Time,Proportional,Point,10,Bold", "CONDITIONS:" ).
633 RUN hpgl-move-relative
( 28, 0 ).
634 RUN hpgl-text
( "Time,Proportional,Point,8,Normal",
635 "I/we understand and accept that the bank accepts this authority only upon the following conditions, namely:-" ).
637 RUN hpgl-move-relative
( -28, -5 ).
638 RUN hpgl-text
( "Time,Proportional,Point,7,Normal", "1." ).
640 "The bank will endeavour to effect such automatic payments without any responsibility or liability for any refusal or omission to make all or any of the payments, or for late" + CHR(10) +
641 "payment, or for any omission to follow any such instructions. Further the bank accepts no responsibility or liability for the accuracy of the information contained in the" + CHR(10) +
642 "payment information fields on this authority, or for failure to transmit such information in the manner requested. In any event this authority is subject to any arrangement" + CHR(10) +
643 "nor or hereafter subsisting between myself/ourselves and the bank in relation to my/our account." ).
645 RUN hpgl-move-relative
( -3, -2.2 ).
646 RUN hpgl-text
( hpgl-last-font
, "2." ).
648 "The bank may, in its absolute discretion, conclusively determine the order of priority of payment by it of any moneys pursuant to this or any other authority or cheque which" + CHR(10) +
649 "I/we may now or hereafter give to the bank or draw on my/our account." ).
651 RUN hpgl-move-relative
( -3, -2.2 ).
652 RUN hpgl-text
( hpgl-last-font
, "3." ).
654 "The bank may at any time terminate this order as to future payments by notice in writing to me/us - or without any notice at any time after being advised in writing by the" + CHR(10) +
655 "abovenamed payee that no further payment is required." ).
657 RUN hpgl-move-relative
( -3, -2.2 ).
658 RUN hpgl-text
( hpgl-last-font
, "4." ).
660 "This order will remain in full force and effect in respect of all payments made in good faith notwithstanding my/our death or bankruptcy or any other revocation of this order" + CHR(10) +
661 "until notice of my/our death, bankruptcy or such revocation is received by the bank." ).
663 RUN hpgl-move-relative
( -3, -2.2 ).
664 RUN hpgl-text
( hpgl-last-font
, "5." ).
666 "All current bank charges for this service in force from time to time are to be added to the payment and debited to my/our account." ).
668 RUN hpgl-get-codes
( no
, yes
, OUTPUT section-codes
[3] ).
672 /* _UIB-CODE-BLOCK-END
*/
676 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-4 Procedure
677 PROCEDURE section-4
:
678 /*------------------------------------------------------------------------------
680 ------------------------------------------------------------------------------*/
682 RUN hpgl-moveto
( 20, 87 ).
683 RUN hpgl-text
( "Times,Proportional,Point,10,Normal",
684 "Information to appear in payee's bank statement (landlord):" ).
686 RUN hpgl-moveto
( 28, 76 ).
687 RUN edit-box
( "18" ).
689 RUN hpgl-move-relative
( 0, -1.8 ).
690 RUN hpgl-text
( "Times,Proportional,Point,6,Bold", "Please enter our code for automatic processing" ).
691 RUN hpgl-move-relative
( -8, -9.3 ).
693 RUN hpgl-text
( "Times,Proportional,Point,10,Bold",
694 "Information to appear in payer's bank statement (tenant):" ).
695 RUN hpgl-move-relative
( 8, -11 ).
696 RUN edit-box
( "18" ).
698 RUN hpgl-set-line-width
( 1 ).
699 RUN hpgl-box-relative
( 72, 6.5 ).
701 RUN hpgl-move-relative
( -8, -33 ).
702 RUN hpgl-box-relative
( 184, 21 ).
703 RUN hpgl-box-relative
( 85, 21 ).
705 RUN hpgl-move-relative
( 2, 17 ).
706 RUN hpgl-text
( "Times,Proportional,Point,10,Bold", "IMPORTANT - PLEASE INDICATE" ).
707 RUN hpgl-move-relative
( 0, -12 ).
709 RUN hpgl-move-relative
( 8, 3.5 ).
710 RUN hpgl-text
( "Times,Proportional,Point,6,Normal", "This is a new" ).
711 RUN hpgl-move-relative
( 0, -2 ).
712 RUN hpgl-text
( hpgl-last-font
, "Authority" ).
713 RUN hpgl-move-relative
( 17, -1.5 ).
716 RUN hpgl-move-relative
( 8, 7 ).
717 RUN hpgl-text
( hpgl-last-font
, "As from above commencing date, this" ).
718 RUN hpgl-move-relative
( 0, -2 ).
719 RUN hpgl-text
( hpgl-last-font
, "authority replaces existing authorities for" ).
720 RUN hpgl-move-relative
( 0, -5 ).
721 RUN hpgl-text
( hpgl-last-font
, "$" ).
722 RUN hpgl-move-relative
( 2, 0 ).
723 RUN hpgl-set-line-width
( 0.1 ).
724 RUN hpgl-line-relative
( 34, 0 ).
725 RUN hpgl-move-relative
( 1, 0 ).
726 RUN hpgl-text
( hpgl-last-font
, "in favour of" ).
727 RUN hpgl-move-relative
( -37, -2 ).
728 RUN hpgl-text
( hpgl-last-font
, "the same payee." ).
729 RUN hpgl-move-relative
( -36, -3 ).
731 RUN hpgl-move-relative
( 88, 17.5 ).
732 RUN hpgl-text
( hpgl-last-font
, "Name of Account (Customer to complete):" ).
733 RUN hpgl-move-relative
( 0, -7 ).
734 RUN hpgl-line-relative
( 95, 0 ).
735 RUN hpgl-move-relative
( -95, -7 ).
736 RUN hpgl-line-relative
( 95, 0 ).
737 RUN hpgl-move-relative
( -60, -2 ).
738 RUN hpgl-text
( hpgl-last-font
, "Customer's Signature" ).
739 RUN hpgl-move-relative
( 42, -0.6 ).
740 RUN hpgl-text
( 'Courier
,Point
,4,Proportional
,Normal'
, print-id
).
742 RUN hpgl-get-codes
( no
, yes
, OUTPUT section-codes
[4] ).
746 /* _UIB-CODE-BLOCK-END
*/
750 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE text-lines Procedure
751 PROCEDURE text-lines
:
752 /*------------------------------------------------------------------------------
756 ------------------------------------------------------------------------------*/
758 DEF INPUT PARAMETER lines
AS CHAR NO-UNDO.
760 DEF VAR i
AS INT NO-UNDO.
762 RUN hpgl-move-relative
( 3, 0 ).
764 DO i
= 1 TO NUM-ENTRIES( lines
, CHR(10) ):
765 RUN hpgl-text
( hpgl-last-font
, ENTRY( i
, lines
, CHR(10) ) ).
766 RUN hpgl-move-relative
( 0, -2.2 ).
771 /* _UIB-CODE-BLOCK-END
*/
775 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE variable-replacements Procedure
776 PROCEDURE variable-replacements
:
777 /*------------------------------------------------------------------------------
779 ------------------------------------------------------------------------------*/
781 RUN get-tenant-details.
782 RUN replace-payee-details.
784 DEF VAR date-in-words
AS CHAR NO-UNDO.
785 DEF VAR amount-in-words
AS CHAR NO-UNDO.
787 hpgl-codes
= variable-codes.
789 RUN date-to-word
( TODAY, OUTPUT date-in-words
).
790 RUN hpgl-replace
( "@TodaysDate@", date-in-words
).
791 RUN date-to-word
( commence-date
, OUTPUT date-in-words
).
792 RUN hpgl-replace
( "@CommenceDate@", date-in-words
).
793 RUN hpgl-replace
( "@Frequency@", "Monthly" ).
795 RUN amount-to-word
( total-per-month
, OUTPUT amount-in-words
).
796 SUBSTR( amount-in-words
, 1, 1 ) = CAPS( SUBSTR( amount-in-words
, 1, 1 ) ).
797 RUN hpgl-replace
( "@DollarAmount@", STRING( total-per-month
, "$ZZZ,ZZ9.99" ) ).
798 RUN hpgl-replace
( "@AmountInWords@", amount-in-words
).
800 RUN hpgl-get-codes
( no
, yes
, OUTPUT variable-codes
).
804 /* _UIB-CODE-BLOCK-END
*/
808 /* ************************ Function Implementations
***************** */
810 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-expected-dc Procedure
811 FUNCTION get-expected-dc
RETURNS DECIMAL
812 ( /* parameter-definitions
*/ ) :
813 /*------------------------------------------------------------------------------
814 Purpose
: Get the expected DC due
816 ------------------------------------------------------------------------------*/
817 IF use-rent-charges
<> Yes
THEN RETURN get-expected-dc-rentalspace
().
819 rent-charge-one-period
= Yes.
820 RUN build-tenant-charges
( Tenant.TenantCode
, commence-month-start
, commence-month-end
).
821 FIND FIRST ChargeDetail
NO-ERROR.
822 IF NOT AVAILABLE(ChargeDetail
) THEN RETURN 0.0 .
824 DEF VAR to-be-charged
AS DEC NO-UNDO INITIAL 0.0 .
825 DEF VAR this-charge
AS DEC NO-UNDO INITIAL 0.0 .
826 DEF VAR taxable-total
AS DEC NO-UNDO.
828 FOR EACH ChargeDetail
WHERE ChargeDetail.TenantCode
= Tenant.TenantCode
829 AND ChargeDetail.ChargeStart
<= commence-date
830 AND ChargeDetail.ChargedFrom
>= commence-date
831 AND ChargeDetail.ChargedUpTo
>= commence-date
832 AND (ChargeDetail.ChargeEnd
> commence-date
OR ChargeDetail.ChargeEnd
= ?
)
833 BREAK BY ChargeDetail.AccountCode
:
834 this-charge
= this-charge
+ ChargeDetail.ChargeAmount.
835 taxable-total
= taxable-total
+ ChargeDetail.TaxableAmount.
836 IF LAST-OF( ChargeDetail.AccountCode
) OR ChargeDetail.ChargeType
= "S" THEN DO:
837 to-be-charged
= to-be-charged
+ ROUND( this-charge
, 2)
838 + ROUND( taxable-total
* (Office.GST
/ 100), 2).
844 RETURN to-be-charged.
848 /* _UIB-CODE-BLOCK-END
*/
852 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-expected-dc-rentalspace Procedure
853 FUNCTION get-expected-dc-rentalspace
RETURNS DECIMAL
854 ( /* parameter-definitions
*/ ) :
855 /*------------------------------------------------------------------------------
858 ------------------------------------------------------------------------------*/
859 DEF VAR total-outgoings
AS DEC NO-UNDO.
860 DEF VAR total-rental
AS DEC NO-UNDO INITIAL 0.0 .
861 DEF VAR total-per-annum
AS DEC NO-UNDO.
862 DEF VAR per-month
AS DEC NO-UNDO.
863 DEF VAR gst
AS DEC NO-UNDO.
864 DEF VAR total-per-month
AS DEC NO-UNDO.
865 DEF VAR tax-aplicable
AS LOGI
INITIAL No
NO-UNDO.
867 RUN process
/calcoutg.p
( Tenant.TenantCode
, OUTPUT total-outgoings
).
869 FOR EACH TenancyLease
WHERE TenancyLease.TenantCode
= Tenant.TenantCode
870 AND TenancyLease.LeaseStatus
<> "PAST",
871 EACH RentalSpace
OF TenancyLease
WHERE RentalSpace.AreaStatus
<> "V"
873 total-rental
= total-rental
+ RentalSpace.ChargedRental.
874 tax-applicable
= tax-applicable
OR TenancyLease.TaxApplies.
877 total-per-annum
= total-rental
+ total-outgoings.
878 per-month
= ROUND( total-per-annum
/ 12, 2).
879 gst
= IF tax-applicable
AND gst-applies
THEN
880 ROUND( per-month
* ( Office.GST
/ 100 ), 2)
882 total-per-month
= per-month
+ ROUND( gst
, 2).
884 RETURN total-per-month.
888 /* _UIB-CODE-BLOCK-END
*/
892 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION include-lease Procedure
893 FUNCTION include-lease
RETURNS LOGICAL
894 ( INPUT lease-code
AS INT ) :
895 /*------------------------------------------------------------------------------
897 Notes
: Dummy function.
898 ------------------------------------------------------------------------------*/
900 RETURN Yes.
/* Function return value.
*/
904 /* _UIB-CODE-BLOCK-END
*/