Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-dbtrpt.w
blob3b27c4c92d0142bdb7e7c65120cbf77d8038f523
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 File:
10 Description:
11 ------------------------------------------------------------------------*/
12 CREATE WIDGET-POOL.
13 /* *************************** Definitions ************************** */
15 DEF VAR user-name AS CHAR INITIAL "Andrew" NO-UNDO.
17 DEF VAR portfolio-list AS CHAR NO-UNDO.
18 DEF VAR portfolio-pd AS CHAR NO-UNDO.
19 DEF VAR manager-list AS CHAR NO-UNDO.
20 DEF VAR manager-pd AS CHAR NO-UNDO.
21 DEF VAR region-list AS CHAR NO-UNDO.
22 DEF VAR region-pd AS CHAR NO-UNDO.
24 /* _UIB-CODE-BLOCK-END */
25 &ANALYZE-RESUME
28 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
30 /* ******************** Preprocessor Definitions ******************** */
32 &Scoped-define PROCEDURE-TYPE SmartViewer
34 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
36 /* Name of first Frame and/or Browse and/or first Query */
37 &Scoped-define FRAME-NAME F-Main
39 /* External Tables */
40 &Scoped-define EXTERNAL-TABLES RP
41 &Scoped-define FIRST-EXTERNAL-TABLE RP
44 /* Need to scope the external tables to this procedure */
45 DEFINE QUERY external_tables FOR RP.
46 /* Standard List Definitions */
47 &Scoped-Define ENABLED-FIELDS RP.Char2 RP.Int1 RP.Int2 RP.Char1 RP.Dec1 ~
48 RP.Log5 RP.Dec2 RP.Log4 RP.Int4 RP.Log3 RP.Log2
49 &Scoped-define FIELD-PAIRS~
50 ~{&FP1}Int1 ~{&FP2}Int1 ~{&FP3}~
51 ~{&FP1}Int2 ~{&FP2}Int2 ~{&FP3}~
52 ~{&FP1}Dec1 ~{&FP2}Dec1 ~{&FP3}~
53 ~{&FP1}Dec2 ~{&FP2}Dec2 ~{&FP3}
54 &Scoped-define ENABLED-TABLES RP
55 &Scoped-define FIRST-ENABLED-TABLE RP
56 &Scoped-Define ENABLED-OBJECTS RECT-24 cmb_Select1 cmb_Select2 ~
57 cmb_ConsolidationList cmb_month Btn_OK
58 &Scoped-Define DISPLAYED-FIELDS RP.Char2 RP.Int1 RP.Int2 RP.Char1 RP.Dec1 ~
59 RP.Log5 RP.Dec2 RP.Log4 RP.Int4 RP.Log3 RP.Log2
60 &Scoped-Define DISPLAYED-OBJECTS fil_Company fil_Property cmb_Select1 ~
61 cmb_Select2 cmb_ConsolidationList cmb_month
63 /* Custom List Definitions */
64 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
66 /* _UIB-PREPROCESSOR-BLOCK-END */
67 &ANALYZE-RESUME
71 /* *********************** Control Definitions ********************** */
74 /* Definitions of the field level widgets */
75 DEFINE BUTTON Btn_OK AUTO-GO DEFAULT
76 LABEL "OK"
77 SIZE 11.72 BY 1.1
78 BGCOLOR 8 FONT 9.
80 DEFINE VARIABLE cmb_ConsolidationList AS CHARACTER FORMAT "X(256)":U
81 VIEW-AS COMBO-BOX INNER-LINES 5
82 LIST-ITEMS "Item 1"
83 SIZE 38.29 BY 1 NO-UNDO.
85 DEFINE VARIABLE cmb_month AS CHARACTER FORMAT "X(256)":U
86 VIEW-AS COMBO-BOX INNER-LINES 10
87 LIST-ITEMS "",""
88 SIZE 16 BY 1 NO-UNDO.
90 DEFINE VARIABLE cmb_Select1 AS CHARACTER FORMAT "X(256)":U
91 LABEL "Select 1"
92 VIEW-AS COMBO-BOX INNER-LINES 15
93 LIST-ITEMS "",""
94 SIZE 40.29 BY 1
95 FONT 10 NO-UNDO.
97 DEFINE VARIABLE cmb_Select2 AS CHARACTER FORMAT "X(256)":U
98 LABEL "Select 2"
99 VIEW-AS COMBO-BOX INNER-LINES 5
100 LIST-ITEMS "",""
101 SIZE 40.29 BY 1
102 FONT 10 NO-UNDO.
104 DEFINE VARIABLE fil_Company AS CHARACTER FORMAT "X(256)":U
105 VIEW-AS FILL-IN
106 SIZE 37.43 BY 1
107 FONT 10 NO-UNDO.
109 DEFINE VARIABLE fil_Property AS CHARACTER FORMAT "X(256)":U
110 VIEW-AS FILL-IN
111 SIZE 37.43 BY 1
112 FONT 10 NO-UNDO.
114 DEFINE RECTANGLE RECT-24
115 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
116 SIZE 69.43 BY 14.5.
119 /* ************************ Frame Definitions *********************** */
121 DEFINE FRAME F-Main
122 RP.Char2 AT ROW 1.1 COL 3.86 HELP
123 "" NO-LABEL
124 VIEW-AS RADIO-SET VERTICAL
125 RADIO-BUTTONS
126 "One Property", "1P":U,
127 "One Company", "1G":U,
128 "One Region", "1R":U,
129 "One Building Manager", "1M":U,
130 "Range of Regions", "RR":U,
131 "Portfolio - by Region", "AR":U,
132 "Portfolio - by Company", "AG":U,
133 "Portfolio - by Manager", "AM":U,
134 "Consolidation List", "List":U
135 SIZE 18.29 BY 6.4
136 FONT 10
137 RP.Int1 AT ROW 1.3 COL 20.72 COLON-ALIGNED NO-LABEL FORMAT "99999"
138 VIEW-AS FILL-IN
139 SIZE 6.86 BY 1
140 RP.Int2 AT ROW 1.3 COL 20.72 COLON-ALIGNED NO-LABEL
141 VIEW-AS FILL-IN
142 SIZE 6.86 BY 1
143 fil_Company AT ROW 1.3 COL 30.14 COLON-ALIGNED NO-LABEL
144 fil_Property AT ROW 1.3 COL 30.14 COLON-ALIGNED NO-LABEL
145 cmb_Select1 AT ROW 2.6 COL 27.29 COLON-ALIGNED
146 cmb_Select2 AT ROW 3.7 COL 27.29 COLON-ALIGNED
147 cmb_ConsolidationList AT ROW 6 COL 23 COLON-ALIGNED NO-LABEL
148 RP.Char1 AT ROW 8.2 COL 3.86 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 8.8 COL 27.86 NO-LABEL
156 RP.Dec1 AT ROW 10.5 COL 14.14 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 10.6 COL 29.57
162 LABEL "Only include current debit balances"
163 VIEW-AS TOGGLE-BOX
164 SIZE 28.57 BY .85
165 RP.Dec2 AT ROW 12.1 COL 25.57 COLON-ALIGNED
166 LABEL "Minimum" FORMAT "->,>>>,>>9.99"
167 VIEW-AS FILL-IN
168 SIZE 11.43 BY 1.05
169 RP.Log4 AT ROW 12.2 COL 3.57
170 LABEL "Overdue tests:"
171 VIEW-AS TOGGLE-BOX
172 SIZE 12.86 BY .85
173 RP.Int4 AT ROW 12.2 COL 42.14 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.Log3 AT ROW 13.2 COL 3.57
182 LABEL "Summarise part-closed transaction groups"
183 VIEW-AS TOGGLE-BOX
184 SIZE 30.86 BY 1
185 FONT 10
186 Btn_OK AT ROW 14.2 COL 57.86
187 RP.Log2 AT ROW 14.3 COL 3.57 HELP
189 LABEL "Preview"
190 VIEW-AS TOGGLE-BOX
191 SIZE 8.57 BY 1
192 FONT 10
193 RECT-24 AT ROW 1 COL 1
194 "by" VIEW-AS TEXT
195 SIZE 2 BY .9 AT ROW 12.2 COL 39.86
196 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
197 SIDE-LABELS NO-UNDERLINE THREE-D
198 AT COL 1 ROW 1 SCROLLABLE
199 FONT 10
200 DEFAULT-BUTTON Btn_OK.
203 /* *********************** Procedure Settings ************************ */
205 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
206 /* Settings for THIS-PROCEDURE
207 Type: SmartViewer
208 External Tables: ttpl.RP
209 Allow: Basic,DB-Fields
210 Frames: 1
211 Add Fields to: EXTERNAL-TABLES
212 Other Settings: PERSISTENT-ONLY COMPILE
215 /* This procedure should always be RUN PERSISTENT. Report the error, */
216 /* then cleanup and return. */
217 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
218 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
219 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
220 RETURN.
221 END.
223 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
225 /* ************************* Create Window ************************** */
227 &ANALYZE-SUSPEND _CREATE-WINDOW
228 /* DESIGN Window definition (used by the UIB)
229 CREATE WINDOW V-table-Win ASSIGN
230 HEIGHT = 20.1
231 WIDTH = 89.
232 /* END WINDOW DEFINITION */
234 &ANALYZE-RESUME
237 /* *************** Runtime Attributes and UIB Settings ************** */
239 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
240 /* SETTINGS FOR WINDOW V-table-Win
241 VISIBLE,,RUN-PERSISTENT */
242 /* SETTINGS FOR FRAME F-Main
243 NOT-VISIBLE Size-to-Fit */
244 ASSIGN
245 FRAME F-Main:SCROLLABLE = FALSE
246 FRAME F-Main:HIDDEN = TRUE.
248 /* SETTINGS FOR RADIO-SET RP.Char2 IN FRAME F-Main
249 EXP-HELP */
250 /* SETTINGS FOR COMBO-BOX cmb_month IN FRAME F-Main
251 ALIGN-L */
252 /* SETTINGS FOR FILL-IN RP.Dec1 IN FRAME F-Main
253 EXP-LABEL EXP-FORMAT */
254 /* SETTINGS FOR FILL-IN RP.Dec2 IN FRAME F-Main
255 EXP-LABEL EXP-FORMAT */
256 /* SETTINGS FOR FILL-IN fil_Company IN FRAME F-Main
257 NO-ENABLE */
258 /* SETTINGS FOR FILL-IN fil_Property IN FRAME F-Main
259 NO-ENABLE */
260 /* SETTINGS FOR FILL-IN RP.Int1 IN FRAME F-Main
261 EXP-LABEL EXP-FORMAT */
262 /* SETTINGS FOR FILL-IN RP.Int2 IN FRAME F-Main
263 EXP-LABEL */
264 /* SETTINGS FOR RADIO-SET RP.Int4 IN FRAME F-Main
265 EXP-HELP */
266 /* SETTINGS FOR TOGGLE-BOX RP.Log2 IN FRAME F-Main
267 EXP-LABEL EXP-HELP */
268 /* SETTINGS FOR TOGGLE-BOX RP.Log3 IN FRAME F-Main
269 EXP-LABEL */
270 /* SETTINGS FOR TOGGLE-BOX RP.Log4 IN FRAME F-Main
271 EXP-LABEL */
272 /* SETTINGS FOR TOGGLE-BOX RP.Log5 IN FRAME F-Main
273 EXP-LABEL */
274 /* _RUN-TIME-ATTRIBUTES-END */
275 &ANALYZE-RESUME
278 /* Setting information for Queries and Browse Widgets fields */
280 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
281 /* Query rebuild information for FRAME F-Main
282 _Options = "NO-LOCK"
283 _Query is NOT OPENED
284 */ /* FRAME F-Main */
285 &ANALYZE-RESUME
290 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
291 /* ************************* Included-Libraries *********************** */
293 {src/adm/method/viewer.i}
294 {inc/method/m-mntvwr.i}
296 /* _UIB-CODE-BLOCK-END */
297 &ANALYZE-RESUME
302 /* ************************ Control Triggers ************************ */
304 &Scoped-define SELF-NAME Btn_OK
305 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
306 ON CHOOSE OF Btn_OK IN FRAME F-Main /* OK */
308 SELF:SENSITIVE = No.
309 RUN run-report.
310 SELF:SENSITIVE = Yes.
311 END.
313 /* _UIB-CODE-BLOCK-END */
314 &ANALYZE-RESUME
317 &Scoped-define SELF-NAME RP.Char1
318 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
319 ON VALUE-CHANGED OF RP.Char1 IN FRAME F-Main /* Char1 */
321 RUN month-ending-changed.
322 END.
324 /* _UIB-CODE-BLOCK-END */
325 &ANALYZE-RESUME
328 &Scoped-define SELF-NAME RP.Char2
329 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char2 V-table-Win
330 ON VALUE-CHANGED OF RP.Char2 IN FRAME F-Main /* Char2 */
332 RUN enable-appropriate-fields.
333 END.
335 /* _UIB-CODE-BLOCK-END */
336 &ANALYZE-RESUME
339 &Scoped-define SELF-NAME cmb_ConsolidationList
340 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_ConsolidationList V-table-Win
341 ON U1 OF cmb_ConsolidationList IN FRAME F-Main
343 {inc/selcmb/sccls1.i "RP" "Char4"}
344 END.
346 /* _UIB-CODE-BLOCK-END */
347 &ANALYZE-RESUME
350 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_ConsolidationList V-table-Win
351 ON U2 OF cmb_ConsolidationList IN FRAME F-Main
353 {inc/selcmb/sccls2.i "RP" "Char4"}
354 END.
356 /* _UIB-CODE-BLOCK-END */
357 &ANALYZE-RESUME
360 &Scoped-define SELF-NAME cmb_month
361 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month V-table-Win
362 ON U1 OF cmb_month IN FRAME F-Main
364 {inc/selcmb/scmthe1.i "RP" "Int3"}
365 END.
367 /* _UIB-CODE-BLOCK-END */
368 &ANALYZE-RESUME
371 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_month V-table-Win
372 ON U2 OF cmb_month IN FRAME F-Main
374 {inc/selcmb/scmthe2.i "RP" "Int3"}
375 END.
377 /* _UIB-CODE-BLOCK-END */
378 &ANALYZE-RESUME
381 &Scoped-define SELF-NAME cmb_Select2
382 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Select2 V-table-Win
383 ON U1 OF cmb_Select2 IN FRAME F-Main /* Select 2 */
385 {inc/selcmb/scrgn1.i "RP" "Char3"}
386 END.
388 /* _UIB-CODE-BLOCK-END */
389 &ANALYZE-RESUME
392 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Select2 V-table-Win
393 ON U2 OF cmb_Select2 IN FRAME F-Main /* Select 2 */
395 {inc/selcmb/scrgn2.i "RP" "Char3"}
396 END.
398 /* _UIB-CODE-BLOCK-END */
399 &ANALYZE-RESUME
402 &Scoped-define SELF-NAME fil_Company
403 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Company V-table-Win
404 ON U1 OF fil_Company IN FRAME F-Main
406 {inc/selfil/sfcmp1.i "RP" "Int2"}
407 END.
409 /* _UIB-CODE-BLOCK-END */
410 &ANALYZE-RESUME
413 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Company V-table-Win
414 ON U2 OF fil_Company IN FRAME F-Main
416 {inc/selfil/sfcmp2.i "RP" "Int2"}
417 END.
419 /* _UIB-CODE-BLOCK-END */
420 &ANALYZE-RESUME
423 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Company V-table-Win
424 ON U3 OF fil_Company IN FRAME F-Main
426 {inc/selfil/sfcmp3.i "RP" "Int2"}
427 END.
429 /* _UIB-CODE-BLOCK-END */
430 &ANALYZE-RESUME
433 &Scoped-define SELF-NAME fil_Property
434 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Property V-table-Win
435 ON U1 OF fil_Property IN FRAME F-Main
437 {inc/selfil/sfpro1.i "RP" "Int1"}
438 END.
440 /* _UIB-CODE-BLOCK-END */
441 &ANALYZE-RESUME
444 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Property V-table-Win
445 ON U2 OF fil_Property IN FRAME F-Main
447 {inc/selfil/sfpro2.i "RP" "Int1"}
448 END.
450 /* _UIB-CODE-BLOCK-END */
451 &ANALYZE-RESUME
454 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Property V-table-Win
455 ON U3 OF fil_Property IN FRAME F-Main
457 {inc/selfil/sfpro3.i "RP" "Int1"}
458 END.
460 /* _UIB-CODE-BLOCK-END */
461 &ANALYZE-RESUME
464 &Scoped-define SELF-NAME RP.Int1
465 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
466 ON LEAVE OF RP.Int1 IN FRAME F-Main /* Int1 */
468 {inc/selcde/cdpro.i "fil_Property"}
469 END.
471 /* _UIB-CODE-BLOCK-END */
472 &ANALYZE-RESUME
475 &Scoped-define SELF-NAME RP.Int2
476 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
477 ON LEAVE OF RP.Int2 IN FRAME F-Main
479 {inc/selcde/cdcmp.i "fil_Company"}
480 END.
482 /* _UIB-CODE-BLOCK-END */
483 &ANALYZE-RESUME
486 &Scoped-define SELF-NAME RP.Log4
487 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log4 V-table-Win
488 ON VALUE-CHANGED OF RP.Log4 IN FRAME F-Main /* Overdue tests: */
490 RUN enable-appropriate-fields.
491 END.
493 /* _UIB-CODE-BLOCK-END */
494 &ANALYZE-RESUME
497 &UNDEFINE SELF-NAME
499 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
502 /* *************************** Main Block *************************** */
504 /* _UIB-CODE-BLOCK-END */
505 &ANALYZE-RESUME
508 /* ********************** Internal Procedures *********************** */
510 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
511 PROCEDURE adm-row-available :
512 /*------------------------------------------------------------------------------
513 Purpose: Dispatched to this procedure when the Record-
514 Source has a new row available. This procedure
515 tries to get the new row (or foriegn keys) from
516 the Record-Source and process it.
517 Parameters: <none>
518 ------------------------------------------------------------------------------*/
520 /* Define variables needed by this internal procedure. */
521 {src/adm/template/row-head.i}
523 /* Create a list of all the tables that we need to get. */
524 {src/adm/template/row-list.i "RP"}
526 /* Get the record ROWID's from the RECORD-SOURCE. */
527 {src/adm/template/row-get.i}
529 /* FIND each record specified by the RECORD-SOURCE. */
530 {src/adm/template/row-find.i "RP"}
532 /* Process the newly available records (i.e. display fields,
533 open queries, and/or pass records on to any RECORD-TARGETS). */
534 {src/adm/template/row-end.i}
536 END PROCEDURE.
538 /* _UIB-CODE-BLOCK-END */
539 &ANALYZE-RESUME
542 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
543 PROCEDURE disable_UI :
544 /*------------------------------------------------------------------------------
545 Purpose: DISABLE the User Interface
546 Parameters: <none>
547 Notes: Here we clean-up the user-interface by deleting
548 dynamic widgets we have created and/or hide
549 frames. This procedure is usually called when
550 we are ready to "clean-up" after running.
551 ------------------------------------------------------------------------------*/
552 /* Hide all frames. */
553 HIDE FRAME F-Main.
554 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
555 END PROCEDURE.
557 /* _UIB-CODE-BLOCK-END */
558 &ANALYZE-RESUME
561 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
562 PROCEDURE enable-appropriate-fields :
563 /*------------------------------------------------------------------------------
564 Purpose: As its name!
565 ------------------------------------------------------------------------------*/
567 DO WITH FRAME {&FRAME-NAME}:
569 CASE INPUT RP.Char2:
570 WHEN "1P" THEN DO:
571 VIEW RP.Int1 fil_Property .
572 HIDE cmb_Select1 cmb_Select2 cmb_ConsolidationList RP.Int2 fil_Company .
573 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Property:HANDLE ), "HIDDEN = No" ).
574 END.
575 WHEN "1G" THEN DO:
576 VIEW RP.Int2 fil_Company .
577 HIDE cmb_Select1 cmb_Select2 cmb_ConsolidationList RP.Int1 fil_Property.
578 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Company:HANDLE ), "HIDDEN = No" ).
579 END.
580 WHEN "1R" THEN DO:
581 RUN get-regions.
583 cmb_Select1:LIST-ITEMS = region-list.
584 cmb_Select1:PRIVATE-DATA = region-pd.
585 cmb_Select1:SCREEN-VALUE = ENTRY( 1, region-list ).
587 VIEW cmb_Select1 . cmb_Select1:LABEL = "Region".
588 HIDE RP.Int1 cmb_Select2 fil_Property cmb_ConsolidationList RP.Int2 fil_Company .
589 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Property:HANDLE ), "HIDDEN = Yes" ).
590 END.
591 WHEN "1M" THEN DO:
592 RUN get-managers.
593 cmb_Select1:LIST-ITEMS = manager-list.
594 cmb_Select1:PRIVATE-DATA = manager-pd.
595 cmb_Select1:SCREEN-VALUE = ENTRY( 1, manager-list ).
597 VIEW cmb_Select1. cmb_Select1:LABEL = "Manager".
598 HIDE RP.Int1 fil_Property cmb_Select2 cmb_ConsolidationList RP.Int2 fil_Company .
599 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Property:HANDLE ), "HIDDEN = Yes" ).
600 END.
601 WHEN "RR" THEN DO:
602 RUN get-regions.
604 cmb_Select1:LIST-ITEMS = region-list.
605 cmb_Select1:PRIVATE-DATA = region-pd.
606 cmb_Select1:SCREEN-VALUE = ENTRY( 1, region-list ).
608 cmb_Select2:LIST-ITEMS = region-list.
609 cmb_Select2:PRIVATE-DATA = region-pd.
610 cmb_Select2:SCREEN-VALUE = ENTRY( 1, region-list ).
612 VIEW cmb_Select1 cmb_Select2.
613 cmb_Select1:LABEL = "Region". cmb_Select2:LABEL = "To".
614 HIDE RP.Int1 fil_Property cmb_ConsolidationList RP.Int2 fil_Company .
615 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Property:HANDLE ), "HIDDEN = Yes" ).
616 END.
617 WHEN "List" THEN DO:
618 HIDE cmb_Select1 cmb_Select2 RP.Int1 fil_Property RP.Int2 fil_Company .
619 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Property:HANDLE ), "HIDDEN = Yes" ).
620 VIEW cmb_ConsolidationList .
621 END.
622 OTHERWISE DO:
623 HIDE cmb_ConsolidationList cmb_Select1 cmb_Select2 RP.Int1 fil_Property RP.Int2 fil_Company .
624 RUN set-link-attributes IN sys-mgr ( THIS-PROCEDURE, STRING( fil_Property:HANDLE ), "HIDDEN = Yes" ).
625 END.
626 END CASE.
628 IF INPUT RP.Log4 THEN DO:
629 ENABLE RP.Int4 RP.Dec2 .
630 END.
631 ELSE DO:
632 DISABLE RP.Int4 RP.Dec2 .
633 END.
635 RUN month-ending-changed.
636 END.
638 END PROCEDURE.
640 /* _UIB-CODE-BLOCK-END */
641 &ANALYZE-RESUME
644 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-managers V-table-Win
645 PROCEDURE get-managers :
646 /*------------------------------------------------------------------------------
647 Purpose:
648 Parameters: <none>
649 Notes:
650 ------------------------------------------------------------------------------*/
652 IF manager-list <> "" THEN RETURN.
654 FOR EACH Property NO-LOCK
655 BREAK BY Property.Administrator:
656 IF FIRST-OF( Property.Administrator ) THEN
658 FIND Person WHERE Person.PersonCode = Property.Administrator
659 NO-LOCK NO-ERROR.
661 manager-list = manager-list + IF manager-list = "" THEN "" ELSE ",".
662 manager-list = manager-list +
663 ( IF AVAILABLE Person THEN Person.FirstName + ' ' + Person.LastName ELSE "Not Managed" ).
665 manager-pd = manager-pd + IF manager-pd = "" THEN "" ELSE ",".
666 manager-pd = manager-pd + IF AVAILABLE Person THEN STRING( Person.PersonCode ) ELSE STRING( Property.Administrator ).
667 END.
669 END.
671 END PROCEDURE.
673 /* _UIB-CODE-BLOCK-END */
674 &ANALYZE-RESUME
677 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-portfolios V-table-Win
678 PROCEDURE get-portfolios :
679 /*------------------------------------------------------------------------------
680 Purpose:
681 Parameters: <none>
682 Notes:
683 ------------------------------------------------------------------------------*/
685 IF portfolio-list <> "" THEN RETURN.
687 FOR EACH Property NO-LOCK
688 BREAK BY Property.Manager:
689 IF FIRST-OF( Property.Manager ) THEN
691 FIND Person WHERE Person.PersonCode = Property.Manager
692 NO-LOCK NO-ERROR.
694 portfolio-list = portfolio-list + IF portfolio-list = "" THEN "" ELSE ",".
695 portfolio-list = portfolio-list +
696 ( IF AVAILABLE Person THEN Person.JobTitle ELSE "Not in a Portfolio" ).
698 portfolio-pd = portfolio-pd + IF portfolio-pd = "" THEN "" ELSE ",".
699 portfolio-pd = portfolio-pd + IF AVAILABLE Person THEN STRING( Person.PersonCode ) ELSE STRING( Property.Manager ).
700 END.
702 END.
704 END PROCEDURE.
706 /* _UIB-CODE-BLOCK-END */
707 &ANALYZE-RESUME
710 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-regions V-table-Win
711 PROCEDURE get-regions :
712 /*------------------------------------------------------------------------------
713 Purpose:
714 Parameters: <none>
715 Notes:
716 ------------------------------------------------------------------------------*/
718 IF region-list <> "" THEN RETURN.
720 FOR EACH Region NO-LOCK:
722 region-list = region-list + IF region-list = "" THEN "" ELSE ",".
723 region-list = region-list + STRING( Region.Region, "X(5)") + "- " + Region.Name.
725 region-pd = region-pd + IF region-pd = "" THEN "" ELSE ",".
726 region-pd = region-pd + Region.Region.
728 END.
730 END PROCEDURE.
732 /* _UIB-CODE-BLOCK-END */
733 &ANALYZE-RESUME
736 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
737 PROCEDURE inst-initialize :
738 /*------------------------------------------------------------------------------
739 Purpose: Initialise the necessary bits and pieces
740 ------------------------------------------------------------------------------*/
742 &SCOP RPT-NAME "debtors"
743 RUN get-username IN sec-mgr ( OUTPUT user-name ).
744 FIND RP WHERE RP.ReportID = {&RPT-NAME}
745 AND RP.UserName = user-name
746 NO-ERROR.
748 IF NOT AVAILABLE( RP ) THEN DO:
749 CREATE RP.
750 ASSIGN
751 RP.ReportID = {&RPT-NAME}
752 RP.UserName = user-name
754 END.
756 RUN dispatch ( 'display-fields':U ).
757 RUN dispatch ( 'enable-fields':U ).
758 RUN enable-appropriate-fields.
760 END PROCEDURE.
762 /* _UIB-CODE-BLOCK-END */
763 &ANALYZE-RESUME
766 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE month-ending-changed V-table-Win
767 PROCEDURE month-ending-changed :
768 /*------------------------------------------------------------------------------
769 Purpose:
770 Parameters: <none>
771 Notes:
772 ------------------------------------------------------------------------------*/
774 DO WITH FRAME {&FRAME-NAME}:
775 cmb_month:SENSITIVE = INPUT FRAME {&FRAME-NAME} RP.Char1 = 'MONTH':U.
776 END.
778 END PROCEDURE.
780 /* _UIB-CODE-BLOCK-END */
781 &ANALYZE-RESUME
784 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
785 PROCEDURE pre-destroy :
786 /*------------------------------------------------------------------------------
787 Purpose:
788 ------------------------------------------------------------------------------*/
789 RUN check-modified( 'clear':U ).
790 END PROCEDURE.
792 /* _UIB-CODE-BLOCK-END */
793 &ANALYZE-RESUME
796 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
797 PROCEDURE run-report :
798 /*------------------------------------------------------------------------------
799 Purpose: Actually run the report program.
800 ------------------------------------------------------------------------------*/
801 DEF VAR asat-date AS DATE NO-UNDO.
802 DEF VAR report-options AS CHAR NO-UNDO.
804 DO WITH FRAME {&FRAME-NAME}:
805 RUN dispatch IN THIS-PROCEDURE ('update-record':U).
806 IF RP.Char1 = "TODAY" THEN asat-date = TODAY. ELSE DO:
807 FIND Month WHERE Month.MonthCode = RP.Int3 NO-LOCK.
808 asat-date = Month.EndDate .
809 END.
811 report-options = (IF RP.Log3 THEN "SummarisePart" ELSE "")
812 + "~nSortBy,".
813 DEF VAR select-1 AS CHAR NO-UNDO.
814 DEF VAR select-2 AS CHAR NO-UNDO.
816 select-1 = ENTRY( cmb_Select1:LOOKUP( cmb_Select1:SCREEN-VALUE ),
817 cmb_Select1:PRIVATE-DATA ).
818 select-2 = ENTRY( cmb_Select2:LOOKUP( cmb_Select2:SCREEN-VALUE ),
819 cmb_Select1:PRIVATE-DATA ).
821 CASE RP.Char2:
822 WHEN "1P" THEN ASSIGN
823 report-options = report-options + "Property~nRecordRange," + STRING(RP.Int1) + "," + STRING(RP.Int1).
824 WHEN "1G" THEN ASSIGN
825 report-options = report-options + "Company~nRecordRange," + STRING(RP.Int2) + "," + STRING(RP.Int2).
826 WHEN "1R" THEN ASSIGN
827 report-options = report-options + "Region~nRecordRange," + select-1 + "," + select-1.
828 WHEN "1M" THEN ASSIGN
829 report-options = report-options + "Manager~nRecordRange," + select-1 + "," + select-1.
830 WHEN "RR" THEN ASSIGN
831 report-options = report-options + "Region~nRecordRange," + select-1 + "," + select-2.
832 WHEN "AR" THEN ASSIGN
833 report-options = report-options + "Region~nAllRecords".
834 WHEN "AG" THEN ASSIGN
835 report-options = report-options + "Company~nAllRecords".
836 WHEN "AM" THEN ASSIGN
837 report-options = report-options + "Manager~nAllRecords".
838 WHEN "List" THEN ASSIGN
839 report-options = report-options + "Company~nConsolidationList," + RP.Char4.
840 END CASE.
842 report-options = report-options
843 + (IF RP.Log5 THEN "~nMinDebitBalance," ELSE "~nMinAbsBalance,") + STRING( RP.Dec1 )
844 + (IF RP.Log4 THEN "~nOverduePeriods," + STRING(RP.Int4) + "~nOverdueBalance," + STRING(RP.Dec2) ELSE "")
845 + "~nAsAtDate," + STRING( asat-date, "99/99/9999")
846 + (IF RP.Log2 THEN "~nPreview" ELSE "").
848 {inc/bq-do.i "process/report/debtors.p" "report-options" "NOT RP.Log2"}
850 END.
851 END PROCEDURE.
853 /* _UIB-CODE-BLOCK-END */
854 &ANALYZE-RESUME
857 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
858 PROCEDURE send-records :
859 /*------------------------------------------------------------------------------
860 Purpose: Send record ROWID's for all tables used by
861 this file.
862 Parameters: see template/snd-head.i
863 ------------------------------------------------------------------------------*/
865 /* Define variables needed by this internal procedure. */
866 {src/adm/template/snd-head.i}
868 /* For each requested table, put it's ROWID in the output list. */
869 {src/adm/template/snd-list.i "RP"}
871 /* Deal with any unexpected table requests before closing. */
872 {src/adm/template/snd-end.i}
874 END PROCEDURE.
876 /* _UIB-CODE-BLOCK-END */
877 &ANALYZE-RESUME
880 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
881 PROCEDURE state-changed :
882 /* -----------------------------------------------------------
883 Purpose:
884 Parameters: <none>
885 Notes:
886 -------------------------------------------------------------*/
887 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
888 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
890 CASE p-state:
891 /* Object instance CASEs can go here to replace standard behavior
892 or add new cases. */
893 {src/adm/template/vstates.i}
894 END CASE.
895 END PROCEDURE.
897 /* _UIB-CODE-BLOCK-END */
898 &ANALYZE-RESUME