Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-treprt.w
blobb98db7226cca283f223e4bf8ebbdfcca1e493e9c
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r2 GUI
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 /*------------------------------------------------------------------------
9 File: v-kcktru.w
10 Description: Kick of transaction update
11 ------------------------------------------------------------------------*/
12 CREATE WIDGET-POOL.
13 /* *************************** Definitions ************************** */
15 DEF VAR this-batch LIKE Batch.BatchCode NO-UNDO.
17 /* _UIB-CODE-BLOCK-END */
18 &ANALYZE-RESUME
21 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
23 /* ******************** Preprocessor Definitions ******************** */
25 &Scoped-define PROCEDURE-TYPE SmartViewer
27 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
29 /* Name of first Frame and/or Browse and/or first Query */
30 &Scoped-define FRAME-NAME F-Main
32 /* External Tables */
33 &Scoped-define FIRST-EXTERNAL-TABLE Batch
34 &Scoped-define EXTERNAL-TABLES Batch
35 /* Need to scope the external tables to this procedure */
36 DEFINE QUERY external_tables FOR Batch.
38 /* Standard List Definitions */
39 &Scoped-Define ENABLED-OBJECTS RECT-13 btn_update
40 &Scoped-Define DISPLAYED-FIELDS Batch.Description Batch.DocumentCount ~
41 Batch.Total Batch.UpdatedOn
42 &Scoped-Define DISPLAYED-OBJECTS fil_Operator fil_Updated
44 /* Custom List Definitions */
45 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
47 /* _UIB-PREPROCESSOR-BLOCK-END */
48 &ANALYZE-RESUME
52 /* *********************** Control Definitions ********************** */
55 /* Definitions of the field level widgets */
56 DEFINE BUTTON btn_update DEFAULT
57 LABEL "&Reprint"
58 SIZE 16 BY 1.45
59 FONT 9.
61 DEFINE VARIABLE fil_Operator AS CHARACTER FORMAT "X(256)":U
62 LABEL "Operator"
63 VIEW-AS FILL-IN
64 SIZE 52.57 BY 1
65 BGCOLOR 16 NO-UNDO.
67 DEFINE VARIABLE fil_Updated AS CHARACTER FORMAT "X(10)" INITIAL "0"
68 LABEL "Updated At"
69 VIEW-AS FILL-IN
70 SIZE 11.43 BY .9
71 BGCOLOR 16 .
73 DEFINE RECTANGLE RECT-13
74 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
75 SIZE 66.86 BY 6.2.
78 /* ************************ Frame Definitions *********************** */
80 DEFINE FRAME F-Main
81 Batch.Description AT ROW 1.4 COL 12.72 COLON-ALIGNED
82 VIEW-AS FILL-IN
83 SIZE 52.57 BY 1
84 BGCOLOR 16 FONT 11
85 fil_Operator AT ROW 3 COL 12.72 COLON-ALIGNED
86 Batch.DocumentCount AT ROW 4.2 COL 31 COLON-ALIGNED
87 LABEL "Documents"
88 VIEW-AS FILL-IN
89 SIZE 8.43 BY .9
90 BGCOLOR 16
91 Batch.Total AT ROW 4.2 COL 48.72 COLON-ALIGNED FORMAT "-ZZZ,ZZZ,ZZ9.99"
92 VIEW-AS FILL-IN
93 SIZE 16.43 BY .9
94 BGCOLOR 16
95 fil_Updated AT ROW 5.6 COL 12.72 COLON-ALIGNED
96 Batch.UpdatedOn AT ROW 5.6 COL 31 COLON-ALIGNED
97 LABEL "On"
98 VIEW-AS FILL-IN
99 SIZE 11.43 BY .9
100 BGCOLOR 16
101 btn_update AT ROW 5.6 COL 51.29
102 RECT-13 AT ROW 1 COL 1
103 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
104 SIDE-LABELS NO-UNDERLINE THREE-D
105 AT COL 1 ROW 1 SCROLLABLE
106 DEFAULT-BUTTON btn_update.
110 /* *********************** Procedure Settings ************************ */
112 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
113 /* Settings for THIS-PROCEDURE
114 Type: SmartViewer
115 External Tables: ttpl.Batch
116 Allow: Basic,DB-Fields
117 Frames: 1
118 Add Fields to: EXTERNAL-TABLES
119 Other Settings: PERSISTENT-ONLY COMPILE
122 /* This procedure should always be RUN PERSISTENT. Report the error, */
123 /* then cleanup and return. */
124 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
125 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
126 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
127 RETURN.
128 END.
130 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
132 /* ************************* Create Window ************************** */
134 &ANALYZE-SUSPEND _CREATE-WINDOW
135 /* DESIGN Window definition (used by the UIB)
136 CREATE WINDOW V-table-Win ASSIGN
137 HEIGHT = 7
138 WIDTH = 72.
140 &ANALYZE-RESUME
143 /* *************** Runtime Attributes and UIB Settings ************** */
145 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
146 /* SETTINGS FOR WINDOW V-table-Win
147 VISIBLE,,RUN-PERSISTENT */
148 /* SETTINGS FOR FRAME F-Main
149 NOT-VISIBLE Size-to-Fit */
150 ASSIGN
151 FRAME F-Main:SCROLLABLE = FALSE
152 FRAME F-Main:HIDDEN = TRUE.
154 /* SETTINGS FOR FILL-IN Batch.Description IN FRAME F-Main
155 NO-ENABLE */
156 /* SETTINGS FOR FILL-IN Batch.DocumentCount IN FRAME F-Main
157 NO-ENABLE EXP-LABEL */
158 /* SETTINGS FOR FILL-IN fil_Operator IN FRAME F-Main
159 NO-ENABLE */
160 /* SETTINGS FOR FILL-IN fil_Updated IN FRAME F-Main
161 NO-ENABLE */
162 /* SETTINGS FOR FILL-IN Batch.Total IN FRAME F-Main
163 NO-ENABLE EXP-FORMAT */
164 /* SETTINGS FOR FILL-IN Batch.UpdatedOn IN FRAME F-Main
165 NO-ENABLE EXP-LABEL */
166 /* _RUN-TIME-ATTRIBUTES-END */
167 &ANALYZE-RESUME
170 /* Setting information for Queries and Browse Widgets fields */
172 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
173 /* Query rebuild information for FRAME F-Main
174 _Options = "NO-LOCK"
175 _Query is NOT OPENED
176 */ /* FRAME F-Main */
177 &ANALYZE-RESUME
182 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
183 /* ************************* Included-Libraries *********************** */
185 {src/adm/method/viewer.i}
186 {inc/method/m-drlvwr.i}
188 /* _UIB-CODE-BLOCK-END */
189 &ANALYZE-RESUME
194 /* ************************ Control Triggers ************************ */
196 &Scoped-define SELF-NAME btn_update
197 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_update V-table-Win
198 ON CHOOSE OF btn_update IN FRAME F-Main /* Reprint */
201 ASSIGN
202 RB-REPORT-LIBRARY = "REPORTS"
203 RB-REPORT-NAME = "Transaction Update"
204 RB-FILTER = "Batch.BatchCode = " + STRING(Batch.BatchCode)
207 RUN rb-run-report.
210 RUN notify( 'set-busy, CONTAINER-SOURCE':U ).
211 DISABLE {&SELF-NAME}.
212 RUN process/report/trnpst.p( Batch.BatchCode ).
213 ENABLE {&SELF-NAME}.
214 RUN notify( 'set-idle, CONTAINER-SOURCE':U ).
215 RUN dispatch ( 'exit':U ).
216 END.
218 /* _UIB-CODE-BLOCK-END */
219 &ANALYZE-RESUME
222 &UNDEFINE SELF-NAME
224 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
227 /* *************************** Main Block *************************** */
229 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
230 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
231 &ENDIF
233 /************************ INTERNAL PROCEDURES ********************/
235 /* _UIB-CODE-BLOCK-END */
236 &ANALYZE-RESUME
239 /* ********************** Internal Procedures *********************** */
241 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
242 PROCEDURE adm-row-available :
243 /*------------------------------------------------------------------------------
244 Purpose: Dispatched to this procedure when the record-
245 source has a new row available. This procedure
246 tries to get the new row and display it.
247 Parameters: <none>
248 ------------------------------------------------------------------------------*/
250 /* Define variables needed by this internal procedure. */
251 {src/adm/template/row-head.i}
253 /* Create a list of all the tables that we need to get. */
254 {src/adm/template/row-list.i "Batch"}
256 /* Get the record ROWID's from the RECORD-SOURCE. */
257 {src/adm/template/row-get.i}
259 /* FIND each record specified by the RECORD-SOURCE. */
260 {src/adm/template/row-find.i "Batch"}
262 /* Process the newly available records (i.e. display fields,
263 open queries, and/or pass records on to any RECORD-TARGETS). */
264 {src/adm/template/row-end.i}
266 END PROCEDURE.
268 /* _UIB-CODE-BLOCK-END */
269 &ANALYZE-RESUME
272 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
273 PROCEDURE disable_UI :
274 /*------------------------------------------------------------------------------
275 Purpose: DISABLE the User Interface
276 Parameters: <none>
277 Notes: Here we clean-up the user-interface by deleting
278 dynamic widgets we have created and/or hide
279 frames. This procedure is usually called when
280 we are ready to "clean-up" after running.
281 ------------------------------------------------------------------------------*/
282 /* Hide all frames. */
283 HIDE FRAME F-Main.
284 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
285 END PROCEDURE.
287 /* _UIB-CODE-BLOCK-END */
288 &ANALYZE-RESUME
291 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE post-row-available V-table-Win
292 PROCEDURE post-row-available :
293 /*------------------------------------------------------------------------------
294 Purpose: Set the local batch code to the current row available
295 ------------------------------------------------------------------------------*/
296 IF AVAILABLE(Batch) THEN DO:
297 FIND Person WHERE Person.PersonCode = Batch.OperatorCode NO-LOCK NO-ERROR.
298 IF AVAILABLE(Person) AND Person.PersonCode > 0 THEN DO:
299 ASSIGN
300 fil_Operator = Person.FirstName + " " + Person.LastName
302 DISPLAY fil_Operator
303 WITH FRAME {&FRAME-NAME} IN WINDOW {&WINDOW-NAME}.
304 END.
305 fil_Updated = STRING( Batch.UpdatedAt, "HH:MM:SS").
306 DISPLAY fil_Updated
307 WITH FRAME {&FRAME-NAME} IN WINDOW {&WINDOW-NAME}.
308 END.
309 END PROCEDURE.
311 /* _UIB-CODE-BLOCK-END */
312 &ANALYZE-RESUME
315 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
316 PROCEDURE send-records :
317 /*------------------------------------------------------------------------------
318 Purpose: Send record ROWID's for all tables used by
319 this file.
320 Parameters: see template/snd-head.i
321 ------------------------------------------------------------------------------*/
323 /* Define variables needed by this internal procedure. */
324 {src/adm/template/snd-head.i}
326 /* For each requested table, put it's ROWID in the output list. */
327 {src/adm/template/snd-list.i "Batch"}
329 /* Deal with any unexpected table requests before closing. */
330 {src/adm/template/snd-end.i}
332 END PROCEDURE.
334 /* _UIB-CODE-BLOCK-END */
335 &ANALYZE-RESUME
338 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
339 PROCEDURE state-changed :
340 /* -----------------------------------------------------------
341 Purpose:
342 Parameters: <none>
343 Notes:
344 -------------------------------------------------------------*/
345 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
346 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
348 CASE p-state:
349 /* Object instance CASEs can go here to replace standard behavior
350 or add new cases. */
351 {src/adm/template/vstates.i}
352 END CASE.
353 END PROCEDURE.
355 /* _UIB-CODE-BLOCK-END */
356 &ANALYZE-RESUME