Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-tntbal.w
blob051a299a58856c877f8b7c17a87f606e68f61201
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 ------------------------------------------------------------------------*/
11 CREATE WIDGET-POOL.
13 /* *************************** Definitions ************************** */
15 &SCOPED-DEFINE REPORT-ID "Tenant Aged Balances"
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.Char3 RP.Log7 RP.Int1 RP.Int2 RP.Char5 ~
42 RP.Char6 RP.Char1 RP.Dec1 RP.Log5 RP.Dec2 RP.Log4 RP.Int4 RP.Log6 RP.Log8 ~
43 RP.Log1 RP.Log2 RP.Char2 RP.Log3
44 &Scoped-define ENABLED-TABLES RP
45 &Scoped-define FIRST-ENABLED-TABLE RP
46 &Scoped-define DISPLAYED-TABLES RP
47 &Scoped-define FIRST-DISPLAYED-TABLE RP
48 &Scoped-Define ENABLED-OBJECTS cmb_ConsolidationList cmb_month btn_Browse ~
49 tgl_NoOpenItems btn_print RECT-29
50 &Scoped-Define DISPLAYED-FIELDS RP.Char3 RP.Log7 RP.Int1 RP.Int2 RP.Char5 ~
51 RP.Char6 RP.Char1 RP.Dec1 RP.Log5 RP.Dec2 RP.Log4 RP.Int4 RP.Log6 RP.Log8 ~
52 RP.Log1 RP.Log2 RP.Char2 RP.Log3
53 &Scoped-Define DISPLAYED-OBJECTS cmb_ConsolidationList fil_PropertyFrom ~
54 fil_PropertyTo cmb_month tgl_NoOpenItems
56 /* Custom List Definitions */
57 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
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 9.72 BY 1.
72 DEFINE BUTTON btn_print DEFAULT
73 LABEL "&OK"
74 SIZE 9.72 BY 1
75 FONT 9.
77 DEFINE VARIABLE cmb_ConsolidationList AS CHARACTER FORMAT "X(256)":U
78 VIEW-AS COMBO-BOX INNER-LINES 5
79 LIST-ITEMS "Item 1"
80 DROP-DOWN-LIST
81 SIZE 43.43 BY 1 NO-UNDO.
83 DEFINE VARIABLE cmb_month AS CHARACTER FORMAT "X(256)":U
84 VIEW-AS COMBO-BOX INNER-LINES 10
85 DROP-DOWN-LIST
86 SIZE 16 BY 1 NO-UNDO.
88 DEFINE VARIABLE fil_PropertyFrom AS CHARACTER FORMAT "X(256)":U
89 VIEW-AS FILL-IN
90 SIZE 49.72 BY 1 NO-UNDO.
92 DEFINE VARIABLE fil_PropertyTo AS CHARACTER FORMAT "X(256)":U
93 VIEW-AS FILL-IN
94 SIZE 49.72 BY 1 NO-UNDO.
96 DEFINE RECTANGLE RECT-29
97 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
98 SIZE 66.29 BY 19.75.
100 DEFINE VARIABLE tgl_NoOpenItems AS LOGICAL INITIAL no
101 LABEL "Do not use open-item transactions"
102 VIEW-AS TOGGLE-BOX
103 SIZE 26.29 BY .8 NO-UNDO.
106 /* ************************ Frame Definitions *********************** */
108 DEFINE FRAME F-Main
109 RP.Char3 AT ROW 1.2 COL 5 HELP
110 "" NO-LABEL
111 VIEW-AS RADIO-SET VERTICAL
112 RADIO-BUTTONS
113 "All properties", "AllProperties":U,
114 "All Companies", "AllCompanies":U,
115 "Company List", "CompanyList":U,
116 "Range of Properties", "PropertyRange":U
117 SIZE 16.57 BY 3.2
118 RP.Log7 AT ROW 1.9 COL 23.57
119 LABEL "Non-property only"
120 VIEW-AS TOGGLE-BOX
121 SIZE 16.29 BY .85
122 cmb_ConsolidationList AT ROW 2.8 COL 21.29 COLON-ALIGNED NO-LABEL
123 RP.Int1 AT ROW 4.4 COL 5.86 COLON-ALIGNED
124 LABEL "Property" FORMAT "99999"
125 VIEW-AS FILL-IN
126 SIZE 6 BY 1
127 fil_PropertyFrom AT ROW 4.4 COL 15 COLON-ALIGNED NO-LABEL
128 RP.Int2 AT ROW 5.4 COL 5.86 COLON-ALIGNED
129 LABEL "To" FORMAT "99999"
130 VIEW-AS FILL-IN
131 SIZE 6 BY 1
132 fil_PropertyTo AT ROW 5.4 COL 15 COLON-ALIGNED NO-LABEL
133 RP.Char5 AT ROW 6.7 COL 5 HELP
134 "" NO-LABEL
135 VIEW-AS RADIO-SET VERTICAL
136 RADIO-BUTTONS
137 "by Property Manager", "ByManager":U,
138 "by Company List", "ByCompany":U,
139 "by Debt Classification", "ByDebtClass":U
140 SIZE 19.43 BY 2.4
141 RP.Char6 AT ROW 7.4 COL 36.43 HELP
142 "" NO-LABEL
143 VIEW-AS RADIO-SET VERTICAL
144 RADIO-BUTTONS
145 "Numeric - by Tenant Code", "N":U,
146 "Alphabetic - by Name", "A":U
147 SIZE 21.14 BY 1.6
148 RP.Char1 AT ROW 9.6 COL 5 NO-LABEL
149 VIEW-AS RADIO-SET VERTICAL
150 RADIO-BUTTONS
151 "As at Today", "TODAY":U,
152 "At a particular month ending", "MONTH":U
153 SIZE 24 BY 1.6
154 FONT 10
155 cmb_month AT ROW 10.2 COL 29 NO-LABEL
156 RP.Dec1 AT ROW 12 COL 14.72 COLON-ALIGNED
157 LABEL "Minimum current" FORMAT "->,>>>,>>9.99"
158 VIEW-AS FILL-IN
159 SIZE 11.43 BY 1
160 FONT 10
161 RP.Log5 AT ROW 12.1 COL 30.14
162 LABEL "Only include current debit balances"
163 VIEW-AS TOGGLE-BOX
164 SIZE 28.57 BY .85
165 RP.Dec2 AT ROW 13.2 COL 27 COLON-ALIGNED
166 LABEL "Minimum" FORMAT "->,>>>,>>9.99"
167 VIEW-AS FILL-IN
168 SIZE 11.43 BY 1.1
169 RP.Log4 AT ROW 13.3 COL 5
170 LABEL "Overdue tests:"
171 VIEW-AS TOGGLE-BOX
172 SIZE 12.86 BY .85
173 RP.Int4 AT ROW 13.3 COL 43.57 HELP
174 "" NO-LABEL
175 VIEW-AS RADIO-SET HORIZONTAL
176 RADIO-BUTTONS
177 "30", 1,
178 "60", 2,
179 "90 days", 3
180 SIZE 22 BY .9
181 RP.Log6 AT ROW 14.6 COL 5
182 LABEL "Exclude automatic rent charges"
183 VIEW-AS TOGGLE-BOX
184 SIZE 26.29 BY .85 TOOLTIP "Excludes transactions from the monthly rent charge batch"
185 RP.Log8 AT ROW 15.75 COL 5
186 LABEL "Completely hide unreported credits && minor debits"
187 VIEW-AS TOGGLE-BOX
188 SIZE 37 BY .85
189 RP.Log1 AT ROW 17 COL 5
190 LABEL "Summary Only"
191 VIEW-AS TOGGLE-BOX
192 SIZE 13.14 BY .8
193 FONT 10
194 RP.Log2 AT ROW 18 COL 5 HELP
196 LABEL "Export"
197 VIEW-AS TOGGLE-BOX
198 SIZE 7.43 BY 1
199 RP.Char2 AT ROW 18 COL 10.43 COLON-ALIGNED HELP
200 "" NO-LABEL FORMAT "X(256)"
201 VIEW-AS FILL-IN
202 SIZE 44.57 BY 1
204 /* DEFINE FRAME statement is approaching 4K Bytes. Breaking it up */
205 DEFINE FRAME F-Main
206 btn_Browse AT ROW 18 COL 57
207 RP.Log3 AT ROW 19.4 COL 5
208 LABEL "Preview"
209 VIEW-AS TOGGLE-BOX
210 SIZE 12.29 BY 1.05
211 tgl_NoOpenItems AT ROW 19.6 COL 26.14
212 btn_print AT ROW 19.6 COL 57
213 RECT-29 AT ROW 1 COL 1
214 "Tenant ordering within groupings" VIEW-AS TEXT
215 SIZE 23.43 BY .65 AT ROW 6.6 COL 31.86
216 "by" VIEW-AS TEXT
217 SIZE 2 BY .9 AT ROW 13.3 COL 41.29
218 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
219 SIDE-LABELS NO-UNDERLINE THREE-D
220 AT COL 1 ROW 1 SCROLLABLE
221 FONT 10
222 DEFAULT-BUTTON btn_print.
225 /* *********************** Procedure Settings ************************ */
227 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
228 /* Settings for THIS-PROCEDURE
229 Type: SmartViewer
230 External Tables: TTPL.RP
231 Allow: Basic,DB-Fields
232 Frames: 1
233 Add Fields to: EXTERNAL-TABLES
234 Other Settings: PERSISTENT-ONLY COMPILE
237 /* This procedure should always be RUN PERSISTENT. Report the error, */
238 /* then cleanup and return. */
239 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
240 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
241 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
242 RETURN.
243 END.
245 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
247 /* ************************* Create Window ************************** */
249 &ANALYZE-SUSPEND _CREATE-WINDOW
250 /* DESIGN Window definition (used by the UIB)
251 CREATE WINDOW V-table-Win ASSIGN
252 HEIGHT = 24.1
253 WIDTH = 81.43.
254 /* END WINDOW DEFINITION */
256 &ANALYZE-RESUME
258 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
259 /* ************************* Included-Libraries *********************** */
261 {src/adm/method/viewer.i}
262 {inc/method/m-mntvwr.i}
264 /* _UIB-CODE-BLOCK-END */
265 &ANALYZE-RESUME
270 /* *********** Runtime Attributes and AppBuilder Settings *********** */
272 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
273 /* SETTINGS FOR WINDOW V-table-Win
274 VISIBLE,,RUN-PERSISTENT */
275 /* SETTINGS FOR FRAME F-Main
276 NOT-VISIBLE Size-to-Fit */
277 ASSIGN
278 FRAME F-Main:SCROLLABLE = FALSE
279 FRAME F-Main:HIDDEN = TRUE.
281 /* SETTINGS FOR FILL-IN RP.Char2 IN FRAME F-Main
282 EXP-LABEL EXP-FORMAT EXP-HELP */
283 /* SETTINGS FOR RADIO-SET RP.Char3 IN FRAME F-Main
284 EXP-HELP */
285 /* SETTINGS FOR RADIO-SET RP.Char5 IN FRAME F-Main
286 EXP-HELP */
287 /* SETTINGS FOR RADIO-SET RP.Char6 IN FRAME F-Main
288 EXP-HELP */
289 /* SETTINGS FOR COMBO-BOX cmb_month IN FRAME F-Main
290 ALIGN-L */
291 /* SETTINGS FOR FILL-IN RP.Dec1 IN FRAME F-Main
292 EXP-LABEL EXP-FORMAT */
293 /* SETTINGS FOR FILL-IN RP.Dec2 IN FRAME F-Main
294 EXP-LABEL EXP-FORMAT */
295 /* SETTINGS FOR FILL-IN fil_PropertyFrom IN FRAME F-Main
296 NO-ENABLE */
297 /* SETTINGS FOR FILL-IN fil_PropertyTo IN FRAME F-Main
298 NO-ENABLE */
299 /* SETTINGS FOR FILL-IN RP.Int1 IN FRAME F-Main
300 EXP-LABEL EXP-FORMAT */
301 /* SETTINGS FOR FILL-IN RP.Int2 IN FRAME F-Main
302 EXP-LABEL EXP-FORMAT */
303 /* SETTINGS FOR RADIO-SET RP.Int4 IN FRAME F-Main
304 EXP-HELP */
305 /* SETTINGS FOR TOGGLE-BOX RP.Log1 IN FRAME F-Main
306 EXP-LABEL */
307 /* SETTINGS FOR TOGGLE-BOX RP.Log2 IN FRAME F-Main
308 EXP-LABEL EXP-HELP */
309 /* SETTINGS FOR TOGGLE-BOX RP.Log3 IN FRAME F-Main
310 EXP-LABEL */
311 /* SETTINGS FOR TOGGLE-BOX RP.Log4 IN FRAME F-Main
312 EXP-LABEL */
313 /* SETTINGS FOR TOGGLE-BOX RP.Log5 IN FRAME F-Main
314 EXP-LABEL */
315 /* SETTINGS FOR TOGGLE-BOX RP.Log6 IN FRAME F-Main
316 EXP-LABEL */
317 /* SETTINGS FOR TOGGLE-BOX RP.Log7 IN FRAME F-Main
318 EXP-LABEL */
319 /* SETTINGS FOR TOGGLE-BOX RP.Log8 IN FRAME F-Main
320 EXP-LABEL */
321 /* _RUN-TIME-ATTRIBUTES-END */
322 &ANALYZE-RESUME
325 /* Setting information for Queries and Browse Widgets fields */
327 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
328 /* Query rebuild information for FRAME F-Main
329 _Options = "NO-LOCK"
330 _Query is NOT OPENED
331 */ /* FRAME F-Main */
332 &ANALYZE-RESUME
338 /* ************************ Control Triggers ************************ */
340 &Scoped-define SELF-NAME btn_Browse
341 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Browse V-table-Win
342 ON CHOOSE OF btn_Browse IN FRAME F-Main /* Browse */
344 RUN select-file-dialog.
345 END.
347 /* _UIB-CODE-BLOCK-END */
348 &ANALYZE-RESUME
351 &Scoped-define SELF-NAME btn_print
352 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_print V-table-Win
353 ON CHOOSE OF btn_print IN FRAME F-Main /* OK */
355 SELF:SENSITIVE = No.
356 RUN run-report.
357 SELF:SENSITIVE = Yes.
358 END.
360 /* _UIB-CODE-BLOCK-END */
361 &ANALYZE-RESUME
364 &Scoped-define SELF-NAME RP.Char1
365 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
366 ON VALUE-CHANGED OF RP.Char1 IN FRAME F-Main /* Char1 */
368 RUN month-ending-changed.
369 END.
371 /* _UIB-CODE-BLOCK-END */
372 &ANALYZE-RESUME
375 &Scoped-define SELF-NAME RP.Char3
376 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char3 V-table-Win
377 ON VALUE-CHANGED OF RP.Char3 IN FRAME F-Main /* Char3 */
379 RUN enable-appropriate-fields.
380 END.
382 /* _UIB-CODE-BLOCK-END */
383 &ANALYZE-RESUME
386 &Scoped-define SELF-NAME RP.Char5
387 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char5 V-table-Win
388 ON VALUE-CHANGED OF RP.Char5 IN FRAME F-Main /* Char5 */
390 RUN enable-appropriate-fields.
391 END.
393 /* _UIB-CODE-BLOCK-END */
394 &ANALYZE-RESUME
397 &Scoped-define SELF-NAME cmb_ConsolidationList
398 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_ConsolidationList V-table-Win
399 ON U1 OF cmb_ConsolidationList IN FRAME F-Main
401 {inc/selcmb/sccls1.i "RP" "Char4"}
402 END.
404 /* _UIB-CODE-BLOCK-END */
405 &ANALYZE-RESUME
408 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_ConsolidationList V-table-Win
409 ON U2 OF cmb_ConsolidationList IN FRAME F-Main
411 {inc/selcmb/sccls2.i "RP" "Char4"}
412 END.
414 /* _UIB-CODE-BLOCK-END */
415 &ANALYZE-RESUME
418 &Scoped-define SELF-NAME cmb_month
419 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month V-table-Win
420 ON U1 OF cmb_month IN FRAME F-Main
422 {inc/selcmb/scmthe1.i "RP" "Int3"}
423 END.
425 /* _UIB-CODE-BLOCK-END */
426 &ANALYZE-RESUME
429 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month V-table-Win
430 ON U2 OF cmb_month IN FRAME F-Main
432 {inc/selcmb/scmthe2.i "RP" "Int3"}
433 END.
435 /* _UIB-CODE-BLOCK-END */
436 &ANALYZE-RESUME
439 &Scoped-define SELF-NAME fil_PropertyFrom
440 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_PropertyFrom V-table-Win
441 ON U1 OF fil_PropertyFrom IN FRAME F-Main
443 {inc/selfil/sfpro1.i "RP" "Int1"}
444 END.
446 /* _UIB-CODE-BLOCK-END */
447 &ANALYZE-RESUME
450 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_PropertyFrom V-table-Win
451 ON U2 OF fil_PropertyFrom IN FRAME F-Main
453 {inc/selfil/sfpro2.i "RP" "Int1"}
454 ASSIGN RP.int2:SCREEN-VALUE IN FRAME {&FRAME-NAME} = STRING( RP.Int1 ).
455 APPLY 'LEAVE':U TO RP.Int2 IN FRAME {&FRAME-NAME}.
456 END.
458 /* _UIB-CODE-BLOCK-END */
459 &ANALYZE-RESUME
462 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_PropertyFrom V-table-Win
463 ON U3 OF fil_PropertyFrom IN FRAME F-Main
465 {inc/selfil/sfpro3.i "RP" "Int1"}
466 END.
468 /* _UIB-CODE-BLOCK-END */
469 &ANALYZE-RESUME
472 &Scoped-define SELF-NAME fil_PropertyTo
473 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_PropertyTo V-table-Win
474 ON U1 OF fil_PropertyTo IN FRAME F-Main
476 {inc/selfil/sfpro1.i "RP" "Int2"}
477 END.
479 /* _UIB-CODE-BLOCK-END */
480 &ANALYZE-RESUME
483 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_PropertyTo V-table-Win
484 ON U2 OF fil_PropertyTo IN FRAME F-Main
486 {inc/selfil/sfpro2.i "RP" "Int2"}
487 END.
489 /* _UIB-CODE-BLOCK-END */
490 &ANALYZE-RESUME
493 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_PropertyTo V-table-Win
494 ON U3 OF fil_PropertyTo IN FRAME F-Main
496 {inc/selfil/sfpro3.i "RP" "Int2"}
497 END.
499 /* _UIB-CODE-BLOCK-END */
500 &ANALYZE-RESUME
503 &Scoped-define SELF-NAME RP.Int1
504 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
505 ON LEAVE OF RP.Int1 IN FRAME F-Main /* Property */
507 {inc/selcde/cdpro.i "fil_PropertyFrom"}
508 END.
510 /* _UIB-CODE-BLOCK-END */
511 &ANALYZE-RESUME
514 &Scoped-define SELF-NAME RP.Int2
515 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
516 ON LEAVE OF RP.Int2 IN FRAME F-Main /* To */
518 {inc/selcde/cdpro.i "fil_PropertyTo"}
519 END.
521 /* _UIB-CODE-BLOCK-END */
522 &ANALYZE-RESUME
525 &Scoped-define SELF-NAME RP.Log2
526 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log2 V-table-Win
527 ON VALUE-CHANGED OF RP.Log2 IN FRAME F-Main /* Export */
529 RUN enable-appropriate-fields.
530 END.
532 /* _UIB-CODE-BLOCK-END */
533 &ANALYZE-RESUME
536 &Scoped-define SELF-NAME RP.Log4
537 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log4 V-table-Win
538 ON VALUE-CHANGED OF RP.Log4 IN FRAME F-Main /* Overdue tests: */
540 RUN enable-appropriate-fields.
541 END.
543 /* _UIB-CODE-BLOCK-END */
544 &ANALYZE-RESUME
547 &UNDEFINE SELF-NAME
549 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
552 /* *************************** Main Block *************************** */
554 /* _UIB-CODE-BLOCK-END */
555 &ANALYZE-RESUME
558 /* ********************** Internal Procedures *********************** */
560 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
561 PROCEDURE adm-row-available :
562 /*------------------------------------------------------------------------------
563 Purpose: Dispatched to this procedure when the Record-
564 Source has a new row available. This procedure
565 tries to get the new row (or foriegn keys) from
566 the Record-Source and process it.
567 Parameters: <none>
568 ------------------------------------------------------------------------------*/
570 /* Define variables needed by this internal procedure. */
571 {src/adm/template/row-head.i}
573 /* Create a list of all the tables that we need to get. */
574 {src/adm/template/row-list.i "RP"}
576 /* Get the record ROWID's from the RECORD-SOURCE. */
577 {src/adm/template/row-get.i}
579 /* FIND each record specified by the RECORD-SOURCE. */
580 {src/adm/template/row-find.i "RP"}
582 /* Process the newly available records (i.e. display fields,
583 open queries, and/or pass records on to any RECORD-TARGETS). */
584 {src/adm/template/row-end.i}
586 END PROCEDURE.
588 /* _UIB-CODE-BLOCK-END */
589 &ANALYZE-RESUME
591 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
592 PROCEDURE disable_UI :
593 /*------------------------------------------------------------------------------
594 Purpose: DISABLE the User Interface
595 Parameters: <none>
596 Notes: Here we clean-up the user-interface by deleting
597 dynamic widgets we have created and/or hide
598 frames. This procedure is usually called when
599 we are ready to "clean-up" after running.
600 ------------------------------------------------------------------------------*/
601 /* Hide all frames. */
602 HIDE FRAME F-Main.
603 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
604 END PROCEDURE.
606 /* _UIB-CODE-BLOCK-END */
607 &ANALYZE-RESUME
609 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
610 PROCEDURE enable-appropriate-fields :
611 /*------------------------------------------------------------------------------
612 Purpose:
613 ------------------------------------------------------------------------------*/
614 DO WITH FRAME {&FRAME-NAME}:
615 IF INPUT RP.Log2 THEN
616 VIEW RP.Char2 btn_Browse .
617 ELSE
618 HIDE RP.Char2 btn_Browse .
620 IF INPUT RP.Char3 = "PropertyRange" THEN DO:
621 HIDE cmb_ConsolidationList RP.Log7 .
622 VIEW RP.Int1 RP.Int2 fil_PropertyFrom fil_PropertyTo .
623 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyFrom:HANDLE), "hidden = No" ).
624 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyTo:HANDLE), "hidden = No" ).
625 END.
626 ELSE IF INPUT RP.Char3 = "CompanyList" THEN DO:
627 HIDE RP.Int1 RP.Int2 fil_PropertyFrom fil_PropertyTo .
628 VIEW cmb_ConsolidationList RP.Log7.
629 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyFrom:HANDLE), "hidden = Yes" ).
630 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyTo:HANDLE), "hidden = Yes" ).
631 END.
632 ELSE IF INPUT RP.Char3 = "AllCompanies" THEN DO:
633 HIDE RP.Int1 RP.Int2 fil_PropertyFrom fil_PropertyTo cmb_ConsolidationList .
634 VIEW RP.Log7.
635 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyFrom:HANDLE), "hidden = Yes" ).
636 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyTo:HANDLE), "hidden = Yes" ).
637 END.
638 ELSE DO:
639 HIDE RP.Int1 RP.Int2 RP.Log7 fil_PropertyFrom fil_PropertyTo cmb_ConsolidationList .
640 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyFrom:HANDLE), "hidden = Yes" ).
641 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING(fil_PropertyTo:HANDLE), "hidden = Yes" ).
642 END.
644 IF INPUT RP.Log4 THEN DO:
645 ENABLE RP.Int4 RP.Dec2 .
646 END.
647 ELSE DO:
648 DISABLE RP.Int4 RP.Dec2 .
649 END.
651 END.
653 END PROCEDURE.
655 /* _UIB-CODE-BLOCK-END */
656 &ANALYZE-RESUME
658 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
659 PROCEDURE inst-enable-fields :
660 /*------------------------------------------------------------------------------
661 Purpose:
662 Parameters: <none>
663 Notes:
664 ------------------------------------------------------------------------------*/
666 RUN month-ending-changed.
668 END PROCEDURE.
670 /* _UIB-CODE-BLOCK-END */
671 &ANALYZE-RESUME
673 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
674 PROCEDURE inst-initialize :
675 /*------------------------------------------------------------------------------
676 Purpose:
677 Parameters: <none>
678 Notes:
679 ------------------------------------------------------------------------------*/
681 DEF VAR user-name AS CHAR NO-UNDO.
683 RUN get-username IN sys-mgr( OUTPUT user-name ).
685 FIND RP WHERE
686 RP.UserName = user-name AND
687 RP.ReportID = {&REPORT-ID} NO-ERROR.
689 IF NOT AVAILABLE RP THEN
690 DO WITH FRAME {&FRAME-NAME}:
692 DEF VAR first-property LIKE Property.PropertyCode NO-UNDO INITIAL 0.
693 DEF VAR last-property LIKE Property.PropertyCode NO-UNDO INITIAL 99999.
695 FIND FIRST Property NO-LOCK NO-ERROR.
696 IF AVAILABLE(Property) THEN DO:
697 first-property = Property.PropertyCode.
698 FIND LAST Property NO-LOCK.
699 last-property = Property.PropertyCode.
700 END.
702 CREATE RP.
703 ASSIGN
704 RP.ReportID = {&REPORT-ID}
705 RP.UserName = user-name
706 RP.Int1 = first-property
707 RP.Int2 = last-property.
708 END.
710 RUN dispatch( 'display-fields':U ).
711 RUN dispatch( 'enable-fields':U ).
713 RUN enable-appropriate-fields.
715 END PROCEDURE.
717 /* _UIB-CODE-BLOCK-END */
718 &ANALYZE-RESUME
720 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE month-ending-changed V-table-Win
721 PROCEDURE month-ending-changed :
722 /*------------------------------------------------------------------------------
723 Purpose:
724 Parameters: <none>
725 Notes:
726 ------------------------------------------------------------------------------*/
728 DO WITH FRAME {&FRAME-NAME}:
729 cmb_month:SENSITIVE = INPUT FRAME {&FRAME-NAME} RP.Char1 = 'MONTH':U.
730 END.
732 END PROCEDURE.
734 /* _UIB-CODE-BLOCK-END */
735 &ANALYZE-RESUME
737 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
738 PROCEDURE pre-destroy :
739 /*------------------------------------------------------------------------------
740 Purpose:
741 Parameters: <none>
742 Notes:
743 ------------------------------------------------------------------------------*/
745 RUN check-modified( "CLEAR" ).
747 END PROCEDURE.
749 /* _UIB-CODE-BLOCK-END */
750 &ANALYZE-RESUME
752 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
753 PROCEDURE run-report :
754 /*------------------------------------------------------------------------------
755 Purpose:
756 ------------------------------------------------------------------------------*/
757 DEF VAR report-options AS CHAR NO-UNDO.
759 RUN verify-report.
760 IF RETURN-VALUE = "FAIL" THEN RETURN.
762 RUN dispatch( 'update-record':U ).
764 CASE RP.Char3:
765 WHEN "PropertyRange" THEN
766 report-options = "EntityRange,P," + STRING(RP.Int1) + "," + STRING(RP.Int2).
767 WHEN "AllProperties" THEN
768 report-options = "EntityRange,P,0,99999".
769 WHEN "CompanyList" THEN
770 report-options = "CompanyList," + RP.Char4.
771 WHEN "AllCompanies" THEN
772 report-options = "EntityRange,L,0,99999".
773 END CASE.
775 report-options = report-options
776 + (IF RP.Log1 THEN "~nSummary" ELSE "")
777 + (IF RP.Log2 THEN "~nExport," + RP.Char2 ELSE "")
778 + (IF RP.Log3 THEN "~nPreview" ELSE "")
779 + (IF RP.Log6 THEN "~nExcludeRent" ELSE "")
780 + (IF RP.Log5 THEN "~nMinDebitBalance," ELSE "~nMinAbsBalance,") + STRING( RP.Dec1 )
781 + (IF RP.Log7 AND RP.Char3 = "AllCompanies" THEN "~nNonProperty" ELSE "")
782 + (IF RP.Log7 AND RP.Char3 = "CompanyList" THEN "~nNonProperty" ELSE "")
783 + (IF RP.Log8 THEN "~nHideIgnored" ELSE "")
784 + (IF RP.Log4 THEN "~nOverduePeriods," + STRING(RP.Int4) + "~nOverdueBalance," + STRING(RP.Dec2) ELSE "")
785 + ("~nSort," + RP.Char5)
786 + ("~nTenantOrder," + RP.Char6)
787 + (IF RP.Char1 = "TODAY" THEN "" ELSE "~nAtMonthEnd," + STRING(RP.Int3))
788 + (IF INPUT FRAME {&FRAME-NAME} tgl_NoOpenItems THEN "~nNoOpenItems" ELSE "")
791 RUN notify( 'set-busy, container-source':U ).
792 IF RP.Log3 THEN
793 RUN process/report/tntagebl.p ( report-options ).
794 ELSE
795 RUN make-bq-entry IN sys-mgr( "process/report/tntagebl.p", report-options, ?, ?).
797 RUN notify( 'set-idle, container-source':U ).
799 END PROCEDURE.
801 /* _UIB-CODE-BLOCK-END */
802 &ANALYZE-RESUME
804 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
805 PROCEDURE select-file-dialog :
806 /*------------------------------------------------------------------------------
807 Purpose:
808 ------------------------------------------------------------------------------*/
809 DEF VAR select-ok AS LOGICAL INITIAL Yes NO-UNDO.
810 DEF VAR file-name AS CHAR NO-UNDO.
811 DEF VAR start-dir AS CHAR NO-UNDO.
813 file-name = INPUT FRAME {&FRAME-NAME} RP.Char2 .
814 start-dir = SUBSTRING( file-name, 1, R-INDEX(file-name, "\" ) ).
816 SYSTEM-DIALOG GET-FILE file-name FILTERS "Comma-separated values" "*.CSV"
817 SAVE-AS ASK-OVERWRITE CREATE-TEST-FILE DEFAULT-EXTENSION ".CSV"
818 INITIAL-DIR start-dir RETURN-TO-START-DIR
819 TITLE "" USE-FILENAME UPDATE select-ok.
821 IF select-ok THEN DO:
822 IF SUBSTRING( file-name, R-INDEX( file-name, ".") ) <> ".CSV" THEN DO:
823 IF (LENGTH( file-name ) - R-INDEX( file-name, "." )) < 4 THEN
824 file-name = SUBSTRING( file-name, 1, R-INDEX( file-name, ".")) + "CSV" .
825 END.
826 RP.Char2:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
827 END.
829 END PROCEDURE.
831 /* _UIB-CODE-BLOCK-END */
832 &ANALYZE-RESUME
834 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
835 PROCEDURE send-records :
836 /*------------------------------------------------------------------------------
837 Purpose: Send record ROWID's for all tables used by
838 this file.
839 Parameters: see template/snd-head.i
840 ------------------------------------------------------------------------------*/
842 /* Define variables needed by this internal procedure. */
843 {src/adm/template/snd-head.i}
845 /* For each requested table, put it's ROWID in the output list. */
846 {src/adm/template/snd-list.i "RP"}
848 /* Deal with any unexpected table requests before closing. */
849 {src/adm/template/snd-end.i}
851 END PROCEDURE.
853 /* _UIB-CODE-BLOCK-END */
854 &ANALYZE-RESUME
856 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
857 PROCEDURE state-changed :
858 /* -----------------------------------------------------------
859 Purpose:
860 Parameters: <none>
861 Notes:
862 -------------------------------------------------------------*/
863 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
864 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
866 CASE p-state:
867 /* Object instance CASEs can go here to replace standard behavior
868 or add new cases. */
869 {src/adm/template/vstates.i}
870 END CASE.
871 END PROCEDURE.
873 /* _UIB-CODE-BLOCK-END */
874 &ANALYZE-RESUME
876 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-report V-table-Win
877 PROCEDURE verify-report :
878 /*------------------------------------------------------------------------------
879 Purpose:
880 Parameters: <none>
881 Notes:
882 ------------------------------------------------------------------------------*/
884 IF INPUT FRAME {&FRAME-NAME} RP.Int1 >
885 INPUT FRAME {&FRAME-NAME} RP.Int2 THEN
887 MESSAGE "The TO property must be greater than the from property !"
888 VIEW-AS ALERT-BOX ERROR.
889 APPLY 'ENTRY':U TO RP.Int1 IN FRAME {&FRAME-NAME}.
890 RETURN "FAIL".
891 END.
893 IF INPUT FRAME {&FRAME-NAME} RP.Char1 = "MONTH" AND
894 ( cmb_month:SCREEN-VALUE = "" OR cmb_month:SCREEN-VALUE = ? ) THEN
896 MESSAGE "You must select a month" VIEW-AS ALERT-BOX ERROR.
897 APPLY 'ENTRY':U TO cmb_month IN FRAME {&FRAME-NAME}.
898 RETURN "FAIL".
899 END.
901 END PROCEDURE.
903 /* _UIB-CODE-BLOCK-END */
904 &ANALYZE-RESUME