Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / report / apform-agp.p
blob3966b6ad6399121b17c474f77a537df725e70c25
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 File :
6 Purpose :
8 Syntax :
10 Description :
12 Author(s) :
13 Created :
14 Notes :
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.
21 {inc/ofc-this.i}
22 {inc/ofc-set-l.i "Use-Rent-Charges" "use-rent-charges"}
24 RUN parse-parameters.
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 */
50 &ANALYZE-RESUME
53 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
55 /* ******************** Preprocessor Definitions ******************** */
57 &Scoped-define PROCEDURE-TYPE Procedure
61 /* _UIB-PREPROCESSOR-BLOCK-END */
62 &ANALYZE-RESUME
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 */
72 &ANALYZE-RESUME
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 */
79 &ANALYZE-RESUME
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 */
86 &ANALYZE-RESUME
89 /* *********************** Procedure Settings ************************ */
91 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
92 /* Settings for THIS-PROCEDURE
93 Type: Procedure
94 Allow:
95 Frames: 0
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
106 HEIGHT = .08
107 WIDTH = 40.
108 /* END WINDOW DEFINITION */
110 &ANALYZE-RESUME
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}
119 {inc/convert.i}
120 {inc/rentchrg.i}
122 /* _UIB-CODE-BLOCK-END */
123 &ANALYZE-RESUME
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" ) + " " +
133 user-name.
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.
142 RUN ap-form.
144 OUTPUT CLOSE.
145 RUN view-output-file ( No ).
147 /* _UIB-CODE-BLOCK-END */
148 &ANALYZE-RESUME
151 /* ********************** Internal Procedures *********************** */
153 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE ap-form Procedure
154 PROCEDURE ap-form :
155 /*------------------------------------------------------------------------------
156 Purpose:
157 Parameters: <none>
158 Notes:
159 ------------------------------------------------------------------------------*/
161 RUN get-fixed-codes.
162 DEF VAR i AS INT NO-UNDO.
163 DO i = 1 TO 4:
164 PUT CONTROL section-codes[i].
165 END.
167 RUN get-variables.
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.
174 END PROCEDURE.
176 /* _UIB-CODE-BLOCK-END */
177 &ANALYZE-RESUME
180 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE edit-box Procedure
181 PROCEDURE edit-box :
182 /*------------------------------------------------------------------------------
183 Purpose:
184 Parameters: <none>
185 Notes:
186 ------------------------------------------------------------------------------*/
188 &SCOP box-w 4
189 &SCOP box-h 6.5
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 ).
207 k = k + 1.
208 END.
209 ELSE
210 DO j = 1 TO n:
211 RUN hpgl-box-relative( {&box-w}, {&box-h} ).
212 RUN hpgl-move-relative( {&box-w}, 0 ).
213 k = k + 1.
214 END.
216 END.
218 RUN hpgl-move-relative( {&box-w} * k * -1, 0 ).
220 END PROCEDURE.
222 /* _UIB-CODE-BLOCK-END */
223 &ANALYZE-RESUME
226 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-fixed-codes Procedure
227 PROCEDURE get-fixed-codes :
228 /*------------------------------------------------------------------------------
229 Purpose:
230 Parameters: <none>
231 Notes:
232 ------------------------------------------------------------------------------*/
234 RUN hpgl-initialize.
236 /* The constant parts of the page */
237 RUN section-1.
238 RUN section-2.
239 RUN section-3.
240 RUN section-4.
242 END PROCEDURE.
244 /* _UIB-CODE-BLOCK-END */
245 &ANALYZE-RESUME
248 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-tenant-details Procedure
249 PROCEDURE get-tenant-details :
250 /*------------------------------------------------------------------------------
251 Purpose:
252 Parameters: <none>
253 Notes:
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.
264 END.
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.
268 END.
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 ).
276 END PROCEDURE.
278 /* _UIB-CODE-BLOCK-END */
279 &ANALYZE-RESUME
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-variables Procedure
283 PROCEDURE get-variables :
284 /*------------------------------------------------------------------------------
285 Purpose:
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 ).
315 END PROCEDURE.
317 /* _UIB-CODE-BLOCK-END */
318 &ANALYZE-RESUME
321 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
322 PROCEDURE parse-parameters :
323 /*------------------------------------------------------------------------------
324 Purpose:
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)).
339 END CASE.
340 END.
342 END PROCEDURE.
344 /* _UIB-CODE-BLOCK-END */
345 &ANALYZE-RESUME
348 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE replace-payee-details Procedure
349 PROCEDURE replace-payee-details :
350 /*------------------------------------------------------------------------------
351 Purpose:
352 Parameters: <none>
353 Notes:
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 ).
369 /* Payee Name */
371 FIND FIRST BankAccount WHERE BankAccount.BankAccountCode = bank-account
372 NO-LOCK NO-ERROR.
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 .
378 END.
380 /* Account Code */
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.
386 END.
387 account-codes = account-codes + move-relative.
388 END.
390 /* Payee Particulars */
392 DO i = 1 TO LENGTH( payee-particulars ):
393 particular-codes = particular-codes + SUBSTR( payee-particulars, i, 1 ) + move-relative.
394 END.
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 ).
404 END PROCEDURE.
406 /* _UIB-CODE-BLOCK-END */
407 &ANALYZE-RESUME
410 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-1 Procedure
411 PROCEDURE section-1 :
412 /*------------------------------------------------------------------------------
413 Purpose:
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 ).
446 RUN edit-box( "2" ).
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 ).
470 RUN edit-box( "4" ).
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 ).
481 RUN edit-box( "5" ).
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] ).
523 END PROCEDURE.
525 /* _UIB-CODE-BLOCK-END */
526 &ANALYZE-RESUME
529 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-2 Procedure
530 PROCEDURE section-2 :
531 /*------------------------------------------------------------------------------
532 Purpose:
533 Parameters: <none>
534 Notes:
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] ).
617 END PROCEDURE.
619 /* _UIB-CODE-BLOCK-END */
620 &ANALYZE-RESUME
623 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-3 Procedure
624 PROCEDURE section-3 :
625 /*------------------------------------------------------------------------------
626 Purpose:
627 Parameters: <none>
628 Notes:
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." ).
639 RUN text-lines(
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." ).
647 RUN text-lines(
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." ).
653 RUN text-lines(
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." ).
659 RUN text-lines(
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." ).
665 RUN text-lines(
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] ).
670 END PROCEDURE.
672 /* _UIB-CODE-BLOCK-END */
673 &ANALYZE-RESUME
676 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE section-4 Procedure
677 PROCEDURE section-4 :
678 /*------------------------------------------------------------------------------
679 Purpose:
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 ).
708 RUN edit-box( "1" ).
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 ).
715 RUN edit-box( "1" ).
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] ).
744 END PROCEDURE.
746 /* _UIB-CODE-BLOCK-END */
747 &ANALYZE-RESUME
750 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE text-lines Procedure
751 PROCEDURE text-lines :
752 /*------------------------------------------------------------------------------
753 Purpose:
754 Parameters: <none>
755 Notes:
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 ).
767 END.
769 END PROCEDURE.
771 /* _UIB-CODE-BLOCK-END */
772 &ANALYZE-RESUME
775 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE variable-replacements Procedure
776 PROCEDURE variable-replacements :
777 /*------------------------------------------------------------------------------
778 Purpose:
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 ).
802 END PROCEDURE.
804 /* _UIB-CODE-BLOCK-END */
805 &ANALYZE-RESUME
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
815 Notes:
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).
839 this-charge = 0.
840 taxable-total = 0.
841 END.
842 END.
844 RETURN to-be-charged.
846 END FUNCTION.
848 /* _UIB-CODE-BLOCK-END */
849 &ANALYZE-RESUME
852 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-expected-dc-rentalspace Procedure
853 FUNCTION get-expected-dc-rentalspace RETURNS DECIMAL
854 ( /* parameter-definitions */ ) :
855 /*------------------------------------------------------------------------------
856 Purpose:
857 Notes:
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"
872 NO-LOCK:
873 total-rental = total-rental + RentalSpace.ChargedRental.
874 tax-applicable = tax-applicable OR TenancyLease.TaxApplies.
875 END.
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)
881 ELSE 0.
882 total-per-month = per-month + ROUND( gst, 2).
884 RETURN total-per-month.
886 END FUNCTION.
888 /* _UIB-CODE-BLOCK-END */
889 &ANALYZE-RESUME
892 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION include-lease Procedure
893 FUNCTION include-lease RETURNS LOGICAL
894 ( INPUT lease-code AS INT ) :
895 /*------------------------------------------------------------------------------
896 Purpose:
897 Notes: Dummy function.
898 ------------------------------------------------------------------------------*/
900 RETURN Yes. /* Function return value. */
902 END FUNCTION.
904 /* _UIB-CODE-BLOCK-END */
905 &ANALYZE-RESUME