1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
8 ------------------------------------------------------------------------*/
10 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
12 DEF VAR preview
AS LOGI
NO-UNDO INIT Yes.
13 DEF VAR user-name
AS CHAR NO-UNDO.
14 DEF VAR property-1
AS INT NO-UNDO.
15 DEF VAR property-n
AS INT NO-UNDO.
16 DEF VAR charge-date
AS DATE NO-UNDO.
19 {inc
/username.i
"user-name"}
20 DEF VAR timeStamp
AS CHAR FORMAT "X(44)" NO-UNDO.
21 timeStamp
= STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
23 /* _UIB-CODE-BLOCK-END
*/
27 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
29 /* ******************** Preprocessor Definitions
******************** */
31 &Scoped-define PROCEDURE-TYPE Procedure
35 /* _UIB-PREPROCESSOR-BLOCK-END
*/
40 /* *********************** Procedure Settings
************************ */
42 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
43 /* Settings for
THIS-PROCEDURE
47 Add Fields to
: Neither
48 Other Settings
: CODE-ONLY
COMPILE
50 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
52 /* ************************* Create Window
************************** */
54 &ANALYZE-SUSPEND _CREATE-WINDOW
55 /* DESIGN Window definition
(used by the UIB
)
56 CREATE WINDOW Procedure
ASSIGN
59 /* END WINDOW DEFINITION
*/
65 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
66 /* ************************* Included-Libraries
*********************** */
68 {inc
/method
/m-txtrep.i
}
70 /* _UIB-CODE-BLOCK-END
*/
75 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
78 /* *************************** Main Block
*************************** */
81 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
83 RUN pclrep-start
( preview
, "reset,portrait,tm,2,a4,lm,6,courier,cpi,18,lpi,9").
91 /* _UIB-CODE-BLOCK-END
*/
95 /* ********************** Internal Procedures
*********************** */
97 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-property Procedure
98 PROCEDURE each-property
:
99 /*------------------------------------------------------------------------------
101 ------------------------------------------------------------------------------*/
102 FOR EACH TenancyLease
NO-LOCK OF Property
WHERE TenancyLease.LeaseStatus
<> "PAST",
103 FIRST Tenant
NO-LOCK OF TenancyLease
104 BY Tenant.TenantCode
:
105 RUN each-tenancy-lease.
110 /* _UIB-CODE-BLOCK-END
*/
114 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-tenancy-lease Procedure
115 PROCEDURE each-tenancy-lease
:
116 /*------------------------------------------------------------------------------
118 ------------------------------------------------------------------------------*/
119 /* report goes here
-
120 e.g pclrep-line
( "Helvetica,Point,12,Proportional,Normal", "Some Text"
122 FOR EACH RentCharge
NO-LOCK OF TenancyLease
,
123 FIRST RentChargeLine
NO-LOCK OF TenancyLease
124 WHERE RentChargeLine.RentChargeLineStatus
= "C"
125 AND RentChargeLine.StartDate
>= charge-date
126 AND (RentChargeLine.EndDate
= ?
127 OR RentChargeLine.EndDate
>= charge-date
):
128 RUN each-rent-charge.
133 /* _UIB-CODE-BLOCK-END
*/
137 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
138 PROCEDURE inst-page-footer
:
139 /*------------------------------------------------------------------------------
140 Purpose
: Print any page footer
141 ------------------------------------------------------------------------------*/
145 /* _UIB-CODE-BLOCK-END
*/
149 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-header Procedure
150 PROCEDURE inst-page-header
:
151 /*------------------------------------------------------------------------------
152 Purpose
: Print any page header
153 ------------------------------------------------------------------------------*/
155 RUN pclrep-line
( "univers,Point,7,bold,Proportional", TimeStamp
).
156 RUN pclrep-line
( "univers,Point,12,bold,Proportional",
157 SPC
(45) + "Report Header - {&FILE-NAME}"
159 RUN pclrep-line
( "", "" ).
161 /* Put any column headers here
*/
165 /* _UIB-CODE-BLOCK-END
*/
169 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
170 PROCEDURE parse-parameters
:
171 /*------------------------------------------------------------------------------
173 ------------------------------------------------------------------------------*/
174 DEF VAR token
AS CHAR NO-UNDO.
175 DEF VAR i
AS INT NO-UNDO.
177 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
178 token
= ENTRY( i
, report-options
, "~n" ).
180 CASE ENTRY( 1, token
):
182 WHEN "Preview" THEN preview
= Yes.
184 WHEN "ChargeDate" THEN charge-date
= DATE( ENTRY(2,token
) ).
186 WHEN "Property" THEN DO:
187 CASE ENTRY( 2, token
):
188 WHEN "Range" THEN ASSIGN
189 property-1
= INT( ENTRY(3,token
) )
190 property-n
= INT( ENTRY(4,token
) ).
191 WHEN "Single" THEN ASSIGN
192 property-1
= INT( ENTRY(3,token
) )
193 property-n
= property-1.
203 /* _UIB-CODE-BLOCK-END
*/
207 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE rent-schedule Procedure
208 PROCEDURE rent-schedule
:
209 /*------------------------------------------------------------------------------
211 ------------------------------------------------------------------------------*/
212 FOR EACH Property
WHERE Property.PropertyCode
>= property-1
213 AND Property.PropertyCode
<= property-n
NO-LOCK:
218 /* _UIB-CODE-BLOCK-END
*/