Added capital works blank section. Synced calling screen.
[capital-apms-progress.git] / vwr / mnt / v-tr-c.w
blob3664af9d51ec0b3b18ac2fdf31a511f207ac5e08
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 /*------------------------------------------------------------------------
9 File:
10 Description:
11 ------------------------------------------------------------------------*/
12 CREATE WIDGET-POOL.
13 /* *************************** Definitions ************************** */
15 DEF VAR user-name AS CHAR INITIAL "Andrew" 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
26 &Scoped-define DB-AWARE no
28 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
30 /* Name of first Frame and/or Browse and/or first Query */
31 &Scoped-define FRAME-NAME F-Main
33 /* External Tables */
34 &Scoped-define EXTERNAL-TABLES RP
35 &Scoped-define FIRST-EXTERNAL-TABLE RP
38 /* Need to scope the external tables to this procedure */
39 DEFINE QUERY external_tables FOR RP.
40 /* Standard List Definitions */
41 &Scoped-Define ENABLED-FIELDS RP.Char1 RP.Int1 RP.Int5 RP.Int2 RP.Int6 ~
42 RP.Log1 RP.Log5 RP.Char3 RP.Log2
43 &Scoped-define ENABLED-TABLES RP
44 &Scoped-define FIRST-ENABLED-TABLE RP
45 &Scoped-Define ENABLED-OBJECTS cmb_month1 cmb_month2 btn_Browse Btn_OK ~
46 RECT-1
47 &Scoped-Define DISPLAYED-FIELDS RP.Char1 RP.Int1 RP.Int5 RP.Int2 RP.Int6 ~
48 RP.Log1 RP.Log5 RP.Char3 RP.Log2
49 &Scoped-define DISPLAYED-TABLES RP
50 &Scoped-define FIRST-DISPLAYED-TABLE RP
51 &Scoped-Define DISPLAYED-OBJECTS fil_cred1 fil_comp1 fil_cred2 fil_comp2 ~
52 cmb_month1 cmb_month2
54 /* Custom List Definitions */
55 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
56 &Scoped-define ADM-CREATE-FIELDS RP.Log2
57 &Scoped-define ADM-ASSIGN-FIELDS RP.Log2
59 /* _UIB-PREPROCESSOR-BLOCK-END */
60 &ANALYZE-RESUME
64 /* *********************** Control Definitions ********************** */
67 /* Definitions of the field level widgets */
68 DEFINE BUTTON btn_Browse
69 LABEL "Browse"
70 SIZE 5.72 BY 1.05
71 FONT 10.
73 DEFINE BUTTON Btn_OK AUTO-GO DEFAULT
74 LABEL "OK"
75 SIZE 12 BY 1
76 BGCOLOR 8 FONT 10.
78 DEFINE VARIABLE cmb_month1 AS CHARACTER FORMAT "X(256)":U
79 LABEL "Period"
80 VIEW-AS COMBO-BOX INNER-LINES 15
81 LIST-ITEMS "Item 1"
82 DROP-DOWN-LIST
83 SIZE 17.14 BY 1 NO-UNDO.
85 DEFINE VARIABLE cmb_month2 AS CHARACTER FORMAT "X(256)":U
86 LABEL "To"
87 VIEW-AS COMBO-BOX INNER-LINES 15
88 LIST-ITEMS "Item 1"
89 DROP-DOWN-LIST
90 SIZE 17.14 BY 1 NO-UNDO.
92 DEFINE VARIABLE fil_comp1 AS CHARACTER FORMAT "X(256)":U
93 VIEW-AS FILL-IN
94 SIZE 51 BY 1
95 BGCOLOR 16 NO-UNDO.
97 DEFINE VARIABLE fil_comp2 AS CHARACTER FORMAT "X(256)":U
98 VIEW-AS FILL-IN
99 SIZE 51 BY 1
100 BGCOLOR 16 NO-UNDO.
102 DEFINE VARIABLE fil_cred1 AS CHARACTER FORMAT "X(256)":U
103 VIEW-AS FILL-IN
104 SIZE 51 BY 1
105 BGCOLOR 16 NO-UNDO.
107 DEFINE VARIABLE fil_cred2 AS CHARACTER FORMAT "X(256)":U
108 VIEW-AS FILL-IN
109 SIZE 51 BY 1
110 BGCOLOR 16 NO-UNDO.
112 DEFINE RECTANGLE RECT-1
113 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
114 SIZE 72 BY 13.75.
117 /* ************************ Frame Definitions *********************** */
119 DEFINE FRAME F-Main
120 RP.Char1 AT ROW 1.5 COL 3 NO-LABEL
121 VIEW-AS RADIO-SET VERTICAL
122 RADIO-BUTTONS
123 "All creditors", "All":U,
124 "for a single Creditor", "C1":U,
125 "for a range of Creditor Codes", "CR":U,
126 "Creditors of a single company", "L1":U,
127 "Creditors of a range of companies", "LR":U
128 SIZE 31 BY 5
129 FONT 10
130 RP.Int1 AT ROW 7.2 COL 10 COLON-ALIGNED HELP
132 LABEL "Creditor" FORMAT "99999"
133 VIEW-AS FILL-IN
134 SIZE 6.29 BY 1
135 RP.Int5 AT ROW 7.2 COL 10 COLON-ALIGNED
136 LABEL "Company" FORMAT "99999"
137 VIEW-AS FILL-IN
138 SIZE 6.29 BY 1
139 fil_cred1 AT ROW 7.2 COL 19.14 COLON-ALIGNED NO-LABEL
140 fil_comp1 AT ROW 7.2 COL 19.14 COLON-ALIGNED NO-LABEL
141 RP.Int2 AT ROW 8.2 COL 10 COLON-ALIGNED HELP
143 LABEL "to" FORMAT "99999"
144 VIEW-AS FILL-IN
145 SIZE 6.29 BY 1
146 RP.Int6 AT ROW 8.2 COL 10 COLON-ALIGNED
147 LABEL "to" FORMAT "99999"
148 VIEW-AS FILL-IN
149 SIZE 6.29 BY 1
150 fil_cred2 AT ROW 8.2 COL 19.14 COLON-ALIGNED NO-LABEL
151 fil_comp2 AT ROW 8.2 COL 19.14 COLON-ALIGNED NO-LABEL
152 cmb_month1 AT ROW 9.65 COL 10 COLON-ALIGNED
153 cmb_month2 AT ROW 9.65 COL 36.29 COLON-ALIGNED
154 RP.Log1 AT ROW 11.25 COL 12 HELP
156 LABEL "Include closed transactions"
157 VIEW-AS TOGGLE-BOX
158 SIZE 23.43 BY .8
159 FONT 10
160 RP.Log5 AT ROW 12.25 COL 12
161 LABEL "Export to"
162 VIEW-AS TOGGLE-BOX
163 SIZE 9.14 BY .8
164 FONT 10
165 RP.Char3 AT ROW 12.25 COL 20.29 COLON-ALIGNED HELP
166 "" NO-LABEL FORMAT "X(256)"
167 VIEW-AS FILL-IN
168 SIZE 44 BY 1.05
169 btn_Browse AT ROW 12.25 COL 66.29
170 RP.Log2 AT ROW 13.25 COL 12 HELP
172 LABEL "Preview"
173 VIEW-AS TOGGLE-BOX
174 SIZE 11.72 BY .8
175 FONT 10
176 Btn_OK AT ROW 13.45 COL 60
177 RECT-1 AT ROW 1 COL 1
178 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
179 SIDE-LABELS NO-UNDERLINE THREE-D
180 AT COL 1 ROW 1 SCROLLABLE
181 FONT 10
182 DEFAULT-BUTTON Btn_OK.
185 /* *********************** Procedure Settings ************************ */
187 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
188 /* Settings for THIS-PROCEDURE
189 Type: SmartViewer
190 External Tables: ttpl.RP
191 Allow: Basic,DB-Fields
192 Frames: 1
193 Add Fields to: EXTERNAL-TABLES
194 Other Settings: PERSISTENT-ONLY COMPILE
197 /* This procedure should always be RUN PERSISTENT. Report the error, */
198 /* then cleanup and return. */
199 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
200 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
201 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
202 RETURN.
203 END.
205 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
207 /* ************************* Create Window ************************** */
209 &ANALYZE-SUSPEND _CREATE-WINDOW
210 /* DESIGN Window definition (used by the UIB)
211 CREATE WINDOW V-table-Win ASSIGN
212 HEIGHT = 18.6
213 WIDTH = 76.
214 /* END WINDOW DEFINITION */
216 &ANALYZE-RESUME
218 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
219 /* ************************* Included-Libraries *********************** */
221 {src/adm/method/viewer.i}
222 {inc/method/m-mntvwr.i}
224 /* _UIB-CODE-BLOCK-END */
225 &ANALYZE-RESUME
230 /* *********** Runtime Attributes and AppBuilder Settings *********** */
232 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
233 /* SETTINGS FOR WINDOW V-table-Win
234 VISIBLE,,RUN-PERSISTENT */
235 /* SETTINGS FOR FRAME F-Main
236 NOT-VISIBLE Size-to-Fit */
237 ASSIGN
238 FRAME F-Main:SCROLLABLE = FALSE
239 FRAME F-Main:HIDDEN = TRUE.
241 /* SETTINGS FOR FILL-IN RP.Char3 IN FRAME F-Main
242 EXP-LABEL EXP-FORMAT EXP-HELP */
243 /* SETTINGS FOR FILL-IN fil_comp1 IN FRAME F-Main
244 NO-ENABLE */
245 /* SETTINGS FOR FILL-IN fil_comp2 IN FRAME F-Main
246 NO-ENABLE */
247 /* SETTINGS FOR FILL-IN fil_cred1 IN FRAME F-Main
248 NO-ENABLE */
249 /* SETTINGS FOR FILL-IN fil_cred2 IN FRAME F-Main
250 NO-ENABLE */
251 /* SETTINGS FOR FILL-IN RP.Int1 IN FRAME F-Main
252 EXP-LABEL EXP-FORMAT EXP-HELP */
253 /* SETTINGS FOR FILL-IN RP.Int2 IN FRAME F-Main
254 EXP-LABEL EXP-FORMAT EXP-HELP */
255 /* SETTINGS FOR FILL-IN RP.Int5 IN FRAME F-Main
256 EXP-LABEL EXP-FORMAT */
257 /* SETTINGS FOR FILL-IN RP.Int6 IN FRAME F-Main
258 EXP-LABEL EXP-FORMAT */
259 /* SETTINGS FOR TOGGLE-BOX RP.Log1 IN FRAME F-Main
260 EXP-LABEL EXP-HELP */
261 /* SETTINGS FOR TOGGLE-BOX RP.Log2 IN FRAME F-Main
262 1 2 EXP-LABEL EXP-HELP */
263 /* SETTINGS FOR TOGGLE-BOX RP.Log5 IN FRAME F-Main
264 EXP-LABEL */
265 /* _RUN-TIME-ATTRIBUTES-END */
266 &ANALYZE-RESUME
269 /* Setting information for Queries and Browse Widgets fields */
271 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
272 /* Query rebuild information for FRAME F-Main
273 _Options = "NO-LOCK"
274 _Query is NOT OPENED
275 */ /* FRAME F-Main */
276 &ANALYZE-RESUME
282 /* ************************ Control Triggers ************************ */
284 &Scoped-define SELF-NAME btn_Browse
285 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Browse V-table-Win
286 ON CHOOSE OF btn_Browse IN FRAME F-Main /* Browse */
288 RUN select-file-dialog .
289 END.
291 /* _UIB-CODE-BLOCK-END */
292 &ANALYZE-RESUME
295 &Scoped-define SELF-NAME Btn_OK
296 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
297 ON CHOOSE OF Btn_OK IN FRAME F-Main /* OK */
299 DISABLE Btn_OK WITH FRAME {&FRAME-NAME}.
300 RUN run-report.
301 ENABLE Btn_OK WITH FRAME {&FRAME-NAME}.
302 END.
304 /* _UIB-CODE-BLOCK-END */
305 &ANALYZE-RESUME
308 &Scoped-define SELF-NAME RP.Char1
309 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
310 ON VALUE-CHANGED OF RP.Char1 IN FRAME F-Main /* Char1 */
312 RUN enable-appropriate-fields.
313 END.
315 /* _UIB-CODE-BLOCK-END */
316 &ANALYZE-RESUME
319 &Scoped-define SELF-NAME cmb_month1
320 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month1 V-table-Win
321 ON U1 OF cmb_month1 IN FRAME F-Main /* Period */
323 {inc/selcmb/scmths1.i "RP" "Int3"}
324 END.
326 /* _UIB-CODE-BLOCK-END */
327 &ANALYZE-RESUME
330 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month1 V-table-Win
331 ON U2 OF cmb_month1 IN FRAME F-Main /* Period */
333 {inc/selcmb/scmths2.i "RP" "Int3"}
334 END.
336 /* _UIB-CODE-BLOCK-END */
337 &ANALYZE-RESUME
340 &Scoped-define SELF-NAME cmb_month2
341 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month2 V-table-Win
342 ON U1 OF cmb_month2 IN FRAME F-Main /* To */
344 {inc/selcmb/scmthe1.i "RP" "Int4"}
345 END.
347 /* _UIB-CODE-BLOCK-END */
348 &ANALYZE-RESUME
351 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month2 V-table-Win
352 ON U2 OF cmb_month2 IN FRAME F-Main /* To */
354 {inc/selcmb/scmthe2.i "RP" "Int4"}
355 END.
357 /* _UIB-CODE-BLOCK-END */
358 &ANALYZE-RESUME
361 &Scoped-define SELF-NAME fil_comp1
362 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
363 ON U1 OF fil_comp1 IN FRAME F-Main
365 {inc/selfil/sfcmp1.i "RP" "Int5"}
366 END.
368 /* _UIB-CODE-BLOCK-END */
369 &ANALYZE-RESUME
372 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
373 ON U2 OF fil_comp1 IN FRAME F-Main
375 {inc/selfil/sfcmp2.i "RP" "Int5"}
376 END.
378 /* _UIB-CODE-BLOCK-END */
379 &ANALYZE-RESUME
382 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
383 ON U3 OF fil_comp1 IN FRAME F-Main
385 {inc/selfil/sfcmp3.i "RP" "Int5"}
386 END.
388 /* _UIB-CODE-BLOCK-END */
389 &ANALYZE-RESUME
392 &Scoped-define SELF-NAME fil_comp2
393 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
394 ON U1 OF fil_comp2 IN FRAME F-Main
396 {inc/selfil/sfcmp1.i "RP" "Int6"}
397 END.
399 /* _UIB-CODE-BLOCK-END */
400 &ANALYZE-RESUME
403 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
404 ON U2 OF fil_comp2 IN FRAME F-Main
406 {inc/selfil/sfcmp2.i "RP" "Int6"}
407 END.
409 /* _UIB-CODE-BLOCK-END */
410 &ANALYZE-RESUME
413 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
414 ON U3 OF fil_comp2 IN FRAME F-Main
416 {inc/selfil/sfcmp3.i "RP" "Int6"}
417 END.
419 /* _UIB-CODE-BLOCK-END */
420 &ANALYZE-RESUME
423 &Scoped-define SELF-NAME fil_cred1
424 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred1 V-table-Win
425 ON U1 OF fil_cred1 IN FRAME F-Main
427 {inc/selfil/sfcrd1.i "RP" "Int1"}
428 END.
430 /* _UIB-CODE-BLOCK-END */
431 &ANALYZE-RESUME
434 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred1 V-table-Win
435 ON U2 OF fil_cred1 IN FRAME F-Main
437 {inc/selfil/sfcrd2.i "RP" "Int1"}
438 END.
440 /* _UIB-CODE-BLOCK-END */
441 &ANALYZE-RESUME
444 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred1 V-table-Win
445 ON U3 OF fil_cred1 IN FRAME F-Main
447 {inc/selfil/sfcrd3.i "RP" "Int1"}
448 END.
450 /* _UIB-CODE-BLOCK-END */
451 &ANALYZE-RESUME
454 &Scoped-define SELF-NAME fil_cred2
455 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred2 V-table-Win
456 ON U1 OF fil_cred2 IN FRAME F-Main
458 {inc/selfil/sfcrd1.i "RP" "Int2"}
459 END.
461 /* _UIB-CODE-BLOCK-END */
462 &ANALYZE-RESUME
465 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred2 V-table-Win
466 ON U2 OF fil_cred2 IN FRAME F-Main
468 {inc/selfil/sfcrd2.i "RP" "Int2"}
469 END.
471 /* _UIB-CODE-BLOCK-END */
472 &ANALYZE-RESUME
475 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_cred2 V-table-Win
476 ON U3 OF fil_cred2 IN FRAME F-Main
478 {inc/selfil/sfcrd3.i "RP" "Int2"}
479 END.
481 /* _UIB-CODE-BLOCK-END */
482 &ANALYZE-RESUME
485 &Scoped-define SELF-NAME RP.Int1
486 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
487 ON LEAVE OF RP.Int1 IN FRAME F-Main /* Creditor */
489 {inc/selcde/cdcrd.i "fil_cred1"}
490 END.
492 /* _UIB-CODE-BLOCK-END */
493 &ANALYZE-RESUME
496 &Scoped-define SELF-NAME RP.Int2
497 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
498 ON LEAVE OF RP.Int2 IN FRAME F-Main /* to */
500 {inc/selcde/cdcrd.i "fil_cred2"}
501 END.
503 /* _UIB-CODE-BLOCK-END */
504 &ANALYZE-RESUME
507 &Scoped-define SELF-NAME RP.Int5
508 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int5 V-table-Win
509 ON LEAVE OF RP.Int5 IN FRAME F-Main /* Company */
511 DO WITH FRAME {&FRAME-NAME}:
512 {inc/selcde/cdcmp.i "fil_comp1"}
513 END.
514 END.
516 /* _UIB-CODE-BLOCK-END */
517 &ANALYZE-RESUME
520 &Scoped-define SELF-NAME RP.Int6
521 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int6 V-table-Win
522 ON LEAVE OF RP.Int6 IN FRAME F-Main /* to */
524 {inc/selcde/cdcmp.i "fil_comp2"}
525 END.
527 /* _UIB-CODE-BLOCK-END */
528 &ANALYZE-RESUME
531 &Scoped-define SELF-NAME RP.Log5
532 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log5 V-table-Win
533 ON VALUE-CHANGED OF RP.Log5 IN FRAME F-Main /* Export to */
535 RUN enable-appropriate-fields.
536 END.
538 /* _UIB-CODE-BLOCK-END */
539 &ANALYZE-RESUME
542 &UNDEFINE SELF-NAME
544 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
547 /* *************************** Main Block *************************** */
549 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
550 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
551 &ENDIF
553 /************************ INTERNAL PROCEDURES ********************/
555 /* _UIB-CODE-BLOCK-END */
556 &ANALYZE-RESUME
559 /* ********************** Internal Procedures *********************** */
561 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
562 PROCEDURE adm-row-available :
563 /*------------------------------------------------------------------------------
564 Purpose: Dispatched to this procedure when the Record-
565 Source has a new row available. This procedure
566 tries to get the new row (or foriegn keys) from
567 the Record-Source and process it.
568 Parameters: <none>
569 ------------------------------------------------------------------------------*/
571 /* Define variables needed by this internal procedure. */
572 {src/adm/template/row-head.i}
574 /* Create a list of all the tables that we need to get. */
575 {src/adm/template/row-list.i "RP"}
577 /* Get the record ROWID's from the RECORD-SOURCE. */
578 {src/adm/template/row-get.i}
580 /* FIND each record specified by the RECORD-SOURCE. */
581 {src/adm/template/row-find.i "RP"}
583 /* Process the newly available records (i.e. display fields,
584 open queries, and/or pass records on to any RECORD-TARGETS). */
585 {src/adm/template/row-end.i}
587 END PROCEDURE.
589 /* _UIB-CODE-BLOCK-END */
590 &ANALYZE-RESUME
592 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
593 PROCEDURE disable_UI :
594 /*------------------------------------------------------------------------------
595 Purpose: DISABLE the User Interface
596 Parameters: <none>
597 Notes: Here we clean-up the user-interface by deleting
598 dynamic widgets we have created and/or hide
599 frames. This procedure is usually called when
600 we are ready to "clean-up" after running.
601 ------------------------------------------------------------------------------*/
602 /* Hide all frames. */
603 HIDE FRAME F-Main.
604 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
605 END PROCEDURE.
607 /* _UIB-CODE-BLOCK-END */
608 &ANALYZE-RESUME
610 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
611 PROCEDURE enable-appropriate-fields :
612 /*------------------------------------------------------------------------------
613 Purpose: As its name!
614 ------------------------------------------------------------------------------*/
616 DO WITH FRAME {&FRAME-NAME}:
617 IF INPUT RP.Char1 = "All" THEN DO:
618 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred1:HANDLE ), "HIDDEN = Yes" ).
619 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred2:HANDLE ), "HIDDEN = Yes" ).
620 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp1:HANDLE ), "HIDDEN = Yes" ).
621 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp2:HANDLE ), "HIDDEN = Yes" ).
622 HIDE RP.Int1 fil_cred1 RP.Int2 fil_cred2 RP.Int5 RP.Int6 fil_comp1 fil_comp2.
623 END.
624 ELSE IF INPUT RP.Char1 = "CR" THEN DO:
625 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred1:HANDLE ), "HIDDEN = No" ).
626 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred2:HANDLE ), "HIDDEN = No" ).
627 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp1:HANDLE ), "HIDDEN = Yes" ).
628 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp2:HANDLE ), "HIDDEN = Yes" ).
629 VIEW RP.Int1 fil_cred1 RP.Int2 fil_cred2.
630 HIDE RP.Int5 RP.Int6 fil_comp1 fil_comp2.
631 END.
632 ELSE IF INPUT RP.Char1 = "C1" THEN DO:
633 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred1:HANDLE ), "HIDDEN = No" ).
634 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred2:HANDLE ), "HIDDEN = Yes" ).
635 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp1:HANDLE ), "HIDDEN = Yes" ).
636 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp2:HANDLE ), "HIDDEN = Yes" ).
637 HIDE RP.Int2 fil_cred2 RP.Int5 RP.Int6 fil_comp1 fil_comp2.
638 VIEW RP.Int1 fil_cred1.
639 END.
640 ELSE IF INPUT RP.Char1 = "LR" THEN DO:
641 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred1:HANDLE ), "HIDDEN = Yes" ).
642 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred2:HANDLE ), "HIDDEN = Yes" ).
643 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp1:HANDLE ), "HIDDEN = No" ).
644 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp2:HANDLE ), "HIDDEN = No" ).
645 HIDE RP.Int1 fil_cred1 RP.Int2 fil_cred2.
646 VIEW RP.Int5 fil_comp1 RP.Int6 fil_comp2.
647 END.
648 ELSE IF INPUT RP.Char1 = "L1" THEN DO:
649 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred1:HANDLE ), "HIDDEN = Yes" ).
650 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_cred2:HANDLE ), "HIDDEN = Yes" ).
651 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp1:HANDLE ), "HIDDEN = No" ).
652 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_comp2:HANDLE ), "HIDDEN = Yes" ).
653 HIDE RP.Int1 fil_cred1 RP.Int2 fil_cred2 RP.Int6 fil_comp2.
654 VIEW RP.Int5 fil_comp1.
655 END.
656 IF INPUT RP.Log5 THEN DO:
657 VIEW RP.Char3 btn_Browse .
658 HIDE RP.Log2 .
659 END.
660 ELSE DO:
661 HIDE RP.Char3 btn_Browse .
662 VIEW RP.Log2 .
663 END.
664 END.
666 END PROCEDURE.
668 /* _UIB-CODE-BLOCK-END */
669 &ANALYZE-RESUME
671 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
672 PROCEDURE inst-initialize :
673 /*------------------------------------------------------------------------------
674 Purpose: Initialise the necessary bits and pieces
675 ------------------------------------------------------------------------------*/
676 RUN get-username IN sec-mgr ( OUTPUT user-name ).
677 FIND RP WHERE RP.ReportID = "tr-c"
678 AND RP.UserName = user-name
679 NO-ERROR.
681 IF NOT AVAILABLE( RP ) THEN DO:
682 CREATE RP.
683 ASSIGN
684 RP.ReportID = "tr-c"
685 RP.UserName = user-name
687 END.
689 RUN dispatch ( 'display-fields':U ).
690 RUN dispatch ( 'enable-fields':U ).
691 RUN enable-appropriate-fields.
693 END PROCEDURE.
695 /* _UIB-CODE-BLOCK-END */
696 &ANALYZE-RESUME
698 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
699 PROCEDURE pre-destroy :
700 /*------------------------------------------------------------------------------
701 Purpose:
702 ------------------------------------------------------------------------------*/
703 RUN check-modified( 'clear':U ).
704 END PROCEDURE.
706 /* _UIB-CODE-BLOCK-END */
707 &ANALYZE-RESUME
709 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
710 PROCEDURE run-report :
711 /*------------------------------------------------------------------------------
712 Purpose: Actually run the report program.
713 ------------------------------------------------------------------------------*/
714 DEF VAR c1 AS INT INITIAL 0 NO-UNDO.
715 DEF VAR c2 AS INT INITIAL 99999 NO-UNDO.
716 DEF VAR e1 AS INT INITIAL 0 NO-UNDO.
717 DEF VAR e2 AS INT INITIAL 99999 NO-UNDO.
718 DEF VAR et AS CHAR INITIAL "C" NO-UNDO.
719 DEF VAR report-options AS CHAR NO-UNDO.
721 RUN dispatch IN THIS-PROCEDURE ('update-record':U).
723 DO WITH FRAME {&FRAME-NAME}:
724 IF RP.Char1 = "CR" THEN DO:
725 ASSIGN c1 = RP.Int1 c2 = RP.Int2 .
726 END.
727 ELSE IF RP.Char1 = "C1" THEN DO:
728 ASSIGN c1 = RP.Int1 c2 = RP.Int1 .
729 END.
730 ELSE IF RP.Char1 = "LR" THEN DO:
731 et = "L".
732 ASSIGN e1 = RP.Int5 e2 = RP.Int6 .
733 END.
734 ELSE IF RP.Char1 = "L1" THEN DO:
735 et = "L".
736 ASSIGN e1 = RP.Int5 e2 = RP.Int5 .
737 END.
738 ELSE IF RP.Char1 = "All" THEN DO:
739 FIND FIRST Creditor NO-LOCK.
740 c1 = Creditor.CreditorCode.
741 FIND LAST Creditor NO-LOCK.
742 c2 = Creditor.CreditorCode.
743 END.
744 END.
745 report-options = "EntityType," + et
746 + "~nEntityRange," + STRING(e1) + "," + STRING(e2)
747 + "~nCreditorRange," + STRING(c1) + "," + STRING(c2)
748 + "~nMonthRange," + STRING(RP.Int3) + "," + STRING(RP.Int4)
749 + (IF RP.Log1 THEN "~nShow-All" ELSE "")
750 + (IF RP.Log5 THEN "~nExport," + RP.Char3 ELSE "")
751 + (IF RP.Log2 THEN "~nPreview" ELSE "") .
753 RUN notify( 'set-busy,container-source':U ).
754 RUN process/report/tr-c.p ( report-options ).
755 RUN notify( 'set-idle,container-source':U ).
757 END PROCEDURE.
759 /* _UIB-CODE-BLOCK-END */
760 &ANALYZE-RESUME
762 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
763 PROCEDURE select-file-dialog :
764 /*------------------------------------------------------------------------------
765 Purpose:
766 ------------------------------------------------------------------------------*/
767 DEF VAR select-ok AS LOGICAL INITIAL Yes NO-UNDO.
768 DEF VAR file-name AS CHAR NO-UNDO.
769 DEF VAR start-dir AS CHAR NO-UNDO.
771 file-name = INPUT FRAME {&FRAME-NAME} RP.Char3 .
772 start-dir = SUBSTRING( file-name, 1, R-INDEX(file-name, "\" ) ).
774 SYSTEM-DIALOG GET-FILE file-name FILTERS "Comma-separated values" "*.CSV"
775 SAVE-AS ASK-OVERWRITE CREATE-TEST-FILE DEFAULT-EXTENSION ".CSV"
776 INITIAL-DIR start-dir RETURN-TO-START-DIR
777 TITLE "" USE-FILENAME UPDATE select-ok.
779 IF select-ok THEN DO:
780 IF SUBSTRING( file-name, R-INDEX( file-name, ".") ) <> ".CSV" THEN DO:
781 IF (LENGTH( file-name ) - R-INDEX( file-name, "." )) < 4 THEN
782 file-name = SUBSTRING( file-name, 1, R-INDEX( file-name, ".")) + "CSV" .
783 END.
784 RP.Char3:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
785 END.
787 END PROCEDURE.
789 /* _UIB-CODE-BLOCK-END */
790 &ANALYZE-RESUME
792 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
793 PROCEDURE send-records :
794 /*------------------------------------------------------------------------------
795 Purpose: Send record ROWID's for all tables used by
796 this file.
797 Parameters: see template/snd-head.i
798 ------------------------------------------------------------------------------*/
800 /* Define variables needed by this internal procedure. */
801 {src/adm/template/snd-head.i}
803 /* For each requested table, put it's ROWID in the output list. */
804 {src/adm/template/snd-list.i "RP"}
806 /* Deal with any unexpected table requests before closing. */
807 {src/adm/template/snd-end.i}
809 END PROCEDURE.
811 /* _UIB-CODE-BLOCK-END */
812 &ANALYZE-RESUME
814 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
815 PROCEDURE state-changed :
816 /* -----------------------------------------------------------
817 Purpose:
818 Parameters: <none>
819 Notes:
820 -------------------------------------------------------------*/
821 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
822 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
824 CASE p-state:
825 /* Object instance CASEs can go here to replace standard behavior
826 or add new cases. */
827 {src/adm/template/vstates.i}
828 END CASE.
829 END PROCEDURE.
831 /* _UIB-CODE-BLOCK-END */
832 &ANALYZE-RESUME