Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-tr-l.w
blobfe4e2f7580d50b8ba98ad4b00dfecafa56c23a16
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.
16 DEF VAR group-list AS CHAR NO-UNDO.
18 /* _UIB-CODE-BLOCK-END */
19 &ANALYZE-RESUME
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
34 /* External Tables */
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 ~
51 RECT-5 RECT-6
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 ~
57 tgl_NoOpeningBalances
59 /* Custom List Definitions */
60 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
62 /* _UIB-PREPROCESSOR-BLOCK-END */
63 &ANALYZE-RESUME
67 /* *********************** Control Definitions ********************** */
70 /* Definitions of the field level widgets */
71 DEFINE BUTTON btn_Browse
72 LABEL "Browse"
73 SIZE 6.29 BY 1.05
74 FONT 10.
76 DEFINE BUTTON Btn_OK AUTO-GO DEFAULT
77 LABEL "&OK"
78 SIZE 12 BY 1.2
79 BGCOLOR 8 .
81 DEFINE VARIABLE cb-month1 AS CHARACTER FORMAT "X(256)":U
82 LABEL "Period"
83 VIEW-AS COMBO-BOX INNER-LINES 15
84 LIST-ITEMS "10/07/1886"
85 DROP-DOWN-LIST
86 SIZE 17.14 BY 1 NO-UNDO.
88 DEFINE VARIABLE cb-month2 AS CHARACTER FORMAT "X(256)":U
89 LABEL "To"
90 VIEW-AS COMBO-BOX INNER-LINES 15
91 LIST-ITEMS "Item 1"
92 DROP-DOWN-LIST
93 SIZE 17.14 BY 1 NO-UNDO.
95 DEFINE VARIABLE fil_account1 AS CHARACTER FORMAT "X(256)":U
96 VIEW-AS FILL-IN
97 SIZE 51.29 BY 1
98 BGCOLOR 16 NO-UNDO.
100 DEFINE VARIABLE fil_account2 AS CHARACTER FORMAT "X(256)":U
101 VIEW-AS FILL-IN
102 SIZE 51.29 BY 1
103 BGCOLOR 16 NO-UNDO.
105 DEFINE VARIABLE fil_AccountLike AS CHARACTER FORMAT "XXXX.XX":U INITIAL "******"
106 LABEL "Pattern"
107 VIEW-AS FILL-IN
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
111 VIEW-AS FILL-IN
112 SIZE 51.29 BY 1
113 BGCOLOR 16 NO-UNDO.
115 DEFINE VARIABLE fil_comp2 AS CHARACTER FORMAT "X(256)":U
116 VIEW-AS FILL-IN
117 SIZE 51.29 BY 1
118 BGCOLOR 16 NO-UNDO.
120 DEFINE RECTANGLE RECT-1
121 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
122 SIZE 89.14 BY 19.6.
124 DEFINE RECTANGLE RECT-4
125 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
126 SIZE 88 BY 3.8.
128 DEFINE RECTANGLE RECT-5
129 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
130 SIZE 88 BY 2.8.
132 DEFINE RECTANGLE RECT-6
133 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
134 SIZE 88 BY 7.8.
136 DEFINE VARIABLE tgl_MonthTotals AS LOGICAL INITIAL no
137 LABEL "running totals at end of each period"
138 VIEW-AS TOGGLE-BOX
139 SIZE 27.72 BY 1 NO-UNDO.
141 DEFINE VARIABLE tgl_NoOpeningBalances AS LOGICAL INITIAL no
142 LABEL "Don't show opening balances"
143 VIEW-AS TOGGLE-BOX
144 SIZE 24 BY 1 NO-UNDO.
147 /* ************************ Frame Definitions *********************** */
149 DEFINE FRAME F-Main
150 RP.Char1 AT ROW 1.4 COL 2.14 NO-LABEL
151 VIEW-AS RADIO-SET VERTICAL
152 RADIO-BUTTONS
153 "Single company", "1":U,
154 "Company range", "R":U,
155 "Company list", "L":U
156 SIZE 14.29 BY 2.4
157 FONT 10
158 RP.Int1 AT ROW 1.6 COL 23.57 COLON-ALIGNED
159 LABEL "Company" FORMAT "99999"
160 VIEW-AS FILL-IN
161 SIZE 6.29 BY 1
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
167 LIST-ITEMS "TTP"
168 DROP-DOWN-LIST
169 SIZE 63.43 BY 1
170 RP.Int2 AT ROW 2.6 COL 23.57 COLON-ALIGNED
171 LABEL "To" FORMAT "99999"
172 VIEW-AS FILL-IN
173 SIZE 6.29 BY 1
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
176 "" NO-LABEL
177 VIEW-AS RADIO-SET VERTICAL
178 RADIO-BUTTONS
179 "Single account", "1":U,
180 "Account range", "R":U,
181 "Account group", "G":U,
182 "Accounts like", "L":U
183 SIZE 14.86 BY 3.2
184 FONT 10
185 RP.Dec1 AT ROW 4.6 COL 23.57 COLON-ALIGNED HELP
187 LABEL "Account" FORMAT "9999.99"
188 VIEW-AS FILL-IN
189 SIZE 8 BY 1
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"
196 DROP-DOWN-LIST
197 SIZE 63.43 BY 1
198 FONT 8
199 RP.Dec2 AT ROW 5.6 COL 23.57 COLON-ALIGNED HELP
201 LABEL "to" FORMAT "9999.99"
202 VIEW-AS FILL-IN
203 SIZE 8 BY 1
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"
210 VIEW-AS TOGGLE-BOX
211 SIZE 32 BY 1
212 FONT 10
213 RP.Date1 AT ROW 9.8 COL 41.29 COLON-ALIGNED NO-LABEL
214 VIEW-AS FILL-IN
215 SIZE 11.43 BY 1
216 RP.Log4 AT ROW 10.8 COL 11.29
217 LABEL "Only where batch no. greater or equal to"
218 VIEW-AS TOGGLE-BOX
219 SIZE 30.29 BY 1
220 FONT 10
221 RP.Int5 AT ROW 10.8 COL 39.57 COLON-ALIGNED NO-LABEL FORMAT ">>>,>>9"
222 VIEW-AS FILL-IN
223 SIZE 11.43 BY 1
224 RP.Log1 AT ROW 11.8 COL 11.29 HELP
226 LABEL "Show all, including for high-volume accounts"
227 VIEW-AS TOGGLE-BOX
228 SIZE 33.72 BY 1
229 FONT 10
230 RP.Log6 AT ROW 12.8 COL 11.29
231 LABEL "Show only when account balance is non-zero at end of period"
232 VIEW-AS TOGGLE-BOX
233 SIZE 45.72 BY 1
234 FONT 10
235 RP.Log7 AT ROW 13.8 COL 11.29
236 LABEL "Balances only"
237 VIEW-AS TOGGLE-BOX
238 SIZE 12.57 BY 1
239 FONT 10
240 RP.Log8 AT ROW 14.8 COL 11.29
241 LABEL "Exclude Year End Transactions"
242 VIEW-AS TOGGLE-BOX
243 SIZE 24.57 BY 1
244 FONT 10
246 /* DEFINE FRAME statement is approaching 4K Bytes. Breaking it up */
247 DEFINE FRAME F-Main
248 tgl_MonthTotals AT ROW 12.8 COL 61
249 RP.Log9 AT ROW 13.8 COL 61 HELP
251 LABEL "Hide related records"
252 VIEW-AS TOGGLE-BOX
253 SIZE 17.14 BY 1
254 tgl_NoOpeningBalances AT ROW 14.8 COL 61
255 RP.Char3 AT ROW 16.2 COL 10.72 HELP
256 "" NO-LABEL
257 VIEW-AS RADIO-SET VERTICAL
258 RADIO-BUTTONS
259 "by Company, then by Account", "L":U,
260 "by Account, then by Company", "A":U
261 SIZE 24.57 BY 1.6
262 FONT 10
263 RP.Log5 AT ROW 18 COL 10.72
264 LABEL "Export to"
265 VIEW-AS TOGGLE-BOX
266 SIZE 9.14 BY 1
267 FONT 10
268 RP.Char2 AT ROW 18 COL 17.86 COLON-ALIGNED NO-LABEL FORMAT "X(120)"
269 VIEW-AS FILL-IN
270 SIZE 62.86 BY 1
271 btn_Browse AT ROW 18 COL 83.29
272 RP.Log2 AT ROW 19.2 COL 10.72 HELP
274 LABEL "Preview"
275 VIEW-AS TOGGLE-BOX
276 SIZE 11.72 BY .8
277 FONT 10
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
285 FONT 10
286 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
287 SIDE-LABELS NO-UNDERLINE THREE-D
288 AT COL 1 ROW 1 SCROLLABLE
289 FONT 10
290 DEFAULT-BUTTON Btn_OK.
293 /* *********************** Procedure Settings ************************ */
295 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
296 /* Settings for THIS-PROCEDURE
297 Type: SmartViewer
298 External Tables: ttpl.RP
299 Allow: Basic,DB-Fields
300 Frames: 1
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.
310 RETURN.
311 END.
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
320 HEIGHT = 21.3
321 WIDTH = 93.29.
322 /* END WINDOW DEFINITION */
324 &ANALYZE-RESUME
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 */
333 &ANALYZE-RESUME
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 */
345 ASSIGN
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
352 EXP-HELP */
353 /* SETTINGS FOR RADIO-SET RP.Char4 IN FRAME F-Main
354 EXP-HELP */
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
360 EXP-LABEL */
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
366 NO-ENABLE */
367 /* SETTINGS FOR FILL-IN fil_account2 IN FRAME F-Main
368 NO-ENABLE */
369 /* SETTINGS FOR FILL-IN fil_comp1 IN FRAME F-Main
370 NO-ENABLE */
371 /* SETTINGS FOR FILL-IN fil_comp2 IN FRAME F-Main
372 NO-ENABLE */
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
384 EXP-LABEL */
385 /* SETTINGS FOR TOGGLE-BOX RP.Log4 IN FRAME F-Main
386 EXP-LABEL */
387 /* SETTINGS FOR TOGGLE-BOX RP.Log5 IN FRAME F-Main
388 EXP-LABEL */
389 /* SETTINGS FOR TOGGLE-BOX RP.Log6 IN FRAME F-Main
390 EXP-LABEL */
391 /* SETTINGS FOR TOGGLE-BOX RP.Log7 IN FRAME F-Main
392 EXP-LABEL */
393 /* SETTINGS FOR TOGGLE-BOX RP.Log8 IN FRAME F-Main
394 EXP-LABEL */
395 /* SETTINGS FOR TOGGLE-BOX RP.Log9 IN FRAME F-Main
396 EXP-LABEL EXP-HELP */
397 /* _RUN-TIME-ATTRIBUTES-END */
398 &ANALYZE-RESUME
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
405 _Options = "NO-LOCK"
406 _Query is NOT OPENED
407 */ /* FRAME F-Main */
408 &ANALYZE-RESUME
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 .
421 END.
423 /* _UIB-CODE-BLOCK-END */
424 &ANALYZE-RESUME
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}.
432 RUN run-report.
433 ENABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
434 END.
436 /* _UIB-CODE-BLOCK-END */
437 &ANALYZE-RESUME
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.
445 END.
447 /* _UIB-CODE-BLOCK-END */
448 &ANALYZE-RESUME
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.
456 END.
458 /* _UIB-CODE-BLOCK-END */
459 &ANALYZE-RESUME
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.
467 END.
469 /* _UIB-CODE-BLOCK-END */
470 &ANALYZE-RESUME
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"}
478 END.
480 /* _UIB-CODE-BLOCK-END */
481 &ANALYZE-RESUME
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"}
489 END.
491 /* _UIB-CODE-BLOCK-END */
492 &ANALYZE-RESUME
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"}
500 END.
502 /* _UIB-CODE-BLOCK-END */
503 &ANALYZE-RESUME
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"}
510 END.
512 /* _UIB-CODE-BLOCK-END */
513 &ANALYZE-RESUME
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"}
520 END.
522 /* _UIB-CODE-BLOCK-END */
523 &ANALYZE-RESUME
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"}
531 END.
533 /* _UIB-CODE-BLOCK-END */
534 &ANALYZE-RESUME
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"}
541 END.
543 /* _UIB-CODE-BLOCK-END */
544 &ANALYZE-RESUME
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"}
551 END.
553 /* _UIB-CODE-BLOCK-END */
554 &ANALYZE-RESUME
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"}
562 END.
564 /* _UIB-CODE-BLOCK-END */
565 &ANALYZE-RESUME
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"}
572 END.
574 /* _UIB-CODE-BLOCK-END */
575 &ANALYZE-RESUME
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"}
582 END.
584 /* _UIB-CODE-BLOCK-END */
585 &ANALYZE-RESUME
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"}
593 END.
595 /* _UIB-CODE-BLOCK-END */
596 &ANALYZE-RESUME
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"}
603 END.
605 /* _UIB-CODE-BLOCK-END */
606 &ANALYZE-RESUME
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"}
613 END.
615 /* _UIB-CODE-BLOCK-END */
616 &ANALYZE-RESUME
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"}
624 END.
626 /* _UIB-CODE-BLOCK-END */
627 &ANALYZE-RESUME
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"}
635 END.
637 /* _UIB-CODE-BLOCK-END */
638 &ANALYZE-RESUME
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.
646 END.
648 /* _UIB-CODE-BLOCK-END */
649 &ANALYZE-RESUME
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.
657 END.
659 /* _UIB-CODE-BLOCK-END */
660 &ANALYZE-RESUME
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.
668 END.
670 /* _UIB-CODE-BLOCK-END */
671 &ANALYZE-RESUME
674 &UNDEFINE SELF-NAME
676 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
679 /* *************************** Main Block *************************** */
681 /* _UIB-CODE-BLOCK-END */
682 &ANALYZE-RESUME
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.
694 Parameters: <none>
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}
713 END PROCEDURE.
715 /* _UIB-CODE-BLOCK-END */
716 &ANALYZE-RESUME
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
722 Parameters: <none>
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. */
729 HIDE FRAME F-Main.
730 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
731 END PROCEDURE.
733 /* _UIB-CODE-BLOCK-END */
734 &ANALYZE-RESUME
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 */
744 WHEN "1" THEN DO:
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 .
749 END.
750 WHEN "R" THEN DO:
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 .
754 HIDE RP.Char6 .
755 END.
756 WHEN "L" THEN DO:
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 .
760 VIEW RP.Char6 .
761 END.
762 END CASE.
764 CASE INPUT RP.Char4: /* Account: Single, range or group*/
765 WHEN "1" THEN DO:
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 .
770 END.
771 WHEN "R" THEN DO:
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 .
776 END.
777 WHEN "G" THEN DO:
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 .
782 END.
783 WHEN "L" THEN DO:
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 .
787 HIDE RP.Char5 .
788 END.
789 END CASE.
791 /* only after date... */
792 IF INPUT RP.Log3 THEN
793 VIEW RP.Date1.
794 ELSE
795 HIDE RP.Date1.
797 /* only after batch... */
798 IF INPUT RP.Log4 THEN
799 VIEW RP.Int5.
800 ELSE
801 HIDE RP.Int5.
803 /* Export to... */
804 IF INPUT RP.Log5 THEN
805 VIEW RP.Char2 btn_Browse .
806 ELSE
807 HIDE RP.Char2 btn_Browse .
809 END.
811 END PROCEDURE.
813 /* _UIB-CODE-BLOCK-END */
814 &ANALYZE-RESUME
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
828 NO-ERROR.
830 IF NOT AVAILABLE( RP ) THEN DO:
831 CREATE RP.
832 ASSIGN
833 RP.ReportID = "tr-l"
834 RP.UserName = user-name
836 END.
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" ).
842 END.
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}:
846 ASSIGN
847 cb-month1:DELIMITER = delim
848 cb-month2:DELIMITER = delim
849 cb-month1:LIST-ITEMS = month1-list
850 cb-month2:LIST-ITEMS = month2-list
852 END.
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)") + '- '
858 + AccountGroup.Name.
859 END.
860 group-list = SUBSTRING( group-list, 2).
861 DO WITH FRAME {&FRAME-NAME}:
862 ASSIGN
863 RP.Char5:DELIMITER = delim
864 RP.Char5:LIST-ITEMS = group-list
866 END.
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.
872 END.
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 .
877 END.
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.
892 END PROCEDURE.
894 /* _UIB-CODE-BLOCK-END */
895 &ANALYZE-RESUME
897 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
898 PROCEDURE pre-destroy :
899 /*------------------------------------------------------------------------------
900 Purpose:
901 ------------------------------------------------------------------------------*/
902 RUN check-modified( 'clear':U ).
903 END PROCEDURE.
905 /* _UIB-CODE-BLOCK-END */
906 &ANALYZE-RESUME
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 ------------------------------------------------------------------------------*/
914 DO TRANSACTION:
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.
925 END.
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.
939 ASSIGN
940 /* ledger opts, account opts, sort opts, zero opt */
941 report-options =
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 ) + ","
960 + export-fname + ","
961 + group-name
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 = ''))"}
974 END PROCEDURE.
976 /* _UIB-CODE-BLOCK-END */
977 &ANALYZE-RESUME
979 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
980 PROCEDURE select-file-dialog :
981 /*------------------------------------------------------------------------------
982 Purpose:
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" .
1000 END.
1001 RP.Char2:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
1002 END.
1004 END PROCEDURE.
1006 /* _UIB-CODE-BLOCK-END */
1007 &ANALYZE-RESUME
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
1013 this file.
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}
1026 END PROCEDURE.
1028 /* _UIB-CODE-BLOCK-END */
1029 &ANALYZE-RESUME
1031 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
1032 PROCEDURE state-changed :
1033 /* -----------------------------------------------------------
1034 Purpose:
1035 Parameters: <none>
1036 Notes:
1037 -------------------------------------------------------------*/
1038 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
1039 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
1041 CASE p-state:
1042 /* Object instance CASEs can go here to replace standard behavior
1043 or add new cases. */
1044 {src/adm/template/vstates.i}
1045 END CASE.
1046 END PROCEDURE.
1048 /* _UIB-CODE-BLOCK-END */
1049 &ANALYZE-RESUME