1 DEF TEMP-TABLE Expiring
NO-UNDO
2 FIELD PropertyCode
LIKE Property.PropertyCode
3 FIELD ExpiringOn
LIKE TenancyLease.LeaseEndDate
4 FIELD ValueExpiring
LIKE RentalSpace.ContractedRental
5 FIELD AreaExpiring
LIKE RentalSpace.AreaSize
6 INDEX XPKExpiries
IS PRIMARY PropertyCode ExpiringOn.
8 DEF VAR end-date
AS DATE NO-UNDO.
9 DEF VAR month-name
AS CHAR NO-UNDO FORMAT "X(7)" LABEL " Month ".
10 DEF VAR month-value
AS DEC NO-UNDO FORMAT "->>,>>>,>>>,>>9" LABEL " Value".
11 DEF VAR month-area
AS DEC NO-UNDO FORMAT "->>,>>>,>>9" LABEL " Area".
13 FOR EACH Property
WHERE Property.Active
:
14 FOR EACH TenancyLease
OF Property
WHERE TenancyLease.LeaseStatus
<> "PAST"
15 NO-LOCK BY TenancyLease.LeaseEndDate
:
16 FIND Expiring
WHERE Expiring.PropertyCode
= Property.PropertyCode
17 AND Expiring.ExpiringOn
= TenancyLease.LeaseEndDate
19 end-date
= TenancyLease.LeaseEndDate.
20 IF end-date
< TODAY THEN end-date
= ?.
21 IF NOT AVAILABLE(Expiring
) THEN DO:
23 Expiring.PropertyCode
= Property.PropertyCode.
24 Expiring.ExpiringOn
= TenancyLease.LeaseEndDate.
26 FOR EACH RentalSpace
OF TenancyLease
NO-LOCK:
27 Expiring.ValueExpiring
= Expiring.ValueExpiring
+ RentalSpace.ContractedRental .
28 IF INDEX( "CIORW", RentalSpace.AreaType
) > 0 THEN
29 Expiring.AreaExpiring
= Expiring.AreaExpiring
+ RentalSpace.AreaSize .
34 DEFINE FRAME x
WITH DOWN.
36 FOR EACH Property
WHERE Property.Active
:
37 FIND Expiring
WHERE Expiring.PropertyCode
= Property.PropertyCode
NO-LOCK NO-ERROR.
38 IF AVAILABLE(Expiring
) THEN DO:
39 DISPLAY Property.PropertyCode
40 "Monthly" @ month-name
41 Expiring.AreaExpiring @ month-area
42 Expiring.ValueExpiring @ month-value
46 FOR EACH Month
NO-LOCK WHERE CAN-FIND( FIRST Expiring
OF Property
47 WHERE Expiring.ExpiringOn
>= Month.StartDate
48 AND Expiring.ExpiringOn
<= Month.EndDate
) :
49 month-name
= Month.MonthName
+ " " + SUBSTRING( STRING( YEAR(Month.StartDate
), "9999"), 3).
52 FOR EACH Expiring
OF Property
WHERE Expiring.ExpiringOn
>= Month.StartDate
53 AND Expiring.ExpiringOn
<= Month.EndDate
:
54 month-area
= month-area
+ Expiring.AreaExpiring.
55 month-value
= month-value
+ Expiring.ValueExpiring.
57 DISPLAY Property.PropertyCode month-name month-area month-value
WITH FRAME x .