Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / vwr / mnt / v-batch-compare.w
blob0a2e3a81327403365cd77c05dfc13385d215127f
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
2 &ANALYZE-RESUME
3 /* Connected Databases
4 ttpl PROGRESS
5 */
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
10 File:
12 Description: from VIEWER.W - Template for SmartViewer Objects
14 ------------------------------------------------------------------------*/
16 CREATE WIDGET-POOL.
18 /* *************************** Definitions ************************** */
20 /* _UIB-CODE-BLOCK-END */
21 &ANALYZE-RESUME
24 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
26 /* ******************** Preprocessor Definitions ******************** */
28 &Scoped-define PROCEDURE-TYPE SmartViewer
29 &Scoped-define DB-AWARE no
31 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
33 /* Name of first Frame and/or Browse and/or first Query */
34 &Scoped-define FRAME-NAME F-Main
36 /* External Tables */
37 &Scoped-define EXTERNAL-TABLES NewBatch
38 &Scoped-define FIRST-EXTERNAL-TABLE NewBatch
41 /* Need to scope the external tables to this procedure */
42 DEFINE QUERY external_tables FOR NewBatch.
43 /* Standard List Definitions */
44 &Scoped-Define ENABLED-OBJECTS fil_BatchCode tgl_reverse tgl_Preview ~
45 btn_Compare RECT-33
46 &Scoped-Define DISPLAYED-FIELDS NewBatch.BatchCode NewBatch.Description
47 &Scoped-Define DISPLAYED-OBJECTS fil_BatchCode tgl_reverse tgl_Preview
49 /* Custom List Definitions */
50 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
52 /* _UIB-PREPROCESSOR-BLOCK-END */
53 &ANALYZE-RESUME
57 /* *********************** Control Definitions ********************** */
60 /* Definitions of the field level widgets */
61 DEFINE BUTTON btn_Compare
62 LABEL "&Compare"
63 SIZE 10 BY 1.05
64 FONT 10.
66 DEFINE VARIABLE fil_BatchCode AS INTEGER FORMAT ">>>>>>9" INITIAL 0
67 LABEL "Posted Batch"
68 VIEW-AS FILL-IN
69 SIZE 8 BY 1.05 TOOLTIP "The posted batch to compare this batch with".
71 DEFINE RECTANGLE RECT-33
72 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
73 SIZE 51 BY 7.25.
75 DEFINE VARIABLE tgl_Preview AS LOGICAL INITIAL no
76 LABEL "Preview"
77 VIEW-AS TOGGLE-BOX
78 SIZE 9 BY 1
79 FONT 10 NO-UNDO.
81 DEFINE VARIABLE tgl_reverse AS LOGICAL INITIAL no
82 LABEL "Reversed Comparison"
83 VIEW-AS TOGGLE-BOX
84 SIZE 19 BY 1
85 FONT 10 NO-UNDO.
88 /* ************************ Frame Definitions *********************** */
90 DEFINE FRAME F-Main
91 NewBatch.BatchCode AT ROW 1.5 COL 11 COLON-ALIGNED
92 VIEW-AS FILL-IN
93 SIZE 8 BY 1.05
94 NewBatch.Description AT ROW 2.75 COL 11 COLON-ALIGNED
95 VIEW-AS FILL-IN
96 SIZE 37.14 BY 1.05
97 fil_BatchCode AT ROW 5 COL 11 COLON-ALIGNED
98 tgl_reverse AT ROW 6 COL 13
99 tgl_Preview AT ROW 7 COL 13
100 btn_Compare AT ROW 7 COL 41
101 RECT-33 AT ROW 1 COL 1
102 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
103 SIDE-LABELS NO-UNDERLINE THREE-D
104 AT COL 1 ROW 1 SCROLLABLE
105 FONT 10.
108 /* *********************** Procedure Settings ************************ */
110 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
111 /* Settings for THIS-PROCEDURE
112 Type: SmartViewer
113 External Tables: TTPL.NewBatch
114 Allow: Basic,DB-Fields
115 Frames: 1
116 Add Fields to: EXTERNAL-TABLES
117 Other Settings: PERSISTENT-ONLY COMPILE
120 /* This procedure should always be RUN PERSISTENT. Report the error, */
121 /* then cleanup and return. */
122 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
123 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
124 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
125 RETURN.
126 END.
128 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
130 /* ************************* Create Window ************************** */
132 &ANALYZE-SUSPEND _CREATE-WINDOW
133 /* DESIGN Window definition (used by the UIB)
134 CREATE WINDOW V-table-Win ASSIGN
135 HEIGHT = 12.05
136 WIDTH = 56.57.
137 /* END WINDOW DEFINITION */
139 &ANALYZE-RESUME
141 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
142 /* ************************* Included-Libraries *********************** */
144 {src/adm/method/viewer.i}
145 {inc/method/m-mntvwr.i}
147 /* _UIB-CODE-BLOCK-END */
148 &ANALYZE-RESUME
153 /* *********** Runtime Attributes and AppBuilder Settings *********** */
155 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
156 /* SETTINGS FOR WINDOW V-table-Win
157 VISIBLE,,RUN-PERSISTENT */
158 /* SETTINGS FOR FRAME F-Main
159 NOT-VISIBLE Size-to-Fit */
160 ASSIGN
161 FRAME F-Main:SCROLLABLE = FALSE
162 FRAME F-Main:HIDDEN = TRUE.
164 /* SETTINGS FOR FILL-IN NewBatch.BatchCode IN FRAME F-Main
165 NO-ENABLE */
166 /* SETTINGS FOR FILL-IN NewBatch.Description IN FRAME F-Main
167 NO-ENABLE */
168 /* _RUN-TIME-ATTRIBUTES-END */
169 &ANALYZE-RESUME
172 /* Setting information for Queries and Browse Widgets fields */
174 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
175 /* Query rebuild information for FRAME F-Main
176 _Options = "NO-LOCK"
177 _Query is NOT OPENED
178 */ /* FRAME F-Main */
179 &ANALYZE-RESUME
185 /* ************************ Control Triggers ************************ */
187 &Scoped-define SELF-NAME btn_Compare
188 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Compare V-table-Win
189 ON CHOOSE OF btn_Compare IN FRAME F-Main /* Compare */
191 RUN run-report.
192 RUN dispatch( 'exit':U ).
193 END.
195 /* _UIB-CODE-BLOCK-END */
196 &ANALYZE-RESUME
199 &UNDEFINE SELF-NAME
201 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
204 /* *************************** Main Block *************************** */
206 /* _UIB-CODE-BLOCK-END */
207 &ANALYZE-RESUME
210 /* ********************** Internal Procedures *********************** */
212 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
213 PROCEDURE adm-row-available :
214 /*------------------------------------------------------------------------------
215 Purpose: Dispatched to this procedure when the Record-
216 Source has a new row available. This procedure
217 tries to get the new row (or foriegn keys) from
218 the Record-Source and process it.
219 Parameters: <none>
220 ------------------------------------------------------------------------------*/
222 /* Define variables needed by this internal procedure. */
223 {src/adm/template/row-head.i}
225 /* Create a list of all the tables that we need to get. */
226 {src/adm/template/row-list.i "NewBatch"}
228 /* Get the record ROWID's from the RECORD-SOURCE. */
229 {src/adm/template/row-get.i}
231 /* FIND each record specified by the RECORD-SOURCE. */
232 {src/adm/template/row-find.i "NewBatch"}
234 /* Process the newly available records (i.e. display fields,
235 open queries, and/or pass records on to any RECORD-TARGETS). */
236 {src/adm/template/row-end.i}
238 END PROCEDURE.
240 /* _UIB-CODE-BLOCK-END */
241 &ANALYZE-RESUME
243 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
244 PROCEDURE disable_UI :
245 /*------------------------------------------------------------------------------
246 Purpose: DISABLE the User Interface
247 Parameters: <none>
248 Notes: Here we clean-up the user-interface by deleting
249 dynamic widgets we have created and/or hide
250 frames. This procedure is usually called when
251 we are ready to "clean-up" after running.
252 ------------------------------------------------------------------------------*/
253 /* Hide all frames. */
254 HIDE FRAME F-Main.
255 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
256 END PROCEDURE.
258 /* _UIB-CODE-BLOCK-END */
259 &ANALYZE-RESUME
261 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
262 PROCEDURE enable-appropriate-fields :
263 /*------------------------------------------------------------------------------
264 Purpose:
265 ------------------------------------------------------------------------------*/
266 DO WITH FRAME {&FRAME-NAME}:
267 /* nothing to do as yet */
268 END.
270 END PROCEDURE.
272 /* _UIB-CODE-BLOCK-END */
273 &ANALYZE-RESUME
275 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
276 PROCEDURE inst-initialize :
277 /*------------------------------------------------------------------------------
278 Purpose:
279 ------------------------------------------------------------------------------*/
281 END PROCEDURE.
283 /* _UIB-CODE-BLOCK-END */
284 &ANALYZE-RESUME
286 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-row-available V-table-Win
287 PROCEDURE inst-row-available :
288 /*------------------------------------------------------------------------------
289 Purpose:
290 ------------------------------------------------------------------------------*/
292 RUN enable-appropriate-fields.
294 END PROCEDURE.
296 /* _UIB-CODE-BLOCK-END */
297 &ANALYZE-RESUME
299 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
300 PROCEDURE run-report :
301 /*------------------------------------------------------------------------------
302 Purpose: Actually run the rent charge program.
303 ------------------------------------------------------------------------------*/
304 RUN notify( 'set-busy,container-source':U ).
306 DEF VAR report-options AS CHAR NO-UNDO.
308 DO WITH FRAME {&FRAME-NAME}:
309 ASSIGN fil_BatchCode tgl_Reverse .
310 END.
312 report-options = "UnpostedBatch," + STRING(NewBatch.BatchCode)
313 + "PostedBatch," + STRING(fil_BatchCode)
314 + (IF tgl_Reverse THEN "~nReverse" ELSE "")
315 + (IF tgl_Preview THEN "~nPreview" ELSE "") .
317 RUN process/report/batch-compare.p ( report-options ).
319 RUN notify( 'set-idle,container-source':U ).
321 END PROCEDURE.
323 /* _UIB-CODE-BLOCK-END */
324 &ANALYZE-RESUME
326 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
327 PROCEDURE send-records :
328 /*------------------------------------------------------------------------------
329 Purpose: Send record ROWID's for all tables used by
330 this file.
331 Parameters: see template/snd-head.i
332 ------------------------------------------------------------------------------*/
334 /* Define variables needed by this internal procedure. */
335 {src/adm/template/snd-head.i}
337 /* For each requested table, put it's ROWID in the output list. */
338 {src/adm/template/snd-list.i "NewBatch"}
340 /* Deal with any unexpected table requests before closing. */
341 {src/adm/template/snd-end.i}
343 END PROCEDURE.
345 /* _UIB-CODE-BLOCK-END */
346 &ANALYZE-RESUME
348 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
349 PROCEDURE state-changed :
350 /* -----------------------------------------------------------
351 Purpose:
352 Parameters: <none>
353 Notes:
354 -------------------------------------------------------------*/
355 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
356 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
358 CASE p-state:
359 /* Object instance CASEs can go here to replace standard behavior
360 or add new cases. */
361 {src/adm/template/vstates.i}
362 END CASE.
363 END PROCEDURE.
365 /* _UIB-CODE-BLOCK-END */
366 &ANALYZE-RESUME