1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r11
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
15 ------------------------------------------------------------------------*/
16 /* This .W file was created with the Progress UIB.
*/
17 /*----------------------------------------------------------------------*/
19 /* *************************** Definitions
************************** */
21 &SCOPED-DEFINE lines-per-page 112
24 DEF VAR ln
AS DEC INIT 0.00 NO-UNDO.
26 /* Line definitions
*/
28 DEF VAR page-no
AS INT INIT 1 NO-UNDO.
29 DEF VAR reset-page
AS CHAR NO-UNDO.
30 DEF VAR half-line
AS CHAR NO-UNDO. half-line
= CHR(27) + "=".
31 DEF VAR title-font
AS CHAR NO-UNDO.
32 DEF VAR time-font
AS CHAR NO-UNDO.
33 DEF VAR property-font
AS CHAR NO-UNDO.
34 DEF VAR header-font
AS CHAR NO-UNDO.
35 DEF VAR line-printer
AS CHAR NO-UNDO.
36 DEF VAR i
AS INT NO-UNDO.
38 DEF VAR rsp-tot
AS DEC EXTENT 2 NO-UNDO.
39 DEF VAR prp-tot
AS DEC EXTENT 2 NO-UNDO.
40 DEF VAR grd-tot
AS DEC EXTENT 2 NO-UNDO.
42 DEF VAR market-total
AS DEC NO-UNDO.
44 DEF VAR user-name
AS CHAR NO-UNDO.
45 {inc
/username.i
"user-name"}
47 /* _UIB-CODE-BLOCK-END
*/
51 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
53 /* ******************** Preprocessor Definitions
******************** */
55 &Scoped-define PROCEDURE-TYPE Procedure
59 /* _UIB-PREPROCESSOR-BLOCK-END
*/
64 /* *********************** Procedure Settings
************************ */
66 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
67 /* Settings for
THIS-PROCEDURE
71 Add Fields to
: Neither
72 Other Settings
: CODE-ONLY
COMPILE
74 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
76 /* ************************* Create Window
************************** */
78 &ANALYZE-SUSPEND _CREATE-WINDOW
79 /* DESIGN Window definition
(used by the UIB
)
80 CREATE WINDOW Procedure
ASSIGN
88 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
89 /* ************************* Included-Libraries
*********************** */
91 {inc
/method
/m-txtrep.i
}
94 /* _UIB-CODE-BLOCK-END
*/
99 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
102 /* *************************** Main Block
*************************** */
104 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
109 RUN view-output-file
( no
).
111 /* _UIB-CODE-BLOCK-END
*/
115 /* ********************** Internal Procedures
*********************** */
117 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE carriage-return Procedure
118 PROCEDURE carriage-return
:
119 /*------------------------------------------------------------------------------
123 ------------------------------------------------------------------------------*/
129 /* _UIB-CODE-BLOCK-END
*/
133 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE column-header Procedure
134 PROCEDURE column-header
:
135 /*------------------------------------------------------------------------------
139 ------------------------------------------------------------------------------*/
141 PUT CONTROL line-printer.
143 PUT CONTROL header-font.
144 PUT UNFORMATTED SPACE(12)
145 STRING( "Code" ) SPACE(10)
146 STRING( "Space Description", "X(86)" ) SPACE(4)
147 STRING( "Area", "X(8)" ) SPACE(4)
148 STRING( "Expected Market Value" ).
149 PUT CONTROL line-printer.
152 PUT CONTROL header-font.
153 PUT UNFORMATTED SPACE(150)
154 STRING( "$ P.A.", "X(6)" ) SPACE(12)
157 PUT CONTROL line-printer.
162 /* _UIB-CODE-BLOCK-END
*/
166 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-property Procedure
167 PROCEDURE each-property
:
168 /*------------------------------------------------------------------------------
172 ------------------------------------------------------------------------------*/
174 DEF VAR i
AS INT NO-UNDO.
175 DEF VAR area-rental
AS DEC NO-UNDO.
177 RUN reset-prp-totals.
179 FOR EACH RentalSpace
OF Property
NO-LOCK:
180 IF RentalSpace.AreaStatus
= "V" THEN
183 IF i
= 1 THEN RUN property-header.
184 RUN each-vacant-space.
185 area-rental
= (IF RentalSpace.MarketRental
<> ?
THEN RentalSpace.MarketRental
ELSE 0.00).
188 area-rental
= (IF RentalSpace.ContractedRental
<> ?
THEN RentalSpace.ContractedRental
ELSE 0.00).
190 market-total
= market-total
+ area-rental.
193 IF i
> 1 THEN RUN property-footer.
194 IF i
> 0 THEN RUN skip-line
(0.5).
198 /* _UIB-CODE-BLOCK-END
*/
202 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-vacant-space Procedure
203 PROCEDURE each-vacant-space
:
204 /*------------------------------------------------------------------------------
208 ------------------------------------------------------------------------------*/
210 DEF VAR rsp-rate
AS DEC NO-UNDO.
211 DEF VAR c-rate
AS CHAR NO-UNDO.
213 rsp-tot
[1] = IF RentalSpace.AreaSize
<> ?
THEN RentalSpace.AreaSize
ELSE 0.00.
214 rsp-tot
[2] = IF RentalSpace.MarketRental
<> ?
THEN RentalSpace.MarketRental
ELSE 0.00.
215 IF RentalSpace.AreaType
= "C" THEN DO:
217 rsp-rate
= rsp-tot
[2] / rsp-tot
[1]
218 rsp-rate
= rsp-rate
/ 52.
220 IF rsp-rate
= ?
THEN rsp-rate
= rsp-tot
[2].
221 c-rate
= STRING( rsp-rate
, ">>>9.99" ) + "pw".
224 rsp-rate
= rsp-tot
[2] / rsp-tot
[1].
225 IF rsp-rate
= ?
THEN rsp-rate
= rsp-tot
[2].
226 c-rate
= STRING( rsp-rate
, ">>>9.99" ).
229 PUT UNFORMATTED SPACE(8)
230 STRING( RentalSpace.RentalSpaceCode
, "9999" ) SPACE(6)
231 STRING( RentalSpace.Description
, "X(50)" ) SPACE(4)
232 STRING( rsp-tot
[1], ">>>,>>9.99" ) SPACE(4)
233 STRING( rsp-tot
[2], ">>>,>>>,>>9.99" ) SPACE(4)
234 STRING( c-rate
, "X(12)" ).
236 RUN update-prp-totals.
240 /* _UIB-CODE-BLOCK-END
*/
244 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-control-strings Procedure
245 PROCEDURE get-control-strings
:
246 /*------------------------------------------------------------------------------
247 Purpose
: Get all control strings for this report
250 ------------------------------------------------------------------------------*/
252 DEF VAR rows
AS DEC NO-UNDO.
253 DEF VAR cols
AS DEC NO-UNDO.
255 RUN make-control-string
( "PCL", "reset,portrait,a4,tm,0,lm,4",
256 OUTPUT reset-page
, OUTPUT rows
, OUTPUT cols
).
258 RUN make-control-string
( "PCL", "Proportional,Helvetica,Bold,Point,12",
259 OUTPUT title-font
, OUTPUT rows
, OUTPUT cols
).
261 RUN make-control-string
( "PCL", "Proportional,Helvetica,Bold,Point,6",
262 OUTPUT time-font
, OUTPUT rows
, OUTPUT cols
).
264 RUN make-control-string
( "PCL", "Proportional,Helvetica,Bold,Point,8",
265 OUTPUT header-font
, OUTPUT rows
, OUTPUT cols
).
267 RUN make-control-string
( "PCL", "Proportional,Helvetica,Bold,Point,10",
268 OUTPUT property-font
, OUTPUT rows
, OUTPUT cols
).
270 RUN make-control-string
( "PCL", "LinePrinter,lpi,9.54",
271 OUTPUT line-printer
, OUTPUT rows
, OUTPUT cols
).
275 /* _UIB-CODE-BLOCK-END
*/
279 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE page-feed Procedure
280 PROCEDURE page-feed
:
281 /*------------------------------------------------------------------------------
285 ------------------------------------------------------------------------------*/
287 page-no
= page-no
+ 1.
292 /* _UIB-CODE-BLOCK-END
*/
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE page-header Procedure
297 PROCEDURE page-header
:
298 /*------------------------------------------------------------------------------
302 ------------------------------------------------------------------------------*/
310 /* _UIB-CODE-BLOCK-END
*/
314 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-grd-totals Procedure
315 PROCEDURE print-grd-totals
:
316 /*------------------------------------------------------------------------------
320 ------------------------------------------------------------------------------*/
323 PUT UNFORMATTED SPACE(72)
324 STRING( FILL( '
-'
, 10 ) + FILL( ' '
, 4 ) + FILL( '
-'
, 14 ), "X(50)" ).
327 DEF VAR percentage
AS DEC NO-UNDO.
328 percentage
= grd-tot
[2] / market-total.
331 STRING( "GRAND TOTAL", "X(11)" ) SPACE(61)
332 STRING( grd-tot
[1], ">>>,>>9.99" ) SPACE(4)
333 STRING( grd-tot
[2], ">>>,>>>,>>9.99" ).
338 STRING( percentage
, ">>9.99" ) STRING( "%", "X" ) SPACE(1)
339 STRING( "of Rental Gross Income as at " + STRING(TODAY, "99/99/9999"), "X(60)" ).
344 /* _UIB-CODE-BLOCK-END
*/
348 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-title Procedure
349 PROCEDURE print-title
:
350 /*------------------------------------------------------------------------------
354 ------------------------------------------------------------------------------*/
356 PUT CONTROL line-printer.
358 PUT CONTROL time-font.
361 "Printed: " + STRING( TODAY, "99/99/9999" ) + " " +
362 STRING( TIME, "HH:MM:SS" ) + " for " + user-name
,
363 "X(100)" ) SPACE(120)
364 STRING( "Page: " + STRING( page-no
), "X(20)" ).
366 PUT CONTROL title-font.
367 PUT UNFORMATTED SPACE(45) STRING( "Vacant Space Report", "X(50)" ).
369 PUT CONTROL line-printer.
373 /* _UIB-CODE-BLOCK-END
*/
377 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE property-footer Procedure
378 PROCEDURE property-footer
:
379 /*------------------------------------------------------------------------------
383 ------------------------------------------------------------------------------*/
385 PUT UNFORMATTED SPACE(72)
386 STRING( FILL( '
-'
, 10 ) + FILL( ' '
, 4 ) + FILL( '
-'
, 14 ), "X(50)" ).
389 PUT UNFORMATTED SPACE(72)
390 STRING( prp-tot
[1], ">>>,>>9.99" ) SPACE(4)
391 STRING( prp-tot
[2], ">>>,>>>,>>9.99" ).
394 RUN update-grd-totals.
399 /* _UIB-CODE-BLOCK-END
*/
403 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE property-header Procedure
404 PROCEDURE property-header
:
405 /*------------------------------------------------------------------------------
409 ------------------------------------------------------------------------------*/
411 PUT CONTROL property-font.
412 PUT UNFORMATTED STRING(
413 "(" + Property.Region
+ ") " +
414 STRING( Property.PropertyCode
, "9999" ) + '
- '
+ Property.Name
,
416 PUT CONTROL line-printer.
421 /* _UIB-CODE-BLOCK-END
*/
425 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE reset-page Procedure
426 PROCEDURE reset-page
:
427 /*------------------------------------------------------------------------------
431 ------------------------------------------------------------------------------*/
433 PUT CONTROL reset-page.
438 /* _UIB-CODE-BLOCK-END
*/
442 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE reset-prp-totals Procedure
443 PROCEDURE reset-prp-totals
:
444 /*------------------------------------------------------------------------------
448 ------------------------------------------------------------------------------*/
450 DO i
= 1 TO 2: prp-tot
[i
] = 0.00.
END.
454 /* _UIB-CODE-BLOCK-END
*/
458 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE skip-line Procedure
459 PROCEDURE skip-line
:
460 /*------------------------------------------------------------------------------
464 ------------------------------------------------------------------------------*/
466 DEF INPUT PARAMETER n
AS DEC NO-UNDO.
468 IF ln
+ n
>= {&lines-per-page} THEN
475 DEF VAR int-part
AS INT NO-UNDO.
476 DEF VAR dec-part
AS DEC NO-UNDO.
478 int-part
= TRUNCATE( n
, 0 ).
479 IF int-part
< 0 THEN RETURN.
480 dec-part
= n
- int-part.
481 IF int-part
= 0 AND dec-part
= 0 THEN RETURN.
483 /* Need to have this like the following
- do not touch
*/
484 IF int-part
<> 0 THEN PUT CONTROL FILL( CHR(10), int-part
).
485 IF dec-part
<> 0 THEN PUT CONTROL half-line.
493 /* _UIB-CODE-BLOCK-END
*/
497 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE skip-to-line Procedure
498 PROCEDURE skip-to-line
:
499 /*------------------------------------------------------------------------------
503 ------------------------------------------------------------------------------*/
505 DEF INPUT PARAMETER line-no
AS DEC NO-UNDO.
507 DEF VAR int-part
AS INT NO-UNDO.
508 DEF VAR dec-part
AS DEC NO-UNDO.
510 int-part
= TRUNCATE( line-no
- ln
, 0 ).
511 IF int-part
< 0 THEN RETURN.
512 dec-part
= ( line-no
- ln
) - int-part.
513 IF int-part
= 0 AND dec-part
= 0 THEN RETURN.
515 IF int-part
<> 0 THEN PUT CONTROL FILL( CHR(10), int-part
).
516 IF dec-part
<> 0 THEN PUT CONTROL half-line.
524 /* _UIB-CODE-BLOCK-END
*/
528 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE update-grd-totals Procedure
529 PROCEDURE update-grd-totals
:
530 /*------------------------------------------------------------------------------
534 ------------------------------------------------------------------------------*/
536 DO i
= 1 TO 2: grd-tot
[i
] = grd-tot
[i
] + prp-tot
[i
].
END.
540 /* _UIB-CODE-BLOCK-END
*/
544 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE update-prp-totals Procedure
545 PROCEDURE update-prp-totals
:
546 /*------------------------------------------------------------------------------
550 ------------------------------------------------------------------------------*/
552 prp-tot
[1] = prp-tot
[1] + IF RentalSpace.AreaType
= "C" THEN 0.00 ELSE rsp-tot
[1].
553 prp-tot
[2] = prp-tot
[2] + rsp-tot
[2].
557 /* _UIB-CODE-BLOCK-END
*/
561 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE vacant-spaces Procedure
562 PROCEDURE vacant-spaces
:
563 /*------------------------------------------------------------------------------
567 ------------------------------------------------------------------------------*/
569 RUN get-control-strings.
572 FOR EACH Property
NO-LOCK WHERE Property.Active
BY Region
:
576 RUN print-grd-totals.
581 /* _UIB-CODE-BLOCK-END
*/