1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
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.
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
*/
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
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
*/
71 /* *********************** Control Definitions
********************** */
74 /* Definitions of the field level widgets
*/
75 DEFINE BUTTON Btn_OK
AUTO-GO DEFAULT
80 DEFINE VARIABLE cmb_ConsolidationList
AS CHARACTER FORMAT "X(256)":U
81 VIEW-AS COMBO-BOX INNER-LINES 5
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
90 DEFINE VARIABLE cmb_Select1
AS CHARACTER FORMAT "X(256)":U
92 VIEW-AS COMBO-BOX INNER-LINES 15
97 DEFINE VARIABLE cmb_Select2
AS CHARACTER FORMAT "X(256)":U
99 VIEW-AS COMBO-BOX INNER-LINES 5
104 DEFINE VARIABLE fil_Company
AS CHARACTER FORMAT "X(256)":U
109 DEFINE VARIABLE fil_Property
AS CHARACTER FORMAT "X(256)":U
114 DEFINE RECTANGLE RECT-24
115 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
119 /* ************************ Frame Definitions
*********************** */
122 RP.Char2
AT ROW 1.1 COL 3.86 HELP
124 VIEW-AS RADIO-SET VERTICAL
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
137 RP.Int1
AT ROW 1.3 COL 20.72 COLON-ALIGNED NO-LABEL FORMAT "99999"
140 RP.Int2
AT ROW 1.3 COL 20.72 COLON-ALIGNED NO-LABEL
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
151 "As at Today", "TODAY":U
,
152 "At a particular month ending", "MONTH":U
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"
161 RP.Log5
AT ROW 10.6 COL 29.57
162 LABEL "Only include current debit balances"
165 RP.Dec2
AT ROW 12.1 COL 25.57 COLON-ALIGNED
166 LABEL "Minimum" FORMAT "->,>>>,>>9.99"
169 RP.Log4
AT ROW 12.2 COL 3.57
170 LABEL "Overdue tests:"
173 RP.Int4
AT ROW 12.2 COL 42.14 HELP
175 VIEW-AS RADIO-SET HORIZONTAL
181 RP.Log3
AT ROW 13.2 COL 3.57
182 LABEL "Summarise part-closed transaction groups"
186 Btn_OK
AT ROW 14.2 COL 57.86
187 RP.Log2
AT ROW 14.3 COL 3.57 HELP
193 RECT-24
AT ROW 1 COL 1
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
200 DEFAULT-BUTTON Btn_OK.
203 /* *********************** Procedure Settings
************************ */
205 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
206 /* Settings for
THIS-PROCEDURE
208 External Tables
: ttpl.RP
209 Allow
: Basic
,DB-Fields
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.
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
232 /* END WINDOW DEFINITION
*/
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
*/
245 FRAME F-Main
:SCROLLABLE = FALSE
246 FRAME F-Main
:HIDDEN = TRUE.
248 /* SETTINGS
FOR RADIO-SET RP.Char2
IN FRAME F-Main
250 /* SETTINGS
FOR COMBO-BOX cmb_month
IN FRAME F-Main
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
258 /* SETTINGS
FOR FILL-IN fil_Property
IN FRAME F-Main
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
264 /* SETTINGS
FOR RADIO-SET RP.Int4
IN FRAME F-Main
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
270 /* SETTINGS
FOR TOGGLE-BOX RP.Log4
IN FRAME F-Main
272 /* SETTINGS
FOR TOGGLE-BOX RP.Log5
IN FRAME F-Main
274 /* _RUN-TIME-ATTRIBUTES-END
*/
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
284 */ /* FRAME F-Main
*/
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
*/
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 */
310 SELF:SENSITIVE = Yes.
313 /* _UIB-CODE-BLOCK-END
*/
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.
324 /* _UIB-CODE-BLOCK-END
*/
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.
335 /* _UIB-CODE-BLOCK-END
*/
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"}
346 /* _UIB-CODE-BLOCK-END
*/
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"}
356 /* _UIB-CODE-BLOCK-END
*/
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"}
367 /* _UIB-CODE-BLOCK-END
*/
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"}
377 /* _UIB-CODE-BLOCK-END
*/
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"}
388 /* _UIB-CODE-BLOCK-END
*/
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"}
398 /* _UIB-CODE-BLOCK-END
*/
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"}
409 /* _UIB-CODE-BLOCK-END
*/
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"}
419 /* _UIB-CODE-BLOCK-END
*/
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"}
429 /* _UIB-CODE-BLOCK-END
*/
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"}
440 /* _UIB-CODE-BLOCK-END
*/
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"}
450 /* _UIB-CODE-BLOCK-END
*/
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"}
460 /* _UIB-CODE-BLOCK-END
*/
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"}
471 /* _UIB-CODE-BLOCK-END
*/
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"}
482 /* _UIB-CODE-BLOCK-END
*/
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.
493 /* _UIB-CODE-BLOCK-END
*/
499 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
502 /* *************************** Main Block
*************************** */
504 /* _UIB-CODE-BLOCK-END
*/
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.
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
}
538 /* _UIB-CODE-BLOCK-END
*/
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
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.
*/
554 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
557 /* _UIB-CODE-BLOCK-END
*/
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}:
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" ).
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" ).
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" ).
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" ).
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" ).
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 .
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" ).
628 IF INPUT RP.Log4
THEN DO:
629 ENABLE RP.Int4 RP.Dec2 .
632 DISABLE RP.Int4 RP.Dec2 .
635 RUN month-ending-changed.
640 /* _UIB-CODE-BLOCK-END
*/
644 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-managers V-table-Win
645 PROCEDURE get-managers
:
646 /*------------------------------------------------------------------------------
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
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
).
673 /* _UIB-CODE-BLOCK-END
*/
677 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-portfolios V-table-Win
678 PROCEDURE get-portfolios
:
679 /*------------------------------------------------------------------------------
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
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
).
706 /* _UIB-CODE-BLOCK-END
*/
710 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-regions V-table-Win
711 PROCEDURE get-regions
:
712 /*------------------------------------------------------------------------------
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.
732 /* _UIB-CODE-BLOCK-END
*/
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
748 IF NOT AVAILABLE( RP
) THEN DO:
751 RP.ReportID
= {&RPT-NAME}
752 RP.UserName
= user-name
756 RUN dispatch
( 'display-fields'
:U
).
757 RUN dispatch
( 'enable-fields'
:U
).
758 RUN enable-appropriate-fields.
762 /* _UIB-CODE-BLOCK-END
*/
766 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE month-ending-changed V-table-Win
767 PROCEDURE month-ending-changed
:
768 /*------------------------------------------------------------------------------
772 ------------------------------------------------------------------------------*/
774 DO WITH FRAME {&FRAME-NAME}:
775 cmb_month
:SENSITIVE = INPUT FRAME {&FRAME-NAME} RP.Char1 = 'MONTH':U.
780 /* _UIB-CODE-BLOCK-END
*/
784 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
785 PROCEDURE pre-destroy
:
786 /*------------------------------------------------------------------------------
788 ------------------------------------------------------------------------------*/
789 RUN check-modified
( 'clear'
:U
).
792 /* _UIB-CODE-BLOCK-END
*/
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 .
811 report-options
= (IF RP.Log3
THEN "SummarisePart" ELSE "")
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 ).
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.
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"}
853 /* _UIB-CODE-BLOCK-END
*/
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
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
}
876 /* _UIB-CODE-BLOCK-END
*/
880 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
881 PROCEDURE state-changed
:
882 /* -----------------------------------------------------------
886 -------------------------------------------------------------*/
887 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
888 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
891 /* Object instance CASEs can go here to replace standard behavior
893 {src
/adm
/template
/vstates.i
}
897 /* _UIB-CODE-BLOCK-END
*/