1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
10 ------------------------------------------------------------------------*/
11 /* *************************** Definitions
************************** */
12 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
14 DEF VAR preview
AS LOGICAL NO-UNDO.
15 DEF VAR exporting
AS LOGICAL NO-UNDO INITIAL No.
16 DEF VAR debug-mode
AS LOGICAL NO-UNDO INITIAL No.
17 DEF VAR file-name
AS CHAR NO-UNDO INITIAL ?.
18 DEF VAR selection-style
AS CHAR NO-UNDO INITIAL "RP".
19 DEF VAR show-warnings
AS LOGI
NO-UNDO INITIAL Yes.
20 DEF VAR level-summaries
AS LOGI
NO-UNDO INITIAL Yes.
21 DEF VAR agent-version
AS LOGI
NO-UNDO INITIAL No.
22 DEF VAR i-e-summary
AS LOGI
NO-UNDO INITIAL Yes.
23 DEF VAR show-notes
AS LOGI
NO-UNDO INITIAL No.
24 DEF VAR pro-rate-og
AS LOGI
NO-UNDO INITIAL No.
25 DEF VAR property-1
AS INTEGER NO-UNDO.
26 DEF VAR property-n
AS INTEGER NO-UNDO.
29 DEF VAR no-on-level
AS INT NO-UNDO.
30 DEF VAR printing-level-info
AS LOGI
NO-UNDO INITIAL No.
32 DEF VAR l-area
AS DEC NO-UNDO INITIAL 0.
33 DEF VAR l-rental
AS DEC NO-UNDO INITIAL 0.
34 DEF VAR l-ogpercent
AS DEC NO-UNDO INITIAL 0.
35 DEF VAR l-ogbudget
AS DEC NO-UNDO INITIAL 0.
36 DEF VAR l-cleaning
AS DEC NO-UNDO INITIAL 0.
37 DEF VAR l-noparks
AS DEC NO-UNDO INITIAL 0.
38 DEF VAR l-parking
AS DEC NO-UNDO INITIAL 0.
39 DEF VAR l-sundry
AS DEC NO-UNDO INITIAL 0.
41 DEF VAR g-area
AS DEC NO-UNDO INITIAL 0.
42 DEF VAR g-rental
AS DEC NO-UNDO INITIAL 0.
43 DEF VAR g-ogpercent
AS DEC NO-UNDO INITIAL 0.
44 DEF VAR g-ogbudget
AS DEC NO-UNDO INITIAL 0.
45 DEF VAR g-cleaning
AS DEC NO-UNDO INITIAL 0.
46 DEF VAR g-noparks
AS DEC NO-UNDO INITIAL 0.
47 DEF VAR g-parking
AS DEC NO-UNDO INITIAL 0.
48 DEF VAR g-sundry
AS DEC NO-UNDO INITIAL 0.
50 DEF VAR base-font
AS CHAR NO-UNDO INITIAL "courier,lpi,12,cpi,23,normal,fixed".
51 DEF VAR page-reset
AS CHAR NO-UNDO INITIAL "reset,landscape,lm,3,tm,4".
52 DEF VAR property-header-font
AS CHAR NO-UNDO INITIAL "Helvetica,point,16,proportional,bold".
53 DEF VAR page-header-font
AS CHAR NO-UNDO INITIAL "Helvetica,point,12,proportional,bold".
54 DEF VAR error-font1
AS CHAR NO-UNDO INITIAL "courier,lpi,10,cpi,18,normal,bold,fixed".
55 DEF VAR error-font2
AS CHAR NO-UNDO INITIAL "courier,lpi,9,cpi,18,normal,italic,fixed".
57 DEF TEMP-TABLE LevelInfo
NO-UNDO
58 FIELD LevelNo
AS INT INITIAL 999
59 FIELD LevelSeq
AS INT INITIAL 999
60 FIELD LevelCode
AS CHAR INITIAL "??"
61 FIELD TenantCode
AS INT INITIAL ?
62 FIELD LeaseCode
AS INT INITIAL ?
63 FIELD LevelInfoType
AS CHAR INITIAL "V"
64 FIELD AreaType
AS CHAR INITIAL ""
65 FIELD TenantName
AS CHAR INITIAL "* * * Vacant * * *"
66 FIELD LevelArea
AS DEC INITIAL 0
67 FIELD LevelRental
AS DEC INITIAL 0
68 FIELD OGPercent
AS DEC INITIAL 0
69 FIELD LeaseType
AS CHAR INITIAL ""
70 FIELD LeaseTypeBase
AS CHAR INITIAL ""
71 FIELD OGBase
AS CHAR INITIAL ""
72 FIELD OGBudget
AS DEC INITIAL 0
73 FIELD Cleaning
AS DEC INITIAL 0
74 FIELD NoParks
AS INT INITIAL 0
75 FIELD Parking
AS DEC INITIAL 0
76 FIELD LeaseStart
AS DATE INITIAL ?
77 FIELD RentStart
AS DATE INITIAL ?
78 FIELD LeaseTerm
AS CHAR INITIAL ""
79 FIELD LeaseExpiry
AS DATE INITIAL ?
80 FIELD LeaseOption
AS CHAR INITIAL ""
81 FIELD AreaNotes
AS CHAR INITIAL ""
82 INDEX XPKLevelInfo
IS PRIMARY UNIQUE LevelNo LevelSeq.
84 DEF TEMP-TABLE SundryCharge
NO-UNDO
85 FIELD LeaseCode
AS INT INITIAL 999
86 FIELD Amount
AS DEC INITIAL 0
87 FIELD Description
AS CHAR INITIAL "Sundry"
88 INDEX XPKSundryCharges
IS PRIMARY LeaseCode.
90 DEF TEMP-TABLE XRentReview
NO-UNDO
91 FIELD LeaseCode
AS INT INITIAL ?
92 FIELD ReviewDate
AS DATE INITIAL ?
93 FIELD ReviewType
AS CHAR INITIAL ""
94 INDEX XPKRentReviews
IS PRIMARY LeaseCode ReviewDate.
96 DEF TEMP-TABLE LeaseDone
NO-UNDO
97 FIELD LeaseCode
AS INT
100 FIELD OGBudget
AS DEC INITIAL 0
101 FIELD OGPercent
AS DEC INITIAL 0
102 FIELD LeasedArea
AS DEC INITIAL 0
103 FIELD LeaseNotes
AS CHAR
104 INDEX XPKLeasesDone
IS UNIQUE PRIMARY LeaseCode
105 INDEX XAK1LevelSeq
IS UNIQUE LevelNo LevelSeq.
107 DEF TEMP-TABLE LeaseRental
NO-UNDO
108 FIELD LeaseCode
AS INT
109 FIELD AreaType
AS CHAR
110 FIELD AnnualRent
AS DEC
111 FIELD AreaSize
AS DEC
112 INDEX XPKLeaseRentals
IS UNIQUE PRIMARY LeaseCode AreaType.
114 DEF TEMP-TABLE HeadLease
NO-UNDO
115 FIELD TenancyLeaseCode
AS INT
116 FIELD HeadLeaseCode
AS INT
117 INDEX XPKLCode
IS UNIQUE PRIMARY TenancyLeaseCode
118 INDEX XAKLCode HeadLeaseCode TenancyLeaseCode.
121 {inc
/ofc-set.i
"Statutory-Expense-Accounts" "stat-accounts"}
122 {inc
/ofc-set-l.i
"Use-Rent-Charges" "use-rent-charges"}
123 {inc
/ofc-set.i
"RentCharge-Outgoings" "og-rentcharge-type"}
124 {inc
/ofc-set.i
"Schedule-AGP-Agent-Excludes" "agent-exclude-types"}
126 /* _UIB-CODE-BLOCK-END
*/
130 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
132 /* ******************** Preprocessor Definitions
******************** */
134 &Scoped-define PROCEDURE-TYPE Procedure
138 /* _UIB-PREPROCESSOR-BLOCK-END
*/
142 /* ************************ Function Prototypes
********************** */
144 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD get-level-code Procedure
145 FUNCTION get-level-code
RETURNS CHARACTER
146 ( /* parameter-definitions
*/ ) FORWARD.
148 /* _UIB-CODE-BLOCK-END
*/
151 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD get-levelinfo-type Procedure
152 FUNCTION get-levelinfo-type
RETURNS CHARACTER
153 ( INPUT type
AS CHAR, INPUT Area
AS DEC ) FORWARD.
155 /* _UIB-CODE-BLOCK-END
*/
158 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD head-lease Procedure
159 FUNCTION head-lease
RETURNS INTEGER
160 ( INPUT lease-code
AS INT ) FORWARD.
162 /* _UIB-CODE-BLOCK-END
*/
165 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION-FORWARD to-annual Procedure
166 FUNCTION to-annual
RETURNS DECIMAL
167 ( INPUT period-amount
AS DEC, INPUT freq-type
AS CHAR ) FORWARD.
169 /* _UIB-CODE-BLOCK-END
*/
173 /* *********************** Procedure Settings
************************ */
175 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
176 /* Settings for
THIS-PROCEDURE
180 Add Fields to
: Neither
181 Other Settings
: CODE-ONLY
COMPILE
183 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
185 /* ************************* Create Window
************************** */
187 &ANALYZE-SUSPEND _CREATE-WINDOW
188 /* DESIGN Window definition
(used by the UIB
)
189 CREATE WINDOW Procedure
ASSIGN
192 /* END WINDOW DEFINITION
*/
198 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
199 /* ************************* Included-Libraries
*********************** */
203 {inc
/method
/m-txtrep.i
}
205 /* _UIB-CODE-BLOCK-END
*/
210 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
213 /* *************************** Main Block
*************************** */
215 RUN pclrep-start
( preview
, page-reset
+ "," + base-font
).
216 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES APPEND.
218 FOR EACH Property
WHERE Property.Active
AND Property.PropertyCode
>= property-1
219 AND Property.PropertyCode
<= property-n
221 RUN property-schedule.
222 IF i-e-summary
THEN RUN print-i-e-summary.
229 /* _UIB-CODE-BLOCK-END
*/
233 /* ********************** Internal Procedures
*********************** */
235 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE add-level-info Procedure
236 PROCEDURE add-level-info
:
237 /*------------------------------------------------------------------------------
241 ------------------------------------------------------------------------------*/
242 IF debug-mode
THEN RUN pclrep-line
( error-font1
, "Adding Level Information").
243 no-on-level
= no-on-level
+ 1.
245 l-area
= l-area
+ LevelInfo.LevelArea.
246 l-rental
= l-rental
+ LevelInfo.LevelRental.
247 l-cleaning
= l-cleaning
+ LevelInfo.Cleaning.
248 l-noparks
= l-noparks
+ LevelInfo.NoParks.
249 l-parking
= l-parking
+ LevelInfo.Parking.
250 IF AVAILABLE(LeaseDone
) THEN ASSIGN
251 l-ogbudget
= l-ogbudget
+ LeaseDone.OGBudget
252 l-ogpercent
= l-ogpercent
+ LeaseDone.OGPercent.
254 l-ogpercent
= l-ogpercent
+ LevelInfo.OGPercent.
256 FOR EACH SundryCharge
OF LeaseDone
:
257 l-sundry
= l-sundry
+ SundryCharge.Amount.
260 g-area
= g-area
+ LevelInfo.LevelArea.
261 g-rental
= g-rental
+ LevelInfo.LevelRental.
262 g-cleaning
= g-cleaning
+ LevelInfo.Cleaning.
263 g-noparks
= g-noparks
+ LevelInfo.NoParks.
264 g-parking
= g-parking
+ LevelInfo.Parking.
265 IF AVAILABLE(LeaseDone
) THEN ASSIGN
266 g-ogbudget
= g-ogbudget
+ LeaseDone.OGBudget
267 g-ogpercent
= g-ogpercent
+ LeaseDone.OGPercent.
269 g-ogpercent
= g-ogpercent
+ LevelInfo.OGPercent.
271 FOR EACH SundryCharge
OF LeaseDone
:
272 g-sundry
= g-sundry
+ SundryCharge.Amount.
277 /* _UIB-CODE-BLOCK-END
*/
281 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE build-head-leases Procedure
282 PROCEDURE build-head-leases
:
283 /*------------------------------------------------------------------------------
285 ------------------------------------------------------------------------------*/
286 DEF BUFFER OtherSpace
FOR RentalSpace.
287 DEF BUFFER OtherLease
FOR HeadLease.
289 DEF VAR hlease
AS INT NO-UNDO.
290 FOR EACH RentalSpace
OF Property
WHERE RentalSpace.AreaStatus
= "L" NO-LOCK:
291 FIND TenancyLease
OF RentalSpace
NO-LOCK NO-ERROR.
293 IF NOT( AVAILABLE(TenancyLease
) ) THEN DO:
294 RUN pclrep-line
( error-font1
, "Error: Rental space at level " + STRING(RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSeq
) + " "
295 + " - " + RentalSpace.Description
+ " - marked as 'leased', but no lease record is associated!").
299 hlease
= head-lease
( RentalSpace.TenancyLeaseCode
).
300 IF hlease
<> ?
THEN NEXT.
302 FOR EACH OtherSpace
OF Property
WHERE OtherSpace.Level
= RentalSpace.Level
303 AND OtherSpace.LevelSeq
= RentalSpace.LevelSeq
304 AND OtherSpace.AreaStatus
= "L" NO-LOCK:
305 hlease
= head-lease
( OtherSpace.TenancyLeaseCode
).
306 IF hlease
<> ?
THEN LEAVE other-space-loop.
309 IF hlease
= ?
THEN hlease
= RentalSpace.TenancyLeaseCode.
311 HeadLease.TenancyLeaseCode
= RentalSpace.TenancyLeaseCode.
312 HeadLease.HeadLeaseCode
= hlease.
315 FOR EACH HeadLease
BY HeadLease.HeadLeaseCode
:
316 FIND LeaseDone
WHERE LeaseDone.LeaseCode
= HeadLease.HeadLeaseCode
NO-ERROR.
317 IF NOT AVAILABLE(LeaseDone
) THEN DO:
319 LeaseDone.LeaseCode
= HeadLease.HeadLeaseCode.
320 LeaseDone.LevelNo
= ?.
321 LeaseDone.LevelSeq
= ?.
323 FIND TenancyLease
OF HeadLease
NO-LOCK.
324 IF CAN-FIND( FIRST RentalSpace
OF TenancyLease
WHERE CAN-FIND(FIRST AreaType
OF RentalSpace
WHERE AreaType.IsFloorArea
) ) THEN ASSIGN
325 /* LeaseDone.OGBudget
= LeaseDone.OGBudget
+ null-dec
( TenancyLease.OutgoingsBudget
, 0.0) */
326 LeaseDone.OGPercent
= LeaseDone.OGPercent
+ null-dec
( TenancyLease.OutgoingsRate
, 0.0).
328 FIND Note
OF TenancyLease
NO-LOCK NO-ERROR.
329 IF AVAILABLE(Note
) THEN
330 LeaseDone.LeaseNotes
= LeaseDone.LeaseNotes
+ TRIM(Note.Detail
) + "~n".
332 FOR EACH RentCharge
OF TenancyLease
NO-LOCK,
333 EACH RentChargeLine
OF RentCharge
WHERE RentChargeLine.RentChargeLineStatus
= "C" NO-LOCK:
334 IF RentChargeLine.StartDate
> TODAY THEN NEXT.
335 IF RentChargeLine.EndDate
< TODAY THEN NEXT.
336 IF agent-version
AND LOOKUP( RentCharge.RentChargeType
, agent-exclude-types
) > 0 THEN
338 ELSE IF RentCharge.RentChargeType
= og-rentcharge-type
THEN DO:
339 LeaseDone.OGBudget
= LeaseDone.OGBudget
+ to-annual
( RentChargeLine.Amount
, RentChargeLine.FrequencyCode
).
341 ELSE IF CAN-FIND( FIRST RentalSpace
OF TenancyLease
WHERE RentalSpace.AreaType
= RentCharge.RentChargeType
) THEN DO:
342 FIND LeaseRental
OF LeaseDone
WHERE LeaseRental.AreaType
= RentCharge.RentChargeType
NO-ERROR.
343 IF NOT AVAILABLE(LeaseRental
) THEN DO:
345 LeaseRental.LeaseCode
= LeaseDone.LeaseCode.
346 LeaseRental.AreaType
= RentCharge.RentChargeType.
347 FOR EACH OtherLease
WHERE OtherLease.HeadLeaseCode
= HeadLease.HeadLeaseCode
,
348 EACH RentalSpace
OF Property
WHERE RentalSpace.TenancyLeaseCode
= OtherLease.TenancyLeaseCode
349 AND RentalSpace.AreaType
= RentCharge.RentChargeType
NO-LOCK:
350 LeaseRental.AreaSize
= LeaseRental.AreaSize
+ RentalSpace.AreaSize.
351 FIND FIRST AreaType
OF RentalSpace
NO-LOCK NO-ERROR.
352 /* MESSAGE STRING(RentalSpace.TenancyLeaseCode
, ">>>9") STRING(LeaseRental.LeaseCode
, ">>>9") STRING(LeaseRental.AreaType
,"X(4)") STRING(LeaseRental.AreaSize
,"->>,>>>,>>9.99") STRING(RentalSpace.Level
,"->9") STRING(RentalSpace.LevelSeq
, "->9") RentalSpace.Description .
*/
353 IF AVAILABLE(AreaType
) AND AreaType.IsFloorArea
THEN
354 LeaseDone.LeasedArea
= LeaseDone.LeasedArea
+ RentalSpace.AreaSize.
357 LeaseRental.AnnualRent
= LeaseRental.AnnualRent
+ to-annual
( RentChargeLine.Amount
, RentChargeLine.FrequencyCode
).
360 RUN new-sundrycharge
( to-annual
( RentChargeLine.Amount
, RentChargeLine.FrequencyCode
),
361 RentCharge.RentChargeType
, RentCharge.Description
, LeaseDone.LeaseCode
).
368 /* _UIB-CODE-BLOCK-END
*/
372 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE build-level-info Procedure
373 PROCEDURE build-level-info
:
374 /*------------------------------------------------------------------------------
375 Purpose
: Set up the work tables
376 ------------------------------------------------------------------------------*/
377 DEF VAR contract-rental
AS DEC NO-UNDO.
379 DEF BUFFER OtherSpace
FOR RentalSpace.
380 /* Clear existing tables
*/
381 FOR EACH LevelInfo
: DELETE LevelInfo.
END.
382 FOR EACH SundryCharge
: DELETE SundryCharge.
END.
383 FOR EACH XRentReview
: DELETE XRentReview.
END.
384 FOR EACH LeaseDone
: DELETE LeaseDone.
END.
385 FOR EACH HeadLease
: DELETE HeadLease.
END.
386 FOR EACH LeaseRental
: DELETE LeaseRental.
END.
388 RUN build-head-leases.
389 FOR EACH RentalSpace
OF Property
WHERE RentalSpace.AreaStatus
<> "X" NO-LOCK
390 BY RentalSpace.PropertyCode
BY RentalSpace.Level
BY RentalSpace.LevelSeq
:
391 FIND LevelInfo
WHERE /* LevelInfo.LeaseCode
= head-lease
(RentalSpace.TenancyLeaseCode
)
392 AND */ LevelInfo.LevelNo
= RentalSpace.Level
393 AND LevelInfo.LevelSeq
= RentalSpace.LevelSequence
NO-ERROR.
394 IF NOT AVAILABLE(LevelInfo
) THEN
396 ELSE IF LevelInfo.LeaseCode
<> ?
AND INDEX( "CV", RentalSpace.AreaStatus
) > 0 THEN DO:
397 RUN pclrep-line
( error-font1
, "Error: Level " + STRING(RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSeq
)
398 + " - Same sequence is assigned to two leases: "
399 + STRING(LevelInfo.LeaseCode
) + " and "
400 + STRING(RentalSpace.TenancyLeaseCode
) ).
403 FIND Note
OF RentalSpace
NO-LOCK NO-ERROR.
404 IF AVAILABLE(Note
) THEN DO:
405 LevelInfo.AreaNotes
= TRIM(LevelInfo.AreaNotes
) + "~n" + Note.Detail.
408 FIND TenancyLease
WHERE TenancyLease.TenancyLeaseCode
= RentalSpace.TenancyLeaseCode
NO-LOCK NO-ERROR.
409 FIND LeaseDone
WHERE LeaseDone.LeaseCode
= head-lease
(RentalSpace.TenancyLeaseCode
) NO-ERROR.
410 IF AVAILABLE(TenancyLease
) AND AVAILABLE(LeaseDone
) AND RentalSpace.RentalSpaceCode
= TenancyLease.PrimarySpace
THEN ASSIGN
411 LeaseDone.LevelNo
= RentalSpace.Level
412 LeaseDone.LevelSeq
= RentalSpace.LevelSeq.
414 IF AVAILABLE(TenancyLease
) AND AVAILABLE(LeaseDone
) THEN
415 LevelInfo.OGPercent
= LeaseDone.OGPercent
* (IF LeaseDone.LeasedArea
> 0 THEN LevelInfo.LevelArea
/ LeaseDone.LeasedArea
ELSE 0).
417 LevelInfo.OGPercent
= LevelInfo.OGPercent
+ RentalSpace.OutgoingsPercent .
419 IF use-rent-charges
THEN DO:
420 IF AVAILABLE(TenancyLease
) AND AVAILABLE(LeaseDone
) THEN DO:
421 FIND LeaseRental
OF LeaseDone
WHERE LeaseRental.AreaType
= RentalSpace.AreaType
NO-ERROR.
422 IF NOT AVAILABLE(LeaseRental
) THEN
423 FIND LeaseRental
WHERE LeaseRental.LeaseCode
= RentalSpace.TenancyLeaseCode
424 AND LeaseRental.AreaType
= RentalSpace.AreaType
NO-ERROR.
425 IF AVAILABLE(LeaseRental
) THEN DO:
426 IF show-warnings
AND RentalSpace.AreaSize
= 0
427 AND CAN-FIND( FIRST OtherSpace
OF TenancyLease
WHERE OtherSpace.AreaType
= RentalSpace.AreaType
428 AND RECID(OtherSpace
) <> RECID(RentalSpace
))
430 RUN pclrep-line
( error-font1
, "Warning: Level " + STRING(RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSeq
)
431 + " - Rented 'area' of 0.0 for " + RentalSpace.Description
+ " - this could cause inconsistencies in reporting of rental.").
432 IF LeaseRental.AreaSize
= 0 THEN
433 contract-rental
= LeaseRental.AnnualRent.
435 contract-rental
= LeaseRental.AnnualRent
* ( RentalSpace.AreaSize
/ LeaseRental.AreaSize
).
436 /* MESSAGE contract-rental LeaseRental.AnnualRent RentalSpace.AreaSize LeaseRental.AreaSize.
*/
441 IF show-warnings
THEN
442 RUN pclrep-line
( error-font1
, "Warning: Level " + STRING(RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSeq
) + " "
443 + RentalSpace.Description
+ " - No rent charges found for this lease for this type of area.").
451 contract-rental
= RentalSpace.ContractedRental.
454 CASE get-levelinfo-type
( RentalSpace.AreaType
, RentalSpace.AreaSize
):
455 WHEN "Park" THEN ASSIGN
456 LevelInfo.Parking
= LevelInfo.Parking
+ contract-rental
457 LevelInfo.NoParks
= LevelInfo.NoParks
+ RentalSpace.AreaSize.
458 WHEN "Floor" THEN ASSIGN
459 LevelInfo.LevelRental
= LevelInfo.LevelRental
+ contract-rental
460 LevelInfo.LevelArea
= LevelInfo.LevelArea
+ RentalSpace.AreaSize
461 LevelInfo.AreaType
= RentalSpace.AreaType.
462 WHEN "Clean" THEN ASSIGN
463 LevelInfo.Cleaning
= LevelInfo.Cleaning
+ contract-rental.
464 WHEN "Other" THEN RUN new-sundrycharge
( contract-rental
, RentalSpace.AreaType
,
465 RentalSpace.Description
, LeaseDone.LeaseCode
).
468 IF LevelInfo.LeaseCode
= ?
AND RentalSpace.AreaStatus
= "C" THEN ASSIGN
469 LevelInfo.LevelInfoType
= "C"
470 LevelInfo.TenantName
= "* * * Common * * *".
471 ELSE IF RentalSpace.AreaStatus
= "C" THEN
472 RUN pclrep-line
( error-font1
, "Error: Level " + STRING(RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSeq
)
473 + " - Common area has the same level/sequence as leased space.").
475 IF LevelInfo.LeaseCode
<> ?
AND RentalSpace.AreaStatus
= "V" THEN
476 RUN pclrep-line
( error-font1
, "Error: Level " + STRING(RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSeq
)
477 + " - Vacant area has the same level/sequence as leased space.").
478 END.
/* FOR EACH RentalSpace
*/
480 FOR EACH TenancyLease
OF Property
WHERE TenancyLease.LeaseStatus
<> "PAST" NO-LOCK:
481 FOR EACH RentReview
OF TenancyLease
WHERE RentReview.ReviewStatus
<> "DONE"
482 AND RentReview.DateDue
<> ?
NO-LOCK:
484 XRentReview.LeaseCode
= TenancyLease.TenancyLeaseCode.
485 XRentReview.ReviewDate
= RentReview.DateDue.
486 XRentReview.ReviewType
= RentReview.EstimateBasis.
492 /* _UIB-CODE-BLOCK-END
*/
496 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE clear-building-summary Procedure
497 PROCEDURE clear-building-summary
:
498 /*------------------------------------------------------------------------------
500 ------------------------------------------------------------------------------*/
513 /* _UIB-CODE-BLOCK-END
*/
517 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE clear-level-summaries Procedure
518 PROCEDURE clear-level-summaries
:
519 /*------------------------------------------------------------------------------
521 ------------------------------------------------------------------------------*/
534 /* _UIB-CODE-BLOCK-END
*/
538 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-header Procedure
539 PROCEDURE inst-page-header
:
540 /*------------------------------------------------------------------------------
542 ------------------------------------------------------------------------------*/
543 DEF VAR p-line
AS CHAR NO-UNDO.
544 DEF VAR pos
AS INT NO-UNDO.
546 IF NOT AVAILABLE(Property
) THEN RETURN.
548 p-line
= Property.Name
+ ", " + Property.StreetAddress.
549 p-line
= FILL( " ", 70 - INT(LENGTH(p-line
))) + p-line
550 + " - Tenancy Schedule " + STRING(TODAY,"99/99/9999").
552 RUN pclrep-line
( page-header-font
, p-line
).
553 RUN pclrep-line
( page-header-font
, "").
555 IF printing-level-info
THEN DO:
556 p-line
= "Level Tenant Area -- Current Rental -- --------------- Outgoings --------------- -- Cleaning -- -- Parking -- ------ Other Payments ----- Lease Rent Lease Lease Option ------ Rent Reviews -----".
557 IF agent-version
THEN ASSIGN
558 pos
= INDEX( p-line
, " Rent ")
559 p-line
= SUBSTRING( p-line
, 1, pos
) + SUBSTRING( p-line
, pos
+ 12).
560 RUN pclrep-line
( base-font
, p-line
).
561 p-line
= " Sq.M $PA $PSM % Type/Base $PA $PSM $PA $PSM No. $PA Type $PA Start Start (Yrs) Expiry (Yrs) Date Type of review".
562 IF agent-version
THEN ASSIGN
563 p-line
= SUBSTRING( p-line
, 1, pos
) + SUBSTRING( p-line
, pos
+ 12).
564 RUN pclrep-line
( base-font
, p-line
).
566 RUN pclrep-line
( base-font
, "" ).
570 /* _UIB-CODE-BLOCK-END
*/
574 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE new-levelinfo Procedure
575 PROCEDURE new-levelinfo
:
576 /*------------------------------------------------------------------------------
578 ------------------------------------------------------------------------------*/
579 DEF VAR lse-term
AS CHAR NO-UNDO.
580 DEF VAR review-d1
AS DATE NO-UNDO.
581 DEF VAR review-d2
AS DATE NO-UNDO.
583 DEF BUFFER LeaseSpace
FOR RentalSpace.
584 DEF BUFFER OtherSpace
FOR RentalSpace.
585 DEF BUFFER OtherLease
FOR TenancyLease.
587 /* IF debug-mode
THEN RUN pclrep-line
( error-font2
, "New level for " + STRING( RentalSpace.Level
) + "/" + STRING(RentalSpace.LevelSequence
)).
*/
589 LevelInfo.LevelNo
= RentalSpace.Level.
590 LevelInfo.LevelSeq
= RentalSpace.LevelSequence.
591 LevelInfo.LevelCode
= get-level-code
().
593 FIND TenancyLease
OF RentalSpace
WHERE TenancyLease.LeaseStatus
<> "PAST" NO-LOCK NO-ERROR.
594 IF AVAILABLE(TenancyLease
) THEN DO:
595 LevelInfo.LeaseCode
= TenancyLease.TenancyLeaseCode.
596 LevelInfo.LeaseStart
= TenancyLease.LeaseStartDate.
597 LevelInfo.RentStart
= TenancyLease.RentStartDate.
598 lse-term
= STRING(TenancyLease.TermYears
).
599 IF (TenancyLease.TermMonths
> 0 OR TenancyLease.TermDays
> 0) THEN
600 lse-term
= lse-term
+ "y" + (IF TenancyLease.TermMonths
> 0 THEN STRING(TenancyLease.TermMonths
) + "m" ELSE "")
601 + (IF TenancyLease.TermDays
> 0 THEN STRING( TenancyLease.TermDays
) + "d" ELSE "").
603 IF TenancyLease.LeaseEndDate
<> ?
AND TenancyLease.LeaseStartDate
<> ?
THEN
604 LevelInfo.LeaseTerm
= STRING( (TenancyLease.LeaseEndDate
- TenancyLease.LeaseStartDate
) / 365.25, ">>9.9" ).
606 LevelInfo.LeaseTerm
= lse-term.
607 LevelInfo.LeaseExpiry
= TenancyLease.LeaseEndDate.
608 LevelInfo.LeaseOption
= TenancyLease.RightsOfRenewal.
610 FIND LeaseType
WHERE LeaseType.LeaseType
= TenancyLease.LeaseType
NO-LOCK NO-ERROR.
611 LevelInfo.LeaseType
= (IF AVAILABLE(LeaseType
) THEN LeaseType.Description
ELSE TenancyLease.LeaseType
).
612 LevelInfo.LeaseTypeBase
= TenancyLease.LeaseType.
613 LevelInfo.LevelInfoType
= "L".
615 FIND Tenant
OF TenancyLease
NO-LOCK NO-ERROR.
616 IF AVAILABLE(Tenant
) THEN DO:
617 LevelInfo.TenantCode
= Tenant.TenantCode.
618 LevelInfo.TenantName
= Tenant.Name.
619 IF TRIM(Tenant.LegalName
) <> "" THEN LevelInfo.TenantName
= TRIM(Tenant.LegalName
).
620 LevelInfo.TenantName
= LevelInfo.TenantName
+ " (T" + STRING(LevelInfo.TenantCode
) + ")".
623 FIND FIRST TenancyOutgoing
OF TenancyLease
WHERE TenancyOutgoing.BaseYear
<> ?
NO-LOCK NO-ERROR.
624 IF AVAILABLE(TenancyOutgoing
) THEN
625 LevelInfo.OGBase
= STRING(YEAR(TenancyOutgoing.BaseYear
)).
627 FIND LeaseDone
WHERE LeaseDone.LeaseCode
= head-lease
( TenancyLease.TenancyLeaseCode
) NO-ERROR.
630 /* IF debug-mode
THEN RUN pclrep-line
( error-font2
, "LevelInfo record created").
*/
634 /* _UIB-CODE-BLOCK-END
*/
638 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE new-sundrycharge Procedure
639 PROCEDURE new-sundrycharge
:
640 /*------------------------------------------------------------------------------
642 FIELD LevelNo
AS INT INITIAL 999
643 FIELD LevelSeq
AS INT INITIAL 999
644 FIELD Amount
AS DEC INITIAL 0
645 FIELD Description
AS CHAR INITIAL "Sundry"
646 ------------------------------------------------------------------------------*/
647 DEF INPUT PARAMETER contract-rental
AS DEC NO-UNDO.
648 DEF INPUT PARAMETER area-type
AS CHAR NO-UNDO.
649 DEF INPUT PARAMETER default-description
AS CHAR NO-UNDO.
650 DEF INPUT PARAMETER lease-code
AS INT NO-UNDO.
653 SundryCharge.LeaseCode
= lease-code.
654 SundryCharge.Amount
= contract-rental.
656 IF default-description
= "" THEN DO:
657 FIND RentChargeType
WHERE RentChargeType
= area-type
NO-LOCK NO-ERROR.
658 IF AVAILABLE(RentChargeType
) THEN
659 default-description
= RentChargeType.Description.
662 FIND AreaType
WHERE AreaType.AreaType
= area-type
NO-LOCK NO-ERROR.
663 IF area-type
= "S" AND default-description
<> "" THEN
664 SundryCharge.Description
= default-description.
665 ELSE IF AVAILABLE(AreaType
) THEN
666 SundryCharge.Description
= AreaType.Description.
668 SundryCharge.Description
= default-description.
670 MESSAGE contract-rental area-type default-description lease-code SundryCharge.Description.
674 /* _UIB-CODE-BLOCK-END
*/
678 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
679 PROCEDURE parse-parameters
:
680 /*------------------------------------------------------------------------------
682 ------------------------------------------------------------------------------*/
683 DEF VAR i
AS INT NO-UNDO.
684 DEF VAR token
AS CHAR NO-UNDO.
686 {inc
/showopts.i
"report-options"}
688 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
689 token
= ENTRY( i
, report-options
, "~n" ).
690 CASE( ENTRY( 1, token
) ):
691 WHEN "Properties" THEN ASSIGN
692 property-1
= INT( ENTRY(2,token
) )
693 property-n
= INT( ENTRY(3,token
) ).
695 WHEN "Selection" THEN selection-style
= ENTRY(2,token
).
696 WHEN "File name" THEN file-name
= ENTRY(2,token
).
697 WHEN "Preview" THEN preview
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
698 WHEN "Agents version" THEN agent-version
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
699 WHEN "Export" THEN exporting
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
700 WHEN "Debug" THEN debug-mode
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
701 WHEN "Warnings" THEN show-warnings
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
702 WHEN "Level Summaries" THEN level-summaries
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
703 WHEN "I&&E Summary" THEN i-e-summary
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
704 WHEN "Show notes" THEN show-notes
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
705 WHEN "Pro-rate O/G" THEN pro-rate-og
= SUBSTRING( ENTRY(2,token
), 1, 1) = "Y".
709 IF property-n
< property-1
THEN property-n
= property-1.
710 IF selection-style
= "AP" THEN ASSIGN
713 ELSE IF selection-style
= "1P" THEN ASSIGN
714 property-n
= property-1.
716 IF agent-version
THEN ASSIGN
722 /* _UIB-CODE-BLOCK-END
*/
726 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-building-summary Procedure
727 PROCEDURE print-building-summary
:
728 /*------------------------------------------------------------------------------
732 ------------------------------------------------------------------------------*/
733 DEF VAR p-line
AS CHAR NO-UNDO.
735 IF debug-mode
THEN RUN pclrep-line
( error-font1
, "Printing Building Summary").
737 DEF VAR t-leased
AS DEC NO-UNDO INITIAL 0.
738 DEF VAR t-vacant
AS DEC NO-UNDO INITIAL 0.
739 DEF VAR t-common
AS DEC NO-UNDO INITIAL 0.
740 DEF VAR t-area
AS DEC NO-UNDO INITIAL 0.
742 DEF VAR t-office-net-rent
AS DEC NO-UNDO INITIAL 0.
743 DEF VAR t-office-net-area
AS DEC NO-UNDO INITIAL 0.
744 DEF VAR t-retail-net-rent
AS DEC NO-UNDO INITIAL 0.
745 DEF VAR t-retail-net-area
AS DEC NO-UNDO INITIAL 0.
746 DEF VAR t-office-gros-rent
AS DEC NO-UNDO INITIAL 0.
747 DEF VAR t-office-gros-area
AS DEC NO-UNDO INITIAL 0.
748 DEF VAR t-retail-gros-rent
AS DEC NO-UNDO INITIAL 0.
749 DEF VAR t-retail-gros-area
AS DEC NO-UNDO INITIAL 0.
751 DEF VAR a-carpark
AS DEC NO-UNDO INITIAL 0.
755 CASE LevelInfo.LevelInfoType
:
756 WHEN "V" THEN t-vacant
= t-vacant
+ LevelInfo.LevelArea.
757 WHEN "C" THEN t-common
= t-common
+ LevelInfo.LevelArea.
758 WHEN "L" THEN t-leased
= t-leased
+ LevelInfo.LevelArea.
760 t-area
= t-area
+ LevelInfo.LevelArea.
762 IF LevelInfo.LevelInfoType
= "L" THEN DO:
763 CASE LevelInfo.AreaType
+ "-" + LevelInfo.LeaseTypeBase
:
764 WHEN "O-NET" THEN ASSIGN
765 t-office-net-rent
= t-office-net-rent
+ LevelInfo.LevelRental
766 t-office-net-area
= t-office-net-area
+ LevelInfo.LevelArea .
767 WHEN "O-GROS" THEN ASSIGN
768 t-office-gros-rent
= t-office-gros-rent
+ LevelInfo.LevelRental
769 t-office-gros-area
= t-office-gros-area
+ LevelInfo.LevelArea .
770 WHEN "R-NET" THEN ASSIGN
771 t-retail-net-rent
= t-retail-net-rent
+ LevelInfo.LevelRental
772 t-retail-net-area
= t-retail-net-area
+ LevelInfo.LevelArea .
773 WHEN "R-GROS" THEN ASSIGN
774 t-retail-gros-rent
= t-retail-gros-rent
+ LevelInfo.LevelRental
775 t-retail-gros-area
= t-retail-gros-area
+ LevelInfo.LevelArea .
780 p-line
= spc
(31) + FILL( '
-'
, 139).
781 RUN pclrep-line
( base-font
+ ",lpi,20", p-line
).
782 p-line
= "Building Totals" + spc
(16)
783 + STRING( g-area
, "->>,>>9.99") + spc
(1)
784 + STRING( g-rental
, "->,>>>,>>9.99") + spc
(2)
785 + STRING( g-ogpercent
, "->>,>>>,>>9.99") + spc
(14)
786 + STRING( g-ogbudget
, "->>,>>>,>>9.99") + spc
(5)
787 + STRING( g-cleaning
, "->>,>>>,>>9.99") + spc
(2)
788 + STRING( g-noparks
, "->>>,>>9")
789 + STRING( g-parking
, "->,>>>,>>9.99") + spc
(15)
790 + STRING( g-sundry
, "->>,>>>,>>9.99") .
792 RUN pclrep-line
( base-font
+ ",lpi,20", p-line
).
793 RUN pclrep-line
( error-font1
, "").
795 RUN clear-building-summary.
797 printing-level-info
= No.
799 IF pclrep-test-bottom
(6.5) THEN
800 RUN pclrep-page-break.
802 RUN pclrep-line
( base-font
, "" ).
804 RUN pclrep-line
( error-font1
, "Building Summary").
805 RUN pclrep-line
( error-font1
, "").
807 RUN pclrep-line
( base-font
, "Total Area Occupied " + STRING( t-leased
, "->>,>>>,>>9.99") ).
808 RUN pclrep-line
( base-font
, "Total Area Vacant " + STRING( t-vacant
, "->>,>>>,>>9.99") ).
809 RUN pclrep-line
( base-font
, "Total Common Area " + STRING( t-common
, "->>,>>>,>>9.99") ).
810 RUN pclrep-line
( base-font
, "Total Area " + STRING( t-area
, "->>,>>>,>>9.99") ).
812 IF debug-mode
THEN DO:
813 RUN pclrep-line
( base-font
, "" ).
814 RUN pclrep-line
( base-font
, "Total Office Gross Area " + STRING( t-office-gros-area
, "->>,>>>,>>9.99") ).
815 RUN pclrep-line
( base-font
, "Total Retail Gross Area " + STRING( t-retail-gros-area
, "->>,>>>,>>9.99") ).
816 RUN pclrep-line
( base-font
, "Total Office Net Area " + STRING( t-office-net-area
, "->>,>>>,>>9.99") ).
817 RUN pclrep-line
( base-font
, "Total Retail Net Area " + STRING( t-retail-net-area
, "->>,>>>,>>9.99") ).
818 RUN pclrep-line
( base-font
, "Total Office Gross Rent " + STRING( t-office-gros-rent
, "->>,>>>,>>9.99") ).
819 RUN pclrep-line
( base-font
, "Total Retail Gross Rent " + STRING( t-retail-gros-rent
, "->>,>>>,>>9.99") ).
820 RUN pclrep-line
( base-font
, "Total Office Net Rent " + STRING( t-office-net-rent
, "->>,>>>,>>9.99") ).
821 RUN pclrep-line
( base-font
, "Total Retail Net Rent " + STRING( t-retail-net-rent
, "->>,>>>,>>9.99") ).
824 RUN pclrep-line
( base-font
, "" ).
825 IF t-office-gros-area
> 0 THEN RUN pclrep-line
( base-font
, "Average Gross Office Rental " + STRING( t-office-gros-rent
/ t-office-gros-area
, "->>,>>>,>>9.99") ).
826 IF t-office-net-area
> 0 THEN RUN pclrep-line
( base-font
, "Average Net Office Rental " + STRING( t-office-net-rent
/ t-office-net-area
, "->>,>>>,>>9.99") ).
827 IF t-retail-gros-area
> 0 THEN RUN pclrep-line
( base-font
, "Average Gross Retail Rental " + STRING( t-retail-gros-rent
/ t-retail-gros-area
, "->>,>>>,>>9.99") ).
828 IF t-retail-net-area
> 0 THEN RUN pclrep-line
( base-font
, "Average Net Retail Rental " + STRING( t-retail-net-rent
/ t-retail-net-area
, "->>,>>>,>>9.99") ).
830 RUN pclrep-line
( base-font
, "" ).
831 IF g-noparks
> 0 THEN
832 RUN pclrep-line
( base-font
, "Average Carpark Rent P.A. " + STRING( g-parking
/ g-noparks
, "->>,>>>,>>9.99") ).
836 /* _UIB-CODE-BLOCK-END
*/
840 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-i-e-summary Procedure
841 PROCEDURE print-i-e-summary
:
842 /*------------------------------------------------------------------------------
843 Purpose
: Print the outgoings budgets for the property
844 ------------------------------------------------------------------------------*/
845 DEF VAR inc-amount
AS DECIMAL INITIAL 0 NO-UNDO.
846 DEF VAR area-size
AS DECIMAL INITIAL 0 NO-UNDO.
847 DEF VAR bldg-area
AS DECIMAL INITIAL 0 NO-UNDO.
848 DEF VAR inc-total
AS DECIMAL INITIAL 0 NO-UNDO.
849 DEF VAR exp-total
AS DECIMAL INITIAL 0 NO-UNDO.
850 DEF VAR stat-total
AS DECIMAL INITIAL 0 NO-UNDO.
851 DEF VAR out-line
AS CHAR NO-UNDO.
853 FIND Month
WHERE Month.StartDate
<= TODAY AND Month.EndDate
>= TODAY NO-LOCK NO-ERROR.
854 FIND FinancialYear
OF Month
NO-LOCK.
856 RUN pclrep-page-break.
857 RUN pclrep-down-by
(3).
858 out-line
= "Estimated Income and Expenditure for the year " + FinancialYear.Description.
859 RUN pclrep-line
( page-header-font
+ ",underline", out-line
).
860 RUN pclrep-down-by
(2).
862 out-line
= FILL(" ", 88) + "$PA Area SqM $/SqM P.C.M." .
863 RUN pclrep-line
( base-font
, out-line
).
864 RUN pclrep-down-by
(1).
866 /* Print income totals
*/
867 FOR EACH AreaType
NO-LOCK,
868 FIRST ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountCode
= AreaType.AccountCode
869 BY AreaType.AccountCode
:
872 FOR EACH RentalSpace
OF Property
NO-LOCK WHERE RentalSpace.AreaType
= AreaType.AreaType
873 AND RentalSpace.AreaStatus
<> "X":
874 IF RentalSpace.AreaStatus
<> "V" THEN
875 inc-amount
= inc-amount
+ RentalSpace.ChargedRental.
876 IF RentalSpace.AreaType
<> "C" AND RentalSpace.AreaType
<> "N" THEN
877 area-size
= area-size
+ RentalSpace.AreaSize.
879 IF inc-amount
<> 0 OR area-size
<> 0 THEN DO:
880 out-line
= FILL(" ", 20)
881 + STRING( ChartOfAccount.AccountCode
, "9999.99") + " "
882 + STRING( ChartOfAccount.Name
, "X(50)") + " "
883 + STRING( inc-amount
, "->>,>>>,>>9.99") + " "
884 + STRING( area-size
, "->>,>>>,>>9.99") + " "
885 + STRING( (IF area-size
= 0 THEN 0 ELSE inc-amount
/ area-size
), "->,>>9.99") + " "
886 + STRING( (inc-amount
/ 12), "->>,>>>,>>9.99").
887 RUN pclrep-line
( base-font
, out-line
).
888 inc-total
= inc-total
+ inc-amount.
889 bldg-area
= bldg-area
+ area-size.
892 FOR EACH PropertyOutgoing
NO-LOCK WHERE PropertyOutgoing.PropertyCode
= Property.PropertyCode
893 AND PropertyOutgoing.BudgetAmount
< 0,
894 FIRST ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountCode
= PropertyOutgoing.AccountCode
:
895 out-line
= FILL(" ", 20)
896 + STRING( PropertyOutgoing.AccountCode
, "9999.99") + " "
897 + STRING( ChartOfAccount.Name
, "X(50)") + " "
898 + STRING( - PropertyOutgoing.BudgetAmount
, "->>,>>>,>>9.99") + " "
899 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
900 + STRING( - (PropertyOutgoing.BudgetAmount
/ bldg-area
), "->,>>9.99") + " "
901 + STRING( - (PropertyOutgoing.BudgetAmount
/ 12), "->>,>>>,>>9.99").
902 RUN pclrep-line
( base-font
, out-line
).
903 inc-total
= inc-total
- PropertyOutgoing.BudgetAmount .
907 FOR EACH TenancyLease
OF Property
NO-LOCK WHERE Tenancylease.LeaseStatus
<> "PAST"
908 AND CAN-FIND( FIRST RentalSpace
OF TenancyLease
WHERE RentalSpace.AreaStatus
<> "V" AND RentalSpace.AreaStatus
<> "X"):
909 inc-amount
= inc-amount
+ TenancyLease.OutgoingsBudget.
911 IF inc-amount
<> 0 THEN DO:
912 out-line
= FILL(" ", 20)
913 + FILL( " ", 7) + " "
914 + STRING( "Outgoings", "X(50)") + " "
915 + STRING( inc-amount
, "->>,>>>,>>9.99") + " "
916 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
917 + STRING( (IF bldg-area
= 0 THEN 0 ELSE inc-amount
/ bldg-area
), "->,>>9.99") + " "
918 + STRING( (inc-amount
/ 12), "->>,>>>,>>9.99").
919 RUN pclrep-line
( base-font
, out-line
).
920 inc-total
= inc-total
+ inc-amount.
922 out-line
= FILL( " ", 81) + FILL( "-", 14)
923 + " " + FILL( "-", 14) + " " + FILL( " ", 9) + " " + FILL( "-", 14).
924 RUN pclrep-line
( base-font
, out-line
).
925 out-line
= FILL( " ", 81) + STRING( inc-total
, "->>,>>>,>>9.99") + " "
926 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
927 + STRING( (inc-total
/ bldg-area
), "->,>>9.99") + " "
928 + STRING( (inc-total
/ 12), "->>,>>>,>>9.99").
929 RUN pclrep-line
( base-font
, out-line
).
930 RUN pclrep-down-by
(3).
932 IF TRIM(stat-accounts
) <> "" THEN DO:
933 /* Print statutory expenses accounts
201 - 205 */
934 FOR EACH PropertyOutgoing
NO-LOCK WHERE PropertyOutgoing.PropertyCode
= Property.PropertyCode
935 AND PropertyOutgoing.BudgetAmount
> 0,
936 FIRST ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountCode
= PropertyOutgoing.AccountCode
:
938 MESSAGE ">>" + stat-accounts
+ "<<" STRING(PropertyOutgoing.AccountCode
, "9999.99") SKIP
939 LOOKUP( STRING(PropertyOutgoing.AccountCode
, "9999.99"), stat-accounts
)
942 IF LOOKUP( STRING(PropertyOutgoing.AccountCode
, "9999.99"), stat-accounts
) = 0 THEN NEXT.
944 out-line
= FILL(" ", 20)
945 + STRING( PropertyOutgoing.AccountCode
, "9999.99") + " "
946 + STRING( ChartOfAccount.Name
, "X(50)") + " "
947 + STRING( PropertyOutgoing.BudgetAmount
, "->>,>>>,>>9.99") + " "
948 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
949 + STRING( (PropertyOutgoing.BudgetAmount
/ bldg-area
), "->,>>9.99") + " "
950 + STRING( (PropertyOutgoing.BudgetAmount
/ 12), "->>,>>>,>>9.99").
951 RUN pclrep-line
( base-font
, out-line
).
952 stat-total
= stat-total
+ PropertyOutgoing.BudgetAmount .
954 out-line
= FILL( " ", 81) + FILL( "-", 14)
955 + " " + FILL( "-", 14) + " " + FILL( "-", 9) + " " + FILL( "-", 14).
956 RUN pclrep-line
( base-font
, out-line
).
957 out-line
= STRING( FILL(" ", 20) + "Statutory expenses", "X(81)")
958 + STRING( stat-total
, "->>,>>>,>>9.99") + " "
959 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
960 + STRING( (stat-total
/ bldg-area
), "->,>>9.99") + " "
961 + STRING( (stat-total
/ 12), "->>,>>>,>>9.99").
962 RUN pclrep-line
( base-font
, out-line
).
963 RUN pclrep-down-by
(1).
966 /* non-statutory expense accounts
*/
967 FOR EACH PropertyOutgoing
NO-LOCK WHERE PropertyOutgoing.PropertyCode
= Property.PropertyCode
968 AND PropertyOutgoing.BudgetAmount
> 0,
969 FIRST ChartOfAccount
NO-LOCK WHERE ChartOfAccount.AccountCode
= PropertyOutgoing.AccountCode
:
971 MESSAGE ">>" + stat-accounts
+ "<<" STRING(PropertyOutgoing.AccountCode
, "9999.99") SKIP
972 LOOKUP( STRING(PropertyOutgoing.AccountCode
, "9999.99"), stat-accounts
)
975 IF LOOKUP( STRING(PropertyOutgoing.AccountCode
, "9999.99"), stat-accounts
) > 0 THEN NEXT.
977 out-line
= FILL(" ", 20)
978 + STRING( PropertyOutgoing.AccountCode
, "9999.99") + " "
979 + STRING( ChartOfAccount.Name
, "X(50)") + " "
980 + STRING( PropertyOutgoing.BudgetAmount
, "->>,>>>,>>9.99") + " "
981 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
982 + STRING( (PropertyOutgoing.BudgetAmount
/ bldg-area
), "->,>>9.99") + " "
983 + STRING( (PropertyOutgoing.BudgetAmount
/ 12), "->>,>>>,>>9.99").
984 RUN pclrep-line
( base-font
, out-line
).
985 exp-total
= exp-total
+ PropertyOutgoing.BudgetAmount .
987 IF TRIM(stat-accounts
) <> "" THEN DO:
988 out-line
= FILL( " ", 81) + FILL( "-", 14)
989 + " " + FILL( "-", 14) + " " + FILL( "-", 9) + " " + FILL( "-", 14).
990 RUN pclrep-line
( base-font
, out-line
).
991 out-line
= STRING( FILL(" ", 20) + "Non-statutory expenses", "X(81)")
992 + STRING( exp-total
, "->>,>>>,>>9.99") + " "
993 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
994 + STRING( (exp-total
/ bldg-area
), "->,>>9.99") + " "
995 + STRING( (exp-total
/ 12), "->>,>>>,>>9.99").
996 RUN pclrep-line
( base-font
, out-line
).
997 RUN pclrep-down-by
(1).
1000 /* all Expense totals
*/
1001 exp-total
= exp-total
+ stat-total .
1002 out-line
= FILL( " ", 81) + FILL( "-", 14)
1003 + " " + FILL( "-", 14) + " " + FILL( "-", 9) + " " + FILL( "-", 14).
1004 RUN pclrep-line
( base-font
, out-line
).
1005 out-line
= STRING( FILL(" ", 20) + "Total expenses", "X(81)")
1006 + STRING( exp-total
, "->>,>>>,>>9.99") + " "
1007 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
1008 + STRING( (exp-total
/ bldg-area
), "->,>>9.99") + " "
1009 + STRING( (exp-total
/ 12), "->>,>>>,>>9.99").
1011 RUN pclrep-line
( base-font
, out-line
).
1012 RUN pclrep-down-by
(2).
1014 /* print net totals
*/
1015 out-line
= FILL(" ", 81) + FILL( "=", 14)
1016 + " " + FILL( "=", 14) + " " + FILL( "=", 9) + " " + FILL( "=", 14).
1017 RUN pclrep-line
( base-font
, out-line
).
1018 out-line
= STRING( FILL(" ", 20) + "Net receipts", "X(81)")
1019 + STRING( (inc-total
- exp-total
), "->>,>>>,>>9.99") + " "
1020 + STRING( bldg-area
, "->>,>>>,>>9.99") + " "
1021 + STRING( ((inc-total
- exp-total
) / bldg-area
), "->,>>9.99") + " "
1022 + STRING( ((inc-total
- exp-total
) / 12), "->>,>>>,>>9.99").
1024 RUN pclrep-line
( base-font
, out-line
).
1028 /* _UIB-CODE-BLOCK-END
*/
1032 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-level-info Procedure
1033 PROCEDURE print-level-info
:
1034 /*------------------------------------------------------------------------------
1036 ------------------------------------------------------------------------------*/
1037 DEF VAR p-line
AS CHAR NO-UNDO.
1038 DEF VAR tenant-name
AS CHAR NO-UNDO.
1039 DEF VAR i
AS INT NO-UNDO.
1041 IF debug-mode
THEN RUN pclrep-line
( base-font
, "Printing for " + LevelInfo.LevelCode
+ " - " + LevelInfo.TenantName
).
1043 FIND LeaseDone
WHERE LeaseDone.LeaseCode
= LevelInfo.LeaseCode
1044 AND LeaseDone.LevelNo
= LevelInfo.LevelNo
1045 AND LeaseDone.LevelSeq
= LevelInfo.LevelSeq
NO-ERROR.
1048 RUN pclrep-line
( base-font
, "" ).
1050 tenant-name
= wrap
( LevelInfo.TenantName
, 25) + FILL( "~n", 50).
1052 p-line
= STRING( LevelInfo.LevelCode
, "X(6)")
1053 + STRING( ENTRY( 1, tenant-name
, "~n"), "X(25)")
1054 + STRING( LevelInfo.LevelArea
, ">>>,>>9.99")
1055 + STRING( LevelInfo.LevelRental
, "->>,>>>,>>9")
1056 + STRING( (IF LevelInfo.LevelArea
> 0 THEN LevelInfo.LevelRental
/ LevelInfo.LevelArea
ELSE 0), "->>>,>>9.99").
1059 + (IF pro-rate-og
THEN
1060 STRING( LevelInfo.OGPercent
, ">>>>9.99")
1062 STRING( (IF AVAILABLE(LeaseDone
) THEN LeaseDone.OGPercent
ELSE LevelInfo.OGPercent
), ">>>>9.99")).
1064 p-line
= p-line
+ " "
1065 + STRING( LevelInfo.LeaseType
, "X(12)").
1068 + (IF pro-rate-og
THEN
1069 STRING( LevelInfo.OGBudget
, "->,>>>,>>9")
1071 STRING( (IF AVAILABLE(LeaseDone
) THEN LeaseDone.OGBudget
ELSE 0), "->,>>>,>>9")).
1074 + STRING( (IF LevelInfo.LevelArea
> 0 THEN LevelInfo.OGBudget
/ LevelInfo.LevelArea
ELSE 0), "->>>,>>9.99")
1075 + STRING( LevelInfo.Cleaning
, "->>>,>>9") .
1078 + STRING( (IF LevelInfo.LevelArea
> 0 THEN LevelInfo.Cleaning
/ LevelInfo.LevelArea
ELSE 0), "->>9.99")
1079 + STRING( LevelInfo.NoParks
, "->,>>9")
1080 + STRING( LevelInfo.Parking
, "->,>>>,>>9") .
1082 FIND FIRST SundryCharge
OF LeaseDone
NO-ERROR.
1083 IF AVAILABLE(SundryCharge
) THEN
1084 p-line
= p-line
+ " "
1085 + STRING( SundryCharge.Description
, "X(16)")
1086 + STRING( SundryCharge.Amount
, "->>,>>>,>>9") + " ".
1088 p-line
= p-line
+ spc
(31).
1091 + (IF LevelInfo.LeaseStart
<> ?
THEN STRING( LevelInfo.LeaseStart
, "99/99/9999") ELSE " ") + " "
1092 + (IF agent-version
THEN "" ELSE (IF LevelInfo.RentStart
<> ?
THEN STRING( LevelInfo.RentStart
, "99/99/9999") ELSE " ") + " ")
1093 + (IF LevelInfo.Leaseterm
<> ?
THEN STRING( LevelInfo.LeaseTerm
, "X(8)") ELSE "Unknown ")
1094 + (IF LevelInfo.LeaseExpiry
<> ?
THEN STRING( LevelInfo.LeaseExpiry
, "99/99/9999") ELSE " ") + " "
1095 + STRING( LevelInfo.LeaseOption
, "X(10)").
1097 FIND FIRST XRentReview
WHERE XRentReview.LeaseCode
= LevelInfo.LeaseCode
NO-ERROR.
1098 IF AVAILABLE(XRentReview
) THEN
1099 p-line
= p-line
+ " "
1100 + STRING( XRentReview.ReviewDate
, "99/99/9999") + " "
1101 + STRING( XRentReview.ReviewType
, "X(20)").
1103 DO WHILE TRIM(p-line
) <> "":
1104 RUN pclrep-line
( base-font
, p-line
).
1106 IF AVAILABLE(SundryCharge
) THEN FIND NEXT SundryCharge
OF LeaseDone
NO-ERROR.
1107 IF AVAILABLE(XRentReview
) THEN FIND NEXT XRentReview
WHERE XRentReview.LeaseCode
= LevelInfo.LeaseCode
NO-ERROR.
1109 + STRING( ENTRY( i
, tenant-name
, "~n"), "X(25)")
1113 p-line
= p-line
+ STRING( LevelInfo.OGBase
, "X(13)" ).
1115 p-line
= p-line
+ spc
(13).
1117 p-line
= p-line
+ spc
(53).
1119 IF AVAILABLE(SundryCharge
) THEN
1121 + STRING( SundryCharge.Description
, "X(16)")
1122 + STRING( SundryCharge.Amount
, "->>,>>>,>>9").
1124 p-line
= p-line
+ spc
(27).
1126 IF AVAILABLE(XRentReview
) THEN
1127 p-line
= p-line
+ spc
(54)
1128 + STRING( XRentReview.ReviewDate
, "99/99/9999") + " "
1129 + STRING( XRentReview.ReviewType
, "X(20)").
1134 /* _UIB-CODE-BLOCK-END
*/
1138 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-level-summaries Procedure
1139 PROCEDURE print-level-summaries
:
1140 /*------------------------------------------------------------------------------
1144 ------------------------------------------------------------------------------*/
1145 DEF VAR p-line
AS CHAR NO-UNDO.
1147 IF debug-mode
THEN RUN pclrep-line
( error-font1
, "Printing Level Summary").
1149 /* RUN pclrep-line
( error-font1
, "Level Summary").
*/
1150 p-line
= spc
(31) + FILL( '
-'
, 139).
1151 RUN pclrep-line
( base-font
+ ",lpi,20", p-line
).
1152 p-line
= "Level Totals" + spc
(19)
1153 + STRING( l-area
, "->>,>>9.99") + spc
(1)
1154 + STRING( l-rental
, "->,>>>,>>9.99") + spc
(2)
1155 + STRING( l-ogpercent
, "->>,>>>,>>9.99") + spc
(14)
1156 + STRING( l-ogbudget
, "->>,>>>,>>9.99") + spc
(5)
1157 + STRING( l-cleaning
, "->>,>>>,>>9.99") + spc
(2)
1158 + STRING( l-noparks
, "->>>,>>9")
1159 + STRING( l-parking
, "->,>>>,>>9.99") + spc
(15)
1160 + STRING( l-sundry
, "->>,>>>,>>9.99") .
1162 RUN pclrep-line
( base-font
+ ",lpi,20", p-line
).
1163 RUN pclrep-line
( error-font1
, "").
1165 RUN clear-level-summaries.
1169 /* _UIB-CODE-BLOCK-END
*/
1173 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-notes Procedure
1174 PROCEDURE print-notes
:
1175 /*------------------------------------------------------------------------------
1177 ------------------------------------------------------------------------------*/
1178 DEF VAR i
AS INT NO-UNDO.
1179 DEF VAR n
AS INT NO-UNDO.
1180 DEF VAR note-text
AS CHAR NO-UNDO.
1182 IF CAN-FIND( FIRST LevelInfo
WHERE TRIM(LevelInfo.AreaNotes
) <> "") THEN DO:
1183 RUN pclrep-down-by
(1).
1184 RUN pclrep-line
( page-header-font
, "Area Notes" ).
1185 FOR EACH LevelInfo
WHERE TRIM(LevelInfo.AreaNotes
) <> "":
1186 n
= NUM-ENTRIES( LevelInfo.AreaNotes
, "~n").
1187 RUN pclrep-line
( base-font
, SPC
(30) +
1188 STRING( LevelInfo.LevelCode
, "X(25)")
1189 + ENTRY( 1, LevelInfo.AreaNotes
, "~n") ).
1191 RUN pclrep-line
( base-font
, SPC
(55) + ENTRY( i
, LevelInfo.AreaNotes
, "~n") ).
1193 RUN pclrep-down-by
(0.3).
1197 IF CAN-FIND( FIRST LeaseDone
WHERE TRIM(LeaseDone.LeaseNotes
) <> "") THEN DO:
1198 RUN pclrep-down-by
(1).
1199 RUN pclrep-line
( page-header-font
, "Lease Notes" ).
1200 FOR EACH LeaseDone
WHERE TRIM(LeaseDone.LeaseNotes
) <> "":
1201 FIND TenancyLease
WHERE TenancyLease.TenancyLeaseCode
= LeaseDone.LeaseCode
NO-LOCK.
1202 FIND Tenant
OF TenancyLease
NO-LOCK.
1203 n
= NUM-ENTRIES( LeaseDone.LeaseNotes
, "~n").
1204 RUN pclrep-line
( base-font
, STRING( Tenant.Name
, "X(50)") + SPC
(5)
1205 + ENTRY( 1, LeaseDone.LeaseNotes
, "~n") ).
1207 RUN pclrep-line
( base-font
, SPC
(55) + ENTRY( i
, LeaseDone.LeaseNotes
, "~n") ).
1209 RUN pclrep-down-by
(0.3).
1213 FIND Note
OF Property
NO-LOCK NO-ERROR.
1214 IF AVAILABLE(Note
) AND TRIM(Note.Detail
) <> "" THEN DO:
1215 note-text
= TRIM( REPLACE( Note.Detail
, "~r", "") ).
1216 RUN pclrep-down-by
(1).
1217 RUN pclrep-line
( page-header-font
, "Building Notes" ).
1218 n
= NUM-ENTRIES( note-text
, "~n").
1220 RUN pclrep-line
( base-font
, SPC
(55) + ENTRY( i
, note-text
, "~n") ).
1226 /* _UIB-CODE-BLOCK-END
*/
1230 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE property-schedule Procedure
1231 PROCEDURE property-schedule
:
1232 /*------------------------------------------------------------------------------
1234 ------------------------------------------------------------------------------*/
1235 DEF VAR last-level
AS INT NO-UNDO INITIAL -999999.
1237 printing-level-info
= Yes.
1238 RUN build-level-info.
1239 RUN verify-level-info.
1242 IF last-level
<> LevelInfo.LevelNo
THEN DO:
1243 IF last-level
> -999999 AND level-summaries
THEN RUN print-level-summaries.
1244 last-level
= LevelInfo.LevelNo.
1245 RUN start-new-level.
1247 IF LevelInfo.LevelInfoType
<> "C" THEN RUN print-level-info.
1249 IF last-level
> -999999 AND level-summaries
THEN RUN print-level-summaries.
1250 RUN print-building-summary.
1252 IF show-notes
THEN RUN print-notes.
1254 RUN pclrep-page-break.
1258 /* _UIB-CODE-BLOCK-END
*/
1262 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE start-new-level Procedure
1263 PROCEDURE start-new-level
:
1264 /*------------------------------------------------------------------------------
1268 ------------------------------------------------------------------------------*/
1270 RUN clear-level-summaries.
1274 /* _UIB-CODE-BLOCK-END
*/
1278 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-level-info Procedure
1279 PROCEDURE verify-level-info
:
1280 /*------------------------------------------------------------------------------
1282 ------------------------------------------------------------------------------*/
1283 DEF VAR lease-percent
AS DEC NO-UNDO.
1285 IF debug-mode
THEN RUN pclrep-line
( error-font1
, "Verifying Lease Information").
1289 FOR EACH TenancyLease
OF Property
WHERE TenancyLease.LeaseStatus
<> "PAST"
1290 AND TenancyLease.OutgoingsBudget
<> 0 NO-LOCK,
1291 FIRST Tenant
OF TenancyLease
NO-LOCK:
1293 FOR EACH LevelInfo
WHERE LevelInfo.LeaseCode
= TenancyLease.TenancyLeaseCode
:
1294 lease-percent
= lease-percent
+ LevelInfo.OGPercent.
1296 IF ABS(TenancyLease.OutgoingsRate
- lease-percent
) > (lease-percent
/ 10) THEN DO:
1297 IF show-warnings
THEN DO:
1298 RUN pclrep-line
( error-font1
, "Warning: Lease " + STRING(TenancyLease.TenancyLeaseCode
)
1299 + ", Tenant " + STRING(TenancyLease.TenantCode
) + " " + Tenant.Name
1300 + " - figures vary by more than 10% calculating outgoings budget for leased space").
1301 RUN pclrep-line
( error-font2
, spc
(30) + "Lease Outgoings %age = "
1302 + STRING(TenancyLease.OutgoingsRate
)
1303 + ", but the sum of Rental Space outgoings %ages = "
1304 + STRING(lease-percent
) ).
1306 IF lease-percent
= 0 THEN NEXT lease-loop.
1308 FOR EACH LevelInfo
WHERE LevelInfo.LeaseCode
= TenancyLease.TenancyLeaseCode
:
1309 LevelInfo.OGBudget
= null-dec
( TenancyLease.OutgoingsBudget
* (LevelInfo.OGPercent
/ lease-percent
), 0.0).
1314 DEF VAR wrap-width
AS INT NO-UNDO INITIAL 160.
1315 IF debug-mode
THEN RUN pclrep-line
( error-font1
, "Verifying Level Information").
1317 IF LENGTH( LevelInfo.TenantName
) > 69 AND show-warnings
THEN DO:
1318 RUN pclrep-line
( error-font1
, "Warning: Tenant " + STRING(Tenant.TenantCode
) + " " + STRING(LevelInfo.TenantName
)
1319 + " - Recommend setting trading name to shorten displayed tenant name field.").
1321 IF (LevelInfo.LevelInfoType
= "C" OR LevelInfo.LevelInfoType
= "V")
1322 AND LevelInfo.LeaseCode
<> ?
AND show-warnings
THEN DO:
1323 RUN pclrep-line
( error-font1
, "Warning: Level " + STRING(LevelInfo.LevelNo
) + "/" + STRING(LevelInfo.LevelSeq
)
1324 + " - Status is " + (IF LevelInfo.LevelInfoType
= "C" THEN "Common" ELSE "Vacant")
1325 + " but appears to have active lease no. " + STRING( LevelInfo.LeaseCode
)
1326 + (IF LevelInfo.TenantCode
<> ?
THEN " (T" + STRING(LevelInfo.TenantCode
) + ")" ELSE "")).
1327 RUN pclrep-line
( error-font2
, spc
(30) + "It may be that leased space shares the same level sequence as a common area or vacant space.").
1329 LevelInfo.AreaNotes
= WRAP
( LevelInfo.AreaNotes
, wrap-width
).
1333 LeaseDone.LeaseNotes
= WRAP
( LeaseDone.LeaseNotes
, wrap-width
).
1336 IF debug-mode
THEN RUN pclrep-line
( error-font1
, "Verification Complete").
1340 /* _UIB-CODE-BLOCK-END
*/
1344 /* ************************ Function Implementations
***************** */
1346 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-level-code Procedure
1347 FUNCTION get-level-code
RETURNS CHARACTER
1348 ( /* parameter-definitions
*/ ) :
1349 /*------------------------------------------------------------------------------
1352 ------------------------------------------------------------------------------*/
1353 DEF VAR answer
AS CHAR NO-UNDO.
1355 IF RentalSpace.Level
= 0 THEN
1357 ELSE IF RentalSpace.Level
= 90 THEN
1359 ELSE IF RentalSpace.Level
= 80 THEN
1361 ELSE IF RentalSpace.Level
> 80 AND RentalSpace.Level
< 90 THEN
1362 answer
= "B" + STRING(RentalSpace.Level
- 80).
1363 ELSE IF RentalSpace.Level
< 0 THEN
1364 answer
= "B" + STRING(ABS(RentalSpace.Level
)).
1366 answer
= STRING(RentalSpace.Level
).
1369 + (IF RentalSpace.LevelSequence
= 0 THEN "" ELSE "-" + TRIM(STRING(RentalSpace.LevelSequence
))).
1375 /* _UIB-CODE-BLOCK-END
*/
1379 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION get-levelinfo-type Procedure
1380 FUNCTION get-levelinfo-type
RETURNS CHARACTER
1381 ( INPUT type
AS CHAR, INPUT Area
AS DEC ) :
1382 /*------------------------------------------------------------------------------
1383 Purpose
: Return appropriate type to indicate Floor
, park
, cleaning or other
1384 ------------------------------------------------------------------------------*/
1385 DEF BUFFER AType
FOR AreaType.
1387 IF type
= "L" THEN RETURN "Clean".
1388 IF type
= "N" THEN RETURN "Other".
1390 FIND AType
WHERE AType.AreaType
= type
NO-LOCK NO-ERROR.
1391 IF AVAILABLE(AType
) THEN DO:
1392 IF AType.IsFloorArea
THEN RETURN "Floor".
1393 ELSE IF AType.IsCarPark
THEN RETURN "Park".
1396 IF Area
> 20 OR (Area
<> INTEGER(Area
)) THEN RETURN "Floor".
1402 /* _UIB-CODE-BLOCK-END
*/
1406 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION head-lease Procedure
1407 FUNCTION head-lease
RETURNS INTEGER
1408 ( INPUT lease-code
AS INT ) :
1409 /*------------------------------------------------------------------------------
1410 Purpose
: Convert a lease code into the appropriate head lease
1411 ------------------------------------------------------------------------------*/
1412 FIND HeadLease
WHERE HeadLease.TenancyLeaseCode
= lease-code
NO-ERROR.
1413 IF AVAILABLE(HeadLease
) THEN
1414 RETURN HeadLease.HeadLeaseCode.
1420 /* _UIB-CODE-BLOCK-END
*/
1424 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _FUNCTION to-annual Procedure
1425 FUNCTION to-annual
RETURNS DECIMAL
1426 ( INPUT period-amount
AS DEC, INPUT freq-type
AS CHAR ) :
1427 /*------------------------------------------------------------------------------
1428 Purpose
: Return an annualised conversion of the amount.
1430 ------------------------------------------------------------------------------*/
1431 DEF VAR annual-amount
AS DEC NO-UNDO.
1433 FIND FrequencyType
WHERE FrequencyType.FrequencyCode
= freq-type
NO-LOCK.
1435 annual-amount
= ((period-amount
/ FrequencyType.UnitCount
) * (IF FrequencyType.RepeatUnits
= "D" THEN 365 ELSE 12)).
1437 RETURN annual-amount.
1441 /* _UIB-CODE-BLOCK-END
*/