1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 DEF VAR user-name
AS CHAR INITIAL "Andrew" NO-UNDO.
16 DEF VAR group-list
AS CHAR NO-UNDO.
18 /* _UIB-CODE-BLOCK-END
*/
22 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
24 /* ******************** Preprocessor Definitions
******************** */
26 &Scoped-define PROCEDURE-TYPE SmartViewer
27 &Scoped-define DB-AWARE no
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
35 &Scoped-define EXTERNAL-TABLES RP
36 &Scoped-define FIRST-EXTERNAL-TABLE RP
39 /* Need to scope the external tables to this procedure
*/
40 DEFINE QUERY external_tables
FOR RP.
41 /* Standard List Definitions
*/
42 &Scoped-Define ENABLED-FIELDS RP.Char1 RP.Int1 RP.Char6 RP.Int2 RP.Char4 ~
43 RP.Dec1 RP.Char5 RP.Dec2 RP.Log3 RP.Date1 RP.Log4 RP.Int5 RP.Log1 RP.Log6 ~
44 RP.Log7 RP.Log8 RP.Log9 RP.Char3 RP.Log5 RP.Char2 RP.Log2
45 &Scoped-define ENABLED-TABLES RP
46 &Scoped-define FIRST-ENABLED-TABLE RP
47 &Scoped-define DISPLAYED-TABLES RP
48 &Scoped-define FIRST-DISPLAYED-TABLE RP
49 &Scoped-Define ENABLED-OBJECTS fil_AccountLike cb-month1 cb-month2 ~
50 tgl_MonthTotals tgl_NoOpeningBalances btn_Browse Btn_OK RECT-1 RECT-4 ~
52 &Scoped-Define DISPLAYED-FIELDS RP.Char1 RP.Int1 RP.Char6 RP.Int2 RP.Char4 ~
53 RP.Dec1 RP.Char5 RP.Dec2 RP.Log3 RP.Date1 RP.Log4 RP.Int5 RP.Log1 RP.Log6 ~
54 RP.Log7 RP.Log8 RP.Log9 RP.Char3 RP.Log5 RP.Char2 RP.Log2
55 &Scoped-Define DISPLAYED-OBJECTS fil_comp1 fil_comp2 fil_account1 ~
56 fil_account2 fil_AccountLike cb-month1 cb-month2 tgl_MonthTotals ~
59 /* Custom List Definitions
*/
60 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
62 /* _UIB-PREPROCESSOR-BLOCK-END
*/
67 /* *********************** Control Definitions
********************** */
70 /* Definitions of the field level widgets
*/
71 DEFINE BUTTON btn_Browse
76 DEFINE BUTTON Btn_OK
AUTO-GO DEFAULT
81 DEFINE VARIABLE cb-month1
AS CHARACTER FORMAT "X(256)":U
83 VIEW-AS COMBO-BOX INNER-LINES 15
84 LIST-ITEMS "10/07/1886"
86 SIZE 17.14 BY 1 NO-UNDO.
88 DEFINE VARIABLE cb-month2
AS CHARACTER FORMAT "X(256)":U
90 VIEW-AS COMBO-BOX INNER-LINES 15
93 SIZE 17.14 BY 1 NO-UNDO.
95 DEFINE VARIABLE fil_account1
AS CHARACTER FORMAT "X(256)":U
100 DEFINE VARIABLE fil_account2
AS CHARACTER FORMAT "X(256)":U
105 DEFINE VARIABLE fil_AccountLike
AS CHARACTER FORMAT "XXXX.XX":U
INITIAL "******"
108 SIZE 8 BY 1 TOOLTIP "Enter a pattern to match the accounts to be reported" NO-UNDO.
110 DEFINE VARIABLE fil_comp1
AS CHARACTER FORMAT "X(256)":U
115 DEFINE VARIABLE fil_comp2
AS CHARACTER FORMAT "X(256)":U
120 DEFINE RECTANGLE RECT-1
121 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
124 DEFINE RECTANGLE RECT-4
125 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
128 DEFINE RECTANGLE RECT-5
129 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
132 DEFINE RECTANGLE RECT-6
133 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
136 DEFINE VARIABLE tgl_MonthTotals
AS LOGICAL INITIAL no
137 LABEL "running totals at end of each period"
139 SIZE 27.72 BY 1 NO-UNDO.
141 DEFINE VARIABLE tgl_NoOpeningBalances
AS LOGICAL INITIAL no
142 LABEL "Don't show opening balances"
144 SIZE 24 BY 1 NO-UNDO.
147 /* ************************ Frame Definitions
*********************** */
150 RP.Char1
AT ROW 1.4 COL 2.14 NO-LABEL
151 VIEW-AS RADIO-SET VERTICAL
153 "Single company", "1":U
,
154 "Company range", "R":U
,
155 "Company list", "L":U
158 RP.Int1
AT ROW 1.6 COL 23.57 COLON-ALIGNED
159 LABEL "Company" FORMAT "99999"
162 fil_comp1
AT ROW 1.6 COL 35.72 COLON-ALIGNED NO-LABEL
163 RP.Char6
AT ROW 2 COL 23.57 COLON-ALIGNED HELP
165 LABEL "List" FORMAT "X(100)"
166 VIEW-AS COMBO-BOX INNER-LINES 10
170 RP.Int2
AT ROW 2.6 COL 23.57 COLON-ALIGNED
171 LABEL "To" FORMAT "99999"
174 fil_comp2
AT ROW 2.6 COL 35.72 COLON-ALIGNED NO-LABEL
175 RP.Char4
AT ROW 4.4 COL 2.14 HELP
177 VIEW-AS RADIO-SET VERTICAL
179 "Single account", "1":U
,
180 "Account range", "R":U
,
181 "Account group", "G":U
,
182 "Accounts like", "L":U
185 RP.Dec1
AT ROW 4.6 COL 23.57 COLON-ALIGNED HELP
187 LABEL "Account" FORMAT "9999.99"
190 fil_account1
AT ROW 4.6 COL 35.72 COLON-ALIGNED NO-LABEL
191 RP.Char5
AT ROW 5 COL 23.57 COLON-ALIGNED HELP
193 LABEL "Group" FORMAT "X(100)"
194 VIEW-AS COMBO-BOX INNER-LINES 20
195 LIST-ITEMS "PROPEX - Property Expenses"
199 RP.Dec2
AT ROW 5.6 COL 23.57 COLON-ALIGNED HELP
201 LABEL "to" FORMAT "9999.99"
204 fil_account2
AT ROW 5.6 COL 35.72 COLON-ALIGNED NO-LABEL
205 fil_AccountLike
AT ROW 6.6 COL 23.57 COLON-ALIGNED
206 cb-month1
AT ROW 8.4 COL 9.29 COLON-ALIGNED
207 cb-month2
AT ROW 8.4 COL 35.57 COLON-ALIGNED
208 RP.Log3
AT ROW 9.8 COL 11.29
209 LABEL "Only where Transaction Date greater than"
213 RP.Date1
AT ROW 9.8 COL 41.29 COLON-ALIGNED NO-LABEL
216 RP.Log4
AT ROW 10.8 COL 11.29
217 LABEL "Only where batch no. greater or equal to"
221 RP.Int5
AT ROW 10.8 COL 39.57 COLON-ALIGNED NO-LABEL FORMAT ">>>,>>9"
224 RP.Log1
AT ROW 11.8 COL 11.29 HELP
226 LABEL "Show all, including for high-volume accounts"
230 RP.Log6
AT ROW 12.8 COL 11.29
231 LABEL "Show only when account balance is non-zero at end of period"
235 RP.Log7
AT ROW 13.8 COL 11.29
236 LABEL "Balances only"
240 RP.Log8
AT ROW 14.8 COL 11.29
241 LABEL "Exclude Year End Transactions"
246 /* DEFINE FRAME statement is approaching
4K Bytes. Breaking it up
*/
248 tgl_MonthTotals
AT ROW 12.8 COL 61
249 RP.Log9
AT ROW 13.8 COL 61 HELP
251 LABEL "Hide related records"
254 tgl_NoOpeningBalances
AT ROW 14.8 COL 61
255 RP.Char3
AT ROW 16.2 COL 10.72 HELP
257 VIEW-AS RADIO-SET VERTICAL
259 "by Company, then by Account", "L":U
,
260 "by Account, then by Company", "A":U
263 RP.Log5
AT ROW 18 COL 10.72
268 RP.Char2
AT ROW 18 COL 17.86 COLON-ALIGNED NO-LABEL FORMAT "X(120)"
271 btn_Browse
AT ROW 18 COL 83.29
272 RP.Log2
AT ROW 19.2 COL 10.72 HELP
278 Btn_OK
AT ROW 19.2 COL 77.57
279 RECT-1
AT ROW 1 COL 1
280 RECT-4
AT ROW 4.2 COL 1.57
281 RECT-5
AT ROW 1.2 COL 1.57
282 RECT-6
AT ROW 8.2 COL 1.57
283 "Sequence" VIEW-AS TEXT
284 SIZE 7.43 BY .8 AT ROW 16.2 COL 2.72
286 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
287 SIDE-LABELS NO-UNDERLINE THREE-D
288 AT COL 1 ROW 1 SCROLLABLE
290 DEFAULT-BUTTON Btn_OK.
293 /* *********************** Procedure Settings
************************ */
295 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
296 /* Settings for
THIS-PROCEDURE
298 External Tables
: ttpl.RP
299 Allow
: Basic
,DB-Fields
301 Add Fields to
: EXTERNAL-TABLES
302 Other Settings
: PERSISTENT-ONLY
COMPILE
305 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
306 /* then cleanup and return.
*/
307 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
308 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
309 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
313 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
315 /* ************************* Create Window
************************** */
317 &ANALYZE-SUSPEND _CREATE-WINDOW
318 /* DESIGN Window definition
(used by the UIB
)
319 CREATE WINDOW V-table-Win
ASSIGN
322 /* END WINDOW DEFINITION
*/
326 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
327 /* ************************* Included-Libraries
*********************** */
329 {src
/adm
/method
/viewer.i
}
330 {inc
/method
/m-mntvwr.i
}
332 /* _UIB-CODE-BLOCK-END
*/
338 /* *********** Runtime Attributes and AppBuilder Settings
*********** */
340 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
341 /* SETTINGS
FOR WINDOW V-table-Win
342 VISIBLE,,RUN-PERSISTENT
*/
343 /* SETTINGS
FOR FRAME F-Main
344 NOT-VISIBLE Size-to-Fit Custom
*/
346 FRAME F-Main
:SCROLLABLE = FALSE
347 FRAME F-Main
:HIDDEN = TRUE.
349 /* SETTINGS
FOR FILL-IN RP.Char2
IN FRAME F-Main
350 EXP-LABEL EXP-FORMAT
*/
351 /* SETTINGS
FOR RADIO-SET RP.Char3
IN FRAME F-Main
353 /* SETTINGS
FOR RADIO-SET RP.Char4
IN FRAME F-Main
355 /* SETTINGS
FOR COMBO-BOX RP.Char5
IN FRAME F-Main
356 EXP-LABEL EXP-FORMAT EXP-HELP
*/
357 /* SETTINGS
FOR COMBO-BOX RP.Char6
IN FRAME F-Main
358 EXP-LABEL EXP-FORMAT EXP-HELP
*/
359 /* SETTINGS
FOR FILL-IN RP.Date1
IN FRAME F-Main
361 /* SETTINGS
FOR FILL-IN RP.Dec1
IN FRAME F-Main
362 EXP-LABEL EXP-FORMAT EXP-HELP
*/
363 /* SETTINGS
FOR FILL-IN RP.Dec2
IN FRAME F-Main
364 EXP-LABEL EXP-FORMAT EXP-HELP
*/
365 /* SETTINGS
FOR FILL-IN fil_account1
IN FRAME F-Main
367 /* SETTINGS
FOR FILL-IN fil_account2
IN FRAME F-Main
369 /* SETTINGS
FOR FILL-IN fil_comp1
IN FRAME F-Main
371 /* SETTINGS
FOR FILL-IN fil_comp2
IN FRAME F-Main
373 /* SETTINGS
FOR FILL-IN RP.Int1
IN FRAME F-Main
374 EXP-LABEL EXP-FORMAT
*/
375 /* SETTINGS
FOR FILL-IN RP.Int2
IN FRAME F-Main
376 EXP-LABEL EXP-FORMAT
*/
377 /* SETTINGS
FOR FILL-IN RP.Int5
IN FRAME F-Main
378 EXP-LABEL EXP-FORMAT
*/
379 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
380 EXP-LABEL EXP-HELP
*/
381 /* SETTINGS
FOR TOGGLE-BOX RP.Log2
IN FRAME F-Main
382 EXP-LABEL EXP-HELP
*/
383 /* SETTINGS
FOR TOGGLE-BOX RP.Log3
IN FRAME F-Main
385 /* SETTINGS
FOR TOGGLE-BOX RP.Log4
IN FRAME F-Main
387 /* SETTINGS
FOR TOGGLE-BOX RP.Log5
IN FRAME F-Main
389 /* SETTINGS
FOR TOGGLE-BOX RP.Log6
IN FRAME F-Main
391 /* SETTINGS
FOR TOGGLE-BOX RP.Log7
IN FRAME F-Main
393 /* SETTINGS
FOR TOGGLE-BOX RP.Log8
IN FRAME F-Main
395 /* SETTINGS
FOR TOGGLE-BOX RP.Log9
IN FRAME F-Main
396 EXP-LABEL EXP-HELP
*/
397 /* _RUN-TIME-ATTRIBUTES-END
*/
401 /* Setting information for Queries and Browse Widgets fields
*/
403 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
404 /* Query rebuild information for
FRAME F-Main
407 */ /* FRAME F-Main
*/
414 /* ************************ Control Triggers
************************ */
416 &Scoped-define SELF-NAME btn_Browse
417 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Browse V-table-Win
418 ON CHOOSE OF btn_Browse
IN FRAME F-Main
/* Browse
*/
420 RUN select-file-dialog .
423 /* _UIB-CODE-BLOCK-END
*/
427 &Scoped-define SELF-NAME Btn_OK
428 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
429 ON CHOOSE OF Btn_OK
IN FRAME F-Main
/* OK */
431 DISABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
433 ENABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
436 /* _UIB-CODE-BLOCK-END
*/
440 &Scoped-define SELF-NAME RP.Char1
441 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
442 ON VALUE-CHANGED
OF RP.Char1
IN FRAME F-Main
/* Char1
*/
444 RUN enable-appropriate-fields.
447 /* _UIB-CODE-BLOCK-END
*/
451 &Scoped-define SELF-NAME RP.Char3
452 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char3 V-table-Win
453 ON VALUE-CHANGED
OF RP.Char3
IN FRAME F-Main
/* Char3
*/
455 RUN enable-appropriate-fields.
458 /* _UIB-CODE-BLOCK-END
*/
462 &Scoped-define SELF-NAME RP.Char4
463 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char4 V-table-Win
464 ON VALUE-CHANGED
OF RP.Char4
IN FRAME F-Main
/* Char4
*/
466 RUN enable-appropriate-fields.
469 /* _UIB-CODE-BLOCK-END
*/
473 &Scoped-define SELF-NAME RP.Dec1
474 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec1 V-table-Win
475 ON LEAVE OF RP.Dec1
IN FRAME F-Main
/* Account
*/
477 {inc
/selcde
/cdcoa.i
"fil_account1"}
480 /* _UIB-CODE-BLOCK-END
*/
484 &Scoped-define SELF-NAME RP.Dec2
485 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec2 V-table-Win
486 ON LEAVE OF RP.Dec2
IN FRAME F-Main
/* to
*/
488 {inc
/selcde
/cdcoa.i
"fil_account2"}
491 /* _UIB-CODE-BLOCK-END
*/
495 &Scoped-define SELF-NAME fil_account1
496 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
497 ON U1
OF fil_account1
IN FRAME F-Main
499 {inc
/selfil
/sfcoa1.i
"RP" "Dec1"}
502 /* _UIB-CODE-BLOCK-END
*/
506 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
507 ON U2
OF fil_account1
IN FRAME F-Main
509 {inc
/selfil
/sfcoa2.i
"RP" "Dec1"}
512 /* _UIB-CODE-BLOCK-END
*/
516 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
517 ON U3
OF fil_account1
IN FRAME F-Main
519 {inc
/selfil
/sfcoa3.i
"RP" "Dec1"}
522 /* _UIB-CODE-BLOCK-END
*/
526 &Scoped-define SELF-NAME fil_account2
527 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
528 ON U1
OF fil_account2
IN FRAME F-Main
530 {inc
/selfil
/sfcoa1.i
"RP" "Dec2"}
533 /* _UIB-CODE-BLOCK-END
*/
537 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
538 ON U2
OF fil_account2
IN FRAME F-Main
540 {inc
/selfil
/sfcoa2.i
"RP" "Dec2"}
543 /* _UIB-CODE-BLOCK-END
*/
547 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
548 ON U3
OF fil_account2
IN FRAME F-Main
550 {inc
/selfil
/sfcoa3.i
"RP" "Dec2"}
553 /* _UIB-CODE-BLOCK-END
*/
557 &Scoped-define SELF-NAME fil_comp1
558 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
559 ON U1
OF fil_comp1
IN FRAME F-Main
561 {inc
/selfil
/sfcmp1.i
"RP" "Int1"}
564 /* _UIB-CODE-BLOCK-END
*/
568 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
569 ON U2
OF fil_comp1
IN FRAME F-Main
571 {inc
/selfil
/sfcmp2.i
"RP" "Int1"}
574 /* _UIB-CODE-BLOCK-END
*/
578 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp1 V-table-Win
579 ON U3
OF fil_comp1
IN FRAME F-Main
581 {inc
/selfil
/sfcmp3.i
"RP" "Int1"}
584 /* _UIB-CODE-BLOCK-END
*/
588 &Scoped-define SELF-NAME fil_comp2
589 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
590 ON U1
OF fil_comp2
IN FRAME F-Main
592 {inc
/selfil
/sfcmp1.i
"RP" "Int2"}
595 /* _UIB-CODE-BLOCK-END
*/
599 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
600 ON U2
OF fil_comp2
IN FRAME F-Main
602 {inc
/selfil
/sfcmp2.i
"RP" "Int2"}
605 /* _UIB-CODE-BLOCK-END
*/
609 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_comp2 V-table-Win
610 ON U3
OF fil_comp2
IN FRAME F-Main
612 {inc
/selfil
/sfcmp3.i
"RP" "Int2"}
615 /* _UIB-CODE-BLOCK-END
*/
619 &Scoped-define SELF-NAME RP.Int1
620 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
621 ON LEAVE OF RP.Int1
IN FRAME F-Main
/* Company
*/
623 {inc
/selcde
/cdcmp.i
"fil_comp1"}
626 /* _UIB-CODE-BLOCK-END
*/
630 &Scoped-define SELF-NAME RP.Int2
631 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
632 ON LEAVE OF RP.Int2
IN FRAME F-Main
/* To
*/
634 {inc
/selcde
/cdcmp.i
"fil_comp2"}
637 /* _UIB-CODE-BLOCK-END
*/
641 &Scoped-define SELF-NAME RP.Log3
642 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log3 V-table-Win
643 ON VALUE-CHANGED
OF RP.Log3
IN FRAME F-Main
/* Only where Transaction Date greater than
*/
645 RUN enable-appropriate-fields.
648 /* _UIB-CODE-BLOCK-END
*/
652 &Scoped-define SELF-NAME RP.Log4
653 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log4 V-table-Win
654 ON VALUE-CHANGED
OF RP.Log4
IN FRAME F-Main
/* Only where batch no. greater or equal to
*/
656 RUN enable-appropriate-fields.
659 /* _UIB-CODE-BLOCK-END
*/
663 &Scoped-define SELF-NAME RP.Log5
664 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log5 V-table-Win
665 ON VALUE-CHANGED
OF RP.Log5
IN FRAME F-Main
/* Export to
*/
667 RUN enable-appropriate-fields.
670 /* _UIB-CODE-BLOCK-END
*/
676 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
679 /* *************************** Main Block
*************************** */
681 /* _UIB-CODE-BLOCK-END
*/
685 /* ********************** Internal Procedures
*********************** */
687 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
688 PROCEDURE adm-row-available
:
689 /*------------------------------------------------------------------------------
690 Purpose
: Dispatched to this procedure when the Record-
691 Source has a new row available. This procedure
692 tries to get the new row
(or foriegn keys
) from
693 the Record-Source and process it.
695 ------------------------------------------------------------------------------*/
697 /* Define variables needed by this internal procedure.
*/
698 {src
/adm
/template
/row-head.i
}
700 /* Create a list of all the tables that we need to get.
*/
701 {src
/adm
/template
/row-list.i
"RP"}
703 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
704 {src
/adm
/template
/row-get.i
}
706 /* FIND each record specified by the RECORD-SOURCE.
*/
707 {src
/adm
/template
/row-find.i
"RP"}
709 /* Process the newly available records
(i.e. display fields
,
710 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
711 {src
/adm
/template
/row-end.i
}
715 /* _UIB-CODE-BLOCK-END
*/
718 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
719 PROCEDURE disable_UI
:
720 /*------------------------------------------------------------------------------
721 Purpose
: DISABLE the User Interface
723 Notes
: Here we clean-up the user-interface by deleting
724 dynamic widgets we have created and
/or hide
725 frames. This procedure is usually called when
726 we are ready to
"clean-up" after running.
727 ------------------------------------------------------------------------------*/
728 /* Hide all frames.
*/
730 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
733 /* _UIB-CODE-BLOCK-END
*/
736 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
737 PROCEDURE enable-appropriate-fields
:
738 /*------------------------------------------------------------------------------
739 Purpose
: As its name
!
740 ------------------------------------------------------------------------------*/
742 DO WITH FRAME {&FRAME-NAME}:
743 CASE INPUT RP.Char1
: /* Company
: single or range
*/
745 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING(fil_comp2
:HANDLE), 'hidden
= yes'
).
746 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING(fil_comp1
:HANDLE), 'hidden
= no'
).
747 HIDE RP.Int2 fil_comp2 RP.Char6 .
748 VIEW RP.Int1 fil_comp1 .
751 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING(fil_comp1
:HANDLE), 'hidden
= no'
).
752 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING(fil_comp2
:HANDLE), 'hidden
= no'
).
753 VIEW RP.Int1 fil_comp1 RP.Int2 fil_comp2 .
757 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING(fil_comp1
:HANDLE), 'hidden
= yes'
).
758 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING(fil_comp2
:HANDLE), 'hidden
= yes'
).
759 HIDE RP.Int1 fil_comp1 RP.Int2 fil_comp2 .
764 CASE INPUT RP.Char4
: /* Account
: Single
, range or group
*/
766 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account1
:HANDLE), 'hidden
= no'
).
767 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account2
:HANDLE), 'hidden
= yes'
).
768 VIEW RP.Dec1 fil_account1 .
769 HIDE RP.Dec2 fil_account2 RP.Log1 RP.Char5 fil_AccountLike .
772 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account1
:HANDLE), 'hidden
= no'
).
773 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account2
:HANDLE), 'hidden
= no'
).
774 VIEW RP.Dec1 fil_account1 RP.Dec2 fil_account2 RP.Log1 .
775 HIDE RP.Char5 fil_AccountLike .
778 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account1
:HANDLE), 'hidden
= yes'
).
779 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account2
:HANDLE), 'hidden
= yes'
).
780 VIEW RP.Log1 RP.Char5 .
781 HIDE RP.Dec1 RP.Dec2 fil_account1 fil_account2 fil_AccountLike .
784 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account1
:HANDLE), 'hidden
= no'
).
785 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_account2
:HANDLE), 'hidden
= no'
).
786 VIEW fil_AccountLike RP.Log1 RP.Dec1 fil_account1 RP.Dec2 fil_account2 RP.Log1 .
791 /* only after date...
*/
792 IF INPUT RP.Log3
THEN
797 /* only after batch...
*/
798 IF INPUT RP.Log4
THEN
804 IF INPUT RP.Log5
THEN
805 VIEW RP.Char2 btn_Browse .
807 HIDE RP.Char2 btn_Browse .
813 /* _UIB-CODE-BLOCK-END
*/
816 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
817 PROCEDURE inst-initialize
:
818 /*------------------------------------------------------------------------------
819 Purpose
: Initialise the necessary bits and pieces
820 ------------------------------------------------------------------------------*/
821 DEF VAR month1-list
AS CHAR INITIAL "" NO-UNDO.
822 DEF VAR month2-list
AS CHAR INITIAL "" NO-UNDO.
823 DEF VAR delim
AS CHAR INITIAL "|" NO-UNDO.
825 RUN get-username
IN sec-mgr
( OUTPUT user-name
).
826 FIND RP
WHERE RP.ReportID
= "tr-l"
827 AND RP.UserName
= user-name
830 IF NOT AVAILABLE( RP
) THEN DO:
834 RP.UserName
= user-name
838 /* Initialise the month list for the combos
*/
839 FOR EACH Month
NO-LOCK:
840 month1-list
= month1-list
+ delim
+ STRING( Month.StartDate
, "99/99/9999" ).
841 month2-list
= month2-list
+ delim
+ STRING( Month.EndDate
, "99/99/9999" ).
843 month1-list
= SUBSTRING( month1-list
, 2).
/* trim initial delimiter
*/
844 month2-list
= SUBSTRING( month2-list
, 2).
/* trim initial delimiter
*/
845 DO WITH FRAME {&FRAME-NAME}:
847 cb-month1
:DELIMITER = delim
848 cb-month2
:DELIMITER = delim
849 cb-month1
:LIST-ITEMS = month1-list
850 cb-month2
:LIST-ITEMS = month2-list
854 /* Initialise the account group list
*/
855 FOR EACH AccountGroup
NO-LOCK BY AccountGroup.SequenceCode
:
856 group-list
= group-list
+ delim
857 + STRING(AccountGroup.AccountGroupCode
,"X(7)") + '
- '
860 group-list
= SUBSTRING( group-list
, 2).
861 DO WITH FRAME {&FRAME-NAME}:
863 RP.Char5
:DELIMITER = delim
864 RP.Char5
:LIST-ITEMS = group-list
868 /* Initialise the consolidation list for the combos
*/
869 DEF VAR con-list
AS CHAR NO-UNDO.
870 FOR EACH ConsolidationList
NO-LOCK:
871 con-list
= con-list
+ delim
+ STRING( ConsolidationList.Name
, "X(5)") + "- " + ConsolidationList.Description.
873 con-list
= SUBSTRING( con-list
, 2).
/* trim initial delimiter
*/
874 DO WITH FRAME {&FRAME-NAME}:
875 ASSIGN RP.Char6
:DELIMITER = delim
876 RP.Char6
:LIST-ITEMS = con-list .
880 /* Set to initially saved values
*/
881 FIND Month
WHERE Month.MonthCode
= RP.Int3
NO-LOCK NO-ERROR.
882 IF AVAILABLE(Month
) THEN cb-month1
= STRING( Month.StartDate
, "99/99/9999" ).
883 FIND Month
WHERE Month.MonthCode
= RP.Int4
NO-LOCK NO-ERROR.
884 IF AVAILABLE(Month
) THEN cb-month2
= STRING( Month.EndDate
, "99/99/9999" ).
886 DISPLAY cb-month1 cb-month2 RP.Char5
WITH FRAME {&FRAME-NAME} IN WINDOW {&WINDOW-NAME}.
888 RUN dispatch
( 'display-fields'
:U
).
889 RUN dispatch
( 'enable-fields'
:U
).
890 RUN enable-appropriate-fields.
894 /* _UIB-CODE-BLOCK-END
*/
897 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
898 PROCEDURE pre-destroy
:
899 /*------------------------------------------------------------------------------
901 ------------------------------------------------------------------------------*/
902 RUN check-modified
( 'clear'
:U
).
905 /* _UIB-CODE-BLOCK-END
*/
908 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
909 PROCEDURE run-report
:
910 /*------------------------------------------------------------------------------
911 Purpose
: Actually run the report program.
912 ------------------------------------------------------------------------------*/
915 RUN dispatch
IN THIS-PROCEDURE ('update-record'
:U
).
916 ASSIGN FRAME {&FRAME-NAME} fil_AccountLike tgl_MonthTotals tgl_NoOpeningBalances .
918 FIND CURRENT RP
EXCLUSIVE-LOCK.
919 FIND Month
WHERE Month.StartDate
= DATE( cb-month1
:SCREEN-VALUE IN FRAME {&FRAME-NAME}) NO-LOCK NO-ERROR.
920 IF AVAILABLE(Month
) THEN RP.Int3
= Month.MonthCode.
922 FIND Month
WHERE Month.EndDate
= DATE( cb-month2
:SCREEN-VALUE IN FRAME {&FRAME-NAME}) NO-LOCK NO-ERROR.
923 IF AVAILABLE(Month
) THEN RP.Int4
= Month.MonthCode.
924 FIND CURRENT RP
NO-LOCK.
927 DEF VAR report-options
AS CHAR NO-UNDO.
928 DEF VAR e1
AS INTEGER NO-UNDO.
929 DEF VAR e2
AS INTEGER NO-UNDO.
930 DEF VAR show-all
AS LOGICAL NO-UNDO.
931 DEF VAR a1
AS DECIMAL NO-UNDO.
932 DEF VAR a2
AS DECIMAL NO-UNDO.
933 DEF VAR after
AS DATE NO-UNDO.
934 DEF VAR earliest-batch
AS INT NO-UNDO.
935 DEF VAR export-fname
AS CHAR INITIAL ?
NO-UNDO.
936 DEF VAR group-name
AS CHAR INITIAL ?
NO-UNDO.
940 /* ledger opts
, account opts
, sort opts
, zero opt
*/
942 RP.Char1
+ RP.Char4
+ RP.Char3
+ (IF RP.Log6
THEN "X" ELSE "I") +
943 (IF RP.Log7
THEN "S" ELSE "V") + (IF RP.Log8
THEN "Y" ELSE "N")
944 e1
= RP.Int1 e2
= (IF RP.Char1
= "1" THEN RP.Int1
ELSE RP.Int2
)
945 a1
= RP.Dec1 a2
= (IF RP.Char4
= "1" THEN RP.Dec1
ELSE RP.Dec2
)
946 show-all
= ( RP.Log1
OR (RP.Char4
= "1"))
947 after
= (IF RP.Log3
THEN RP.Date1
ELSE DATE(1,1,1) /* less than anything
! */ )
948 earliest-batch
= (IF RP.Log4
THEN RP.Int5
ELSE 0 )
949 export-fname
= (IF RP.Log5
THEN RP.Char2
ELSE "" )
950 group-name
= (IF RP.Char4
= "G" THEN TRIM( SUBSTRING(RP.Char5
, 1, 6)) ELSE "" )
953 report-options
= report-options
+ "," + STRING( e1
) + "," + STRING( e2
) + ","
954 + STRING( RP.Int3
) + "," + STRING( RP.Int4
) + ","
955 + STRING( show-all
, "Yes/No" ) + ","
956 + STRING( a1
) + "," + STRING( a2
) + ","
957 + STRING( RP.Log2
, "Yes/No" ) + ","
958 + STRING( after
) + ","
959 + STRING( earliest-batch
) + ","
962 + (IF RP.Char1
= "L" THEN "~nConsolidationList," + TRIM(SUBSTRING(RP.Char6
, 1, 4)) ELSE "" )
963 + (IF RP.Char4
= "L":U
THEN "~nAccountsLike," + fil_AccountLike
ELSE "")
964 + "~nSortBy," + RP.Char3
965 + (IF RP.Log9
THEN "~nNoRelations" ELSE "")
966 + (IF RP.Log6
THEN "~nNonZeroOnly" ELSE "")
967 + (IF RP.Log7
THEN "~nBalancesOnly" ELSE "")
968 + (IF RP.Log8
THEN "~nExcludeYearEnd" ELSE "")
969 + (IF tgl_MonthTotals
THEN "~nMonthTotals" ELSE "")
970 + (IF tgl_NoOpeningBalances
THEN "~nNoOpeningBalances" ELSE "").
972 {inc
/bq-do.i
"process/report/tr-l.p" "report-options" "(NOT RP.Log2 AND (export-fname = ''))"}
976 /* _UIB-CODE-BLOCK-END
*/
979 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
980 PROCEDURE select-file-dialog
:
981 /*------------------------------------------------------------------------------
983 ------------------------------------------------------------------------------*/
984 DEF VAR select-ok
AS LOGICAL INITIAL Yes
NO-UNDO.
985 DEF VAR file-name
AS CHAR NO-UNDO.
986 DEF VAR start-dir
AS CHAR NO-UNDO.
988 file-name
= INPUT FRAME {&FRAME-NAME} RP.Char2 .
989 start-dir
= SUBSTRING( file-name
, 1, R-INDEX(file-name
, "\" ) ).
991 SYSTEM-DIALOG GET-FILE file-name
FILTERS "Comma-separated values" "*.CSV"
992 SAVE-AS ASK-OVERWRITE CREATE-TEST-FILE DEFAULT-EXTENSION ".CSV"
993 INITIAL-DIR start-dir
RETURN-TO-START-DIR
994 TITLE "" USE-FILENAME UPDATE select-ok.
996 IF select-ok
THEN DO:
997 IF SUBSTRING( file-name
, R-INDEX( file-name
, ".") ) <> ".CSV" THEN DO:
998 IF (LENGTH( file-name
) - R-INDEX( file-name
, "." )) < 4 THEN
999 file-name
= SUBSTRING( file-name
, 1, R-INDEX( file-name
, ".")) + "CSV" .
1001 RP.Char2
:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
1006 /* _UIB-CODE-BLOCK-END
*/
1009 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
1010 PROCEDURE send-records
:
1011 /*------------------------------------------------------------------------------
1012 Purpose
: Send record
ROWID's for all tables used by
1014 Parameters
: see template
/snd-head.i
1015 ------------------------------------------------------------------------------*/
1017 /* Define variables needed by this internal procedure.
*/
1018 {src
/adm
/template
/snd-head.i
}
1020 /* For each requested table
, put it's
ROWID in the output list.
*/
1021 {src
/adm
/template
/snd-list.i
"RP"}
1023 /* Deal with any unexpected table requests before closing.
*/
1024 {src
/adm
/template
/snd-end.i
}
1028 /* _UIB-CODE-BLOCK-END
*/
1031 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
1032 PROCEDURE state-changed
:
1033 /* -----------------------------------------------------------
1037 -------------------------------------------------------------*/
1038 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
1039 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
1042 /* Object instance CASEs can go here to replace standard behavior
1043 or add new cases.
*/
1044 {src
/adm
/template
/vstates.i
}
1048 /* _UIB-CODE-BLOCK-END
*/