Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / report / tntaddr.p
blob3240c9d1feecec3fb77294b9185cfb73d9a8bb80
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r11
2 &ANALYZE-RESUME
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
7 DEF VAR report-options AS CHAR NO-UNDO INITIAL "33,33,0,99999".
8 DEF VAR preview AS LOGICAL NO-UNDO INITIAL Yes.
10 /* page control */
11 DEF VAR prt-ctrl AS CHAR NO-UNDO.
12 DEF VAR cols AS INT NO-UNDO.
13 DEF VAR rows AS INT NO-UNDO.
14 DEF VAR user-name AS CHAR NO-UNDO.
15 {inc/username.i "user-name"}
17 DEF VAR p1 AS INT NO-UNDO. p1 = INTEGER( ENTRY( 1, report-options)).
18 DEF VAR p2 AS INT NO-UNDO. p2 = INTEGER( ENTRY( 2, report-options)).
19 DEF VAR t1 AS INT NO-UNDO. t1 = INTEGER( ENTRY( 3, report-options)).
20 DEF VAR t2 AS INT NO-UNDO. t2 = INTEGER( ENTRY( 4, report-options)).
22 /* page header */
23 &SCOPED-DEFINE page-width 165
24 &SCOPED-DEFINE with-clause NO-BOX USE-TEXT NO-LABELS WIDTH {&page-width}
26 DEF VAR timeStamp AS CHAR FORMAT "X(44)" NO-UNDO.
27 timeStamp = STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
28 DEF VAR hline2 AS CHAR FORMAT "X({&page-width})" NO-UNDO.
29 DEF VAR hline3 AS CHAR FORMAT "X({&page-width})" NO-UNDO.
30 hline2 = "Tenant Address Information".
31 hline2 = SUBSTRING( STRING("","X({&page-width})"), 1, INTEGER(({&page-width} - LENGTH(hline2) ) / 2)) + hline2.
32 hline3 = "line 2".
33 hline3 = SUBSTRING( STRING("","X({&page-width})"), 1, INTEGER(({&page-width} - LENGTH(hline3) ) / 2)) + hline3.
35 DEFINE FRAME heading-frame WITH 1 DOWN {&with-clause} PAGE-TOP.
36 FORM HEADER
37 timeStamp "Page " + STRING( PAGE-NUMBER ) TO {&page-width} SKIP (1)
38 hline2 FORMAT "X({&page-width})"
39 hline3 FORMAT "X({&page-width})"
40 SKIP (2) ""
41 WITH FRAME heading-frame.
43 DEF VAR out-line AS CHAR FORMAT "X({&page-width})" NO-UNDO.
44 DEFINE FRAME listing-frame WITH DOWN {&with-clause}.
45 FORM
46 out-line FORMAT "X({&page-width})"
47 WITH FRAME listing-frame.
51 /* $History: TNTADDR.P $
53 * ***************** Version 7 *****************
54 * User: Andrew Date: 22/12/97 Time: 14:49
55 * Updated in $/PROCESS/REPORT
56 * Should only check in a couple of items - let's see!
58 * ***************** Version 6 *****************
59 * User: Andrew Date: 22/12/97 Time: 9:44
60 * Updated in $/PROCESS/REPORT
61 * Testing new SS version
63 * ***************** Version 5 *****************
64 * User: Andrew Date: 19/12/97 Time: 10:46
65 * Updated in $/PROCESS/REPORT
66 * Sending an update to OZ and to Auckland
68 * ***************** Version 4 *****************
69 * User: Andrew Date: 20/05/97 Time: 20:21
70 * Updated in $/PROCESS/REPORT
71 * At home
73 * ***************** Version 3 *****************
74 * User: Andrew Date: 14/05/97 Time: 9:48
75 * Updated in $/PROCESS/REPORT
76 * Back from Auckland
78 * ***************** Version 2 *****************
79 * User: Andrew Date: 24/04/97 Time: 17:42
80 * Updated in $/PROCESS/REPORT
81 * Leaving Sydney
83 * ***************** Version 1 *****************
84 * User: Andrew Date: 19/04/97 Time: 11:39
85 * Created in $/PROCESS/REPORT
89 /* _UIB-CODE-BLOCK-END */
90 &ANALYZE-RESUME
93 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
95 /* ******************** Preprocessor Definitions ******************** */
97 &Scoped-define PROCEDURE-TYPE Procedure
101 /* _UIB-PREPROCESSOR-BLOCK-END */
102 &ANALYZE-RESUME
106 /* *********************** Procedure Settings ************************ */
108 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
109 /* Settings for THIS-PROCEDURE
110 Type: Procedure
111 Allow:
112 Frames: 0
113 Add Fields to: Neither
114 Other Settings: CODE-ONLY COMPILE
116 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
118 /* ************************* Create Window ************************** */
120 &ANALYZE-SUSPEND _CREATE-WINDOW
121 /* DESIGN Window definition (used by the UIB)
122 CREATE WINDOW Procedure ASSIGN
123 HEIGHT = .67
124 WIDTH = 30.14.
126 &ANALYZE-RESUME
130 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
131 /* ************************* Included-Libraries *********************** */
133 {inc/method/m-txtrep.i}
135 /* _UIB-CODE-BLOCK-END */
136 &ANALYZE-RESUME
140 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
143 /* *************************** Main Block *************************** */
145 RUN make-control-string ( "PCL", "reset,portrait,tm,2,a4,lm,6,courier,cpi,18,lpi,9",
146 OUTPUT prt-ctrl, OUTPUT rows, OUTPUT cols ).
148 RUN output-control-file ( prt-ctrl ).
149 OUTPUT TO VALUE(txtrep-print-file) KEEP-MESSAGES PAGE-SIZE VALUE(rows).
151 VIEW FRAME heading-frame.
153 FOR EACH Property WHERE Property.PropertyCode >= p1 AND Property.PropertyCode <= p2 NO-LOCK:
154 RUN each-property.
155 END.
158 OUTPUT CLOSE.
159 RUN view-output-file ( preview ).
161 WAIT-FOR "WINDOW-CLOSE":U OF CURRENT-WINDOW.
163 /* _UIB-CODE-BLOCK-END */
164 &ANALYZE-RESUME
167 /* ********************** Internal Procedures *********************** */
169 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-property Procedure
170 PROCEDURE each-property :
171 /*------------------------------------------------------------------------------
172 Purpose:
173 ------------------------------------------------------------------------------*/
175 FOR EACH Tenant WHERE Tenant.EntityType = "P" AND Tenant.EntityCode = Property.PropertyCode
176 AND Tenant.TenantCode >= t1 AND Tenant.TenantCode <= t2 NO-LOCK:
177 RUN each-tenant.
178 END.
180 END PROCEDURE.
182 /* _UIB-CODE-BLOCK-END */
183 &ANALYZE-RESUME
186 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE each-tenant Procedure
187 PROCEDURE each-tenant :
188 /*------------------------------------------------------------------------------
189 Purpose:
190 ------------------------------------------------------------------------------*/
191 DEF VAR acct-matters AS CHAR NO-UNDO.
192 DEF VAR prop-matters AS CHAR NO-UNDO.
193 DEF VAR ah1-address AS CHAR NO-UNDO.
194 DEF VAR ah2-address AS CHAR NO-UNDO.
196 DEF VAR i AS INT NO-UNDO.
198 out-line = Tenant.Name.
199 RUN print-line.
200 RUN get-address( Tenant.BillingContact, OUTPUT acct-matters ).
201 RUN get-address( Tenant.PropertyContact, OUTPUT prop-matters ).
202 RUN get-address( Tenant.AH1Contact, OUTPUT ah1-address ).
203 RUN get-address( Tenant.AH2Contact, OUTPUT ah2-address ).
205 IF acct-matters <> "" THEN acct-matters = "Accounting Matters~n" + acct-matters.
206 IF prop-matters <> "" THEN prop-matters = "Property Matters~n" + prop-matters.
207 IF ah1-address <> "" THEN ah1-address = "After Hours #1~n" + ah1-address.
208 IF ah2-address <> "" THEN ah2-address = "After Hours #2~n" + ah2-address.
210 acct-matters = acct-matters + FILL( "~n", 10).
211 prop-matters = prop-matters + FILL( "~n", 10).
212 ah1-address = ah1-address + FILL( "~n", 10).
213 ah2-address = ah2-address + FILL( "~n", 10).
215 DO i = 1 TO 7:
216 out-line = STRING( ENTRY( i, acct-matters, "~n"), "X(40)")
217 + STRING( ENTRY( i, prop-matters, "~n"), "X(40)")
218 + STRING( ENTRY( i, ah1-address, "~n"), "X(40)")
219 + STRING( ENTRY( i, ah2-address, "~n"), "X(40)")
221 IF TRIM(out-line) = "" THEN LEAVE.
222 out-line = RIGHT-TRIM( out-line ).
223 RUN print-line.
224 END.
225 out-line = FILL( "-", {&page-width}).
226 RUN print-line.
227 END PROCEDURE.
229 /* _UIB-CODE-BLOCK-END */
230 &ANALYZE-RESUME
233 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-address Procedure
234 PROCEDURE get-address :
235 /*------------------------------------------------------------------------------
236 Purpose:
237 Parameters: <none>
238 Notes:
239 ------------------------------------------------------------------------------*/
240 DEF INPUT PARAMETER contact-code LIKE Person.PersonCode NO-UNDO.
241 DEF OUTPUT PARAMETER address AS CHAR NO-UNDO INITIAL "".
243 FIND Person WHERE Person.PersonCode = contact-code NO-LOCK NO-ERROR.
244 IF NOT AVAILABLE(Person) THEN RETURN.
245 RUN process/getaddr.p( "PERSON", contact-code, "BILL,POST,MAIN", OUTPUT address).
247 END PROCEDURE.
249 /* _UIB-CODE-BLOCK-END */
250 &ANALYZE-RESUME
253 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-line Procedure
254 PROCEDURE print-line :
255 /*------------------------------------------------------------------------------
256 Purpose:
257 ------------------------------------------------------------------------------*/
259 DISPLAY out-line WITH FRAME listing-frame.
260 DOWN WITH FRAME listing-frame.
262 END PROCEDURE.
264 /* _UIB-CODE-BLOCK-END */
265 &ANALYZE-RESUME