1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
6 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
8 DEF VAR preview
AS LOGICAL NO-UNDO.
9 DEF VAR property-1
AS INTEGER NO-UNDO.
10 DEF VAR property-n
AS INTEGER NO-UNDO.
12 DEF VAR print-financials
AS LOGICAL INITIAL Yes
NO-UNDO.
13 DEF VAR print-arrears
AS LOGICAL INITIAL Yes
NO-UNDO.
14 DEF VAR print-vacancies
AS LOGICAL INITIAL Yes
NO-UNDO.
15 DEF VAR print-bldgincome
AS LOGICAL INITIAL Yes
NO-UNDO.
16 DEF VAR print-issues
AS LOGICAL INITIAL Yes
NO-UNDO.
17 DEF VAR print-capital-works
AS LOGICAL INITIAL Yes
NO-UNDO.
19 DEF VAR as-at-date
AS DATE NO-UNDO INITIAL TODAY.
20 DEF VAR selection-style
AS CHAR NO-UNDO.
21 DEF VAR test-client-code
AS CHAR NO-UNDO INITIAL ?.
22 DEF VAR company-list
AS CHAR NO-UNDO INITIAL ?.
23 DEF VAR show-warnings
AS LOGI
NO-UNDO INITIAL ?.
26 /* for accumulating outgoing details over a property
*/
27 DEF WORK-TABLE bldg-sublease
NO-UNDO LIKE SubLease.
28 DEF WORK-TABLE og-acct
NO-UNDO
29 FIELD AccountCode
LIKE ChartOfAccount.AccountCode
30 FIELD ShortName
AS CHAR FORMAT "X(9)"
31 FIELD Recovered
AS DECIMAL
32 FIELD Gross
AS DECIMAL
33 FIELD Vacant
AS DECIMAL.
34 DEFINE WORKFILE og-desc
NO-UNDO
36 FIELD accounts
AS CHAR
37 FIELD description
AS CHAR
40 DEF WORK-TABLE tenant-reviews
NO-UNDO
42 FIELD TenantName
LIKE Tenant.
NAME
43 FIELD TenantCode
LIKE Tenant.TenantCode
44 FIELD DateDue
LIKE RentReview.DateDue
45 FIELD EstimateBasis
LIKE RentReview.EstimateBasis
46 FIELD ReviewType
LIKE RentReview.ReviewType.
48 DEF WORK-TABLE account-total
NO-UNDO
51 FIELD mth-actual
LIKE AccountBalance.Balance
52 FIELD mth-budget
LIKE AccountBalance.Balance
53 FIELD ytd-actual
LIKE AccountBalance.Balance
54 FIELD ytd-budget
LIKE AccountBalance.Balance
55 FIELD fyr-budget
LIKE AccountBalance.Balance
56 FIELD fyr-frcast
LIKE AccountBalance.Balance.
58 DEF VAR first-building
AS LOGICAL INITIAL yes
NO-UNDO.
59 DEF VAR user-name
AS CHAR NO-UNDO.
60 {inc
/username.i
"user-name"}
63 {inc
/ofc-set-l.i
"Use-Rent-Charges" "use-rent-charges"}
64 {inc
/ofc-set.i
"RentCharge-Outgoings" "og-rentcharge-type"}
65 IF NOT AVAILABLE(OfficeSetting
) THEN og-rentcharge-type
= "".
67 {inc
/ofc-acct.i
"DEBTORS" "sundry-debtors"}
69 DEF VAR timeStamp
AS CHAR FORMAT "X(40)" NO-UNDO.
70 timeStamp
= STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name
+ " as at " + STRING( as-at-date
, "99/99/9999").
72 /* We calculate the building income report into this string
*/
73 DEF VAR building-income-report
AS CHAR NO-UNDO INITIAL "".
76 DEF VAR area-format
AS CHAR NO-UNDO INITIAL "->>>,>>9.99".
77 DEF VAR unit-format
AS CHAR NO-UNDO INITIAL "->>>,>>9".
78 DEF VAR money-format
AS CHAR NO-UNDO INITIAL "->>,>>>,>>9.99".
79 DEF VAR pcnt-format
AS CHAR NO-UNDO INITIAL "->>,>>9.99%".
80 DEF VAR psm-format
AS CHAR NO-UNDO INITIAL "->>,>>9.99psm".
82 /* Global Variables calculated for each property
*/
83 DEF VAR annual-income
AS DECIMAL NO-UNDO.
84 DEF VAR annual-recexp
AS DECIMAL NO-UNDO.
85 DEF VAR net-income
AS DECIMAL NO-UNDO.
86 DEF VAR net-frcast
AS DECIMAL NO-UNDO.
88 DEF VAR office-rent
AS DECIMAL NO-UNDO.
89 DEF VAR office-area
AS DECIMAL NO-UNDO.
90 DEF VAR retail-rent
AS DECIMAL NO-UNDO.
91 DEF VAR retail-area
AS DECIMAL NO-UNDO.
92 DEF VAR indust-rent
AS DECIMAL NO-UNDO.
93 DEF VAR indust-area
AS DECIMAL NO-UNDO.
94 DEF VAR carpk-rent
AS DECIMAL NO-UNDO.
95 DEF VAR carpk-count
AS DECIMAL NO-UNDO.
96 DEF VAR other-rent
AS DECIMAL NO-UNDO.
97 DEF VAR other-area
AS DECIMAL NO-UNDO.
98 DEF VAR total-area
AS DECIMAL NO-UNDO.
100 DEF VAR wale-area
AS DECIMAL NO-UNDO.
101 DEF VAR wale-income
AS DECIMAL NO-UNDO.
103 DEF VAR purchase-price
AS DECIMAL NO-UNDO.
105 /* _UIB-CODE-BLOCK-END
*/
109 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
111 /* ******************** Preprocessor Definitions
******************** */
113 &Scoped-define PROCEDURE-TYPE Procedure
114 &Scoped-define DB-AWARE no
118 /* _UIB-PREPROCESSOR-BLOCK-END
*/
122 /* ************************ Function Prototypes
********************** */
124 &IF DEFINED(EXCLUDE-add-building-account) = 0 &THEN
126 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD add-building-account Procedure
127 FUNCTION add-building-account
RETURNS CHARACTER
128 ( INPUT month-from
AS INT, INPUT month-to
AS INT,
129 OUTPUT mth-actual
AS DECIMAL, OUTPUT mth-budget
AS DECIMAL,
130 OUTPUT ytd-actual
AS DECIMAL, OUTPUT ytd-budget
AS DECIMAL,
131 OUTPUT fyr-budget
AS DECIMAL, OUTPUT fyr-frcast
AS DECIMAL
134 /* _UIB-CODE-BLOCK-END
*/
139 &IF DEFINED(EXCLUDE-div) = 0 &THEN
141 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD div Procedure
142 FUNCTION div
RETURNS CHARACTER
143 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) FORWARD.
145 /* _UIB-CODE-BLOCK-END
*/
150 &IF DEFINED(EXCLUDE-do-0-property-header) = 0 &THEN
152 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-0-property-header Procedure
153 FUNCTION do-0-property-header
RETURNS CHARACTER
154 ( /* parameter-definitions
*/ ) FORWARD.
156 /* _UIB-CODE-BLOCK-END
*/
161 &IF DEFINED(EXCLUDE-do-0-section-header) = 0 &THEN
163 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-0-section-header Procedure
164 FUNCTION do-0-section-header
RETURNS CHARACTER
165 ( INPUT section-name
AS CHAR ) FORWARD.
167 /* _UIB-CODE-BLOCK-END
*/
172 &IF DEFINED(EXCLUDE-do-1-financial-report) = 0 &THEN
174 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-1-financial-report Procedure
175 FUNCTION do-1-financial-report
RETURNS CHARACTER
176 ( /* parameter-definitions
*/ ) FORWARD.
178 /* _UIB-CODE-BLOCK-END
*/
183 &IF DEFINED(EXCLUDE-do-2-arrears) = 0 &THEN
185 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-2-arrears Procedure
186 FUNCTION do-2-arrears
RETURNS CHARACTER
187 ( /* parameter-definitions
*/ ) FORWARD.
189 /* _UIB-CODE-BLOCK-END
*/
194 &IF DEFINED(EXCLUDE-do-3-vacancies) = 0 &THEN
196 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-3-vacancies Procedure
197 FUNCTION do-3-vacancies
RETURNS CHARACTER
198 ( /* parameter-definitions
*/ ) FORWARD.
200 /* _UIB-CODE-BLOCK-END
*/
205 &IF DEFINED(EXCLUDE-do-3a-reviews) = 0 &THEN
207 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-3a-reviews Procedure
208 FUNCTION do-3a-reviews
RETURNS CHARACTER
209 ( /* parameter-definitions
*/ ) FORWARD.
211 /* _UIB-CODE-BLOCK-END
*/
216 &IF DEFINED(EXCLUDE-do-4-building-income) = 0 &THEN
218 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-4-building-income Procedure
219 FUNCTION do-4-building-income
RETURNS CHARACTER
220 ( /* parameter-definitions
*/ ) FORWARD.
222 /* _UIB-CODE-BLOCK-END
*/
227 &IF DEFINED(EXCLUDE-do-5-capital-works) = 0 &THEN
229 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-5-capital-works Procedure
230 FUNCTION do-5-capital-works
RETURNS CHARACTER
231 ( /* parameter-definitions
*/ ) FORWARD.
233 /* _UIB-CODE-BLOCK-END
*/
238 &IF DEFINED(EXCLUDE-do-6-call-register) = 0 &THEN
240 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD do-6-call-register Procedure
241 FUNCTION do-6-call-register
RETURNS CHARACTER
242 ( /* parameter-definitions
*/ ) FORWARD.
244 /* _UIB-CODE-BLOCK-END
*/
249 &IF DEFINED(EXCLUDE-empty) = 0 &THEN
251 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD empty Procedure
252 FUNCTION empty
RETURNS CHARACTER
253 ( INPUT num
AS INT ) FORWARD.
255 /* _UIB-CODE-BLOCK-END
*/
260 &IF DEFINED(EXCLUDE-financial-report-row) = 0 &THEN
262 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD financial-report-row Procedure
263 FUNCTION financial-report-row
RETURNS CHARACTER
264 ( INPUT in-ttype
AS CHAR, INPUT line-desc
AS CHAR ) FORWARD.
266 /* _UIB-CODE-BLOCK-END
*/
271 &IF DEFINED(EXCLUDE-get-acctgrp-amnt) = 0 &THEN
273 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD get-acctgrp-amnt Procedure
274 FUNCTION get-acctgrp-amnt
RETURNS DECIMAL
275 ( INPUT actual
AS LOGICAL, INPUT acctgrp
AS CHAR ) FORWARD.
277 /* _UIB-CODE-BLOCK-END
*/
282 &IF DEFINED(EXCLUDE-get-prop-og) = 0 &THEN
284 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD get-prop-og Procedure
285 FUNCTION get-prop-og
RETURNS DECIMAL
286 ( INPUT doit
AS LOGICAL, INPUT pc
AS INTEGER, INPUT ac
AS DECIMAL ) FORWARD.
288 /* _UIB-CODE-BLOCK-END
*/
293 &IF DEFINED(EXCLUDE-lease-years-remaining) = 0 &THEN
295 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD lease-years-remaining Procedure
296 FUNCTION lease-years-remaining
RETURNS DECIMAL
297 ( /* parameter-definitions
*/ ) FORWARD.
299 /* _UIB-CODE-BLOCK-END
*/
304 &IF DEFINED(EXCLUDE-notes-section) = 0 &THEN
306 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD notes-section Procedure
307 FUNCTION notes-section
RETURNS CHARACTER
308 ( INPUT section-title
AS CHAR, INPUT section-lines
AS INT ) FORWARD.
310 /* _UIB-CODE-BLOCK-END
*/
315 &IF DEFINED(EXCLUDE-prepare-building-account) = 0 &THEN
317 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD prepare-building-account Procedure
318 FUNCTION prepare-building-account
RETURNS CHARACTER
319 ( INPUT month-from
AS INT, INPUT month-to
AS INT,
320 OUTPUT mth-actual
AS DECIMAL, OUTPUT mth-budget
AS DECIMAL,
321 OUTPUT ytd-actual
AS DECIMAL, OUTPUT ytd-budget
AS DECIMAL,
322 OUTPUT fyr-budget
AS DECIMAL, OUTPUT fyr-frcast
AS DECIMAL
325 /* _UIB-CODE-BLOCK-END
*/
330 &IF DEFINED(EXCLUDE-prepare-building-income) = 0 &THEN
332 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD prepare-building-income Procedure
333 FUNCTION prepare-building-income
RETURNS CHARACTER
334 ( /* parameter-definitions
*/ ) FORWARD.
336 /* _UIB-CODE-BLOCK-END
*/
341 &IF DEFINED(EXCLUDE-show-one-review) = 0 &THEN
343 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD show-one-review Procedure
344 FUNCTION show-one-review
RETURNS CHARACTER
345 ( /* no parameter-definitions
*/ ) FORWARD.
347 /* _UIB-CODE-BLOCK-END
*/
352 &IF DEFINED(EXCLUDE-tbl) = 0 &THEN
354 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD tbl Procedure
355 FUNCTION tbl
RETURNS CHARACTER
356 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) FORWARD.
358 /* _UIB-CODE-BLOCK-END
*/
363 &IF DEFINED(EXCLUDE-tbody) = 0 &THEN
365 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD tbody Procedure
366 FUNCTION tbody
RETURNS CHARACTER
367 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) FORWARD.
369 /* _UIB-CODE-BLOCK-END
*/
374 &IF DEFINED(EXCLUDE-td) = 0 &THEN
376 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD td Procedure
377 FUNCTION td
RETURNS CHARACTER
378 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) FORWARD.
380 /* _UIB-CODE-BLOCK-END
*/
385 &IF DEFINED(EXCLUDE-td-amount) = 0 &THEN
387 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD td-amount Procedure
388 FUNCTION td-amount
RETURNS CHARACTER
389 ( INPUT amount
AS DECIMAL, INPUT fmt
AS CHAR, INPUT class
AS CHAR ) FORWARD.
391 /* _UIB-CODE-BLOCK-END
*/
396 &IF DEFINED(EXCLUDE-test-floor-space) = 0 &THEN
398 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD test-floor-space Procedure
399 FUNCTION test-floor-space
RETURNS CHARACTER
400 ( INPUT type
AS CHAR, INPUT area
AS DECIMAL ) FORWARD.
402 /* _UIB-CODE-BLOCK-END
*/
407 &IF DEFINED(EXCLUDE-tr) = 0 &THEN
409 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD tr Procedure
410 FUNCTION tr
RETURNS CHARACTER
411 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) FORWARD.
413 /* _UIB-CODE-BLOCK-END
*/
419 /* *********************** Procedure Settings
************************ */
421 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
422 /* Settings for
THIS-PROCEDURE
426 Add Fields to
: Neither
427 Other Settings
: CODE-ONLY
COMPILE
429 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
431 /* ************************* Create Window
************************** */
433 &ANALYZE-SUSPEND _CREATE-WINDOW
434 /* DESIGN Window definition
(used by the UIB
)
435 CREATE WINDOW Procedure
ASSIGN
438 /* END WINDOW DEFINITION
*/
442 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
443 /* ************************* Included-Libraries
*********************** */
446 {inc
/method
/m-txtrep.i
}
447 {inc
/method
/m-charged-rent.i
}
449 /* _UIB-CODE-BLOCK-END
*/
456 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
459 /* *************************** Main Block
*************************** */
461 txtrep-file-suffix
= ".html".
462 RUN txtrep-initialise.
464 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
466 RUN htmlrep-start
('TGG Property Management Report'
).
470 IF selection-style
= "OneClient" THEN RUN for-one-client.
471 ELSE IF selection-style
= "CompanyList" THEN RUN for-company-list.
473 RUN for-each-property.
478 /* _UIB-CODE-BLOCK-END
*/
482 /* ********************** Internal Procedures
*********************** */
484 &IF DEFINED(EXCLUDE-clear-property) = 0 &THEN
486 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE clear-property Procedure
487 PROCEDURE clear-property
:
488 /*------------------------------------------------------------------------------
489 Purpose
: Clear the work-tables we are using for each property
490 ------------------------------------------------------------------------------*/
491 FOR EACH bldg-sublease
: DELETE bldg-sublease.
END.
492 FOR EACH og-acct
: DELETE og-acct.
END.
493 FOR EACH tenant-reviews
: DELETE tenant-reviews.
END.
494 FOR EACH account-total
: DELETE account-total.
END.
496 IF Property.PurchasePrice
NE ?
AND Property.PurchasePrice
GT 0.0 THEN DO:
497 purchase-price
= Property.PurchasePrice.
500 /* Get 'Historical Cost' valuation for purchase-price
*/
501 FIND FIRST Valuation
OF Property
WHERE ValuationType
= 'HCST'
NO-LOCK NO-ERROR.
502 IF NOT AVAILABLE(Valuation
) THEN DO:
503 FIND LAST Valuation
OF Property
WHERE ValuationType
= 'CVAL'
NO-LOCK NO-ERROR.
505 IF AVAILABLE(Valuation
) THEN purchase-price
= Valuation.Amount.
ELSE purchase-price
= 1.0.
509 building-income-report
= ?.
510 prepare-building-income
().
525 DEF VAR charged-rental
AS DECIMAL NO-UNDO.
526 DEF VAR income-years
AS DECIMAL NO-UNDO INITIAL 0.0.
527 DEF VAR area-years
AS DECIMAL NO-UNDO INITIAL 0.0.
528 DEF VAR years
AS DECIMAL NO-UNDO.
530 FOR EACH RentalSpace
OF Property
NO-LOCK:
531 IF RentalSpace.AreaStatus
= "V"
532 OR NOT CAN-FIND( TenancyLease
OF RentalSpace
WHERE TenancyLease.LeaseStatus
<> "PAST" )
538 charged-rental
= get-charged-rent
( RentalSpace.ChargedRental
, RentalSpace.ContractedRental
, RentalSpace.AreaType
, RentalSpace.TenancyLeaseCode
).
539 years
= lease-years-remaining
().
540 income-years
= income-years
+ (years
* charged-rental
).
543 annual-income
= annual-income
+ charged-rental.
545 FIND AreaType
WHERE AreaType.AreaType
= RentalSpace.AreaType
NO-LOCK NO-ERROR.
546 IF (AVAILABLE(AreaType
) AND AreaType.IsCarPark
) OR RentalSpace.AreaType
= 'C'
THEN DO:
547 carpk-rent
= carpk-rent
+ charged-rental.
548 carpk-count
= carpk-count
+ RentalSpace.AreaSize.
551 IF RentalSpace.AreaType
EQ 'O'
OR RentalSpace.AreaType
EQ 'R'
OR RentalSpace.AreaType
EQ 'W'
552 OR (AVAILABLE(AreaType
) AND AreaType.IsFloorArea
) THEN DO:
553 area-years
= area-years
+ (years
* RentalSpace.AreaSize
).
556 CASE RentalSpace.AreaType
:
558 office-rent
= office-rent
+ charged-rental.
559 office-area
= office-area
+ RentalSpace.AreaSize.
562 retail-rent
= retail-rent
+ charged-rental.
563 retail-area
= retail-area
+ RentalSpace.AreaSize.
566 indust-rent
= indust-rent
+ charged-rental.
567 indust-area
= indust-area
+ RentalSpace.AreaSize.
570 other-rent
= other-rent
+ charged-rental.
571 IF (AVAILABLE(AreaType
) AND AreaType.IsFloorArea
) THEN DO:
572 other-area
= other-area
+ RentalSpace.AreaSize.
577 total-area
= (office-area
+ retail-area
+ indust-area
+ other-area
).
578 wale-area
= area-years
/ (office-area
+ retail-area
+ indust-area
+ other-area
).
579 wale-income
= income-years
/ annual-income.
581 FOR EACH Tenant
WHERE Tenant.Entitytype
= "P" AND Tenant.EntityCode
= Property.PropertyCode
NO-LOCK:
582 FOR EACH TenancyLease
OF Tenant
WHERE TenancyLease.LeaseStatus
<> "PAST" NO-LOCK:
583 annual-recexp
= annual-recexp
+ TenancyLease.OutgoingsBudget.
584 FOR EACH RentReview
OF TenancyLease
585 WHERE RentReview.DateDue
<= (as-at-date
+ 190)
586 AND (RentReview.DateComplete
>= as-at-date
OR RentReview.DateComplete
= ?
)
588 CREATE tenant-reviews.
589 ASSIGN tenant-reviews.Static
= 0
590 tenant-reviews.TenantName
= Tenant.
NAME
591 tenant-reviews.TenantCode
= Tenant.TenantCode
592 tenant-reviews.DateDue
= RentReview.DateDue
593 tenant-reviews.EstimateBasis
= RentReview.EstimateBasis
594 tenant-reviews.ReviewType
= RentReview.ReviewType.
601 /* _UIB-CODE-BLOCK-END
*/
606 &IF DEFINED(EXCLUDE-each-property) = 0 &THEN
608 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-property Procedure
609 PROCEDURE each-property
:
610 /*------------------------------------------------------------------------------
612 ------------------------------------------------------------------------------*/
613 DEF VAR report-0
AS CHAR NO-UNDO.
614 DEF VAR report-1
AS CHAR NO-UNDO.
615 DEF VAR report-2
AS CHAR NO-UNDO.
616 DEF VAR report-3
AS CHAR NO-UNDO.
617 DEF VAR report-4
AS CHAR NO-UNDO.
618 DEF VAR report-5
AS CHAR NO-UNDO.
619 DEF VAR report-6
AS CHAR NO-UNDO.
620 DEF VAR did-something
AS LOGICAL INITIAL NO NO-UNDO.
621 DEF VAR did-header
AS LOGICAL INITIAL NO NO-UNDO.
625 IF print-financials
THEN DO:
626 RUN print-line
( '
<table class
="property">'
).
627 RUN print-line
( do-0-section-header
( "Financials Report") ).
628 do-1-financial-report
().
634 IF print-arrears
THEN DO:
635 report-2
= do-2-arrears
().
636 IF report-2
<> ''
THEN did-something
= YES.
638 IF print-vacancies
THEN DO:
639 report-3
= do-3a-reviews
() + do-3-vacancies
().
640 IF report-3
<> ''
THEN did-something
= YES.
642 IF print-bldgincome
THEN DO:
643 report-4
= do-4-building-income
().
644 IF report-4
<> ''
THEN did-something
= YES.
646 IF print-issues
THEN DO:
647 report-5
= do-5-capital-works
().
648 IF report-5
<> ''
THEN did-something
= YES.
650 IF print-capital-works
THEN DO:
651 report-6
= do-6-call-register
().
652 IF report-6
<> ''
THEN did-something
= YES.
655 IF print-bldgincome
OR print-issues
OR print-capital-works
THEN DO:
656 report-4
= do-0-section-header
( "Facilities Management") + report-4.
659 IF did-something
THEN DO:
660 IF NOT( did-header
) THEN DO:
662 RUN print-line
( report-2
).
663 RUN print-line
( report-3
).
664 RUN print-line
( report-4
).
665 RUN print-line
( report-5
).
666 RUN print-line
( report-6
).
667 RUN print-line
( '
</table
>'
).
672 /* _UIB-CODE-BLOCK-END
*/
677 &IF DEFINED(EXCLUDE-for-company-list) = 0 &THEN
679 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE for-company-list Procedure
680 PROCEDURE for-company-list
:
681 /*------------------------------------------------------------------------------
683 ------------------------------------------------------------------------------*/
684 DEF VAR i
AS INT NO-UNDO.
685 DEF VAR n
AS INT NO-UNDO.
686 DEF VAR company-code
AS INT NO-UNDO.
688 FIND ConsolidationList
WHERE ConsolidationList.Name
= company-list
NO-LOCK.
689 n
= NUM-ENTRIES( ConsolidationList.CompanyList
).
691 company-code
= INT( ENTRY( i
, ConsolidationList.CompanyList
) ).
692 FOR EACH Property
WHERE Property.CompanyCode
= company-code
693 AND Property.Active
NO-LOCK:
701 /* _UIB-CODE-BLOCK-END
*/
706 &IF DEFINED(EXCLUDE-for-each-property) = 0 &THEN
708 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE for-each-property Procedure
709 PROCEDURE for-each-property
:
710 /*------------------------------------------------------------------------------
712 ------------------------------------------------------------------------------*/
714 FOR EACH Property
WHERE Property.Active
AND Property.PropertyCode
>= property-1
715 AND Property.PropertyCode
<= property-n
723 /* _UIB-CODE-BLOCK-END
*/
728 &IF DEFINED(EXCLUDE-for-one-client) = 0 &THEN
730 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE for-one-client Procedure
731 PROCEDURE for-one-client
:
732 /*------------------------------------------------------------------------------
734 ------------------------------------------------------------------------------*/
736 FOR EACH Company
WHERE Company.ClientCode
= test-client-code
NO-LOCK:
737 FOR EACH Property
OF Company
WHERE Property.Active
NO-LOCK:
744 /* _UIB-CODE-BLOCK-END
*/
749 &IF DEFINED(EXCLUDE-parse-parameters) = 0 &THEN
751 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
752 PROCEDURE parse-parameters
:
753 /*------------------------------------------------------------------------------
755 ------------------------------------------------------------------------------*/
756 DEF VAR i
AS INT NO-UNDO.
757 DEF VAR token
AS CHAR NO-UNDO.
759 {inc
/showopts.i
"report-options"}
761 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
762 token
= ENTRY( i
, report-options
, "~n" ).
764 CASE( ENTRY( 1, token
) ):
765 WHEN "Properties" THEN ASSIGN
766 property-1
= INT( ENTRY(2,token
) )
767 property-n
= INT( ENTRY(3,token
) ).
769 WHEN "Client" THEN test-client-code
= ENTRY(2,token
).
770 WHEN "CompanyList" THEN company-list
= ENTRY(2,token
).
771 WHEN "Selection" THEN selection-style
= ENTRY(2,token
).
772 WHEN "Warnings" THEN show-warnings
= ENTRY(2,token
) BEGINS "Y".
773 WHEN "Financials" THEN print-financials
= ENTRY(2,token
) BEGINS "Y".
774 WHEN "Arrears" THEN print-arrears
= ENTRY(2,token
) BEGINS "Y".
775 WHEN "Vacancies" THEN print-vacancies
= ENTRY(2,token
) BEGINS "Y".
776 WHEN "Issues" THEN print-issues
= ENTRY(2,token
) BEGINS "Y".
777 WHEN "Capital Works" THEN print-capital-works
= ENTRY(2,token
) BEGINS "Y".
778 WHEN "Building Income" THEN print-bldgincome
= ENTRY(2,token
) BEGINS "Y".
779 WHEN "As At Date" THEN as-at-date
= DATE(ENTRY(2,token
)).
783 IF property-n
< property-1
THEN property-n
= property-1.
784 IF selection-style
= "AP" THEN ASSIGN
787 ELSE IF selection-style
= "1P" THEN ASSIGN
788 property-n
= property-1.
792 /* _UIB-CODE-BLOCK-END
*/
797 &IF DEFINED(EXCLUDE-print-line) = 0 &THEN
799 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-line Procedure
800 PROCEDURE print-line
:
801 /*------------------------------------------------------------------------------
802 Purpose
: Print a line of output
803 ------------------------------------------------------------------------------*/
804 DEF INPUT PARAMETER the-line
AS CHAR NO-UNDO.
806 PUT CONTROL REPLACE(the-line
, '
&', '&').
810 /* _UIB-CODE-BLOCK-END
*/
815 &IF DEFINED(EXCLUDE-report-headers) = 0 &THEN
817 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE report-headers Procedure
818 PROCEDURE report-headers
:
819 /*------------------------------------------------------------------------------
820 Purpose
: Print the headers for the whole report. The style sheet link
, mainly
821 ------------------------------------------------------------------------------*/
823 PUT CONTROL '
<link rel
="stylesheet" type
="text/css" href
="schdtgg2.css">~n' .
824 htmlrep-css-file
= 'support
/css
/schdtgg2.css'.
828 /* _UIB-CODE-BLOCK-END
*/
833 /* ************************ Function Implementations
***************** */
835 &IF DEFINED(EXCLUDE-add-building-account) = 0 &THEN
837 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION add-building-account Procedure
838 FUNCTION add-building-account
RETURNS CHARACTER
839 ( INPUT month-from
AS INT, INPUT month-to
AS INT,
840 OUTPUT mth-actual
AS DECIMAL, OUTPUT mth-budget
AS DECIMAL,
841 OUTPUT ytd-actual
AS DECIMAL, OUTPUT ytd-budget
AS DECIMAL,
842 OUTPUT fyr-budget
AS DECIMAL, OUTPUT fyr-frcast
AS DECIMAL
844 /*------------------------------------------------------------------------------
847 ------------------------------------------------------------------------------*/
848 DEF VAR rrow
AS CHAR NO-UNDO INITIAL ''.
849 DEF VAR acctgroup
AS CHAR NO-UNDO.
851 mth-actual
= 0.0 . mth-budget
= 0.0 .
852 ytd-actual
= 0.0 . ytd-budget
= 0.0 .
853 fyr-budget
= 0.0 . fyr-frcast
= 0.0 .
854 FOR EACH AccountBalance
NO-LOCK WHERE
855 AccountBalance.EntityType
= 'P'
AND
856 AccountBalance.EntityCode
= Property.PropertyCode
AND
857 AccountBalance.AccountCode
= ChartOfAccount.AccountCode
AND
858 AccountBalance.MonthCode
>= month-from
AND
859 AccountBalance.MonthCode
<= Month.MonthCode
:
861 IF AccountBalance.MonthCode
= month-to
THEN DO:
862 mth-actual
= AccountBalance.Balance.
863 mth-budget
= AccountBalance.Budget.
866 IF AccountBalance.MonthCode
<= month-to
THEN DO:
867 ytd-actual
= ytd-actual
+ AccountBalance.Balance.
868 ytd-budget
= ytd-budget
+ AccountBalance.Budget.
869 fyr-frcast
= fyr-frcast
+ AccountBalance.Balance.
872 fyr-frcast
= fyr-frcast
+ AccountBalance.Budget.
875 fyr-budget
= fyr-budget
+ AccountBalance.Budget.
881 /* _UIB-CODE-BLOCK-END
*/
886 &IF DEFINED(EXCLUDE-div) = 0 &THEN
888 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION div Procedure
889 FUNCTION div
RETURNS CHARACTER
890 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) :
891 /*------------------------------------------------------------------------------
892 Purpose
: Shorthand for specific html tag
893 ------------------------------------------------------------------------------*/
895 RETURN tag
("div", content
, attributes
).
899 /* _UIB-CODE-BLOCK-END
*/
904 &IF DEFINED(EXCLUDE-do-0-property-header) = 0 &THEN
906 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-0-property-header Procedure
907 FUNCTION do-0-property-header
RETURNS CHARACTER
908 ( /* parameter-definitions
*/ ) :
909 /*------------------------------------------------------------------------------
910 Purpose
: The per-property headers for the report.
912 ------------------------------------------------------------------------------*/
913 DEF VAR report
AS CHAR NO-UNDO INITIAL ''.
916 td
(Property.Name
, 'class
="propertyname" colspan
="10"'
) +
917 td
(month-desc
(as-at-date
),'class
="reportmonth" colspan
="5"'
), ''
).
919 report
= tag
("thead", report
, 'class
="colhead"'
).
922 /* report
= tbl
(report
,'class
="header"'
).
*/
928 /* _UIB-CODE-BLOCK-END
*/
933 &IF DEFINED(EXCLUDE-do-0-section-header) = 0 &THEN
935 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-0-section-header Procedure
936 FUNCTION do-0-section-header
RETURNS CHARACTER
937 ( INPUT section-name
AS CHAR ) :
938 /*------------------------------------------------------------------------------
939 Purpose
: The header for the facilities section of the report.
941 ------------------------------------------------------------------------------*/
942 DEF VAR report
AS CHAR NO-UNDO INITIAL ''.
945 td
(Property.Name
, 'class
="propertyname" colspan
="5"'
) +
946 td
(section-name
, 'class
="sectionheader" colspan
="3"'
) +
947 td
(month-desc
(as-at-date
),'class
="reportmonth" colspan
="5"'
), ''
).
949 report
= tag
("thead", report
, 'class
="colhead"'
).
952 /* report
= tbl
(report
,'class
="header"'
).
*/
958 /* _UIB-CODE-BLOCK-END
*/
963 &IF DEFINED(EXCLUDE-do-1-financial-report) = 0 &THEN
965 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-1-financial-report Procedure
966 FUNCTION do-1-financial-report
RETURNS CHARACTER
967 ( /* parameter-definitions
*/ ) :
968 /*------------------------------------------------------------------------------
969 Purpose
: Returns nothing
- it always prints something.
970 ------------------------------------------------------------------------------*/
971 DEF VAR report
AS CHAR NO-UNDO INITIAL ''.
972 DEF VAR rrows
AS CHAR NO-UNDO INITIAL ''.
973 DEF VAR rrow
AS CHAR NO-UNDO.
974 DEF VAR found
AS LOGICAL NO-UNDO INITIAL No.
976 FIND FIRST account-total
WHERE ttype
= 'RENT'.
977 account-total.fyr-budget
= annual-income.
979 FIND FIRST account-total
WHERE ttype
= 'OGREC'.
980 account-total.fyr-budget
= annual-recexp.
983 tr
( empty
(13), 'class
="groupbreak"'
) +
985 td
("Income", 'colspan
="2"'
)
986 + td
("Ann. Passing", ''
)
987 + td
("Annual $PSM", ''
)
988 + td
("30June Fcast", ''
)
989 + td
("F'cast $PSM", ''
)
991 + td
("Month Actual", ''
)
992 + td
("Month Budget", ''
)
994 + td
("YTD Actual", ''
)
995 + td
("YTD Budget", ''
)
997 , ''
), 'class
="colhead"'
).
999 rrows
= financial-report-row
( 'RENT'
, 'Gross Income'
).
1000 rrows
= rrows
+ financial-report-row
( 'OGREC'
, 'Recoverable Outgoings'
).
1001 rrows
= rrows
+ financial-report-row
( 'OOI'
, 'One Off Income'
).
1002 rrows
= rrows
+ financial-report-row
( 'PROPEX'
, 'Opp Expense'
).
1003 rrows
= rrows
+ financial-report-row
( 'TENEX'
, 'One Off Expense'
).
1004 rrows
= rrows
+ financial-report-row
( 'OWNEX'
, 'Non-rec Outgoings'
).
1005 rrows
= rrows
+ financial-report-row
( 'NETINC'
, 'Net Income'
).
1007 report
= report
+ tbody
( rrows
, ''
) + tr
( empty
(15), 'class
="groupbreak"'
).
1008 RUN print-line
( report
).
1011 rrows
= tr
( td
('Yield'
, 'colspan
="5"'
)
1012 + td
(''
,'class
="groupbreak"'
)
1013 + td
('Financial Commentary'
, 'colspan
="8"'
)
1015 rrows
= rrows
+ tr
( td
("", 'colspan
="2" class
="leftmost"'
)
1016 + td
("Capital $", ''
)
1017 + td
("Actual Yield", ''
)
1018 + td
("F'cast Yield", ''
)
1019 + td
(''
,'class
="groupbreak"'
)
1020 + td
(''
,'colspan
="8" class
="notes"'
), ''
).
1022 report
= tbody
( rrows
, 'class
="colhead"'
).
1024 rrows
= tr
( td
('Purchase Price'
,'colspan
="2" align
="right" class
="leftmost"'
)
1025 + td-amount
(purchase-price
, money-format
, 'money'
)
1026 + td-amount
((net-income
/ purchase-price
) * 100, pcnt-format
, 'decimal'
)
1027 + td-amount
((net-frcast
/ purchase-price
) * 100, pcnt-format
, 'decimal'
)
1028 + td
(''
,'class
="groupbreak" rowspan
="2"'
)
1029 + td
(''
,'colspan
="7" class
="notes" rowspan
="2" style
="border-bottom-style:none;border-top-style:none"'
), ''
).
1031 DEF VAR account-sum
AS DECIMAL NO-UNDO.
1032 account-sum
= get-acctgrp-amnt
( true
, 'INVPRP'
).
1033 rrows
= rrows
+ tr
( td
('TCO to Date'
,'colspan
="2" align
="right" class
="leftmost"'
)
1034 + td-amount
(account-sum
, money-format
, 'money'
)
1035 + td-amount
((net-income
/ account-sum
) * 100, pcnt-format
, 'decimal'
)
1036 + td-amount
((net-frcast
/ account-sum
) * 100, pcnt-format
, 'decimal'
)
1037 , 'class
="bottom"'
).
1039 report
= report
+ tbody
( rrows
, ''
)
1040 + tr
( empty
(5) + td
(''
,'class
="groupbreak"'
)
1041 + td
(''
,'colspan
="7" class
="notes" style
="border-bottom-style:none;border-top-style:none"'
),
1042 'class
="groupbreak"'
).
1043 RUN print-line
( report
).
1046 /* Rent Distribution
*/
1047 rrows
= tr
( td
('RENT DISTRIBUTION'
, 'colspan
="5"'
)
1048 + td
(''
,'class
="groupbreak"'
)
1049 + td
(''
,'colspan
="7" class
="notes"'
), ''
).
1050 rrows
= rrows
+ tr
( td
("Income Type", 'colspan
="2"'
)
1051 + td
("$ of Income", ''
)
1052 + td
("% Gross Inc.", ''
)
1054 + td
(''
,'class
="groupbreak"'
)
1055 + td
(''
,'colspan
="7" class
="notes" style
="border-bottom-style:none;border-top-style:none"'
), ''
).
1057 report
= tbody
( rrows
, 'class
="colhead"'
).
1059 rrows
= tr
( td
('Office Rent'
, 'colspan
="2" class
="leftmost"'
)
1060 + td-amount
(office-rent
, money-format
, 'money'
)
1061 + td-amount
((office-rent
/ annual-income
) * 100, pcnt-format
, 'decimal'
)
1062 + td-amount
((office-rent
/ office-area
), psm-format
, 'decimal'
)
1063 + td
(''
,'class
="groupbreak" rowspan
="8"'
)
1064 + td
(''
,'colspan
="7" rowspan
="8" class
="notes bottom" style
="border-top-style:none"'
), ''
).
1066 rrows
= rrows
+ tr
( td
('Retail Rent'
, 'colspan
="2" class
="leftmost"'
)
1067 + td-amount
(retail-rent
, money-format
, 'money'
)
1068 + td-amount
((retail-rent
/ annual-income
) * 100, pcnt-format
, 'decimal'
)
1069 + td-amount
((retail-rent
/ retail-area
), psm-format
, 'decimal'
)
1072 rrows
= rrows
+ tr
( td
('Industrial Rent'
, 'colspan
="2" class
="leftmost"'
)
1073 + td-amount
(indust-rent
, money-format
, 'money'
)
1074 + td-amount
((indust-rent
/ annual-income
) * 100, pcnt-format
, 'decimal'
)
1075 + td-amount
((indust-rent
/ indust-area
), psm-format
, 'decimal'
)
1078 rrows
= rrows
+ tr
( td
('Carpark Rent'
, 'colspan
="2" class
="leftmost"'
)
1079 + td-amount
(carpk-rent
, money-format
, 'money'
)
1080 + td-amount
((carpk-rent
/ annual-income
) * 100, pcnt-format
, 'decimal'
)
1081 + td
(TRIM(STRING(((carpk-rent
/ Property.TotalParks
) / 52),money-format
)) + 'pw'
, 'class
="decimal"'
)
1084 rrows
= rrows
+ tr
( td
('Other Rent'
, 'colspan
="2" class
="leftmost"'
)
1085 + td-amount
(other-rent
, money-format
, 'money'
)
1086 + td-amount
((other-rent
/ annual-income
) * 100, pcnt-format
, 'decimal'
)
1087 + td-amount
((other-rent
/ other-area
), psm-format
, 'decimal'
)
1090 rrows
= rrows
+ tr
( td
('Retail'
, 'colspan
="2" class
="leftmost"'
)
1091 + td
(TRIM(STRING(retail-area
,money-format
)) + 'sqm'
, 'class
="money"'
)
1092 + td
('W.A.L.E'
, 'class
="subhead"'
)
1096 rrows
= rrows
+ tr
( td
('Office'
, 'colspan
="2" class
="leftmost"'
)
1097 + td
(TRIM(STRING(office-area
,money-format
)) + 'sqm'
, 'class
="money"'
)
1098 + td
('By Income'
, 'class
="subhead"'
)
1099 + td-amount
(wale-income
, area-format
, 'decimal'
)
1102 rrows
= rrows
+ tr
( td
('NLA'
, 'colspan
="2" class
="leftmost"'
)
1103 + td
(TRIM(STRING(total-area
,money-format
)) + 'sqm'
, 'class
="money"'
)
1104 + td
('By Area'
, 'class
="subhead"'
)
1105 + td-amount
(wale-area
, area-format
, 'decimal'
)
1106 , 'class
="bottom"'
).
1108 report
= report
+ tbody
( rrows
, ''
).
1109 RUN print-line
( report
).
1113 RUN print-line
( '
<tbody
>'
).
1115 FIND FIRST tenant-reviews
NO-LOCK.
1116 DO WHILE AVAILABLE(tenant-reviews
):
1117 RUN print-line
( tr
( EMPTY(3) + show-one-review
() + EMPTY(8), ''
) ).
1120 RUN print-line
( '
</tbody
>'
).
1125 /* _UIB-CODE-BLOCK-END
*/
1130 &IF DEFINED(EXCLUDE-do-2-arrears) = 0 &THEN
1132 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-2-arrears Procedure
1133 FUNCTION do-2-arrears
RETURNS CHARACTER
1134 ( /* parameter-definitions
*/ ) :
1135 /*------------------------------------------------------------------------------
1136 Purpose
: Get the current arrears for the tenants of this property.
1137 ------------------------------------------------------------------------------*/
1138 DEF VAR report
AS CHAR NO-UNDO.
1139 DEF VAR rrows
AS CHAR NO-UNDO.
1140 DEF VAR found
AS LOGICAL NO-UNDO INITIAL No.
1142 DEF VAR total-00
AS DECIMAL NO-UNDO INITIAL 0.0 .
1143 DEF VAR total-30
AS DECIMAL NO-UNDO INITIAL 0.0 .
1144 DEF VAR total-60
AS DECIMAL NO-UNDO INITIAL 0.0 .
1145 DEF VAR total-90
AS DECIMAL NO-UNDO INITIAL 0.0 .
1147 DEF VAR billings
AS DECIMAL NO-UNDO INITIAL 0.0 .
1148 DEF VAR receipts
AS DECIMAL NO-UNDO INITIAL 0.0 .
1149 DEF VAR arrears
AS DECIMAL NO-UNDO INITIAL 0.0 .
1151 DEF VAR month-30
AS INT NO-UNDO.
1152 DEF VAR month-60
AS INT NO-UNDO.
1153 DEF VAR month-90
AS INT NO-UNDO.
1156 tr
( empty
(13), 'class
="groupbreak"'
) +
1159 td
("Arrears", 'colspan
="8"'
)
1160 + td
(''
,'class
="groupbreak" rowspan
="2"'
)
1161 + td
("Arrears Commentary", 'colspan
="4" rowspan
="2"'
)
1165 + td
("Receipts", ''
)
1167 + td
("Total Arrears", ''
)
1171 + td
("90 days +", ''
)
1173 , 'class
="colhead"'
).
1175 FIND LAST Month
WHERE Month.EndDate
< as-at-date
NO-LOCK.
1176 month-30
= Month.MonthCode.
1177 FIND LAST Month
WHERE Month.MonthCode
< month-30
NO-LOCK.
1178 month-60
= Month.MonthCode.
1179 FIND LAST Month
WHERE Month.MonthCode
< month-60
NO-LOCK.
1180 month-90
= Month.MonthCode.
1183 FOR EACH Tenant
WHERE Tenant.EntityType
= 'P'
AND Tenant.EntityCode
= Property.PropertyCode
NO-LOCK,
1184 EACH AcctTran
WHERE AcctTran.EntityType
= 'T'
AND AcctTran.EntityCode
= Tenant.TenantCode
1185 AND AcctTran.AccountCode
= sundry-debtors
AND ClosedState
<> 'F'
NO-LOCK:
1186 IF AcctTran.MonthCode
> month-30
THEN DO:
1187 total-00
= total-00
+ AcctTran.Amount .
1189 ELSE IF AcctTran.MonthCode
> month-60
THEN DO:
1190 total-30
= total-30
+ AcctTran.Amount .
1192 ELSE IF AcctTran.MonthCode
> month-90
THEN DO:
1193 total-60
= total-60
+ AcctTran.Amount .
1196 total-90
= total-90
+ AcctTran.Amount .
1200 arrears
= total-00
+ total-30
+ total-60
+ total-90.
1202 FOR EACH Tenant
WHERE Tenant.EntityType
= 'P'
AND Tenant.EntityCode
= Property.PropertyCode
NO-LOCK,
1203 EACH AcctTran
WHERE AcctTran.EntityType
= 'T'
AND AcctTran.EntityCode
= Tenant.TenantCode
1204 AND AcctTran.AccountCode
= sundry-debtors
AND AcctTran.MonthCode
> month-30
NO-LOCK:
1205 IF AcctTran.Amount
> 0 THEN
1206 billings
= billings
+ AcctTran.Amount.
1208 receipts
= receipts
+ AcctTran.Amount.
1212 IF NOT found
THEN RETURN ''.
1215 td
(TRIM(STRING(billings
,money-format
)),'class
="money leftmost"'
)
1216 + td
(TRIM(STRING(receipts
,money-format
)),'class
="money"'
)
1218 + td
(TRIM(STRING(arrears
,money-format
)),'class
="money"'
)
1219 + td
(TRIM(STRING(total-00
,money-format
)),'class
="money"'
)
1220 + td
(TRIM(STRING(total-30
,money-format
)),'class
="money"'
)
1221 + td
(TRIM(STRING(total-60
,money-format
)),'class
="money"'
)
1222 + td
(TRIM(STRING(total-90
,money-format
)),'class
="money"'
)
1223 + td
(''
,'class
="groupbreak"'
)
1224 + td
( ''
,'colspan
="4" class
="rightmost"'
)
1228 td
(TRIM(STRING((arrears
/ billings
) * 100, pcnt-format
)), 'class
="decimal leftmost"'
)
1229 + td
(TRIM(STRING((arrears
/ receipts
) * 100, pcnt-format
)), 'class
="decimal"'
)
1230 + td
(''
,''
) + td
('
-'
,''
)
1231 + td
(TRIM(STRING((total-00
/ arrears
) * 100, pcnt-format
)), 'class
="decimal"'
)
1232 + td
(TRIM(STRING((total-30
/ arrears
) * 100, pcnt-format
)), 'class
="decimal"'
)
1233 + td
(TRIM(STRING((total-60
/ arrears
) * 100, pcnt-format
)), 'class
="decimal"'
)
1234 + td
(TRIM(STRING((total-90
/ arrears
) * 100, pcnt-format
)), 'class
="decimal"'
)
1235 + td
(''
,'class
="groupbreak"'
)
1236 + td
( ''
,'colspan
="4" class
="rightmost"'
)
1237 , 'class
="bottom"'
).
1239 report
= report
+ tbody
(rrows
,''
).
1245 /* _UIB-CODE-BLOCK-END
*/
1250 &IF DEFINED(EXCLUDE-do-3-vacancies) = 0 &THEN
1252 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-3-vacancies Procedure
1253 FUNCTION do-3-vacancies
RETURNS CHARACTER
1254 ( /* parameter-definitions
*/ ) :
1255 /*------------------------------------------------------------------------------
1256 Purpose
: Do the vacant space listing for the report.
1257 ------------------------------------------------------------------------------*/
1258 DEF VAR report
AS CHAR NO-UNDO.
1259 DEF VAR rrows
AS CHAR NO-UNDO.
1260 DEF VAR rrow
AS CHAR NO-UNDO.
1261 DEF VAR found
AS LOGICAL NO-UNDO INITIAL No.
1263 DEF VAR vacant-area
AS DECIMAL NO-UNDO INITIAL 0.0 .
1264 DEF VAR vacant-rent
AS DECIMAL NO-UNDO INITIAL 0.0 .
1266 report
= tr
( empty
(13), 'class
="groupbreak"'
) +
1269 td
("Leasing Activity", 'colspan
="9"'
)
1270 + td
(''
,'class
="groupbreak" rowspan
="2"'
)
1271 + td
("Leasing Commentary", 'colspan
="3" rowspan
="2"'
)
1274 td
("Vacant Unit", ''
)
1278 + td
("Rent Income PA", ''
)
1279 + td
("New Deals", ''
)
1280 + td
("Type of Deal", ''
)
1281 + td
("Rent Income PA", ''
)
1282 + td
("Gross $PSM", ''
)
1283 , ''
), 'class
="colhead"'
).
1285 FOR EACH RentalSpace
OF Property
WHERE RentalSpace.AreaStatus
= "V"
1286 OR NOT CAN-FIND( TenancyLease
OF RentalSpace
WHERE TenancyLease.LeaseStatus
<> "PAST") NO-LOCK
1287 BY RentalSpace.PropertyCode
BY RentalSpace.Level
BY RentalSpace.LevelSequence
:
1288 rrow
= td
(RentalSpace.Description
,'class
="leftmost"'
).
1289 rrow
= rrow
+ td
( TRIM(STRING(RentalSpace.AreaSize
,area-format
)),'class
="decimal"'
).
1290 rrow
= rrow
+ td
( TRIM(STRING(RentalSpace.MarketRental
/ RentalSpace.AreaSize
,money-format
)),'class
="decimal"'
).
1291 rrow
= rrow
+ td
( TRIM(STRING((RentalSpace.AreaSize
/ total-area
)* 100,pcnt-format
)),'class
="decimal"'
).
1292 rrow
= rrow
+ td
( TRIM(STRING(RentalSpace.MarketRental
,money-format
)),'class
="money"'
).
1293 rrow
= rrow
+ td
(''
,''
) + td
(''
,''
) + td
(''
,''
) + td
(''
,''
)
1294 + td
( ''
,'class
="groupbreak"'
)
1295 + td
( ''
,'colspan
="4" class
="rightmost"'
).
1297 rrows
= rrows
+ tr
(rrow
,''
).
1299 IF test-floor-space
(RentalSpace.AreaType
,RentalSpace.AreaSize
) = "Yes" THEN DO:
1300 vacant-area
= vacant-area
+ RentalSpace.AreaSize.
1301 vacant-rent
= vacant-rent
+ RentalSpace.MarketRental.
1307 IF NOT found
THEN RETURN ''.
1310 td
(''
, 'class
="leftmost"'
)
1311 + td
(TRIM(STRING(vacant-area
,area-format
)), 'class
="decimal"'
)
1312 + td
(TRIM(STRING(vacant-rent
/ vacant-area
,money-format
)), 'class
="decimal"'
)
1313 + td
(TRIM(STRING((vacant-area
/ total-area
)* 100,pcnt-format
)), 'class
="decimal"'
)
1314 + td
(TRIM(STRING(vacant-rent
,money-format
)), 'class
="money"'
)
1315 + td
(''
,''
) + td
(''
,''
) + td
(''
,''
) + td
(''
,''
)
1316 + td
( ''
,'class
="groupbreak" style
="border-top-style:none"'
)
1317 + td
( ''
,'colspan
="4" class
="rightmost"'
)
1318 , 'class
="bottom"'
).
1320 report
= report
+ tbody
(rrows
,''
) + tbody
(rrow
,'class
="totals"'
).
1322 report
= report
+ notes-section
("Tenant Activity Report by Exception", 5).
1323 report
= report
+ notes-section
("Outstanding Legal Issues", 4).
1329 /* _UIB-CODE-BLOCK-END
*/
1334 &IF DEFINED(EXCLUDE-do-3a-reviews) = 0 &THEN
1336 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-3a-reviews Procedure
1337 FUNCTION do-3a-reviews
RETURNS CHARACTER
1338 ( /* parameter-definitions
*/ ) :
1339 /*------------------------------------------------------------------------------
1342 ------------------------------------------------------------------------------*/
1343 DEF VAR report
AS CHAR NO-UNDO INITIAL ''.
1344 DEF VAR rowclass
AS CHAR NO-UNDO INITIAL ''.
1346 report
= tr
( empty
(14), 'class
="groupbreak"'
) +
1349 td
("Rent Reviews", 'colspan
="8"'
)
1350 + td
(''
,'class
="groupbreak" rowspan
="2"'
)
1351 + td
("Review Notes", 'colspan
="4" rowspan
="2"'
)
1354 td
("Tenant Name", 'colspan
="4"'
)
1355 + td
("Date Due", ''
)
1357 + td
("Basis", 'colspan
="2"'
)
1358 , ''
), 'class
="colhead"'
).
1360 report
= report
+ '
<tbody
>'.
1361 FOR EACH tenant-reviews
NO-LOCK BREAK BY Static
:
1362 IF LAST-OF(Static
) THEN DO:
1363 rowclass
= 'class
="bottom"'.
1365 report
= report
+ tr
(
1366 td
( tenant-reviews.TenantName
, 'colspan
="4" class
="leftmost"'
)
1367 + td
( STRING(tenant-reviews.DateDue
, '
99/99/9999'
), 'date'
)
1368 + td
( tenant-reviews.ReviewType
, ''
)
1369 + td
( tenant-reviews.EstimateBasis
, 'colspan
="2"'
)
1370 + td
( ''
,'class
="groupbreak"'
)
1371 + td
( ''
,'colspan
="4" class
="rightmost"'
)
1374 report
= report
+ '
</tbody
>'.
1380 /* _UIB-CODE-BLOCK-END
*/
1385 &IF DEFINED(EXCLUDE-do-4-building-income) = 0 &THEN
1387 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-4-building-income Procedure
1388 FUNCTION do-4-building-income
RETURNS CHARACTER
1389 ( /* parameter-definitions
*/ ) :
1390 /*------------------------------------------------------------------------------
1391 Purpose
: Get the current arrears for the tenants of this property.
1392 ------------------------------------------------------------------------------*/
1393 DEF VAR report
AS CHAR NO-UNDO INITIAL ''.
1395 DEF VAR month-from
AS INT NO-UNDO.
1396 DEF VAR month-to
AS INT NO-UNDO.
1397 DEF VAR fin-year
AS INT NO-UNDO.
1398 DEF VAR totals
AS DECIMAL EXTENT 6 NO-UNDO INITIAL 0.0 .
1400 DEF VAR mth-actual
AS DECIMAL NO-UNDO INITIAL 0.0 .
1401 DEF VAR mth-budget
AS DECIMAL NO-UNDO INITIAL 0.0 .
1402 DEF VAR ytd-actual
AS DECIMAL NO-UNDO INITIAL 0.0 .
1403 DEF VAR ytd-budget
AS DECIMAL NO-UNDO INITIAL 0.0 .
1404 DEF VAR fyr-budget
AS DECIMAL NO-UNDO INITIAL 0.0 .
1405 DEF VAR fyr-frcast
AS DECIMAL NO-UNDO INITIAL 0.0 .
1407 DEF VAR mth-actual-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
1408 DEF VAR mth-budget-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
1409 DEF VAR ytd-actual-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
1410 DEF VAR ytd-budget-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
1411 DEF VAR fyr-budget-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
1412 DEF VAR fyr-frcast-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
1414 DEF VAR mth-actual-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
1415 DEF VAR mth-budget-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
1416 DEF VAR ytd-actual-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
1417 DEF VAR ytd-budget-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
1418 DEF VAR fyr-budget-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
1419 DEF VAR fyr-frcast-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
1421 FIND LAST Month
WHERE Month.StartDate
< as-at-date
NO-LOCK.
1422 month-to
= Month.MonthCode.
1423 fin-year
= Month.FinancialYearCode.
1424 FIND FIRST Month
WHERE Month.FinancialYearCode
= fin-year
NO-LOCK.
1425 month-from
= Month.MonthCode.
1426 FIND LAST Month
WHERE Month.FinancialYearCode
= fin-year
NO-LOCK.
1428 DEF VAR last-section
AS CHAR INITIAL ?.
1429 DEF VAR this-section
AS CHAR INITIAL ?.
1430 FOR EACH ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountGroupCode
= 'PROPEX'
BY NAME:
1431 IF INDEX( ChartOfAccount.
NAME, '
-'
) = 0 THEN NEXT.
1432 this-section
= TRIM( ENTRY( 1, ChartOfAccount.
NAME, '
-'
) ).
1433 IF this-section
<> last-section
THEN DO:
1434 IF last-section
<> ?
THEN DO:
1435 report
= report
+ tr
(
1436 td
(last-section
, 'colspan
="2" class
="leftmost"'
)
1437 + td
(TRIM(STRING(mth-actual-t
,money-format
)), 'class
="money"'
)
1438 + td
(TRIM(STRING(mth-budget-t
,money-format
)), 'class
="money"'
)
1439 + td
(TRIM(STRING(ytd-actual-t
,money-format
)), 'class
="money"'
)
1440 + td
(TRIM(STRING(ytd-budget-t
,money-format
)), 'class
="money"'
)
1441 + td
(TRIM(STRING(fyr-budget-t
,money-format
)), 'class
="money"'
)
1442 + td
(TRIM(STRING(fyr-frcast-t
,money-format
)), 'class
="money"'
)
1443 + td
(TRIM(STRING( (fyr-frcast-t
/ total-area
), money-format
)), 'class
="money"'
)
1444 + td
(TRIM(STRING(((fyr-frcast-t
- fyr-budget-t
) / fyr-budget-t
) * 100,pcnt-format
)), 'class
="decimal"'
)
1445 + empty
(1) + td
(''
,'colspan
="5" class
="rightmost"'
)
1448 mth-actual-g
= mth-actual-g
+ mth-actual-t.
1449 mth-budget-g
= mth-budget-g
+ mth-budget-t.
1450 ytd-actual-g
= ytd-actual-g
+ ytd-actual-t.
1451 ytd-budget-g
= ytd-budget-g
+ ytd-budget-t.
1452 fyr-budget-g
= fyr-budget-g
+ fyr-budget-t.
1453 fyr-frcast-g
= fyr-frcast-g
+ fyr-frcast-t.
1458 tr
( empty
(15), 'class
="groupbreak"'
) +
1460 td
("Account", 'colspan
="2"'
)
1461 + td
("Mth Actual", ''
)
1462 + td
("Mth Budget", ''
)
1463 + td
("YTD Actual", ''
)
1464 + td
("YTD Budget", ''
)
1465 + td
("FY Budget", ''
)
1466 + td
("FY Forecast", ''
)
1468 + td
("Variance", ''
)
1469 + td
("PCA Rate", ''
)
1470 + td
("Comments", 'colspan
="5"'
)
1471 , ''
), 'class
="colhead"'
).
1473 mth-actual-t
= 0.0 .
1474 mth-budget-t
= 0.0 .
1475 ytd-actual-t
= 0.0 .
1476 ytd-budget-t
= 0.0 .
1477 fyr-budget-t
= 0.0 .
1478 fyr-frcast-t
= 0.0 .
1479 last-section
= this-section.
1481 add-building-account
( month-from
, month-to
, mth-actual
, mth-budget
,
1482 ytd-actual
, ytd-budget
, fyr-budget
, fyr-frcast
).
1484 IF mth-actual
<> 0.0 OR mth-budget
<> 0.0
1485 OR ytd-actual
<> 0.0 OR ytd-budget
<> 0.0
1486 OR fyr-frcast
<> 0.0 OR ytd-budget
<> 0.0
1489 mth-actual-t
= mth-actual-t
+ mth-actual.
1490 mth-budget-t
= mth-budget-t
+ mth-budget.
1491 ytd-actual-t
= ytd-actual-t
+ ytd-actual.
1492 ytd-budget-t
= ytd-budget-t
+ ytd-budget.
1493 fyr-budget-t
= fyr-budget-t
+ fyr-budget.
1494 fyr-frcast-t
= fyr-frcast-t
+ fyr-frcast.
1499 IF last-section
= ?
THEN RETURN ''.
1501 report
= report
+ tr
(
1502 td
(last-section
, 'colspan
="2" class
="leftmost"'
)
1503 + td
(TRIM(STRING(mth-actual-t
,money-format
)), 'class
="money"'
)
1504 + td
(TRIM(STRING(mth-budget-t
,money-format
)), 'class
="money"'
)
1505 + td
(TRIM(STRING(ytd-actual-t
,money-format
)), 'class
="money"'
)
1506 + td
(TRIM(STRING(ytd-budget-t
,money-format
)), 'class
="money"'
)
1507 + td
(TRIM(STRING(fyr-budget-t
,money-format
)), 'class
="money"'
)
1508 + td
(TRIM(STRING(fyr-frcast-t
,money-format
)), 'class
="money"'
)
1509 + td
(TRIM(STRING( (fyr-frcast-t
/ total-area
), money-format
)), 'class
="money"'
)
1510 + td
(TRIM(STRING(((fyr-frcast-t
- fyr-budget-t
) / fyr-budget-t
) * 100,pcnt-format
)), 'class
="decimal"'
)
1511 + empty
(1) + td
(''
,'colspan
="5" class
="rightmost"'
)
1514 mth-actual-g
= mth-actual-g
+ mth-actual-t.
1515 mth-budget-g
= mth-budget-g
+ mth-budget-t.
1516 ytd-actual-g
= ytd-actual-g
+ ytd-actual-t.
1517 ytd-budget-g
= ytd-budget-g
+ ytd-budget-t.
1518 fyr-budget-g
= fyr-budget-g
+ fyr-budget-t.
1519 fyr-frcast-g
= fyr-frcast-g
+ fyr-frcast-t.
1521 report
= report
+ tbody
( tr
(
1522 td
("Property Expense Totals", 'colspan
="2" class
="leftmost"'
)
1523 + td
(TRIM(STRING(mth-actual-g
,money-format
)), 'class
="money"'
)
1524 + td
(TRIM(STRING(mth-budget-g
,money-format
)), 'class
="money"'
)
1525 + td
(TRIM(STRING(ytd-actual-g
,money-format
)), 'class
="money"'
)
1526 + td
(TRIM(STRING(ytd-budget-g
,money-format
)), 'class
="money"'
)
1527 + td
(TRIM(STRING(fyr-budget-g
,money-format
)), 'class
="money"'
)
1528 + td
(TRIM(STRING(fyr-frcast-g
,money-format
)), 'class
="money"'
)
1529 + td
(TRIM(STRING( (fyr-frcast-g
/ total-area
), money-format
)), 'class
="money"'
)
1530 + td
(TRIM(STRING(((fyr-frcast-g
- fyr-budget-g
) / fyr-budget-g
) * 100,pcnt-format
)), 'class
="decimal"'
)
1531 + empty
(1) + td
(''
,'colspan
="5" class
="rightmost"'
)
1532 , 'class
="bottom"'
), 'class
="totals"'
).
1538 /* _UIB-CODE-BLOCK-END
*/
1543 &IF DEFINED(EXCLUDE-do-5-capital-works) = 0 &THEN
1545 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-5-capital-works Procedure
1546 FUNCTION do-5-capital-works
RETURNS CHARACTER
1547 ( /* parameter-definitions
*/ ) :
1548 /*------------------------------------------------------------------------------
1551 ------------------------------------------------------------------------------*/
1552 DEF VAR report
AS CHAR NO-UNDO INITIAL ''.
1553 DEF VAR rrows
AS CHAR NO-UNDO INITIAL ''.
1554 DEF VAR i
AS INT NO-UNDO INITIAL 0.
1556 report
= tr
( empty
(13), 'class
="groupbreak"'
) +
1559 td
("Capital Works", 'colspan
="9"'
)
1560 + td
(''
,'class
="groupbreak" rowspan
="2"'
)
1561 + td
("Notes", 'colspan
="3" rowspan
="2"'
)
1564 td
("Scope of Works", 'colspan
="3"'
)
1568 + td
("Un-Budgeted", ''
)
1569 + td
("Target Completed", ''
)
1570 + td
("Actual Completion", ''
)
1571 , ''
), 'class
="colhead"'
).
1576 td
( ''
, 'colspan
="3" class
="empty leftmost"'
)
1577 + EMPTY(1) + EMPTY(1) + EMPTY(1)
1578 + EMPTY(1) + EMPTY(1) + EMPTY(1)
1579 + td
( ''
,'class
="groupbreak"'
)
1580 + td
( ''
,'colspan
="3" class
="rightmost"'
)
1583 report
= report
+ tbody
( rrows
, ''
).
1587 td
("Exceptions", 'colspan
="3"'
)
1588 + td
("Works", 'colspan
="2"'
)
1589 + td
("Expenditure", 'colspan
="4"'
)
1590 + td
(''
,'class
="groupbreak"'
)
1591 + td
("", 'colspan
="3" class
="notes"'
)
1592 , ''
), 'class
="colhead"'
).
1597 td
( ''
, 'colspan
="3" class
="empty leftmost"'
)
1600 + td
( ''
,'class
="groupbreak"'
)
1601 + td
( ''
,'colspan
="3" class
="rightmost"'
)
1605 td
( ''
, 'colspan
="3" class
="empty leftmost"'
)
1608 + td
( ''
,'class
="groupbreak"'
)
1609 + td
( ''
,'colspan
="3" class
="rightmost"'
)
1610 , 'class
="bottom"'
).
1611 report
= report
+ tbody
( rrows
, ''
).
1617 /* _UIB-CODE-BLOCK-END
*/
1622 &IF DEFINED(EXCLUDE-do-6-call-register) = 0 &THEN
1624 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION do-6-call-register Procedure
1625 FUNCTION do-6-call-register
RETURNS CHARACTER
1626 ( /* parameter-definitions
*/ ) :
1627 /*------------------------------------------------------------------------------
1628 Purpose
: Do the vacant space listing for the report.
1629 ------------------------------------------------------------------------------*/
1630 DEF VAR report
AS CHAR NO-UNDO.
1631 DEF VAR rrows
AS CHAR NO-UNDO.
1632 DEF VAR rrow
AS CHAR NO-UNDO.
1633 DEF VAR found
AS LOGICAL NO-UNDO INITIAL No.
1635 DEF VAR tenant-name
AS CHAR NO-UNDO INITIAL ''.
1636 DEF VAR service-description
AS CHAR NO-UNDO INITIAL ''.
1638 report
= tr
( empty
(13), 'class
="groupbreak"'
) +
1641 td
("FM Call Register", 'colspan
="13"'
)
1646 + td
("Completed", ''
)
1647 + td
("Tenant", 'colspan
="2"'
)
1648 + td
("Category", 'colspan
="2"'
)
1649 + td
("Description", 'colspan
="3"'
)
1650 + td
("Notes", 'colspan
="4"'
)
1651 , ''
), 'class
="colhead"'
).
1653 FOR EACH TenantCall
OF Property
NO-LOCK
1654 WHERE TenantCall.CallStatusCode
<> 'Closed'
OR TenantCall.DateComplete
> add-months
(as-at-date
, -1)
1655 BY TenantCall.CallCategoryCode
BY TenantCall.CallNumber
DESC:
1657 IF found
THEN rrows
= rrows
+ tr
(rrow
,''
).
1658 FIND FIRST Tenant
OF TenantCall
NO-LOCK NO-ERROR.
1659 tenant-name
= 'Tenant record not available.'.
1660 IF AVAILABLE(Tenant
) THEN tenant-name
= Tenant.
NAME.
1661 FIND FIRST ServiceType
WHERE ServiceType.ServiceType
= TenantCall.CallCategoryCode
NO-LOCK NO-ERROR.
1662 service-description
= 'Service Type record not available.'.
1663 IF AVAILABLE(ServiceType
) THEN service-description
= ServiceType.
DESCRIPTION.
1666 TenantCall.Action TenantCall.CallCategoryCode TenantCall.CallNumber
1667 TenantCall.CallStatusCode TenantCall.ContactName TenantCall.ContactPhone
1668 TenantCall.CreditorCode TenantCall.DateComplete TenantCall.DateOfCall
1669 TenantCall.Description TenantCall.LastEmailDate TenantCall.Level
1670 TenantCall.LoggedBy TenantCall.OrderAmount TenantCall.OrderNo
1671 TenantCall.Priority TenantCall.Problem TenantCall.PropertyCode
1672 TenantCall.SendEmail TenantCall.TenantCode TenantCall.TimeComplete
1673 TenantCall.TimeOfCall
1675 rrow
= td
( display-date-with-time
(TenantCall.DateOfCall
, TenantCall.TimeOfCall
),'class
="leftmost"'
).
1676 rrow
= rrow
+ td
( TenantCall.CallStatusCode
, ''
).
1677 rrow
= rrow
+ td
( STRING(TenantCall.DateComplete
, '
99/99/9999'
), ''
).
1678 rrow
= rrow
+ td
( tenant-name
, 'colspan
="2"'
).
1679 rrow
= rrow
+ td
( service-description
, 'colspan
="2"'
).
1680 rrow
= rrow
+ td
( TenantCall.
DESCRIPTION, 'colspan
="3"'
)
1681 + td
( ''
,'colspan
="4" class
="rightmost"'
).
1685 IF found
THEN rrows
= rrows
+ tr
(rrow
,'class
="bottom"'
).
1687 report
= report
+ tbody
(rrows
,''
).
1688 report
= report
+ notes-section
("General commentary - Facilities Management", 10).
1694 /* _UIB-CODE-BLOCK-END
*/
1699 &IF DEFINED(EXCLUDE-empty) = 0 &THEN
1701 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION empty Procedure
1702 FUNCTION empty
RETURNS CHARACTER
1703 ( INPUT num
AS INT ) :
1704 /*------------------------------------------------------------------------------
1705 Purpose
: Return some empty cells
1706 ------------------------------------------------------------------------------*/
1708 RETURN td
("", 'colspan
="' + TRIM(STRING(num,">>9")) + '" class
="empty"'
).
1712 /* _UIB-CODE-BLOCK-END
*/
1717 &IF DEFINED(EXCLUDE-financial-report-row) = 0 &THEN
1719 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION financial-report-row Procedure
1720 FUNCTION financial-report-row
RETURNS CHARACTER
1721 ( INPUT in-ttype
AS CHAR, INPUT line-desc
AS CHAR ) :
1722 /*------------------------------------------------------------------------------
1725 ------------------------------------------------------------------------------*/
1726 DEF VAR answer
AS CHAR NO-UNDO INITIAL ''.
1727 DEF VAR i
AS INT NO-UNDO.
1728 DEF VAR style
AS CHAR NO-UNDO INITIAL 'decimal'.
1729 DEF VAR rowstyle
AS CHAR NO-UNDO INITIAL ''.
1730 DEFINE BUFFER net-income-buffer
FOR account-total.
1732 FIND FIRST account-total
WHERE ttype
= in-ttype
NO-ERROR.
1733 IF NOT AVAILABLE(account-total
) THEN DO:
1735 answer
= answer
+ td
(''
,''
).
1737 answer
= tr
( td
(line-desc
, 'colspan
="2" class
="leftmost"'
) + answer
+ td
(''
,'class
="rightmost"'
), ''
).
1741 IF in-ttype
= 'NETINC'
THEN DO:
1742 net-income
= account-total.fyr-budget.
1743 net-frcast
= account-total.fyr-frcast.
1744 style
= 'moneytotal'.
1745 rowstyle
= 'class
="bottom"'.
1747 answer
= tr
( td
(line-desc
, 'colspan
="2" class
="leftmost"'
)
1748 + td-amount
(account-total.fyr-budget
, money-format
, style
)
1749 + td-amount
(account-total.fyr-budget
/ total-area
, psm-format
, style
)
1751 + td-amount
(account-total.fyr-frcast
, money-format
, style
)
1752 + td-amount
(account-total.fyr-frcast
/ total-area
, psm-format
, style
)
1753 */ + td
(''
,''
) + td
(''
,''
)
1754 + td-amount
(((account-total.fyr-frcast
- account-total.fyr-budget
) / account-total.fyr-budget
) * 100, pcnt-format
, style
)
1755 + td-amount
(account-total.mth-actual
, money-format
, style
)
1756 + td-amount
(account-total.mth-budget
, money-format
, style
)
1757 + td-amount
(((account-total.mth-budget
- account-total.mth-actual
) / account-total.mth-actual
) * 100, pcnt-format
, style
)
1758 + td-amount
(account-total.ytd-actual
, money-format
, style
)
1759 + td-amount
(account-total.ytd-budget
, money-format
, style
)
1760 + td-amount
(((account-total.ytd-budget
- account-total.ytd-actual
) / account-total.ytd-actual
) * 100, pcnt-format
, style
+ ' rightmost'
)
1763 FIND FIRST net-income-buffer
WHERE net-income-buffer.ttype
= 'NETINC'
NO-ERROR.
1764 IF NOT AVAILABLE(net-income-buffer
) THEN DO:
1765 CREATE net-income-buffer.
1766 net-income-buffer.ttype
= 'NETINC'.
1768 net-income-buffer.mth-actual
= net-income-buffer.mth-actual
+ account-total.mth-actual.
1769 net-income-buffer.mth-budget
= net-income-buffer.mth-budget
+ account-total.mth-budget.
1770 net-income-buffer.ytd-actual
= net-income-buffer.ytd-actual
+ account-total.ytd-actual.
1771 net-income-buffer.ytd-budget
= net-income-buffer.ytd-budget
+ account-total.ytd-budget.
1772 net-income-buffer.fyr-budget
= net-income-buffer.fyr-budget
+ account-total.fyr-budget.
1773 net-income-buffer.fyr-frcast
= net-income-buffer.fyr-frcast
+ account-total.fyr-frcast.
1779 /* _UIB-CODE-BLOCK-END
*/
1784 &IF DEFINED(EXCLUDE-get-acctgrp-amnt) = 0 &THEN
1786 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-acctgrp-amnt Procedure
1787 FUNCTION get-acctgrp-amnt
RETURNS DECIMAL
1788 ( INPUT actual
AS LOGICAL, INPUT acctgrp
AS CHAR ) :
1789 /*------------------------------------------------------------------------------
1790 Purpose
: Get the sum of the accounts in a particular entity
1791 ------------------------------------------------------------------------------*/
1792 IF NOT AVAILABLE(Property
) THEN RETURN 0.0 .
1794 DEF VAR sum
AS DECIMAL NO-UNDO INITIAL 0.0 .
1796 FOR EACH ChartOfAccount
WHERE ChartOfAccount.AccountGroupCode
= acctgrp
NO-LOCK:
1797 FOR EACH AccountSummary
WHERE EntityType
= 'P'
AND EntityCode
= PropertyCode
1798 AND AccountSummary.AccountCode
= ChartOfAccount.AccountCode
NO-LOCK:
1799 sum
= sum
+ (IF actual
THEN AccountSummary.Balance
ELSE AccountSummary.Budget
).
1807 /* _UIB-CODE-BLOCK-END
*/
1812 &IF DEFINED(EXCLUDE-get-prop-og) = 0 &THEN
1814 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-prop-og Procedure
1815 FUNCTION get-prop-og
RETURNS DECIMAL
1816 ( INPUT doit
AS LOGICAL, INPUT pc
AS INTEGER, INPUT ac
AS DECIMAL ) :
1817 /*------------------------------------------------------------------------------
1820 ------------------------------------------------------------------------------*/
1821 IF doit
<> Yes
THEN RETURN 1.0 .
1822 FIND PropertyOutgoing
WHERE PropertyOutgoing.PropertyCode
= pc
1823 AND PropertyOutgoing.AccountCode
= ac
NO-LOCK NO-ERROR.
1824 IF AVAILABLE(PropertyOutgoing
) THEN
1825 RETURN PropertyOutgoing.BudgetAmount
/ 100 .
1831 /* _UIB-CODE-BLOCK-END
*/
1836 &IF DEFINED(EXCLUDE-lease-years-remaining) = 0 &THEN
1838 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION lease-years-remaining Procedure
1839 FUNCTION lease-years-remaining
RETURNS DECIMAL
1840 ( /* parameter-definitions
*/ ) :
1842 /*------------------------------------------------------------------------------
1843 Purpose
: How much time is remaining on this lease
1844 ------------------------------------------------------------------------------*/
1845 FIND TenancyLease
OF RentalSpace
WHERE TenancyLease.LeaseStatus
<> "PAST" NO-LOCK NO-ERROR.
1846 IF NOT AVAILABLE(TenancyLease
) THEN RETURN 0.0 .
1848 DEF VAR remaining
AS DECIMAL.
1849 remaining
= TenancyLease.LeaseEndDate
- as-at-date.
1850 IF remaining
= ?
OR remaining
< 30.4375 THEN DO:
1851 remaining
= 30.4375.
1853 remaining
= remaining
/ 365.25.
1859 /* _UIB-CODE-BLOCK-END
*/
1864 &IF DEFINED(EXCLUDE-notes-section) = 0 &THEN
1866 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION notes-section Procedure
1867 FUNCTION notes-section
RETURNS CHARACTER
1868 ( INPUT section-title
AS CHAR, INPUT section-lines
AS INT ) :
1869 /*------------------------------------------------------------------------------
1870 Purpose
: Put in a blank section for random notes
1871 ------------------------------------------------------------------------------*/
1872 DEF VAR report
AS CHAR NO-UNDO.
1873 DEF VAR rrows
AS CHAR NO-UNDO.
1874 DEF VAR i
AS INT NO-UNDO.
1876 report
= tr
( empty
(13), 'class
="groupbreak"'
) +
1877 tbody
( tr
( td
(section-title
, 'colspan
="13"'
), ''
), 'class
="colhead"'
).
1880 DO i
= 2 TO section-lines
:
1881 rrows
= rrows
+ tr
( td
(''
,'colspan
="13" class
="empty leftmost rightmost"'
), ''
).
1883 rrows
= rrows
+ tr
( td
(''
,'colspan
="13" class
="empty leftmost rightmost"'
), 'class
="bottom"'
).
1885 report
= report
+ tbody
(rrows
,'class
="notes"'
).
1891 /* _UIB-CODE-BLOCK-END
*/
1896 &IF DEFINED(EXCLUDE-prepare-building-account) = 0 &THEN
1898 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION prepare-building-account Procedure
1899 FUNCTION prepare-building-account
RETURNS CHARACTER
1900 ( INPUT month-from
AS INT, INPUT month-to
AS INT,
1901 OUTPUT mth-actual
AS DECIMAL, OUTPUT mth-budget
AS DECIMAL,
1902 OUTPUT ytd-actual
AS DECIMAL, OUTPUT ytd-budget
AS DECIMAL,
1903 OUTPUT fyr-budget
AS DECIMAL, OUTPUT fyr-frcast
AS DECIMAL
1905 /*------------------------------------------------------------------------------
1908 ------------------------------------------------------------------------------*/
1909 DEF VAR rrow
AS CHAR NO-UNDO INITIAL ''.
1910 DEF VAR acctgroup
AS CHAR NO-UNDO.
1912 mth-actual
= 0.0 . mth-budget
= 0.0 .
1913 ytd-actual
= 0.0 . ytd-budget
= 0.0 .
1914 fyr-budget
= 0.0 . fyr-frcast
= 0.0 .
1915 FOR EACH AccountBalance
NO-LOCK WHERE
1916 AccountBalance.EntityType
= 'P'
AND
1917 AccountBalance.EntityCode
= Property.PropertyCode
AND
1918 AccountBalance.AccountCode
= ChartOfAccount.AccountCode
AND
1919 AccountBalance.MonthCode
>= month-from
AND
1920 AccountBalance.MonthCode
<= Month.MonthCode
:
1922 IF AccountBalance.MonthCode
= month-to
THEN DO:
1923 mth-actual
= AccountBalance.Balance.
1924 mth-budget
= AccountBalance.Budget.
1927 IF AccountBalance.MonthCode
<= month-to
THEN DO:
1928 ytd-actual
= ytd-actual
+ AccountBalance.Balance.
1929 ytd-budget
= ytd-budget
+ AccountBalance.Budget.
1930 fyr-frcast
= fyr-frcast
+ AccountBalance.Balance.
1933 fyr-frcast
= fyr-frcast
+ AccountBalance.Budget.
1936 fyr-budget
= fyr-budget
+ AccountBalance.Budget.
1940 IF mth-actual
<> 0.0 OR mth-budget
<> 0.0
1941 OR ytd-actual
<> 0.0 OR ytd-budget
<> 0.0
1942 OR fyr-frcast
<> 0.0 OR ytd-budget
<> 0.0
1945 td
(ChartOfAccount.Name
, 'colspan
="2" class
="leftmost"'
)
1946 + td
(TRIM(STRING(mth-actual
,money-format
)), 'class
="money"'
)
1947 + td
(TRIM(STRING(mth-budget
,money-format
)), 'class
="money"'
)
1948 + td
(TRIM(STRING(ytd-actual
,money-format
)), 'class
="money"'
)
1949 + td
(TRIM(STRING(ytd-budget
,money-format
)), 'class
="money"'
)
1950 + td
(TRIM(STRING(fyr-budget
,money-format
)), 'class
="money"'
)
1951 + td
(TRIM(STRING(fyr-frcast
,money-format
)), 'class
="money"'
)
1952 + td
(TRIM(STRING( (fyr-frcast
/ total-area
), money-format
)), 'class
="money"'
)
1953 + td
(TRIM(STRING(((fyr-frcast
- fyr-budget
) / fyr-budget
) * 100,pcnt-format
)), 'class
="decimal"'
)
1954 + td
(''
, 'colspan
="3" class
="empty rightmost"'
), ''
).
1956 acctgroup
= ChartOfAccount.AccountGroupCode.
1957 FIND FIRST account-total
WHERE ttype
= acctgroup
NO-ERROR.
1958 IF NOT AVAILABLE(account-total
) THEN DO:
1959 CREATE account-total.
1962 account-total.mth-actual
= account-total.mth-actual
- mth-actual.
1963 account-total.mth-budget
= account-total.mth-budget
- mth-budget.
1964 account-total.ytd-actual
= account-total.ytd-actual
- ytd-actual.
1965 account-total.ytd-budget
= account-total.ytd-budget
- ytd-budget.
1966 account-total.fyr-frcast
= account-total.fyr-frcast
- fyr-frcast.
1967 account-total.fyr-budget
= account-total.fyr-budget
- fyr-budget.
1974 /* _UIB-CODE-BLOCK-END
*/
1979 &IF DEFINED(EXCLUDE-prepare-building-income) = 0 &THEN
1981 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION prepare-building-income Procedure
1982 FUNCTION prepare-building-income
RETURNS CHARACTER
1983 ( /* parameter-definitions
*/ ) :
1984 /*------------------------------------------------------------------------------
1987 ------------------------------------------------------------------------------*/
1988 IF building-income-report
= ?
THEN DO:
1989 DEF VAR report
AS CHAR NO-UNDO.
1990 DEF VAR rrows
AS CHAR NO-UNDO INITIAL ''.
1991 DEF VAR rrow
AS CHAR NO-UNDO.
1992 DEF VAR found
AS LOGICAL NO-UNDO INITIAL No.
1994 DEF VAR month-from
AS INT NO-UNDO.
1995 DEF VAR month-to
AS INT NO-UNDO.
1996 DEF VAR fin-year
AS INT NO-UNDO.
1997 DEF VAR totals
AS DECIMAL EXTENT 6 NO-UNDO INITIAL 0.0 .
1999 DEF VAR mth-actual
AS DECIMAL NO-UNDO INITIAL 0.0 .
2000 DEF VAR mth-budget
AS DECIMAL NO-UNDO INITIAL 0.0 .
2001 DEF VAR ytd-actual
AS DECIMAL NO-UNDO INITIAL 0.0 .
2002 DEF VAR ytd-budget
AS DECIMAL NO-UNDO INITIAL 0.0 .
2003 DEF VAR fyr-budget
AS DECIMAL NO-UNDO INITIAL 0.0 .
2004 DEF VAR fyr-frcast
AS DECIMAL NO-UNDO INITIAL 0.0 .
2006 DEF VAR mth-actual-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
2007 DEF VAR mth-budget-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
2008 DEF VAR ytd-actual-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
2009 DEF VAR ytd-budget-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
2010 DEF VAR fyr-budget-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
2011 DEF VAR fyr-frcast-t
AS DECIMAL NO-UNDO INITIAL 0.0 .
2013 DEF VAR mth-actual-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
2014 DEF VAR mth-budget-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
2015 DEF VAR ytd-actual-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
2016 DEF VAR ytd-budget-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
2017 DEF VAR fyr-budget-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
2018 DEF VAR fyr-frcast-g
AS DECIMAL NO-UNDO INITIAL 0.0 .
2020 FIND LAST Month
WHERE Month.StartDate
< as-at-date
NO-LOCK.
2021 month-to
= Month.MonthCode.
2022 fin-year
= Month.FinancialYearCode.
2023 FIND FIRST Month
WHERE Month.FinancialYearCode
= fin-year
NO-LOCK.
2024 month-from
= Month.MonthCode.
2025 FIND LAST Month
WHERE Month.FinancialYearCode
= fin-year
NO-LOCK.
2028 tr
( empty
(15), 'class
="groupbreak"'
) +
2030 td
("Account", 'colspan
="2"'
)
2031 + td
("Mth Actual", ''
)
2032 + td
("Mth Budget", ''
)
2033 + td
("YTD Actual", ''
)
2034 + td
("YTD Budget", ''
)
2035 + td
("FY Budget", ''
)
2036 + td
("FY Forecast", ''
)
2038 + td
("Variance", ''
)
2039 + td
("Notes", 'colspan
="6"'
)
2040 , ''
), 'class
="colhead"'
).
2042 /* A pass through the rent accounts
, for the financial report. We don't show these
*/
2043 FOR EACH ChartOfAccount
NO-LOCK WHERE
2044 ( ChartOfAccount.AccountGroupCode
= 'RENT'
) OR
2045 ( ChartOfAccount.AccountGroupCode
= 'OGREC'
) OR
2046 ( ChartOfAccount.AccountGroupCode
= 'OOI'
):
2047 rrow
= prepare-building-account
( month-from
, month-to
, mth-actual
, mth-budget
,
2048 ytd-actual
, ytd-budget
, fyr-budget
, fyr-frcast
).
2051 FOR EACH ChartOfAccount
NO-LOCK WHERE
2052 ( ChartOfAccount.AccountGroupCode
= 'PROPEX'
) OR
2053 ( ChartOfAccount.AccountGroupCode
= 'TENEX'
) OR
2054 ( ChartOfAccount.AccountGroupCode
= 'LEASNG'
):
2056 rrow
= prepare-building-account
( month-from
, month-to
, mth-actual
, mth-budget
,
2057 ytd-actual
, ytd-budget
, fyr-budget
, fyr-frcast
).
2059 IF mth-actual
<> 0.0 OR mth-budget
<> 0.0
2060 OR ytd-actual
<> 0.0 OR ytd-budget
<> 0.0
2061 OR fyr-frcast
<> 0.0 OR ytd-budget
<> 0.0
2064 rrows
= rrows
+ rrow.
2066 mth-actual-t
= mth-actual-t
+ mth-actual.
2067 mth-budget-t
= mth-budget-t
+ mth-budget.
2068 ytd-actual-t
= ytd-actual-t
+ ytd-actual.
2069 ytd-budget-t
= ytd-budget-t
+ ytd-budget.
2070 fyr-budget-t
= fyr-budget-t
+ fyr-budget.
2071 fyr-frcast-t
= fyr-frcast-t
+ fyr-frcast.
2076 IF rrows
<> ''
THEN DO:
2077 mth-actual-g
= mth-actual-g
+ mth-actual-t.
2078 mth-budget-g
= mth-budget-g
+ mth-budget-t.
2079 ytd-actual-g
= ytd-actual-g
+ ytd-actual-t.
2080 ytd-budget-g
= ytd-budget-g
+ ytd-budget-t.
2081 fyr-budget-g
= fyr-budget-g
+ fyr-budget-t.
2082 fyr-frcast-g
= fyr-frcast-g
+ fyr-frcast-t.
2084 report
= report
+ tbody
( rrows
, ''
).
2086 report
= report
+ tbody
( tr
(
2087 td
("General Expense Totals", 'colspan
="2" class
="leftmost"'
)
2088 + td
(TRIM(STRING(mth-actual-t
,money-format
)), 'class
="money"'
)
2089 + td
(TRIM(STRING(mth-budget-t
,money-format
)), 'class
="money"'
)
2090 + td
(TRIM(STRING(ytd-actual-t
,money-format
)), 'class
="money"'
)
2091 + td
(TRIM(STRING(ytd-budget-t
,money-format
)), 'class
="money"'
)
2092 + td
(TRIM(STRING(fyr-budget-t
,money-format
)), 'class
="money"'
)
2093 + td
(TRIM(STRING(fyr-frcast-t
,money-format
)), 'class
="money"'
)
2094 + td
(TRIM(STRING( (fyr-frcast-t
/ total-area
), money-format
)), 'class
="money"'
)
2095 + td
(TRIM(STRING(((fyr-frcast-t
- fyr-budget-t
) / fyr-budget-t
) * 100,pcnt-format
)), 'class
="decimal"'
)
2096 + td
( ''
, 'colspan
="3" class
="rightmost"'
)
2097 , ''
), 'class
="totals"'
).
2099 mth-actual-t
= 0.0 .
2100 mth-budget-t
= 0.0 .
2101 ytd-actual-t
= 0.0 .
2102 ytd-budget-t
= 0.0 .
2103 fyr-budget-t
= 0.0 .
2104 fyr-frcast-t
= 0.0 .
2108 FOR EACH ChartOfAccount
NO-LOCK WHERE
2109 ( ChartOfAccount.AccountGroupCode
= 'OWNEX'
):
2111 rrow
= prepare-building-account
( month-from
, month-to
, mth-actual
, mth-budget
,
2112 ytd-actual
, ytd-budget
, fyr-budget
, fyr-frcast
).
2114 IF mth-actual
<> 0.0 OR mth-budget
<> 0.0
2115 OR ytd-actual
<> 0.0 OR ytd-budget
<> 0.0
2116 OR fyr-frcast
<> 0.0 OR ytd-budget
<> 0.0
2119 rrows
= rrows
+ rrow.
2121 mth-actual-t
= mth-actual-t
+ mth-actual.
2122 mth-budget-t
= mth-budget-t
+ mth-budget.
2123 ytd-actual-t
= ytd-actual-t
+ ytd-actual.
2124 ytd-budget-t
= ytd-budget-t
+ ytd-budget.
2125 fyr-budget-t
= fyr-budget-t
+ fyr-budget.
2126 fyr-frcast-t
= fyr-frcast-t
+ fyr-frcast.
2131 IF NOT found
THEN RETURN ''.
2133 IF rrows
<> ''
THEN DO:
2134 mth-actual-g
= mth-actual-g
+ mth-actual-t.
2135 mth-budget-g
= mth-budget-g
+ mth-budget-t.
2136 ytd-actual-g
= ytd-actual-g
+ ytd-actual-t.
2137 ytd-budget-g
= ytd-budget-g
+ ytd-budget-t.
2138 fyr-budget-g
= fyr-budget-g
+ fyr-budget-t.
2139 fyr-frcast-g
= fyr-frcast-g
+ fyr-frcast-t.
2142 report
= report
+ tbody
( rrows
, ''
).
2144 report
= report
+ tbody
( tr
(
2145 td
("Owners Expense Totals", 'colspan
="2"class
="leftmost"'
)
2146 + td
(TRIM(STRING(mth-actual-t
,money-format
)), 'class
="money"'
)
2147 + td
(TRIM(STRING(mth-budget-t
,money-format
)), 'class
="money"'
)
2148 + td
(TRIM(STRING(ytd-actual-t
,money-format
)), 'class
="money"'
)
2149 + td
(TRIM(STRING(ytd-budget-t
,money-format
)), 'class
="money"'
)
2150 + td
(TRIM(STRING(fyr-budget-t
,money-format
)), 'class
="money"'
)
2151 + td
(TRIM(STRING(fyr-frcast-t
,money-format
)), 'class
="money"'
)
2152 + td
(TRIM(STRING( (fyr-frcast-t
/ total-area
), money-format
)), 'class
="money"'
)
2153 + td
(TRIM(STRING(((fyr-frcast-t
- fyr-budget-t
) / fyr-budget-t
) * 100,pcnt-format
)), 'class
="decimal"'
)
2154 + td
( ''
, 'colspan
="3" class
="rightmost"'
)
2155 , ''
), 'class
="totals"'
).
2158 report
= report
+ tbody
( tr
(
2159 td
("Building Expense Totals", 'colspan
="2" class
="leftmost"'
)
2160 + td
(TRIM(STRING(mth-actual-g
,money-format
)), 'class
="money"'
)
2161 + td
(TRIM(STRING(mth-budget-g
,money-format
)), 'class
="money"'
)
2162 + td
(TRIM(STRING(ytd-actual-g
,money-format
)), 'class
="money"'
)
2163 + td
(TRIM(STRING(ytd-budget-g
,money-format
)), 'class
="money"'
)
2164 + td
(TRIM(STRING(fyr-budget-g
,money-format
)), 'class
="money"'
)
2165 + td
(TRIM(STRING(fyr-frcast-g
,money-format
)), 'class
="money"'
)
2166 + td
(TRIM(STRING( (fyr-frcast-g
/ total-area
), money-format
)), 'class
="money"'
)
2167 + td
(TRIM(STRING(((fyr-frcast-g
- fyr-budget-g
) / fyr-budget-g
) * 100,pcnt-format
)), 'class
="decimal"'
)
2168 + td
( ''
, 'colspan
="3" class
="rightmost"'
)
2169 , 'class
="bottom"'
), 'class
="totals"'
).
2171 building-income-report
= report.
2174 RETURN building-income-report.
2178 /* _UIB-CODE-BLOCK-END
*/
2183 &IF DEFINED(EXCLUDE-show-one-review) = 0 &THEN
2185 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION show-one-review Procedure
2186 FUNCTION show-one-review
RETURNS CHARACTER
2187 ( /* no parameter-definitions
*/ ) :
2188 /*------------------------------------------------------------------------------
2189 Purpose
: Return a string containing one review.
2191 ------------------------------------------------------------------------------*/
2192 DEF VAR cells
AS CHAR NO-UNDO INITIAL "".
2194 IF NOT AVAILABLE(tenant-reviews
) THEN DO:
2198 cells
= td
( tenant-reviews.TenantName
, ''
)
2199 + td
( STRING(tenant-reviews.DateDue
, '
99/99/9999'
), 'date'
)
2200 + td
( tenant-reviews.ReviewType
, ''
)
2201 + td
( tenant-reviews.EstimateBasis
, ''
).
2202 FIND NEXT tenant-reviews.
2209 /* _UIB-CODE-BLOCK-END
*/
2214 &IF DEFINED(EXCLUDE-tbl) = 0 &THEN
2216 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION tbl Procedure
2217 FUNCTION tbl
RETURNS CHARACTER
2218 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) :
2219 /*------------------------------------------------------------------------------
2220 Purpose
: Shorthand for specific html tag
, 'table' is a reserved word.
2221 ------------------------------------------------------------------------------*/
2223 RETURN tag
("table", content
, attributes
).
2227 /* _UIB-CODE-BLOCK-END
*/
2232 &IF DEFINED(EXCLUDE-tbody) = 0 &THEN
2234 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION tbody Procedure
2235 FUNCTION tbody
RETURNS CHARACTER
2236 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) :
2237 /*------------------------------------------------------------------------------
2239 ------------------------------------------------------------------------------*/
2241 RETURN tag
("tbody", content
, attributes
) + "~n".
2245 /* _UIB-CODE-BLOCK-END
*/
2250 &IF DEFINED(EXCLUDE-td) = 0 &THEN
2252 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION td Procedure
2253 FUNCTION td
RETURNS CHARACTER
2254 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) :
2255 /*------------------------------------------------------------------------------
2256 Purpose
: Shorthand for specific html tag
2257 ------------------------------------------------------------------------------*/
2259 RETURN " " + tag
("td", content
, attributes
) + "~n".
2263 /* _UIB-CODE-BLOCK-END
*/
2268 &IF DEFINED(EXCLUDE-td-amount) = 0 &THEN
2270 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION td-amount Procedure
2271 FUNCTION td-amount
RETURNS CHARACTER
2272 ( INPUT amount
AS DECIMAL, INPUT fmt
AS CHAR, INPUT class
AS CHAR ) :
2273 /*------------------------------------------------------------------------------
2274 Purpose
: Return an appropriate attribute string for negative amounts.
2275 ------------------------------------------------------------------------------*/
2276 DEF VAR attributes
AS CHAR NO-UNDO INITIAL ''.
2278 attributes
= "class='" + class
+ "'".
2280 IF amount
< 0.0 THEN attributes
= attributes
+ ' style
="color:red"'.
2282 RETURN td
( TRIM(STRING(amount
,fmt
)), attributes
).
2286 /* _UIB-CODE-BLOCK-END
*/
2291 &IF DEFINED(EXCLUDE-test-floor-space) = 0 &THEN
2293 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION test-floor-space Procedure
2294 FUNCTION test-floor-space
RETURNS CHARACTER
2295 ( INPUT type
AS CHAR, INPUT area
AS DECIMAL ) :
2296 /*------------------------------------------------------------------------------
2297 Purpose
: Decide if this is actual floor space
2298 ------------------------------------------------------------------------------*/
2299 DEF BUFFER LocAreaType
FOR AreaType.
2301 IF area
= ?
THEN RETURN "No".
2302 FIND LocAreaType
WHERE LocAreaType.AreaType
= type
NO-LOCK NO-ERROR.
2303 IF AVAILABLE(LocAreaType
) THEN DO:
2304 IF LocAreaType.IsCarPark
THEN RETURN "Park".
2305 IF LocAreaType.IsFloorArea
THEN RETURN "Yes".
2310 WHEN "C" THEN RETURN "Park".
2311 WHEN "O" THEN RETURN "Yes".
2312 WHEN "R" THEN RETURN "Yes".
2313 WHEN "W" THEN RETURN "Yes".
2314 WHEN "N" THEN RETURN "No".
2316 IF area
> 10 OR (area
<> INTEGER(area
)) THEN RETURN "Yes".
*/
2323 /* _UIB-CODE-BLOCK-END
*/
2328 &IF DEFINED(EXCLUDE-tr) = 0 &THEN
2330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION tr Procedure
2331 FUNCTION tr
RETURNS CHARACTER
2332 ( INPUT content
AS CHAR, INPUT attributes
AS CHAR ) :
2333 /*------------------------------------------------------------------------------
2334 Purpose
: Shorthand for specific html tag
2335 ------------------------------------------------------------------------------*/
2337 RETURN " " + tag
("tr", content
, attributes
) + "~n".
2341 /* _UIB-CODE-BLOCK-END
*/