1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r11
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
15 ------------------------------------------------------------------------*/
16 /* This .W file was created with the Progress UIB.
*/
17 /*----------------------------------------------------------------------*/
19 /* *************************** Definitions
************************** */
21 /* _UIB-CODE-BLOCK-END
*/
25 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
27 /* ******************** Preprocessor Definitions
******************** */
29 &Scoped-define PROCEDURE-TYPE Procedure
33 /* _UIB-PREPROCESSOR-BLOCK-END
*/
38 /* *********************** Procedure Settings
************************ */
40 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
41 /* Settings for
THIS-PROCEDURE
45 Add Fields to
: Neither
46 Other Settings
: CODE-ONLY
COMPILE
48 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
50 /* ************************* Create Window
************************** */
52 &ANALYZE-SUSPEND _CREATE-WINDOW
53 /* DESIGN Window definition
(used by the UIB
)
54 CREATE WINDOW Procedure
ASSIGN
63 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
66 /* *************************** Main Block
*************************** */
68 RUN fix-property-address.
70 RUN fix-rental-space-nulls.
72 /* _UIB-CODE-BLOCK-END
*/
76 /* ********************** Internal Procedures
*********************** */
78 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE calc-date-diff Procedure
79 PROCEDURE calc-date-diff
:
80 /*------------------------------------------------------------------------------
82 ------------------------------------------------------------------------------*/
83 DEF INPUT PARAMETER start-date
AS DATE NO-UNDO.
84 DEF INPUT PARAMETER end-date
AS DATE NO-UNDO.
85 DEF OUTPUT PARAMETER yy
AS INT NO-UNDO.
86 DEF OUTPUT PARAMETER mm
AS INT NO-UNDO.
87 DEF OUTPUT PARAMETER dd
AS INT NO-UNDO.
89 DEF VAR dpm
AS INT NO-UNDO.
90 DEF VAR start-yy
AS INT NO-UNDO.
91 DEF VAR start-mm
AS INT NO-UNDO.
93 dd
= DAY( end-date
). mm
= MONTH( end-date
). yy
= YEAR( end-date
).
94 RUN get-number-of-days
( yy
, mm
, OUTPUT dpm
).
96 dd
= 1 + dd
- DAY( start-date
).
97 start-mm
= MONTH( start-date
).
98 start-yy
= YEAR( start-date
).
102 ASSIGN dd
= 0 mm
= mm
+ 1 .
103 ELSE IF dd
< 0 THEN DO:
104 RUN get-number-of-days
( start-yy
, start-mm
, OUTPUT dpm
).
105 ASSIGN dd
= dd
+ dpm mm
= mm
- 1 .
107 IF mm
< 0 THEN ASSIGN mm
= mm
+ 12 yy
= yy
- 1.
111 /* _UIB-CODE-BLOCK-END
*/
115 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE fix-lease-term Procedure
116 PROCEDURE fix-lease-term
:
117 /*------------------------------------------------------------------------------
121 ------------------------------------------------------------------------------*/
123 FOR EACH TenancyLease
:
125 TenancyLease.LeaseStartDate
, TenancyLease.LeaseEndDate
,
126 OUTPUT TenancyLease.TermYears
,
127 OUTPUT TenancyLease.TermMonths
,
128 OUTPUT TenancyLease.TermDays
).
133 /* _UIB-CODE-BLOCK-END
*/
137 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE fix-property-address Procedure
138 PROCEDURE fix-property-address
:
139 /*------------------------------------------------------------------------------
140 Purpose
: Fix the
CHR(253) in the property street address
141 ------------------------------------------------------------------------------*/
143 DO WHILE INDEX( Property.StreetAddress
, CHR(218)) > 0:
144 SUBSTRING( Property.StreetAddress
, INDEX( Property.StreetAddress
, CHR(218))) = CHR(10).
149 /* _UIB-CODE-BLOCK-END
*/
153 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE fix-rental-space-nulls Procedure
154 PROCEDURE fix-rental-space-nulls
:
155 /*------------------------------------------------------------------------------
157 ------------------------------------------------------------------------------*/
158 FOR EACH RentalSpace
:
159 IF RentalSpace.AreaSize
= ?
THEN RentalSpace.AreaSize
= 0.
160 IF RentalSpace.ContractedRental
= ?
THEN RentalSpace.ContractedRental
= 0.
161 IF RentalSpace.ChargedRental
= ?
THEN RentalSpace.ChargedRental
= 0.
162 IF RentalSpace.MarketRental
= ?
THEN RentalSpace.ContractedRental
= 0.
166 /* _UIB-CODE-BLOCK-END
*/
170 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-number-of-days Procedure
171 PROCEDURE get-number-of-days
:
172 /*------------------------------------------------------------------------------
174 ------------------------------------------------------------------------------*/
175 DEF INPUT PARAMETER yy
AS INT NO-UNDO.
176 DEF INPUT PARAMETER mm
AS INT NO-UNDO.
177 DEF OUTPUT PARAMETER days
AS INT NO-UNDO.
180 WHEN 1 THEN days
= 31.
183 IF (yy
MODULO 4) = 0 THEN days
= days
+ 1.
185 WHEN 3 THEN days
= 31.
186 WHEN 4 THEN days
= 30.
187 WHEN 5 THEN days
= 31.
188 WHEN 6 THEN days
= 30.
189 WHEN 7 THEN days
= 31.
190 WHEN 8 THEN days
= 31.
191 WHEN 9 THEN days
= 30.
192 WHEN 10 THEN days
= 31.
193 WHEN 11 THEN days
= 30.
194 WHEN 12 THEN days
= 31.
199 /* _UIB-CODE-BLOCK-END
*/