Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-export-balances.w
blob767be0f28089482484ba6354263b795c177f46bc
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 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 ------------------------------------------------------------------------*/
11 CREATE WIDGET-POOL.
13 DEF VAR mth-desc AS CHAR NO-UNDO.
15 DEFINE TEMP-TABLE MthFigs NO-UNDO
16 FIELD MonthCode AS INT
17 FIELD StartDate AS CHAR FORMAT 'X(13)' COLUMN-LABEL ' From'
18 FIELD EndDate AS CHAR FORMAT 'X(13)' COLUMN-LABEL ' To'
19 FIELD FigsFrom AS CHAR FORMAT ' X' COLUMN-LABEL 'Type'
20 FIELD Description AS CHAR FORMAT 'X(32)' COLUMN-LABEL 'Description'
21 INDEX IX-A IS UNIQUE PRIMARY MonthCode ASCENDING.
23 DEF VAR set-list AS CHAR NO-UNDO INITIAL "".
25 /* _UIB-CODE-BLOCK-END */
26 &ANALYZE-RESUME
29 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
31 /* ******************** Preprocessor Definitions ******************** */
33 &Scoped-define PROCEDURE-TYPE SmartViewer
35 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
37 /* Name of first Frame and/or Browse and/or first Query */
38 &Scoped-define FRAME-NAME F-Main
40 /* External Tables */
41 &Scoped-define EXTERNAL-TABLES RP
42 &Scoped-define FIRST-EXTERNAL-TABLE RP
45 /* Need to scope the external tables to this procedure */
46 DEFINE QUERY external_tables FOR RP.
47 /* Standard List Definitions */
48 &Scoped-Define ENABLED-FIELDS RP.Char1 RP.Int2 RP.Int3 RP.Char2 RP.Dec1 ~
49 RP.Dec2 RP.Log1 RP.Log2 RP.Char5 RP.Log3
50 &Scoped-define FIELD-PAIRS~
51 ~{&FP1}Char1 ~{&FP2}Char1 ~{&FP3}~
52 ~{&FP1}Int2 ~{&FP2}Int2 ~{&FP3}~
53 ~{&FP1}Int3 ~{&FP2}Int3 ~{&FP3}~
54 ~{&FP1}Dec1 ~{&FP2}Dec1 ~{&FP3}~
55 ~{&FP1}Dec2 ~{&FP2}Dec2 ~{&FP3}~
56 ~{&FP1}Char5 ~{&FP2}Char5 ~{&FP3}
57 &Scoped-define ENABLED-TABLES RP
58 &Scoped-define FIRST-ENABLED-TABLE RP
59 &Scoped-Define ENABLED-OBJECTS RECT-2 cmb_AccountGroups cmb_To btn_Browse ~
60 btn_OK
61 &Scoped-Define DISPLAYED-FIELDS RP.Char1 RP.Int2 RP.Int3 RP.Char2 RP.Dec1 ~
62 RP.Dec2 RP.Log1 RP.Log2 RP.Char5 RP.Log3
63 &Scoped-Define DISPLAYED-OBJECTS fil_Entity-1 fil_Entity-2 ~
64 cmb_AccountGroups fil_account1 fil_account2 cmb_To
66 /* Custom List Definitions */
67 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
69 /* _UIB-PREPROCESSOR-BLOCK-END */
70 &ANALYZE-RESUME
73 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
74 /* Actions: ? adm/support/keyedit.w ? ? ? */
75 /* STRUCTURED-DATA
76 <KEY-OBJECT>
77 THIS-PROCEDURE
78 </KEY-OBJECT>
79 <FOREIGN-KEYS>
80 </FOREIGN-KEYS>
81 <EXECUTING-CODE>
82 **************************
83 * Set attributes related to FOREIGN KEYS
85 RUN set-attribute-list (
86 'Keys-Accepted = "",
87 Keys-Supplied = ""':U).
88 /**************************
89 </EXECUTING-CODE> */
91 /* _UIB-CODE-BLOCK-END */
92 &ANALYZE-RESUME
95 /* *********************** Control Definitions ********************** */
98 /* Definitions of the field level widgets */
99 DEFINE BUTTON btn_Browse
100 LABEL "&Browse"
101 SIZE 8.57 BY 1.
103 DEFINE BUTTON btn_OK DEFAULT
104 LABEL "&OK"
105 SIZE 10.86 BY 1.2
106 FONT 9.
108 DEFINE VARIABLE cmb_To AS DATE FORMAT "99/99/9999":U
109 LABEL "To"
110 VIEW-AS COMBO-BOX INNER-LINES 18
111 LIST-ITEMS "31/12/97"
112 SIZE 15 BY 1 NO-UNDO.
114 DEFINE VARIABLE fil_account1 AS CHARACTER FORMAT "X(256)":U
115 VIEW-AS FILL-IN
116 SIZE 50.72 BY 1
117 BGCOLOR 16 NO-UNDO.
119 DEFINE VARIABLE fil_account2 AS CHARACTER FORMAT "X(256)":U
120 VIEW-AS FILL-IN
121 SIZE 50.72 BY 1
122 BGCOLOR 16 NO-UNDO.
124 DEFINE VARIABLE fil_Entity-1 AS CHARACTER FORMAT "X(256)":U
125 VIEW-AS FILL-IN
126 SIZE 52.57 BY 1
127 BGCOLOR 16 NO-UNDO.
129 DEFINE VARIABLE fil_Entity-2 AS CHARACTER FORMAT "X(256)":U
130 VIEW-AS FILL-IN
131 SIZE 52.57 BY 1
132 BGCOLOR 16 NO-UNDO.
134 DEFINE RECTANGLE RECT-2
135 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
136 SIZE 70.86 BY 17.2.
138 DEFINE VARIABLE cmb_AccountGroups AS CHARACTER
139 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
140 SIZE 62.29 BY 7 NO-UNDO.
143 /* ************************ Frame Definitions *********************** */
145 DEFINE FRAME F-Main
146 RP.Char1 AT ROW 1.4 COL 7 COLON-ALIGNED
147 LABEL "Entity" FORMAT "X"
148 VIEW-AS FILL-IN
149 SIZE 2.86 BY 1
150 RP.Int2 AT ROW 1.4 COL 9.86 COLON-ALIGNED HELP
151 "" NO-LABEL FORMAT "99999"
152 VIEW-AS FILL-IN
153 SIZE 6.29 BY 1
154 fil_Entity-1 AT ROW 1.4 COL 16.72 COLON-ALIGNED NO-LABEL
155 RP.Int3 AT ROW 2.55 COL 9.86 COLON-ALIGNED HELP
156 "" NO-LABEL FORMAT "99999"
157 VIEW-AS FILL-IN
158 SIZE 6.29 BY 1
159 fil_Entity-2 AT ROW 2.55 COL 16.72 COLON-ALIGNED NO-LABEL
160 RP.Char2 AT ROW 4.2 COL 1.57 HELP
161 "" NO-LABEL
162 VIEW-AS RADIO-SET HORIZONTAL
163 RADIO-BUTTONS
164 "Account Range", "Range":U,
165 "Account Groups", "Groups":U
166 SIZE 36.57 BY 1
167 cmb_AccountGroups AT ROW 5.2 COL 9 NO-LABEL
168 RP.Dec1 AT ROW 6 COL 7 COLON-ALIGNED HELP
170 LABEL "From" FORMAT "9999.99"
171 VIEW-AS FILL-IN
172 SIZE 8 BY 1
173 fil_account1 AT ROW 6 COL 18.57 COLON-ALIGNED NO-LABEL
174 RP.Dec2 AT ROW 7 COL 7 COLON-ALIGNED HELP
176 LABEL "to" FORMAT "9999.99"
177 VIEW-AS FILL-IN
178 SIZE 8 BY 1
179 fil_account2 AT ROW 7 COL 18.57 COLON-ALIGNED NO-LABEL
180 RP.Log1 AT ROW 12.4 COL 9 HELP
182 LABEL "Detailed"
183 VIEW-AS TOGGLE-BOX
184 SIZE 9.14 BY 1
185 RP.Log2 AT ROW 12.4 COL 28.43 HELP
187 LABEL "Merge sub-accounts"
188 VIEW-AS TOGGLE-BOX
189 SIZE 17.14 BY 1
190 cmb_To AT ROW 13.6 COL 7 COLON-ALIGNED
191 RP.Char5 AT ROW 15 COL 7 COLON-ALIGNED
192 LABEL "File" FORMAT "X(256)"
193 VIEW-AS FILL-IN
194 SIZE 53.72 BY 1
195 btn_Browse AT ROW 15 COL 62.72
196 RP.Log3 AT ROW 16.2 COL 9 HELP
197 "" NO-LABEL
198 VIEW-AS RADIO-SET VERTICAL
199 RADIO-BUTTONS
200 "Entity Rows - Account Columns", TRUE,
201 "Account Rows - Entity Columns", FALSE
202 SIZE 26.29 BY 1.6
203 btn_OK AT ROW 16.8 COL 60.43
204 RECT-2 AT ROW 1 COL 1
205 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
206 SIDE-LABELS NO-UNDERLINE THREE-D
207 AT COL 1 ROW 1 SCROLLABLE
208 FONT 10
209 DEFAULT-BUTTON btn_OK.
212 /* *********************** Procedure Settings ************************ */
214 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
215 /* Settings for THIS-PROCEDURE
216 Type: SmartViewer
217 External Tables: ttpl.RP
218 Allow: Basic,DB-Fields
219 Frames: 1
220 Add Fields to: EXTERNAL-TABLES
221 Other Settings: PERSISTENT-ONLY COMPILE
224 /* This procedure should always be RUN PERSISTENT. Report the error, */
225 /* then cleanup and return. */
226 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
227 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
228 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
229 RETURN.
230 END.
232 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
234 /* ************************* Create Window ************************** */
236 &ANALYZE-SUSPEND _CREATE-WINDOW
237 /* DESIGN Window definition (used by the UIB)
238 CREATE WINDOW V-table-Win ASSIGN
239 HEIGHT = 20.15
240 WIDTH = 83.86.
241 /* END WINDOW DEFINITION */
243 &ANALYZE-RESUME
246 /* *************** Runtime Attributes and UIB Settings ************** */
248 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
249 /* SETTINGS FOR WINDOW V-table-Win
250 VISIBLE,,RUN-PERSISTENT */
251 /* SETTINGS FOR FRAME F-Main
252 NOT-VISIBLE Size-to-Fit */
253 ASSIGN
254 FRAME F-Main:SCROLLABLE = FALSE
255 FRAME F-Main:HIDDEN = TRUE.
257 /* SETTINGS FOR FILL-IN RP.Char1 IN FRAME F-Main
258 EXP-LABEL EXP-FORMAT */
259 /* SETTINGS FOR RADIO-SET RP.Char2 IN FRAME F-Main
260 EXP-HELP */
261 /* SETTINGS FOR FILL-IN RP.Char5 IN FRAME F-Main
262 EXP-LABEL EXP-FORMAT */
263 /* SETTINGS FOR FILL-IN RP.Dec1 IN FRAME F-Main
264 EXP-LABEL EXP-FORMAT EXP-HELP */
265 /* SETTINGS FOR FILL-IN RP.Dec2 IN FRAME F-Main
266 EXP-LABEL EXP-FORMAT EXP-HELP */
267 /* SETTINGS FOR FILL-IN fil_account1 IN FRAME F-Main
268 NO-ENABLE */
269 /* SETTINGS FOR FILL-IN fil_account2 IN FRAME F-Main
270 NO-ENABLE */
271 /* SETTINGS FOR FILL-IN fil_Entity-1 IN FRAME F-Main
272 NO-ENABLE */
273 /* SETTINGS FOR FILL-IN fil_Entity-2 IN FRAME F-Main
274 NO-ENABLE */
275 /* SETTINGS FOR FILL-IN RP.Int2 IN FRAME F-Main
276 EXP-LABEL EXP-FORMAT EXP-HELP */
277 /* SETTINGS FOR FILL-IN RP.Int3 IN FRAME F-Main
278 EXP-LABEL EXP-FORMAT EXP-HELP */
279 /* SETTINGS FOR TOGGLE-BOX RP.Log1 IN FRAME F-Main
280 EXP-LABEL EXP-HELP */
281 /* SETTINGS FOR TOGGLE-BOX RP.Log2 IN FRAME F-Main
282 EXP-LABEL EXP-HELP */
283 /* SETTINGS FOR RADIO-SET RP.Log3 IN FRAME F-Main
284 EXP-HELP */
285 /* _RUN-TIME-ATTRIBUTES-END */
286 &ANALYZE-RESUME
289 /* Setting information for Queries and Browse Widgets fields */
291 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
292 /* Query rebuild information for FRAME F-Main
293 _Options = "NO-LOCK"
294 _Query is NOT OPENED
295 */ /* FRAME F-Main */
296 &ANALYZE-RESUME
301 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
302 /* ************************* Included-Libraries *********************** */
304 {src/adm/method/viewer.i}
305 {inc/method/m-mntvwr.i}
307 /* _UIB-CODE-BLOCK-END */
308 &ANALYZE-RESUME
313 /* ************************ Control Triggers ************************ */
315 &Scoped-define SELF-NAME btn_Browse
316 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Browse V-table-Win
317 ON CHOOSE OF btn_Browse IN FRAME F-Main /* Browse */
319 RUN select-file-dialog.
320 END.
322 /* _UIB-CODE-BLOCK-END */
323 &ANALYZE-RESUME
326 &Scoped-define SELF-NAME btn_OK
327 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_OK V-table-Win
328 ON CHOOSE OF btn_OK IN FRAME F-Main /* OK */
330 DISABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
331 RUN run-report.
332 ENABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
333 END.
335 /* _UIB-CODE-BLOCK-END */
336 &ANALYZE-RESUME
339 &Scoped-define SELF-NAME RP.Char1
340 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
341 ON LEAVE OF RP.Char1 IN FRAME F-Main /* Entity */
343 IF NOT SELF:MODIFIED THEN RETURN.
344 DO WITH FRAME {&FRAME-NAME}:
345 SELF:SCREEN-VALUE = CAPS(SELF:SCREEN-VALUE).
346 RUN get-entity-name( SELF:SCREEN-VALUE, INT(RP.Int2:SCREEN-VALUE), OUTPUT fil_Entity-1 ).
347 RUN get-entity-name( SELF:SCREEN-VALUE, INT(RP.Int2:SCREEN-VALUE), OUTPUT fil_Entity-2 ).
348 DISPLAY fil_Entity-1 fil_Entity-2 .
349 END.
350 END.
352 /* _UIB-CODE-BLOCK-END */
353 &ANALYZE-RESUME
356 &Scoped-define SELF-NAME RP.Char2
357 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char2 V-table-Win
358 ON VALUE-CHANGED OF RP.Char2 IN FRAME F-Main /* Char2 */
360 RUN account-selection-changed.
361 END.
363 /* _UIB-CODE-BLOCK-END */
364 &ANALYZE-RESUME
367 &Scoped-define SELF-NAME cmb_AccountGroups
368 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AccountGroups V-table-Win
369 ON U1 OF cmb_AccountGroups IN FRAME F-Main
371 {inc/selcmb/sel-acg1.i "RP" "Char6"}
372 END.
374 /* _UIB-CODE-BLOCK-END */
375 &ANALYZE-RESUME
378 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AccountGroups V-table-Win
379 ON U2 OF cmb_AccountGroups IN FRAME F-Main
381 {inc/selcmb/sel-acg2.i "RP" "Char6"}
382 END.
384 /* _UIB-CODE-BLOCK-END */
385 &ANALYZE-RESUME
388 &Scoped-define SELF-NAME cmb_To
389 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_To V-table-Win
390 ON U1 OF cmb_To IN FRAME F-Main /* To */
392 {inc/selcmb/scmthe1.i "RP" "Int6"}
393 END.
395 /* _UIB-CODE-BLOCK-END */
396 &ANALYZE-RESUME
399 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_To V-table-Win
400 ON U2 OF cmb_To IN FRAME F-Main /* To */
402 {inc/selcmb/scmthe2.i "RP" "Int6"}
403 END.
405 /* _UIB-CODE-BLOCK-END */
406 &ANALYZE-RESUME
409 &Scoped-define SELF-NAME RP.Dec1
410 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec1 V-table-Win
411 ON LEAVE OF RP.Dec1 IN FRAME F-Main /* From */
413 {inc/selcde/cdcoa.i "fil_account1"}
414 END.
416 /* _UIB-CODE-BLOCK-END */
417 &ANALYZE-RESUME
420 &Scoped-define SELF-NAME RP.Dec2
421 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec2 V-table-Win
422 ON LEAVE OF RP.Dec2 IN FRAME F-Main /* to */
424 {inc/selcde/cdcoa.i "fil_account2"}
425 END.
427 /* _UIB-CODE-BLOCK-END */
428 &ANALYZE-RESUME
431 &Scoped-define SELF-NAME fil_account1
432 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
433 ON U1 OF fil_account1 IN FRAME F-Main
435 {inc/selfil/sfcoa1.i "RP" "Dec1"}
436 END.
438 /* _UIB-CODE-BLOCK-END */
439 &ANALYZE-RESUME
442 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
443 ON U2 OF fil_account1 IN FRAME F-Main
445 {inc/selfil/sfcoa2.i "RP" "Dec1"}
446 END.
448 /* _UIB-CODE-BLOCK-END */
449 &ANALYZE-RESUME
452 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
453 ON U3 OF fil_account1 IN FRAME F-Main
455 {inc/selfil/sfcoa3.i "RP" "Dec1"}
456 END.
458 /* _UIB-CODE-BLOCK-END */
459 &ANALYZE-RESUME
462 &Scoped-define SELF-NAME fil_account2
463 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
464 ON U1 OF fil_account2 IN FRAME F-Main
466 {inc/selfil/sfcoa1.i "RP" "Dec2"}
467 END.
469 /* _UIB-CODE-BLOCK-END */
470 &ANALYZE-RESUME
473 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
474 ON U2 OF fil_account2 IN FRAME F-Main
476 {inc/selfil/sfcoa2.i "RP" "Dec2"}
477 END.
479 /* _UIB-CODE-BLOCK-END */
480 &ANALYZE-RESUME
483 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
484 ON U3 OF fil_account2 IN FRAME F-Main
486 {inc/selfil/sfcoa3.i "RP" "Dec2"}
487 END.
489 /* _UIB-CODE-BLOCK-END */
490 &ANALYZE-RESUME
493 &Scoped-define SELF-NAME RP.Int2
494 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
495 ON LEAVE OF RP.Int2 IN FRAME F-Main /* Int2 */
497 DO WITH FRAME {&FRAME-NAME}:
498 RUN get-entity-name( RP.Char1:SCREEN-VALUE, INT(SELF:SCREEN-VALUE), OUTPUT fil_Entity-1 ).
499 DISPLAY fil_Entity-1.
500 END.
501 END.
503 /* _UIB-CODE-BLOCK-END */
504 &ANALYZE-RESUME
507 &Scoped-define SELF-NAME RP.Int3
508 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int3 V-table-Win
509 ON LEAVE OF RP.Int3 IN FRAME F-Main /* Int3 */
511 DO WITH FRAME {&FRAME-NAME}:
512 RUN get-entity-name( RP.Char1:SCREEN-VALUE, INT(SELF:SCREEN-VALUE), OUTPUT fil_Entity-2 ).
513 DISPLAY fil_Entity-2 .
514 END.
515 END.
517 /* _UIB-CODE-BLOCK-END */
518 &ANALYZE-RESUME
521 &Scoped-define SELF-NAME RP.Log1
522 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log1 V-table-Win
523 ON VALUE-CHANGED OF RP.Log1 IN FRAME F-Main /* Detailed */
525 RUN detail-flag-changed.
526 END.
528 /* _UIB-CODE-BLOCK-END */
529 &ANALYZE-RESUME
532 &UNDEFINE SELF-NAME
534 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
537 /* *************************** Main Block *************************** */
539 /* _UIB-CODE-BLOCK-END */
540 &ANALYZE-RESUME
543 /* ********************** Internal Procedures *********************** */
545 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE account-selection-changed V-table-Win
546 PROCEDURE account-selection-changed :
547 /*------------------------------------------------------------------------------
548 Purpose:
549 ------------------------------------------------------------------------------*/
550 DO WITH FRAME {&FRAME-NAME}:
551 IF INPUT RP.Char2 = "Range" THEN DO:
552 VIEW RP.Dec1 RP.Dec2 fil_account1 fil_account2.
553 HIDE cmb_AccountGroups RP.Log1.
554 END.
555 ELSE DO:
556 HIDE RP.Dec1 RP.Dec2 fil_account1 fil_account2.
557 VIEW cmb_AccountGroups RP.Log1.
558 END.
559 RUN detail-flag-changed.
560 END.
561 END PROCEDURE.
563 /* _UIB-CODE-BLOCK-END */
564 &ANALYZE-RESUME
567 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
568 PROCEDURE adm-row-available :
569 /*------------------------------------------------------------------------------
570 Purpose: Dispatched to this procedure when the Record-
571 Source has a new row available. This procedure
572 tries to get the new row (or foriegn keys) from
573 the Record-Source and process it.
574 Parameters: <none>
575 ------------------------------------------------------------------------------*/
577 /* Define variables needed by this internal procedure. */
578 {src/adm/template/row-head.i}
580 /* Create a list of all the tables that we need to get. */
581 {src/adm/template/row-list.i "RP"}
583 /* Get the record ROWID's from the RECORD-SOURCE. */
584 {src/adm/template/row-get.i}
586 /* FIND each record specified by the RECORD-SOURCE. */
587 {src/adm/template/row-find.i "RP"}
589 /* Process the newly available records (i.e. display fields,
590 open queries, and/or pass records on to any RECORD-TARGETS). */
591 {src/adm/template/row-end.i}
593 END PROCEDURE.
595 /* _UIB-CODE-BLOCK-END */
596 &ANALYZE-RESUME
599 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE detail-flag-changed V-table-Win
600 PROCEDURE detail-flag-changed :
601 /*------------------------------------------------------------------------------
602 Purpose:
603 ------------------------------------------------------------------------------*/
604 DO WITH FRAME {&FRAME-NAME}:
605 IF INPUT RP.Log1 AND INPUT RP.Char2 = "Groups" THEN DO:
606 VIEW RP.Log2.
607 END.
608 ELSE DO:
609 HIDE RP.Log2.
610 END.
611 END.
612 END PROCEDURE.
614 /* _UIB-CODE-BLOCK-END */
615 &ANALYZE-RESUME
618 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
619 PROCEDURE disable_UI :
620 /*------------------------------------------------------------------------------
621 Purpose: DISABLE the User Interface
622 Parameters: <none>
623 Notes: Here we clean-up the user-interface by deleting
624 dynamic widgets we have created and/or hide
625 frames. This procedure is usually called when
626 we are ready to "clean-up" after running.
627 ------------------------------------------------------------------------------*/
628 /* Hide all frames. */
629 HIDE FRAME F-Main.
630 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
631 END PROCEDURE.
633 /* _UIB-CODE-BLOCK-END */
634 &ANALYZE-RESUME
637 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-entity-name V-table-Win
638 PROCEDURE get-entity-name :
639 /*------------------------------------------------------------------------------
640 Purpose:
641 Parameters: <none>
642 Notes:
643 ------------------------------------------------------------------------------*/
644 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
645 DEF INPUT PARAMETER ec AS INT NO-UNDO.
646 DEF OUTPUT PARAMETER o-entityname AS CHAR NO-UNDO.
648 CASE et :
649 WHEN "L" THEN DO:
650 FIND Company WHERE Company.CompanyCode = ec NO-LOCK NO-ERROR.
651 IF AVAILABLE(Company) THEN o-EntityName = Company.LegalName.
652 ELSE o-EntityName = "* * * Company not on file * * *".
653 END.
654 WHEN "P" THEN DO:
655 FIND Property WHERE Property.PropertyCode = ec NO-LOCK NO-ERROR.
656 IF AVAILABLE(Property) THEN o-EntityName = Property.Name.
657 ELSE o-EntityName = "* * * Property not on file * * *".
658 END.
659 WHEN "J" THEN DO:
660 FIND Project WHERE Project.ProjectCode = ec NO-LOCK NO-ERROR.
661 IF AVAILABLE(Project) THEN o-EntityName = Project.Name.
662 ELSE o-EntityName = "* * * Project not on file * * *".
663 END.
664 WHEN "F" THEN DO:
665 FIND FixedAsset WHERE FixedAsset.AssetCode = ec NO-LOCK NO-ERROR.
666 IF AVAILABLE(FixedAsset) THEN o-EntityName = FixedAsset.Description.
667 ELSE o-EntityName = "* * * Fixed Asset not on file * * *".
668 END.
669 /* T and C should be fairly unlikely but we'll do them anyway */
670 WHEN "C" THEN DO:
671 FIND Creditor WHERE Creditor.CreditorCode = ec NO-LOCK NO-ERROR.
672 IF AVAILABLE(Creditor) THEN o-EntityName = Creditor.Name.
673 ELSE o-EntityName = "* * * Creditor not on file * * *".
674 END.
675 WHEN "T" THEN DO:
676 FIND Tenant WHERE Tenant.TenantCode = ec NO-LOCK NO-ERROR.
677 IF AVAILABLE(Tenant) THEN o-EntityName = Tenant.Name.
678 ELSE o-EntityName = "* * * Tenant not on file * * *".
679 END.
680 END CASE.
682 END PROCEDURE.
684 /* _UIB-CODE-BLOCK-END */
685 &ANALYZE-RESUME
688 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-display-fields V-table-Win
689 PROCEDURE inst-display-fields :
690 /*------------------------------------------------------------------------------
691 Purpose:
692 ------------------------------------------------------------------------------*/
693 DO WITH FRAME {&FRAME-NAME}:
694 RUN get-entity-name( INPUT RP.Char1, INPUT RP.Int2, OUTPUT fil_Entity-1 ).
695 RUN get-entity-name( INPUT RP.Char1, INPUT RP.Int3, OUTPUT fil_Entity-2 ).
696 DISPLAY UNLESS-HIDDEN fil_Entity-1 fil_Entity-2.
697 END.
698 END PROCEDURE.
700 /* _UIB-CODE-BLOCK-END */
701 &ANALYZE-RESUME
704 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
705 PROCEDURE inst-enable-fields :
706 /*------------------------------------------------------------------------------
707 Purpose:
708 ------------------------------------------------------------------------------*/
709 RUN account-selection-changed.
710 END PROCEDURE.
712 /* _UIB-CODE-BLOCK-END */
713 &ANALYZE-RESUME
716 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
717 PROCEDURE inst-initialize :
718 /*------------------------------------------------------------------------------
719 Purpose:
720 ------------------------------------------------------------------------------*/
721 DEF VAR user-name AS CHAR NO-UNDO. {inc/username.i "user-name"}
722 &SCOP REPORT-ID "Account Balance Export"
724 FIND RP WHERE RP.ReportID = {&REPORT-ID} AND RP.UserName = user-name EXCLUSIVE-LOCK NO-ERROR .
725 IF NOT AVAILABLE(RP) THEN DO:
726 FIND LAST Month WHERE Month.StartDate <= TODAY NO-LOCK NO-ERROR.
727 CREATE RP.
728 ASSIGN
729 RP.ReportID = {&REPORT-ID}
730 RP.UserName = user-name
732 END.
735 RUN dispatch( 'display-fields':U ).
736 RUN dispatch( 'disable-fields':U ).
737 RUN dispatch( 'enable-fields':U ).
739 END PROCEDURE.
741 /* _UIB-CODE-BLOCK-END */
742 &ANALYZE-RESUME
745 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
746 PROCEDURE pre-destroy :
747 /*------------------------------------------------------------------------------
748 Purpose:
749 ------------------------------------------------------------------------------*/
750 RUN check-modified( 'clear':U ).
751 END PROCEDURE.
753 /* _UIB-CODE-BLOCK-END */
754 &ANALYZE-RESUME
757 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
758 PROCEDURE run-report :
759 /*------------------------------------------------------------------------------
760 Purpose: Actually run the report
761 ------------------------------------------------------------------------------*/
762 DEF VAR report-options AS CHAR NO-UNDO.
764 DO WITH FRAME {&FRAME-NAME}:
766 RUN dispatch( 'update-record':U ).
768 report-options = "EntityType," + RP.Char1
769 + "~nEntityRange," + STRING(RP.Int2) + "," + STRING( RP.Int3 )
770 + (IF RP.Char2 = "Range" THEN
771 "~nAccountRange," + STRING(RP.Dec1) + "," + STRING(RP.Dec2)
772 ELSE
773 "~nAccountGroups," + RP.Char6
774 + (IF RP.Log1 THEN "~nDetailed" ELSE "")
775 + (IF RP.Log1 AND RP.Log2 THEN "~nMergeAccounts" ELSE "")
777 + "~nToMonth," + STRING(RP.Int6)
778 + "~nColumns," + (IF RP.Log3 THEN "Accounts" ELSE "Entities")
779 + "~nFileName," + RP.Char5 .
781 RUN notify( 'set-busy,container-source':U ).
782 RUN process/export/export-balances.p( report-options ).
783 RUN notify( 'set-idle,container-source':U ).
784 END.
785 END PROCEDURE.
787 /* _UIB-CODE-BLOCK-END */
788 &ANALYZE-RESUME
791 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
792 PROCEDURE select-file-dialog :
793 /*------------------------------------------------------------------------------
794 Purpose:
795 ------------------------------------------------------------------------------*/
796 DEF VAR select-ok AS LOGICAL INITIAL Yes NO-UNDO.
797 DEF VAR file-name AS CHAR NO-UNDO.
798 DEF VAR start-dir AS CHAR NO-UNDO.
800 file-name = INPUT FRAME {&FRAME-NAME} RP.Char5 .
801 start-dir = SUBSTRING( file-name, 1, R-INDEX(file-name, "\" ) ).
803 SYSTEM-DIALOG GET-FILE file-name FILTERS "Comma-separated values" "*.CSV"
804 SAVE-AS ASK-OVERWRITE CREATE-TEST-FILE DEFAULT-EXTENSION ".CSV"
805 INITIAL-DIR start-dir RETURN-TO-START-DIR
806 TITLE "" USE-FILENAME UPDATE select-ok.
808 IF select-ok THEN DO:
809 IF SUBSTRING( file-name, R-INDEX( file-name, ".") ) <> ".CSV" THEN DO:
810 IF (LENGTH( file-name ) - R-INDEX( file-name, "." )) < 4 THEN
811 file-name = SUBSTRING( file-name, 1, R-INDEX( file-name, ".")) + "CSV" .
812 END.
813 RP.Char5:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
814 END.
816 END PROCEDURE.
818 /* _UIB-CODE-BLOCK-END */
819 &ANALYZE-RESUME
822 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
823 PROCEDURE send-records :
824 /*------------------------------------------------------------------------------
825 Purpose: Send record ROWID's for all tables used by
826 this file.
827 Parameters: see template/snd-head.i
828 ------------------------------------------------------------------------------*/
830 /* Define variables needed by this internal procedure. */
831 {src/adm/template/snd-head.i}
833 /* For each requested table, put it's ROWID in the output list. */
834 {src/adm/template/snd-list.i "RP"}
836 /* Deal with any unexpected table requests before closing. */
837 {src/adm/template/snd-end.i}
839 END PROCEDURE.
841 /* _UIB-CODE-BLOCK-END */
842 &ANALYZE-RESUME
845 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
846 PROCEDURE state-changed :
847 /* -----------------------------------------------------------
848 Purpose:
849 Parameters: <none>
850 Notes:
851 -------------------------------------------------------------*/
852 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
853 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
855 CASE p-state:
856 /* Object instance CASEs can go here to replace standard behavior
857 or add new cases. */
858 {src/adm/template/vstates.i}
859 END CASE.
860 END PROCEDURE.
862 /* _UIB-CODE-BLOCK-END */
863 &ANALYZE-RESUME