Add %age area column to vacancies section.
[capital-apms-progress.git] / forecast / v-scenario-assumption.w
blobdda7b5a26882a96df364981bb7a865415d112cce
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 ------------------------------------------------------------------------*/
13 CREATE WIDGET-POOL.
15 /* *************************** Definitions ************************** */
17 DEF VAR mode AS CHAR NO-UNDO.
18 DEF VAR key-name AS CHAR NO-UNDO.
19 DEF VAR key-value AS CHAR NO-UNDO INITIAL ?.
21 DEF VAR frequency-type AS CHAR NO-UNDO.
22 DEF VAR region-code AS CHAR NO-UNDO.
24 DEF VAR type-scope AS CHAR NO-UNDO.
26 /* _UIB-CODE-BLOCK-END */
27 &ANALYZE-RESUME
30 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
32 /* ******************** Preprocessor Definitions ******************** */
34 &Scoped-define PROCEDURE-TYPE SmartViewer
36 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
38 /* Name of first Frame and/or Browse and/or first Query */
39 &Scoped-define FRAME-NAME F-Main
41 /* External Tables */
42 &Scoped-define EXTERNAL-TABLES ScenarioAssumption
43 &Scoped-define FIRST-EXTERNAL-TABLE ScenarioAssumption
46 /* Need to scope the external tables to this procedure */
47 DEFINE QUERY external_tables FOR ScenarioAssumption.
48 /* Standard List Definitions */
49 &Scoped-Define ENABLED-FIELDS ScenarioAssumption.Scope ~
50 ScenarioAssumption.TypeScope ScenarioAssumption.AssumptionValue
51 &Scoped-define FIELD-PAIRS~
52 ~{&FP1}AssumptionValue ~{&FP2}AssumptionValue ~{&FP3}
53 &Scoped-define ENABLED-TABLES ScenarioAssumption
54 &Scoped-define FIRST-ENABLED-TABLE ScenarioAssumption
55 &Scoped-Define ENABLED-OBJECTS cmb_Region cmb_Property cmb_Month ~
56 cmb_AssumptionType fil_MonthsVacant fil_PerAnnum fil_PSM cmb_Frequency
57 &Scoped-Define DISPLAYED-FIELDS ScenarioAssumption.ScenarioCode ~
58 ScenarioAssumption.Scope ScenarioAssumption.TypeScope ~
59 ScenarioAssumption.AssumptionValue
60 &Scoped-Define DISPLAYED-OBJECTS cmb_Region cmb_Property cmb_Month ~
61 cmb_AssumptionType fil_MonthsVacant fil_PerAnnum fil_PSM cmb_Frequency
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
70 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
71 /* Actions: ? adm/support/keyedit.w ? ? ? */
72 /* STRUCTURED-DATA
73 <KEY-OBJECT>
74 THIS-PROCEDURE
75 </KEY-OBJECT>
76 <FOREIGN-KEYS>
77 FlowStepType|y|y|TTPL.FlowStepType.FlowStepType
78 </FOREIGN-KEYS>
79 <EXECUTING-CODE>
80 **************************
81 * Set attributes related to FOREIGN KEYS
83 RUN set-attribute-list (
84 'Keys-Accepted = "FlowStepType",
85 Keys-Supplied = "FlowStepType"':U).
86 /**************************
87 </EXECUTING-CODE> */
88 /* _UIB-CODE-BLOCK-END */
89 &ANALYZE-RESUME
92 /* *********************** Control Definitions ********************** */
95 /* Definitions of the field level widgets */
96 DEFINE VARIABLE cmb_AssumptionType AS CHARACTER FORMAT "X(256)":U
97 LABEL "Assumption type"
98 VIEW-AS COMBO-BOX INNER-LINES 5
99 LIST-ITEMS "Item 1"
100 SIZE 42.86 BY 1.05 NO-UNDO.
102 DEFINE VARIABLE cmb_Frequency AS CHARACTER FORMAT "X(256)":U
103 LABEL "per"
104 VIEW-AS COMBO-BOX INNER-LINES 5
105 LIST-ITEMS "Item 1"
106 SIZE 16 BY 1 NO-UNDO.
108 DEFINE VARIABLE cmb_Month AS CHARACTER FORMAT "X(256)":U
109 LABEL "Applying from"
110 VIEW-AS COMBO-BOX INNER-LINES 24
111 LIST-ITEMS "Item 1"
112 SIZE 15.43 BY 1 NO-UNDO.
114 DEFINE VARIABLE cmb_Property AS CHARACTER FORMAT "X(256)":U
115 LABEL "Property"
116 VIEW-AS COMBO-BOX INNER-LINES 20
117 LIST-ITEMS "Item 1"
118 SIZE 42.86 BY 1 NO-UNDO.
120 DEFINE VARIABLE cmb_Region AS CHARACTER FORMAT "X(256)":U
121 LABEL "Region"
122 VIEW-AS COMBO-BOX INNER-LINES 15
123 LIST-ITEMS "Item 1"
124 SIZE 42.86 BY 1 NO-UNDO.
126 DEFINE VARIABLE fil_MonthsVacant AS INTEGER FORMAT "->,>>>,>>9":U
127 LABEL "Months vacant"
128 VIEW-AS FILL-IN
129 SIZE 4.57 BY 1.05 NO-UNDO.
131 DEFINE VARIABLE fil_PerAnnum AS DECIMAL FORMAT "->>,>>9.99":U INITIAL 0
132 LABEL "Per annum"
133 VIEW-AS FILL-IN
134 SIZE 12 BY 1.05 NO-UNDO.
136 DEFINE VARIABLE fil_PSM AS DECIMAL FORMAT "->>,>>9.99":U INITIAL 0
137 LABEL "PSM"
138 VIEW-AS FILL-IN
139 SIZE 10.14 BY 1.05 NO-UNDO.
142 /* ************************ Frame Definitions *********************** */
144 DEFINE FRAME F-Main
145 ScenarioAssumption.ScenarioCode AT ROW 2 COL 13.29 COLON-ALIGNED
146 VIEW-AS FILL-IN
147 SIZE 5.72 BY 1.05
148 ScenarioAssumption.Scope AT ROW 3.2 COL 10
149 VIEW-AS COMBO-BOX INNER-LINES 5
150 LIST-ITEMS "G","R","P"
151 SIZE 5.72 BY 1
152 cmb_Region AT ROW 4.4 COL 13.29 COLON-ALIGNED
153 cmb_Property AT ROW 5.6 COL 13.29 COLON-ALIGNED
154 cmb_Month AT ROW 7.4 COL 13.29 COLON-ALIGNED
155 ScenarioAssumption.TypeScope AT ROW 8.4 COL 7
156 LABEL "Applying to" FORMAT "X(20)"
157 VIEW-AS COMBO-BOX INNER-LINES 5
158 LIST-ITEMS "REVU - Rent Review","NLSE - New Lease"
159 SIZE 21.14 BY 1.05
160 cmb_AssumptionType AT ROW 9.6 COL 13.29 COLON-ALIGNED
161 fil_MonthsVacant AT ROW 12.4 COL 13.29 COLON-ALIGNED
162 fil_PerAnnum AT ROW 13.4 COL 13.29 COLON-ALIGNED
163 fil_PSM AT ROW 13.4 COL 36.14 COLON-ALIGNED
164 cmb_Frequency AT ROW 13.4 COL 49.86 COLON-ALIGNED
165 ScenarioAssumption.AssumptionValue AT ROW 15 COL 13.29 COLON-ALIGNED
166 VIEW-AS FILL-IN
167 SIZE 37.14 BY 1.05
168 "onwards" VIEW-AS TEXT
169 SIZE 8 BY 1 AT ROW 7.4 COL 30.72
170 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
171 SIDE-LABELS NO-UNDERLINE THREE-D
172 AT COL 1 ROW 1 SCROLLABLE
173 FONT 10.
176 /* *********************** Procedure Settings ************************ */
178 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
179 /* Settings for THIS-PROCEDURE
180 Type: SmartViewer
181 External Tables: TTPL.ScenarioAssumption
182 Allow: Basic,DB-Fields
183 Frames: 1
184 Add Fields to: EXTERNAL-TABLES
185 Other Settings: PERSISTENT-ONLY COMPILE
188 /* This procedure should always be RUN PERSISTENT. Report the error, */
189 /* then cleanup and return. */
190 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
191 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
192 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
193 RETURN.
194 END.
196 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
198 /* ************************* Create Window ************************** */
200 &ANALYZE-SUSPEND _CREATE-WINDOW
201 /* DESIGN Window definition (used by the UIB)
202 CREATE WINDOW V-table-Win ASSIGN
203 HEIGHT = 16.05
204 WIDTH = 75.57.
205 /* END WINDOW DEFINITION */
207 &ANALYZE-RESUME
210 /* *************** Runtime Attributes and UIB Settings ************** */
212 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
213 /* SETTINGS FOR WINDOW V-table-Win
214 VISIBLE,,RUN-PERSISTENT */
215 /* SETTINGS FOR FRAME F-Main
216 NOT-VISIBLE Size-to-Fit */
217 ASSIGN
218 FRAME F-Main:SCROLLABLE = FALSE
219 FRAME F-Main:HIDDEN = TRUE.
221 /* SETTINGS FOR FILL-IN ScenarioAssumption.ScenarioCode IN FRAME F-Main
222 NO-ENABLE */
223 /* SETTINGS FOR COMBO-BOX ScenarioAssumption.Scope IN FRAME F-Main
224 ALIGN-L */
225 /* SETTINGS FOR COMBO-BOX ScenarioAssumption.TypeScope IN FRAME F-Main
226 ALIGN-L EXP-LABEL EXP-FORMAT */
227 /* _RUN-TIME-ATTRIBUTES-END */
228 &ANALYZE-RESUME
231 /* Setting information for Queries and Browse Widgets fields */
233 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
234 /* Query rebuild information for FRAME F-Main
235 _Options = "NO-LOCK"
236 _Query is NOT OPENED
237 */ /* FRAME F-Main */
238 &ANALYZE-RESUME
243 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
244 /* ************************* Included-Libraries *********************** */
246 {src/adm/method/viewer.i}
247 {inc/method/m-mntvwr.i}
249 /* _UIB-CODE-BLOCK-END */
250 &ANALYZE-RESUME
255 /* ************************ Control Triggers ************************ */
257 &Scoped-define SELF-NAME cmb_AssumptionType
258 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AssumptionType V-table-Win
259 ON U1 OF cmb_AssumptionType IN FRAME F-Main /* Assumption type */
261 {inc/selcmb/scrcht1.i "ScenarioAssumption" "AssumptionType"}
262 END.
264 /* _UIB-CODE-BLOCK-END */
265 &ANALYZE-RESUME
268 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AssumptionType V-table-Win
269 ON U2 OF cmb_AssumptionType IN FRAME F-Main /* Assumption type */
271 {inc/selcmb/scrcht2.i "ScenarioAssumption" "AssumptionType"}
272 END.
274 /* _UIB-CODE-BLOCK-END */
275 &ANALYZE-RESUME
278 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AssumptionType V-table-Win
279 ON VALUE-CHANGED OF cmb_AssumptionType IN FRAME F-Main /* Assumption type */
281 RUN enable-appropriate-fields.
282 END.
284 /* _UIB-CODE-BLOCK-END */
285 &ANALYZE-RESUME
288 &Scoped-define SELF-NAME cmb_Frequency
289 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Frequency V-table-Win
290 ON U1 OF cmb_Frequency IN FRAME F-Main /* per */
292 {inc/selcmb/scfty1.i "?" "frequency-type"}
293 END.
295 /* _UIB-CODE-BLOCK-END */
296 &ANALYZE-RESUME
299 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Frequency V-table-Win
300 ON U2 OF cmb_Frequency IN FRAME F-Main /* per */
302 {inc/selcmb/scfty2.i "?" "frequency-type"}
303 END.
305 /* _UIB-CODE-BLOCK-END */
306 &ANALYZE-RESUME
309 &Scoped-define SELF-NAME cmb_Month
310 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Month V-table-Win
311 ON U1 OF cmb_Month IN FRAME F-Main /* Applying from */
313 {inc/selcmb/scmths1.i "ScenarioAssumption" "MonthCode"}
314 END.
316 /* _UIB-CODE-BLOCK-END */
317 &ANALYZE-RESUME
320 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Month V-table-Win
321 ON U2 OF cmb_Month IN FRAME F-Main /* Applying from */
323 {inc/selcmb/scmths2.i "ScenarioAssumption" "MonthCode"}
324 END.
326 /* _UIB-CODE-BLOCK-END */
327 &ANALYZE-RESUME
330 &Scoped-define SELF-NAME cmb_Property
331 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Property V-table-Win
332 ON U1 OF cmb_Property IN FRAME F-Main /* Property */
334 DO WITH FRAME {&FRAME-NAME}:
335 region-code = ENTRY( 1, cmb_Region:SCREEN-VALUE, " ").
336 {inc/selcmb/scprop1.i "ScenarioAssumption" "EntityCode" "region-code"}
337 END.
338 END.
340 /* _UIB-CODE-BLOCK-END */
341 &ANALYZE-RESUME
344 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Property V-table-Win
345 ON U2 OF cmb_Property IN FRAME F-Main /* Property */
347 {inc/selcmb/scprop2.i "ScenarioAssumption" "EntityCode"}
348 END.
350 /* _UIB-CODE-BLOCK-END */
351 &ANALYZE-RESUME
354 &Scoped-define SELF-NAME cmb_Region
355 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Region V-table-Win
356 ON U1 OF cmb_Region IN FRAME F-Main /* Region */
358 {inc/selcmb/scrgn1.i "ScenarioAssumption" "Region"}
359 END.
361 /* _UIB-CODE-BLOCK-END */
362 &ANALYZE-RESUME
365 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Region V-table-Win
366 ON U2 OF cmb_Region IN FRAME F-Main /* Region */
368 {inc/selcmb/scrgn2.i "ScenarioAssumption" "Region"}
369 END.
371 /* _UIB-CODE-BLOCK-END */
372 &ANALYZE-RESUME
375 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_Region V-table-Win
376 ON VALUE-CHANGED OF cmb_Region IN FRAME F-Main /* Region */
378 RUN region-changed.
379 END.
381 /* _UIB-CODE-BLOCK-END */
382 &ANALYZE-RESUME
385 &Scoped-define SELF-NAME ScenarioAssumption.Scope
386 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ScenarioAssumption.Scope V-table-Win
387 ON VALUE-CHANGED OF ScenarioAssumption.Scope IN FRAME F-Main /* Scope */
389 RUN enable-appropriate-fields.
390 END.
392 /* _UIB-CODE-BLOCK-END */
393 &ANALYZE-RESUME
396 &Scoped-define SELF-NAME ScenarioAssumption.TypeScope
397 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL ScenarioAssumption.TypeScope V-table-Win
398 ON VALUE-CHANGED OF ScenarioAssumption.TypeScope IN FRAME F-Main /* Applying to */
400 RUN type-scope-changed.
401 RUN enable-appropriate-fields.
402 END.
404 /* _UIB-CODE-BLOCK-END */
405 &ANALYZE-RESUME
408 &UNDEFINE SELF-NAME
410 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
413 /* *************************** Main Block *************************** */
415 &IF DEFINED(UIB_IS_RUNNING) <> 0 &THEN
416 RUN dispatch IN THIS-PROCEDURE ('initialize':U).
417 &ENDIF
419 /************************ INTERNAL PROCEDURES ********************/
421 /* _UIB-CODE-BLOCK-END */
422 &ANALYZE-RESUME
425 /* ********************** Internal Procedures *********************** */
427 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-find-using-key V-table-Win adm/support/_key-fnd.p
428 PROCEDURE adm-find-using-key :
429 /*------------------------------------------------------------------------------
430 Purpose: Finds the current record using the contents of
431 the 'Key-Name' and 'Key-Value' attributes.
432 Parameters: <none>
433 ------------------------------------------------------------------------------*/
434 DEF VAR key-value AS CHAR NO-UNDO.
435 DEF VAR row-avail-enabled AS LOGICAL NO-UNDO.
437 /* LOCK status on the find depends on FIELDS-ENABLED. */
438 RUN get-attribute ('FIELDS-ENABLED':U).
439 row-avail-enabled = (RETURN-VALUE eq 'yes':U).
440 /* Look up the current key-value. */
441 RUN get-attribute ('Key-Value':U).
442 key-value = RETURN-VALUE.
444 /* Find the current record using the current Key-Name. */
445 RUN get-attribute ('Key-Name':U).
446 CASE RETURN-VALUE:
447 WHEN 'FlowStepType':U THEN
448 {src/adm/template/find-tbl.i
449 &TABLE = FlowStepType
450 &WHERE = "WHERE FlowStepType.FlowStepType eq key-value"
452 END CASE.
454 END PROCEDURE.
456 /* _UIB-CODE-BLOCK-END */
457 &ANALYZE-RESUME
460 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
461 PROCEDURE adm-row-available :
462 /*------------------------------------------------------------------------------
463 Purpose: Dispatched to this procedure when the Record-
464 Source has a new row available. This procedure
465 tries to get the new row (or foriegn keys) from
466 the Record-Source and process it.
467 Parameters: <none>
468 ------------------------------------------------------------------------------*/
470 /* Define variables needed by this internal procedure. */
471 {src/adm/template/row-head.i}
473 /* Create a list of all the tables that we need to get. */
474 {src/adm/template/row-list.i "ScenarioAssumption"}
476 /* Get the record ROWID's from the RECORD-SOURCE. */
477 {src/adm/template/row-get.i}
479 /* FIND each record specified by the RECORD-SOURCE. */
480 {src/adm/template/row-find.i "ScenarioAssumption"}
482 /* Process the newly available records (i.e. display fields,
483 open queries, and/or pass records on to any RECORD-TARGETS). */
484 {src/adm/template/row-end.i}
486 END PROCEDURE.
488 /* _UIB-CODE-BLOCK-END */
489 &ANALYZE-RESUME
492 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
493 PROCEDURE cancel-changes :
494 /*------------------------------------------------------------------------------
495 Purpose: Quit without applying any changes
496 ------------------------------------------------------------------------------*/
497 IF mode = "Add" THEN DO TRANSACTION:
498 FIND CURRENT ScenarioAssumption NO-ERROR.
499 IF AVAILABLE(ScenarioAssumption) THEN DELETE ScenarioAssumption.
500 END.
502 RUN check-modified( 'clear':U ).
504 RUN dispatch( 'exit':U ).
506 END PROCEDURE.
508 /* _UIB-CODE-BLOCK-END */
509 &ANALYZE-RESUME
512 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
513 PROCEDURE confirm-changes :
514 /*------------------------------------------------------------------------------
515 Purpose:
516 ------------------------------------------------------------------------------*/
517 RUN verify-record.
518 IF RETURN-VALUE <> "" THEN RETURN.
520 RUN dispatch( 'update-record':U ).
521 RUN notify( 'open-query,record-source':U ).
523 RUN dispatch( 'exit':U ).
525 END PROCEDURE.
527 /* _UIB-CODE-BLOCK-END */
528 &ANALYZE-RESUME
531 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
532 PROCEDURE disable_UI :
533 /*------------------------------------------------------------------------------
534 Purpose: DISABLE the User Interface
535 Parameters: <none>
536 Notes: Here we clean-up the user-interface by deleting
537 dynamic widgets we have created and/or hide
538 frames. This procedure is usually called when
539 we are ready to "clean-up" after running.
540 ------------------------------------------------------------------------------*/
541 /* Hide all frames. */
542 HIDE FRAME F-Main.
543 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
544 END PROCEDURE.
546 /* _UIB-CODE-BLOCK-END */
547 &ANALYZE-RESUME
550 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
551 PROCEDURE enable-appropriate-fields :
552 /*------------------------------------------------------------------------------
553 Purpose:
554 ------------------------------------------------------------------------------*/
555 DO WITH FRAME {&FRAME-NAME}:
556 /* changing scope */
557 CASE INPUT ScenarioAssumption.Scope:
558 WHEN "R" THEN DO:
559 IF cmb_Region:SCREEN-VALUE = ? THEN DO:
560 cmb_Region:SCREEN-VALUE = cmb_Region:ENTRY(1).
561 RUN region-changed.
562 END.
563 ENABLE cmb_Region.
564 DISABLE cmb_Property.
565 END.
566 WHEN "P" THEN DO:
567 IF cmb_Region:SCREEN-VALUE = ? THEN DO:
568 cmb_Region:SCREEN-VALUE = cmb_Region:ENTRY(1).
569 RUN region-changed.
570 END.
571 IF cmb_Property:SCREEN-VALUE = ? THEN cmb_Property:SCREEN-VALUE = cmb_Property:ENTRY(1).
572 ENABLE cmb_Region cmb_Property.
573 END.
574 OTHERWISE DO:
575 DISABLE cmb_Region cmb_Property.
576 END.
577 END CASE.
579 /* type of assumption */
580 DEF VAR assumption-type AS CHAR NO-UNDO.
581 DEF VAR type-scope AS CHAR NO-UNDO.
582 type-scope = ENTRY( 1, INPUT ScenarioAssumption.TypeScope, " ").
583 assumption-type = ENTRY( 1, INPUT cmb_AssumptionType, " ").
584 IF type-scope = "REVU" OR type-scope = "NLSE" THEN DO:
585 FIND AreaType WHERE AreaType.AreaType = assumption-type NO-LOCK.
586 IF AreaType.IsCarPark THEN DO:
587 fil_PSM:LABEL = "Per park".
588 ENABLE fil_PerAnnum fil_PSM cmb_Frequency.
589 END.
590 ELSE IF AreaType.IsFloorArea THEN DO:
591 END.
592 ELSE DO:
593 END.
594 END.
595 ELSE DO:
596 MESSAGE "Service Contracts not supported yet" SKIP(1)
597 "What should it do?"
598 VIEW-AS ALERT-BOX ERROR.
599 END.
601 /* scope of assumption type */
603 CASE INPUT ScenarioAssumption.TypeScope:
604 WHEN "Rent Review" THEN DO:
605 END.
606 WHEN "New Leasing" THEN DO:
607 END.
608 END.
610 END.
611 END PROCEDURE.
613 /* _UIB-CODE-BLOCK-END */
614 &ANALYZE-RESUME
617 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-assign-statement V-table-Win
618 PROCEDURE inst-assign-statement :
619 /*------------------------------------------------------------------------------
620 Purpose:
621 ------------------------------------------------------------------------------*/
622 DO WITH FRAME {&FRAME-NAME}:
623 IF ScenarioAssumption.Scope = "G" THEN ASSIGN
624 ScenarioAssumption.Region = ?
625 ScenarioAssumption.EntityType = ?
626 ScenarioAssumption.EntityCode = ?.
627 ELSE IF ScenarioAssumption.Scope = "R" THEN ASSIGN
628 ScenarioAssumption.EntityType = ?
629 ScenarioAssumption.EntityCode = ?.
631 DEF VAR type-scope AS CHAR NO-UNDO.
632 type-scope = ENTRY( 1, ScenarioAssumption.TypeScope, " ").
633 CASE type-scope:
634 WHEN "REVU" THEN DO:
635 END.
636 WHEN "NLSE" THEN DO:
637 END.
638 END.
639 END.
640 END PROCEDURE.
642 /* _UIB-CODE-BLOCK-END */
643 &ANALYZE-RESUME
646 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
647 PROCEDURE inst-enable-fields :
648 /*------------------------------------------------------------------------------
649 Purpose:
650 ------------------------------------------------------------------------------*/
651 RUN enable-appropriate-fields.
652 END PROCEDURE.
654 /* _UIB-CODE-BLOCK-END */
655 &ANALYZE-RESUME
658 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
659 PROCEDURE inst-initialize :
660 /*------------------------------------------------------------------------------
661 Purpose:
662 ------------------------------------------------------------------------------*/
664 IF mode = 'Add' THEN DO:
665 have-records = Yes.
666 key-name = "ScenarioCode":U.
667 key-value = find-parent-key( key-name ).
668 CURRENT-WINDOW:TITLE = "Adding a New Scenario Assumption".
669 RUN dispatch( 'add-record':U ).
670 END.
671 ELSE IF mode = "Maintain" THEN
672 RUN dispatch( 'enable-fields':U ).
673 ELSE
674 RUN dispatch( 'disable-fields':U ).
676 END PROCEDURE.
678 /* _UIB-CODE-BLOCK-END */
679 &ANALYZE-RESUME
682 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE override-add-record V-table-Win
683 PROCEDURE override-add-record :
684 /*------------------------------------------------------------------------------
685 Purpose:
686 ------------------------------------------------------------------------------*/
687 DO WITH FRAME {&FRAME-NAME}:
689 FIND ScenarioAssumption WHERE ScenarioAssumption.ScenarioCode = INT(key-value)
690 AND ScenarioAssumption.Scope = ? NO-LOCK NO-ERROR.
691 IF NOT AVAILABLE(ScenarioAssumption) THEN CREATE ScenarioAssumption.
693 FIND LAST Month WHERE Month.StartDate < TODAY NO-LOCK.
694 FIND FinancialYear OF Month NO-LOCK.
695 FIND FIRST Month OF FinancialYear NO-LOCK.
697 ASSIGN ScenarioAssumption.ScenarioCode = INT(key-value)
698 ScenarioAssumption.Scope = ?
699 ScenarioAssumption.EntityType = "P"
700 ScenarioAssumption.Scope = ScenarioAssumption.Scope:ENTRY(1)
701 ScenarioAssumption.TypeScope = ScenarioAssumption.TypeScope:ENTRY(1)
702 ScenarioAssumption.MonthCode = Month.MonthCode .
704 CURRENT-WINDOW:TITLE = "Adding a New Scenario Assumption".
705 RUN dispatch( 'display-fields':U ).
706 RUN dispatch( 'enable-fields':U ).
707 RUN dispatch( 'update-record':U ).
709 END.
711 END PROCEDURE.
713 /* _UIB-CODE-BLOCK-END */
714 &ANALYZE-RESUME
717 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
718 PROCEDURE pre-destroy :
719 /*------------------------------------------------------------------------------
720 Purpose:
721 ------------------------------------------------------------------------------*/
722 IF LAST-EVENT:FUNCTION = "WINDOW-CLOSE" THEN RUN cancel-changes.
723 END PROCEDURE.
725 /* _UIB-CODE-BLOCK-END */
726 &ANALYZE-RESUME
729 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE region-changed V-table-Win
730 PROCEDURE region-changed :
731 /*------------------------------------------------------------------------------
732 Purpose:
733 ------------------------------------------------------------------------------*/
734 DO WITH FRAME {&FRAME-NAME}:
735 APPLY "U1":U TO cmb_Property.
736 DISPLAY cmb_Property.
737 END.
738 END PROCEDURE.
740 /* _UIB-CODE-BLOCK-END */
741 &ANALYZE-RESUME
744 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key V-table-Win adm/support/_key-snd.p
745 PROCEDURE send-key :
746 /*------------------------------------------------------------------------------
747 Purpose: Sends a requested KEY value back to the calling
748 SmartObject.
749 Parameters: <see adm/template/sndkytop.i>
750 ------------------------------------------------------------------------------*/
752 /* Define variables needed by this internal procedure. */
753 {src/adm/template/sndkytop.i}
755 /* Return the key value associated with each key case. */
756 {src/adm/template/sndkycas.i "FlowStepType" "FlowStepType" "FlowStepType"}
758 /* Close the CASE statement and end the procedure. */
759 {src/adm/template/sndkyend.i}
761 END PROCEDURE.
763 /* _UIB-CODE-BLOCK-END */
764 &ANALYZE-RESUME
767 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
768 PROCEDURE send-records :
769 /*------------------------------------------------------------------------------
770 Purpose: Send record ROWID's for all tables used by
771 this file.
772 Parameters: see template/snd-head.i
773 ------------------------------------------------------------------------------*/
775 /* Define variables needed by this internal procedure. */
776 {src/adm/template/snd-head.i}
778 /* For each requested table, put it's ROWID in the output list. */
779 {src/adm/template/snd-list.i "ScenarioAssumption"}
781 /* Deal with any unexpected table requests before closing. */
782 {src/adm/template/snd-end.i}
784 END PROCEDURE.
786 /* _UIB-CODE-BLOCK-END */
787 &ANALYZE-RESUME
790 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
791 PROCEDURE state-changed :
792 /* -----------------------------------------------------------
793 Purpose:
794 Parameters: <none>
795 Notes:
796 -------------------------------------------------------------*/
797 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
798 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
800 CASE p-state:
801 /* Object instance CASEs can go here to replace standard behavior
802 or add new cases. */
803 {src/adm/template/vstates.i}
804 END CASE.
805 END PROCEDURE.
807 /* _UIB-CODE-BLOCK-END */
808 &ANALYZE-RESUME
811 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE type-scope-changed V-table-Win
812 PROCEDURE type-scope-changed :
813 /*------------------------------------------------------------------------------
814 Purpose:
815 ------------------------------------------------------------------------------*/
816 DEF VAR new-type AS CHAR NO-UNDO.
818 DO WITH FRAME {&FRAME-NAME}:
819 new-type = INPUT ScenarioAssumption.TypeScope.
820 IF LOOKUP( type-scope, "REVU,NLSE") > 0 THEN DO:
821 IF LOOKUP( new-type, "REVU,NLSE") = 0 THEN APPLY "U1":U TO cmb_AssumptionType .
822 END.
823 ELSE IF LOOKUP( new-type, "REVU,NLSE") > 0 THEN
824 APPLY "U1":U TO cmb_AssumptionType .
826 type-scope = new-type.
827 END.
828 END PROCEDURE.
830 /* _UIB-CODE-BLOCK-END */
831 &ANALYZE-RESUME
834 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name V-table-Win
835 PROCEDURE use-Key-Name :
836 /*------------------------------------------------------------------------------
837 Purpose:
838 ------------------------------------------------------------------------------*/
839 DEF INPUT PARAMETER new-key-name AS CHAR NO-UNDO.
840 key-name = new-key-name.
841 END PROCEDURE.
843 /* _UIB-CODE-BLOCK-END */
844 &ANALYZE-RESUME
847 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Value V-table-Win
848 PROCEDURE use-Key-Value :
849 /*------------------------------------------------------------------------------
850 Purpose:
851 ------------------------------------------------------------------------------*/
852 DEF INPUT PARAMETER new-key-value AS CHAR NO-UNDO.
853 key-value = new-key-value.
854 END PROCEDURE.
856 /* _UIB-CODE-BLOCK-END */
857 &ANALYZE-RESUME
860 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Mode V-table-Win
861 PROCEDURE use-Mode :
862 /*------------------------------------------------------------------------------
863 Purpose:
864 ------------------------------------------------------------------------------*/
865 DEF INPUT PARAMETER new-mode AS CHAR NO-UNDO.
866 mode = new-mode.
867 END PROCEDURE.
869 /* _UIB-CODE-BLOCK-END */
870 &ANALYZE-RESUME
873 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-record V-table-Win
874 PROCEDURE verify-record :
875 /*------------------------------------------------------------------------------
876 Purpose:
877 ------------------------------------------------------------------------------*/
878 DEF VAR input-task-type AS CHAR NO-UNDO.
880 DO WITH FRAME {&FRAME-NAME}:
882 END.
884 END PROCEDURE.
886 /* _UIB-CODE-BLOCK-END */
887 &ANALYZE-RESUME