Add blank column, rename column.
[capital-apms-progress.git] / process / report / rent-schedule.p
blob6ebc997c292b5159387e4b7f49281d6c2dae3000
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 Report:
6 Author:
7 Date:
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 */
24 &ANALYZE-RESUME
27 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
29 /* ******************** Preprocessor Definitions ******************** */
31 &Scoped-define PROCEDURE-TYPE Procedure
35 /* _UIB-PREPROCESSOR-BLOCK-END */
36 &ANALYZE-RESUME
40 /* *********************** Procedure Settings ************************ */
42 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
43 /* Settings for THIS-PROCEDURE
44 Type: Procedure
45 Allow:
46 Frames: 0
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
57 HEIGHT = .08
58 WIDTH = 32.57.
59 /* END WINDOW DEFINITION */
61 &ANALYZE-RESUME
65 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
66 /* ************************* Included-Libraries *********************** */
68 {inc/method/m-txtrep.i}
70 /* _UIB-CODE-BLOCK-END */
71 &ANALYZE-RESUME
75 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
78 /* *************************** Main Block *************************** */
79 RUN parse-parameters.
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").
85 RUN rent-schedule.
87 OUTPUT CLOSE.
89 RUN pclrep-finish.
91 /* _UIB-CODE-BLOCK-END */
92 &ANALYZE-RESUME
95 /* ********************** Internal Procedures *********************** */
97 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-property Procedure
98 PROCEDURE each-property :
99 /*------------------------------------------------------------------------------
100 Purpose:
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.
106 END.
108 END PROCEDURE.
110 /* _UIB-CODE-BLOCK-END */
111 &ANALYZE-RESUME
114 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-tenancy-lease Procedure
115 PROCEDURE each-tenancy-lease :
116 /*------------------------------------------------------------------------------
117 Purpose:
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.
129 END.
131 END PROCEDURE.
133 /* _UIB-CODE-BLOCK-END */
134 &ANALYZE-RESUME
137 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
138 PROCEDURE inst-page-footer :
139 /*------------------------------------------------------------------------------
140 Purpose: Print any page footer
141 ------------------------------------------------------------------------------*/
143 END PROCEDURE.
145 /* _UIB-CODE-BLOCK-END */
146 &ANALYZE-RESUME
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 */
163 END PROCEDURE.
165 /* _UIB-CODE-BLOCK-END */
166 &ANALYZE-RESUME
169 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
170 PROCEDURE parse-parameters :
171 /*------------------------------------------------------------------------------
172 Purpose:
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.
194 END CASE.
195 END.
197 END CASE.
199 END.
201 END PROCEDURE.
203 /* _UIB-CODE-BLOCK-END */
204 &ANALYZE-RESUME
207 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE rent-schedule Procedure
208 PROCEDURE rent-schedule :
209 /*------------------------------------------------------------------------------
210 Purpose:
211 ------------------------------------------------------------------------------*/
212 FOR EACH Property WHERE Property.PropertyCode >= property-1
213 AND Property.PropertyCode <= property-n NO-LOCK:
214 RUN each-property.
215 END.
216 END PROCEDURE.
218 /* _UIB-CODE-BLOCK-END */
219 &ANALYZE-RESUME