Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / process / report / lglnam.p
blobf2ef6608e6e001449f2c6071df1a6ac7fa6830f3
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 "".
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"}
18 /* page header */
19 &SCOPED-DEFINE page-width 126
20 &SCOPED-DEFINE with-clause NO-BOX USE-TEXT NO-LABELS WIDTH {&page-width}
22 DEF VAR timeStamp AS CHAR FORMAT "X(44)" NO-UNDO.
23 timeStamp = STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
24 DEF VAR hline2 AS CHAR FORMAT "X({&page-width})" NO-UNDO.
25 DEF VAR hline3 AS CHAR FORMAT "X({&page-width})" NO-UNDO.
26 hline2 = "Tenant Legal Names".
27 hline2 = SUBSTRING( STRING("","X({&page-width})"), 1, INTEGER(({&page-width} - LENGTH(hline2) ) / 2)) + hline2.
28 hline3 = "".
29 hline3 = SUBSTRING( STRING("","X({&page-width})"), 1, INTEGER(({&page-width} - LENGTH(hline3) ) / 2)) + hline3.
31 DEFINE FRAME heading-frame WITH 1 DOWN {&with-clause} PAGE-TOP.
32 FORM HEADER
33 timeStamp "Page " + STRING( PAGE-NUMBER ) TO {&page-width} SKIP (1)
34 hline2 FORMAT "X({&page-width})"
35 hline3 FORMAT "X({&page-width})"
36 SKIP (2) ""
37 WITH FRAME heading-frame.
39 DEF VAR name-type AS CHAR FORMAT "X(3):" NO-UNDO.
40 DEFINE FRAME listing-frame WITH DOWN {&with-clause}.
41 FORM
42 " " name-type Tenant.Name
43 WITH FRAME listing-frame.
45 /* $History: lglnam.P $
47 * ***************** Version 5 *****************
48 * User: Andrew Date: 22/12/97 Time: 14:49
49 * Updated in $/PROCESS/REPORT
50 * Should only check in a couple of items - let's see!
52 * ***************** Version 4 *****************
53 * User: Andrew Date: 22/12/97 Time: 9:44
54 * Updated in $/PROCESS/REPORT
55 * Testing new SS version
57 * ***************** Version 3 *****************
58 * User: Andrew Date: 19/12/97 Time: 10:46
59 * Updated in $/PROCESS/REPORT
60 * Sending an update to OZ and to Auckland
62 * ***************** Version 2 *****************
63 * User: Andrew Date: 26/05/97 Time: 21:49
64 * Updated in $/PROCESS/REPORT
65 * Finished for the night
67 * ***************** Version 1 *****************
68 * User: Andrew Date: 14/04/97 Time: 10:50
69 * Created in $/PROCESS/REPORT
71 * ***************** Version 9 *****************
72 * User: Andrew Date: 28/03/97 Time: 17:27
73 * Updated in $/PROCESS/REPORT
76 /* _UIB-CODE-BLOCK-END */
77 &ANALYZE-RESUME
80 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
82 /* ******************** Preprocessor Definitions ******************** */
84 &Scoped-define PROCEDURE-TYPE Procedure
88 /* _UIB-PREPROCESSOR-BLOCK-END */
89 &ANALYZE-RESUME
93 /* *********************** Procedure Settings ************************ */
95 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
96 /* Settings for THIS-PROCEDURE
97 Type: Procedure
98 Allow:
99 Frames: 0
100 Add Fields to: Neither
101 Other Settings: CODE-ONLY COMPILE
103 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
105 /* ************************* Create Window ************************** */
107 &ANALYZE-SUSPEND _CREATE-WINDOW
108 /* DESIGN Window definition (used by the UIB)
109 CREATE WINDOW Procedure ASSIGN
110 HEIGHT = .67
111 WIDTH = 30.14.
113 &ANALYZE-RESUME
117 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
118 /* ************************* Included-Libraries *********************** */
120 {inc/method/m-txtrep.i}
122 /* _UIB-CODE-BLOCK-END */
123 &ANALYZE-RESUME
127 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
130 /* *************************** Main Block *************************** */
132 RUN make-control-string ( "PCL", "reset,portrait,tm,2,a4,lm,6,courier,cpi,18,lpi,9",
133 OUTPUT prt-ctrl, OUTPUT rows, OUTPUT cols ).
135 RUN output-control-file ( prt-ctrl ).
136 OUTPUT TO VALUE(txtrep-print-file) KEEP-MESSAGES PAGE-SIZE VALUE(rows).
138 DEF VAR first-time AS LOGICAL INITIAL Yes NO-UNDO.
140 FOR EACH Property WHERE Property.Active NO-LOCK
141 BREAK BY Property.Administrator
142 BY Property.ShortName:
143 IF FIRST-OF(Property.Administrator) THEN DO:
144 FIND Person WHERE Person.PersonCode = Property.Administrator NO-LOCK NO-ERROR.
145 IF AVAILABLE(Person) THEN
146 hline3 = Person.FirstName + " " + Person.LastName.
147 ELSE
148 hline3 = "Person not on file".
149 hline3 = SUBSTRING( STRING("","X({&page-width})"), 1, INTEGER(({&page-width} - LENGTH(hline3) ) / 2)) + hline3.
150 IF NOT first-time THEN
151 PAGE.
152 ELSE
153 VIEW FRAME heading-frame.
154 first-time = No.
155 END.
156 PUT UNFORMATTED
157 STRING( Property.PropertyCode, "99999") + " "
158 STRING( Property.ShortName, "X(12)")
159 Property.Name
160 SKIP.
161 FOR EACH Tenant NO-LOCK WHERE Tenant.Active AND Tenant.EntityType = "P"
162 AND Tenant.EntityCode = Property.PropertyCode
163 AND CAN-FIND( FIRST TenancyLease OF Tenant WHERE TenancyLease.LeaseStatus <> "PAST")
164 BY Tenant.Name:
165 DISPLAY "Lgl" @ name-type Tenant.Name WITH FRAME listing-frame.
166 DOWN WITH FRAME listing-frame.
167 DISPLAY "T/A" @ name-type Tenant.LegalName @ Tenant.Name WITH FRAME listing-frame.
168 DOWN WITH FRAME listing-frame.
169 PUT SKIP(1).
170 END.
171 PUT SKIP(2).
172 END.
174 OUTPUT CLOSE.
175 RUN view-output-file ( preview ).
177 /* _UIB-CODE-BLOCK-END */
178 &ANALYZE-RESUME