Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-xperod.w
blobfb6317e4d692af7e46471f2b74860a9de936abfc
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:
10 Description:
11 ------------------------------------------------------------------------*/
12 CREATE WIDGET-POOL.
13 /* *************************** Definitions ************************** */
15 DEF VAR user-name AS CHAR INITIAL "Andrew" NO-UNDO.
17 &GLOB REPORT-ID "xperiod"
19 /* _UIB-CODE-BLOCK-END */
20 &ANALYZE-RESUME
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions ******************** */
27 &Scoped-define PROCEDURE-TYPE SmartViewer
29 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
31 /* Name of first Frame and/or Browse and/or first Query */
32 &Scoped-define FRAME-NAME F-Main
34 /* External Tables */
35 &Scoped-define FIRST-EXTERNAL-TABLE RP
36 &Scoped-define EXTERNAL-TABLES RP
37 /* Need to scope the external tables to this procedure */
38 DEFINE QUERY external_tables FOR RP.
40 /* Standard List Definitions */
41 &Scoped-Define ENABLED-FIELDS RP.Log1
42 &Scoped-define FIELD-PAIRS
43 &Scoped-Define ENABLED-TABLES RP
44 &Scoped-Define ENABLED-OBJECTS RECT-1 Btn_OK
45 &Scoped-Define DISPLAYED-FIELDS RP.Log1
47 /* Custom List Definitions */
48 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
50 /* _UIB-PREPROCESSOR-BLOCK-END */
51 &ANALYZE-RESUME
55 /* *********************** Control Definitions ********************** */
58 /* Definitions of the field level widgets */
59 DEFINE BUTTON Btn_OK AUTO-GO DEFAULT
60 LABEL "OK"
61 SIZE 12 BY 1.2
62 BGCOLOR 8 .
64 DEFINE RECTANGLE RECT-1
65 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
66 SIZE 53.14 BY 5.2.
69 /* ************************ Frame Definitions *********************** */
71 DEFINE FRAME F-Main
72 RP.Log1 AT ROW 4.8 COL 7.29
73 LABEL "Preview"
74 VIEW-AS TOGGLE-BOX
75 SIZE 17.72 BY 1
76 FONT 10
77 Btn_OK AT ROW 4.8 COL 41.57
78 RECT-1 AT ROW 1 COL 1
79 "Cross Period Creditor Transactions" VIEW-AS TEXT
80 SIZE 49.72 BY 1.8 AT ROW 1.6 COL 2.14
81 FONT 12
82 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
83 SIDE-LABELS NO-UNDERLINE THREE-D
84 AT COL 1 ROW 1 SCROLLABLE
85 DEFAULT-BUTTON Btn_OK.
89 /* *********************** Procedure Settings ************************ */
91 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
92 /* Settings for THIS-PROCEDURE
93 Type: SmartViewer
94 External Tables: ttpl.RP
95 Allow: Basic,DB-Fields
96 Frames: 1
97 Add Fields to: EXTERNAL-TABLES
98 Other Settings: PERSISTENT-ONLY COMPILE
101 /* This procedure should always be RUN PERSISTENT. Report the error, */
102 /* then cleanup and return. */
103 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
104 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
105 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
106 RETURN.
107 END.
109 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
111 /* ************************* Create Window ************************** */
113 &ANALYZE-SUSPEND _CREATE-WINDOW
114 /* DESIGN Window definition (used by the UIB)
115 CREATE WINDOW V-table-Win ASSIGN
116 HEIGHT = 6.95
117 WIDTH = 55.
119 &ANALYZE-RESUME
122 /* *************** Runtime Attributes and UIB Settings ************** */
124 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
125 /* SETTINGS FOR WINDOW V-table-Win
126 VISIBLE,,RUN-PERSISTENT */
127 /* SETTINGS FOR FRAME F-Main
128 NOT-VISIBLE Size-to-Fit */
129 ASSIGN
130 FRAME F-Main:SCROLLABLE = FALSE
131 FRAME F-Main:HIDDEN = TRUE.
133 /* SETTINGS FOR TOGGLE-BOX RP.Log1 IN FRAME F-Main
134 EXP-LABEL */
135 /* _RUN-TIME-ATTRIBUTES-END */
136 &ANALYZE-RESUME
139 /* Setting information for Queries and Browse Widgets fields */
141 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
142 /* Query rebuild information for FRAME F-Main
143 _Options = "NO-LOCK"
144 _Query is NOT OPENED
145 */ /* FRAME F-Main */
146 &ANALYZE-RESUME
151 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
152 /* ************************* Included-Libraries *********************** */
154 {src/adm/method/viewer.i}
155 {inc/method/m-mntvwr.i}
157 /* _UIB-CODE-BLOCK-END */
158 &ANALYZE-RESUME
163 /* ************************ Control Triggers ************************ */
165 &Scoped-define SELF-NAME Btn_OK
166 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
167 ON CHOOSE OF Btn_OK IN FRAME F-Main /* OK */
169 RUN run-report.
170 END.
172 /* _UIB-CODE-BLOCK-END */
173 &ANALYZE-RESUME
176 &UNDEFINE SELF-NAME
178 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
181 /* *************************** Main Block *************************** */
183 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
184 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
185 &ENDIF
187 /************************ INTERNAL PROCEDURES ********************/
189 /* _UIB-CODE-BLOCK-END */
190 &ANALYZE-RESUME
193 /* ********************** Internal Procedures *********************** */
195 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
196 PROCEDURE adm-row-available :
197 /*------------------------------------------------------------------------------
198 Purpose: Dispatched to this procedure when the record-
199 source has a new row available. This procedure
200 tries to get the new row and display it.
201 Parameters: <none>
202 ------------------------------------------------------------------------------*/
204 /* Define variables needed by this internal procedure. */
205 {src/adm/template/row-head.i}
207 /* Create a list of all the tables that we need to get. */
208 {src/adm/template/row-list.i "RP"}
210 /* Get the record ROWID's from the RECORD-SOURCE. */
211 {src/adm/template/row-get.i}
213 /* FIND each record specified by the RECORD-SOURCE. */
214 {src/adm/template/row-find.i "RP"}
216 /* Process the newly available records (i.e. display fields,
217 open queries, and/or pass records on to any RECORD-TARGETS). */
218 {src/adm/template/row-end.i}
220 END PROCEDURE.
222 /* _UIB-CODE-BLOCK-END */
223 &ANALYZE-RESUME
226 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
227 PROCEDURE disable_UI :
228 /*------------------------------------------------------------------------------
229 Purpose: DISABLE the User Interface
230 Parameters: <none>
231 Notes: Here we clean-up the user-interface by deleting
232 dynamic widgets we have created and/or hide
233 frames. This procedure is usually called when
234 we are ready to "clean-up" after running.
235 ------------------------------------------------------------------------------*/
236 /* Hide all frames. */
237 HIDE FRAME F-Main.
238 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
239 END PROCEDURE.
241 /* _UIB-CODE-BLOCK-END */
242 &ANALYZE-RESUME
245 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
246 PROCEDURE enable-appropriate-fields :
247 /*------------------------------------------------------------------------------
248 Purpose: As its name!
249 ------------------------------------------------------------------------------*/
251 DO WITH FRAME {&FRAME-NAME}:
252 /* not required */
253 END.
255 END PROCEDURE.
257 /* _UIB-CODE-BLOCK-END */
258 &ANALYZE-RESUME
261 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
262 PROCEDURE inst-initialize :
263 /*------------------------------------------------------------------------------
264 Purpose: Initialise the necessary bits and pieces
265 ------------------------------------------------------------------------------*/
267 RUN get-username IN sec-mgr ( OUTPUT user-name ).
268 FIND RP WHERE RP.ReportID = {&REPORT-ID}
269 AND RP.UserName = user-name
270 NO-ERROR.
272 IF NOT AVAILABLE( RP ) THEN DO:
273 CREATE RP.
274 ASSIGN
275 RP.ReportID = {&REPORT-ID}
276 RP.UserName = user-name
278 END.
280 RUN dispatch ( 'display-fields':U ).
281 RUN dispatch ( 'enable-fields':U ).
282 RUN enable-appropriate-fields.
284 END PROCEDURE.
286 /* _UIB-CODE-BLOCK-END */
287 &ANALYZE-RESUME
290 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
291 PROCEDURE pre-destroy :
292 /*------------------------------------------------------------------------------
293 Purpose:
294 ------------------------------------------------------------------------------*/
295 RUN check-modified( 'clear':U ).
296 END PROCEDURE.
298 /* _UIB-CODE-BLOCK-END */
299 &ANALYZE-RESUME
302 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
303 PROCEDURE run-report :
304 /*------------------------------------------------------------------------------
305 Purpose: Actually run the report program.
306 ------------------------------------------------------------------------------*/
307 DEF VAR c-win AS HANDLE NO-UNDO.
308 DEF VAR report-options AS CHAR NO-UNDO.
310 c-win = CURRENT-WINDOW.
311 IF c-win:LOAD-MOUSE-POINTER("WAIT":U ) THEN .
312 DISABLE Btn_OK WITH FRAME {&FRAME-NAME}.
313 DO TRANSACTION:
314 RUN dispatch IN THIS-PROCEDURE ('update-record':U).
315 END.
317 report-options = RP.Char1.
318 RUN process/report/xperiod.p ( report-options,
319 RP.Log1 /* preview */
321 ENABLE Btn_OK WITH FRAME {&FRAME-NAME}.
322 IF c-win:LOAD-MOUSE-POINTER("ARROW":U ) THEN .
324 END PROCEDURE.
326 /* _UIB-CODE-BLOCK-END */
327 &ANALYZE-RESUME
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
331 PROCEDURE send-records :
332 /*------------------------------------------------------------------------------
333 Purpose: Send record ROWID's for all tables used by
334 this file.
335 Parameters: see template/snd-head.i
336 ------------------------------------------------------------------------------*/
338 /* Define variables needed by this internal procedure. */
339 {src/adm/template/snd-head.i}
341 /* For each requested table, put it's ROWID in the output list. */
342 {src/adm/template/snd-list.i "RP"}
344 /* Deal with any unexpected table requests before closing. */
345 {src/adm/template/snd-end.i}
347 END PROCEDURE.
349 /* _UIB-CODE-BLOCK-END */
350 &ANALYZE-RESUME
353 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
354 PROCEDURE state-changed :
355 /* -----------------------------------------------------------
356 Purpose:
357 Parameters: <none>
358 Notes:
359 -------------------------------------------------------------*/
360 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
361 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
363 CASE p-state:
364 /* Object instance CASEs can go here to replace standard behavior
365 or add new cases. */
366 {src/adm/template/vstates.i}
367 END CASE.
368 END PROCEDURE.
370 /* _UIB-CODE-BLOCK-END */
371 &ANALYZE-RESUME