1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
12 Description
: from VIEWER.W
- Template for SmartViewer Objects
20 ------------------------------------------------------------------------*/
24 /* *************************** Definitions
************************** */
26 /* Local Variable Definitions
--- */
28 DEF VAR user-name
AS CHAR NO-UNDO.
29 DEF VAR no-months
AS INT NO-UNDO.
31 DEF VAR key-name
AS CHAR NO-UNDO.
32 DEF VAR key-value
AS CHAR NO-UNDO.
33 DEF VAR ext-et
AS CHAR NO-UNDO.
34 DEF VAR ext-ec
AS INT NO-UNDO.
35 DEF VAR ext-ac
AS DEC NO-UNDO.
37 DEF VAR source-link-name
AS CHAR NO-UNDO.
38 DEF VAR source-table
AS CHAR NO-UNDO.
41 {inc
/ofc-set.i
"Budget-Closed-To" "budget-closed-to" "ERROR"}
42 DEF VAR budget-closed-date
AS DATE NO-UNDO.
43 budget-closed-date
= DATE(budget-closed-to
).
45 /* _UIB-CODE-BLOCK-END
*/
49 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
51 /* ******************** Preprocessor Definitions
******************** */
53 &Scoped-define PROCEDURE-TYPE SmartViewer
54 &Scoped-define DB-AWARE no
56 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
58 /* Name of first Frame and
/or Browse and
/or first Query
*/
59 &Scoped-define FRAME-NAME F-Main
62 &Scoped-define EXTERNAL-TABLES RP
63 &Scoped-define FIRST-EXTERNAL-TABLE RP
66 /* Need to scope the external tables to this procedure
*/
67 DEFINE QUERY external_tables
FOR RP.
68 /* Define KEY-PHRASE in case it is used by any query.
*/
69 &Scoped-define KEY-PHRASE TRUE
71 /* Standard List Definitions
*/
72 &Scoped-Define ENABLED-FIELDS RP.Int2 RP.Char2 RP.Int1 RP.Dec1 RP.Char3
73 &Scoped-define ENABLED-TABLES RP
74 &Scoped-define FIRST-ENABLED-TABLE RP
75 &Scoped-Define ENABLED-OBJECTS fil_Month-1 fil_Month-2 fil_Month-3 ~
76 fil_Month-4 fil_AnnualBudget fil_Month-5 fil_Month-6 fil_Month-7 ~
77 fil_Month-8 fil_Month-9 fil_Month-10 fil_Month-11 fil_Month-12 Btn_OK ~
78 Btn_Cancel Btn_Apply RECT-1
79 &Scoped-Define DISPLAYED-FIELDS RP.Int2 RP.Char2 RP.Int1 RP.Dec1 RP.Char3
80 &Scoped-define DISPLAYED-TABLES RP
81 &Scoped-define FIRST-DISPLAYED-TABLE RP
82 &Scoped-Define DISPLAYED-OBJECTS fil_YearDescription fil_EntityName ~
83 fil_AccountName fil_Month-1 fil_Month-2 fil_Month-3 fil_Month-4 ~
84 fil_AnnualBudget fil_Month-5 fil_Month-6 fil_Month-7 fil_Month-8 ~
85 fil_Month-9 fil_Month-10 fil_Month-11 fil_Month-12 fil_Budgetclosed
87 /* Custom List Definitions
*/
88 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
90 /* _UIB-PREPROCESSOR-BLOCK-END
*/
94 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
95 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
101 EntityType||y|AccountSummary.EntityType
102 EntityCode||y|AccountSummary.EntityCode
103 AccountCode||y|AccountSummary.AccountCode
106 **************************
107 * Set attributes related to FOREIGN
KEYS
109 RUN set-attribute-list
(
111 Keys-Supplied
= "EntityType,EntityCode,AccountCode"'
:U
).
112 /**************************
114 /* _UIB-CODE-BLOCK-END
*/
118 /* *********************** Control Definitions
********************** */
121 /* Definitions of the field level widgets
*/
122 DEFINE BUTTON Btn_Apply
DEFAULT
127 DEFINE BUTTON Btn_Cancel
AUTO-END-KEY DEFAULT
132 DEFINE BUTTON Btn_OK
AUTO-GO
137 DEFINE VARIABLE fil_AccountName
AS CHARACTER FORMAT "X(256)":U
142 DEFINE VARIABLE fil_AnnualBudget
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
148 DEFINE VARIABLE fil_Budgetclosed
AS DATE FORMAT "99/99/9999":U
149 LABEL "Budgets are closed up to"
151 SIZE 16 BY .7 NO-UNDO.
153 DEFINE VARIABLE fil_EntityName
AS CHARACTER FORMAT "X(256)":U
158 DEFINE VARIABLE fil_Month-1
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
164 DEFINE VARIABLE fil_Month-10
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
170 DEFINE VARIABLE fil_Month-11
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
176 DEFINE VARIABLE fil_Month-12
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
182 DEFINE VARIABLE fil_Month-2
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
188 DEFINE VARIABLE fil_Month-3
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
194 DEFINE VARIABLE fil_Month-4
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
200 DEFINE VARIABLE fil_Month-5
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
206 DEFINE VARIABLE fil_Month-6
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
212 DEFINE VARIABLE fil_Month-7
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
218 DEFINE VARIABLE fil_Month-8
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
224 DEFINE VARIABLE fil_Month-9
AS DECIMAL FORMAT "-ZZ,ZZZ,ZZ9.99":U
INITIAL 0
230 DEFINE VARIABLE fil_YearDescription
AS CHARACTER FORMAT "X(256)":U
235 DEFINE RECTANGLE RECT-1
236 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
240 /* ************************ Frame Definitions
*********************** */
243 RP.Int2
AT ROW 1.2 COL 9.29 COLON-ALIGNED HELP
245 LABEL "Year" FORMAT "9999"
248 fil_YearDescription
AT ROW 1.2 COL 18.43 COLON-ALIGNED NO-LABEL
249 RP.Char2
AT ROW 2.2 COL 9.29 COLON-ALIGNED HELP
251 LABEL "Entity" FORMAT "X"
254 RP.Int1
AT ROW 2.2 COL 12.14 COLON-ALIGNED HELP
255 "" NO-LABEL FORMAT "99999"
258 fil_EntityName
AT ROW 2.2 COL 18.43 COLON-ALIGNED NO-LABEL
259 RP.Dec1
AT ROW 3.2 COL 9.29 COLON-ALIGNED HELP
261 LABEL "Account" FORMAT "9999.99"
264 fil_AccountName
AT ROW 3.2 COL 18.43 COLON-ALIGNED NO-LABEL
265 RP.Char3
AT ROW 4.2 COL 11.29 HELP
267 VIEW-AS RADIO-SET VERTICAL
273 fil_Month-1
AT ROW 4.4 COL 51.29 COLON-ALIGNED
274 fil_Month-2
AT ROW 5.4 COL 51.29 COLON-ALIGNED
275 fil_Month-3
AT ROW 6.4 COL 51.29 COLON-ALIGNED
276 fil_Month-4
AT ROW 7.4 COL 51.29 COLON-ALIGNED
277 fil_AnnualBudget
AT ROW 8.2 COL 9.29 COLON-ALIGNED
278 fil_Month-5
AT ROW 8.4 COL 51.29 COLON-ALIGNED
279 fil_Month-6
AT ROW 9.4 COL 51.29 COLON-ALIGNED
280 fil_Month-7
AT ROW 10.4 COL 51.29 COLON-ALIGNED
281 fil_Month-8
AT ROW 11.4 COL 51.29 COLON-ALIGNED
282 fil_Month-9
AT ROW 12.4 COL 51.29 COLON-ALIGNED
283 fil_Month-10
AT ROW 13.4 COL 51.29 COLON-ALIGNED
284 fil_Month-11
AT ROW 14.4 COL 51.29 COLON-ALIGNED
285 fil_Month-12
AT ROW 15.4 COL 51.29 COLON-ALIGNED
286 Btn_OK
AT ROW 16.8 COL 28.43
287 Btn_Cancel
AT ROW 16.8 COL 41
288 Btn_Apply
AT ROW 16.8 COL 53.57
289 fil_Budgetclosed
AT ROW 10.9 COL 21 COLON-ALIGNED
290 RECT-1
AT ROW 1 COL 1
291 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
292 SIDE-LABELS NO-UNDERLINE THREE-D
293 AT COL 1 ROW 1 SCROLLABLE
295 DEFAULT-BUTTON Btn_Apply
CANCEL-BUTTON Btn_Cancel.
298 /* *********************** Procedure Settings
************************ */
300 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
301 /* Settings for
THIS-PROCEDURE
303 External Tables
: TTPL.RP
304 Allow
: Basic
,DB-Fields
306 Add Fields to
: EXTERNAL-TABLES
307 Other Settings
: PERSISTENT-ONLY
COMPILE
310 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
311 /* then cleanup and return.
*/
312 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
313 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
314 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
318 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
320 /* ************************* Create Window
************************** */
322 &ANALYZE-SUSPEND _CREATE-WINDOW
323 /* DESIGN Window definition
(used by the UIB
)
324 CREATE WINDOW V-table-Win
ASSIGN
327 /* END WINDOW DEFINITION
*/
331 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
332 /* ************************* Included-Libraries
*********************** */
334 {src
/adm
/method
/viewer.i
}
335 {inc
/method
/m-mntvwr.i
}
337 /* _UIB-CODE-BLOCK-END
*/
343 /* *********** Runtime Attributes and AppBuilder Settings
*********** */
345 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
346 /* SETTINGS
FOR WINDOW V-table-Win
347 VISIBLE,,RUN-PERSISTENT
*/
348 /* SETTINGS
FOR FRAME F-Main
349 NOT-VISIBLE Size-to-Fit
*/
351 FRAME F-Main
:SCROLLABLE = FALSE
352 FRAME F-Main
:HIDDEN = TRUE.
354 /* SETTINGS
FOR FILL-IN RP.Char2
IN FRAME F-Main
355 EXP-LABEL EXP-FORMAT EXP-HELP
*/
356 /* SETTINGS
FOR RADIO-SET RP.Char3
IN FRAME F-Main
358 /* SETTINGS
FOR FILL-IN RP.Dec1
IN FRAME F-Main
359 EXP-LABEL EXP-FORMAT EXP-HELP
*/
360 /* SETTINGS
FOR FILL-IN fil_AccountName
IN FRAME F-Main
362 /* SETTINGS
FOR FILL-IN fil_Budgetclosed
IN FRAME F-Main
364 /* SETTINGS
FOR FILL-IN fil_EntityName
IN FRAME F-Main
366 /* SETTINGS
FOR FILL-IN fil_YearDescription
IN FRAME F-Main
368 /* SETTINGS
FOR FILL-IN RP.Int1
IN FRAME F-Main
369 EXP-LABEL EXP-FORMAT EXP-HELP
*/
370 /* SETTINGS
FOR FILL-IN RP.Int2
IN FRAME F-Main
371 EXP-LABEL EXP-FORMAT EXP-HELP
*/
372 /* _RUN-TIME-ATTRIBUTES-END
*/
376 /* Setting information for Queries and Browse Widgets fields
*/
378 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
379 /* Query rebuild information for
FRAME F-Main
380 _Options
= "NO-LOCK KEY-PHRASE SORTBY-PHRASE KEEP-EMPTY"
382 */ /* FRAME F-Main
*/
389 /* ************************ Control Triggers
************************ */
391 &Scoped-define SELF-NAME Btn_Apply
392 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_Apply V-table-Win
393 ON CHOOSE OF Btn_Apply
IN FRAME F-Main
/* Apply
*/
396 APPLY '
ENTRY'
:U
TO RP.Dec1 .
399 /* _UIB-CODE-BLOCK-END
*/
403 &Scoped-define SELF-NAME Btn_Cancel
404 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_Cancel V-table-Win
405 ON CHOOSE OF Btn_Cancel
IN FRAME F-Main
/* Cancel
*/
407 RUN dispatch
( 'exit'
:U
).
410 /* _UIB-CODE-BLOCK-END
*/
414 &Scoped-define SELF-NAME Btn_OK
415 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
416 ON CHOOSE OF Btn_OK
IN FRAME F-Main
/* OK */
419 RUN dispatch
( 'exit'
:U
).
422 /* _UIB-CODE-BLOCK-END
*/
426 &Scoped-define SELF-NAME RP.Char2
427 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char2 V-table-Win
428 ON LEAVE OF RP.Char2
IN FRAME F-Main
/* Entity
*/
430 DO WITH FRAME {&FRAME-NAME}:
431 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
433 RUN dispatch
( 'enable-fields'
:U
).
438 /* _UIB-CODE-BLOCK-END
*/
442 &Scoped-define SELF-NAME RP.Char3
443 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char3 V-table-Win
444 ON VALUE-CHANGED
OF RP.Char3
IN FRAME F-Main
/* Char3
*/
446 DO WITH FRAME {&FRAME-NAME}:
447 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
449 RUN dispatch
( 'enable-fields'
:U
).
450 IF INPUT {&SELF-NAME} = "A" THEN
451 APPLY "ENTRY":U
TO fil_AnnualBudget.
453 APPLY "ENTRY":U
TO fil_Month-1.
458 /* _UIB-CODE-BLOCK-END
*/
462 &Scoped-define SELF-NAME RP.Dec1
463 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec1 V-table-Win
464 ON LEAVE OF RP.Dec1
IN FRAME F-Main
/* Account
*/
466 DO WITH FRAME {&FRAME-NAME}:
467 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
469 RUN dispatch
( 'enable-fields'
:U
).
474 /* _UIB-CODE-BLOCK-END
*/
478 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec1 V-table-Win
479 ON RETURN OF RP.Dec1
IN FRAME F-Main
/* Account
*/
481 DO WITH FRAME {&FRAME-NAME}:
483 APPLY 'TAB'
TO RP.Char3.
488 /* _UIB-CODE-BLOCK-END
*/
492 &Scoped-define SELF-NAME fil_AnnualBudget
493 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_AnnualBudget V-table-Win
494 ON LEAVE OF fil_AnnualBudget
IN FRAME F-Main
/* Full year
*/
496 DO WITH FRAME {&FRAME-NAME}:
497 IF INPUT fil_AnnualBudget
<> fil_AnnualBudget
THEN DO:
498 ASSIGN fil_AnnualBudget.
499 RUN set-monthly-amounts.
504 /* _UIB-CODE-BLOCK-END
*/
508 &Scoped-define SELF-NAME fil_Month-1
509 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-1 V-table-Win
510 ON LEAVE OF fil_Month-1
IN FRAME F-Main
/* January
*/
512 DO WITH FRAME {&FRAME-NAME}:
513 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
515 RUN set-annual-amount.
520 /* _UIB-CODE-BLOCK-END
*/
524 &Scoped-define SELF-NAME fil_Month-10
525 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-10 V-table-Win
526 ON LEAVE OF fil_Month-10
IN FRAME F-Main
/* October
*/
528 DO WITH FRAME {&FRAME-NAME}:
529 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
531 RUN set-annual-amount.
536 /* _UIB-CODE-BLOCK-END
*/
540 &Scoped-define SELF-NAME fil_Month-11
541 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-11 V-table-Win
542 ON LEAVE OF fil_Month-11
IN FRAME F-Main
/* November
*/
544 DO WITH FRAME {&FRAME-NAME}:
545 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
547 RUN set-annual-amount.
552 /* _UIB-CODE-BLOCK-END
*/
556 &Scoped-define SELF-NAME fil_Month-12
557 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-12 V-table-Win
558 ON LEAVE OF fil_Month-12
IN FRAME F-Main
/* December
*/
560 DO WITH FRAME {&FRAME-NAME}:
561 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
563 RUN set-annual-amount.
568 /* _UIB-CODE-BLOCK-END
*/
572 &Scoped-define SELF-NAME fil_Month-2
573 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-2 V-table-Win
574 ON LEAVE OF fil_Month-2
IN FRAME F-Main
/* February
*/
576 DO WITH FRAME {&FRAME-NAME}:
577 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
579 RUN set-annual-amount.
584 /* _UIB-CODE-BLOCK-END
*/
588 &Scoped-define SELF-NAME fil_Month-3
589 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-3 V-table-Win
590 ON LEAVE OF fil_Month-3
IN FRAME F-Main
/* March
*/
592 DO WITH FRAME {&FRAME-NAME}:
593 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
595 RUN set-annual-amount.
600 /* _UIB-CODE-BLOCK-END
*/
604 &Scoped-define SELF-NAME fil_Month-4
605 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-4 V-table-Win
606 ON LEAVE OF fil_Month-4
IN FRAME F-Main
/* April
*/
608 DO WITH FRAME {&FRAME-NAME}:
609 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
611 RUN set-annual-amount.
616 /* _UIB-CODE-BLOCK-END
*/
620 &Scoped-define SELF-NAME fil_Month-5
621 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-5 V-table-Win
622 ON LEAVE OF fil_Month-5
IN FRAME F-Main
/* May
*/
624 DO WITH FRAME {&FRAME-NAME}:
625 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
627 RUN set-annual-amount.
632 /* _UIB-CODE-BLOCK-END
*/
636 &Scoped-define SELF-NAME fil_Month-6
637 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-6 V-table-Win
638 ON LEAVE OF fil_Month-6
IN FRAME F-Main
/* June
*/
640 DO WITH FRAME {&FRAME-NAME}:
641 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
643 RUN set-annual-amount.
648 /* _UIB-CODE-BLOCK-END
*/
652 &Scoped-define SELF-NAME fil_Month-7
653 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-7 V-table-Win
654 ON LEAVE OF fil_Month-7
IN FRAME F-Main
/* July
*/
656 DO WITH FRAME {&FRAME-NAME}:
657 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
659 RUN set-annual-amount.
664 /* _UIB-CODE-BLOCK-END
*/
668 &Scoped-define SELF-NAME fil_Month-8
669 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-8 V-table-Win
670 ON LEAVE OF fil_Month-8
IN FRAME F-Main
/* August
*/
672 DO WITH FRAME {&FRAME-NAME}:
673 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
675 RUN set-annual-amount.
680 /* _UIB-CODE-BLOCK-END
*/
684 &Scoped-define SELF-NAME fil_Month-9
685 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Month-9 V-table-Win
686 ON LEAVE OF fil_Month-9
IN FRAME F-Main
/* September
*/
688 DO WITH FRAME {&FRAME-NAME}:
689 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
691 RUN set-annual-amount.
696 /* _UIB-CODE-BLOCK-END
*/
700 &Scoped-define SELF-NAME RP.Int1
701 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
702 ON LEAVE OF RP.Int1
IN FRAME F-Main
/* Int1
*/
704 DO WITH FRAME {&FRAME-NAME}:
705 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
707 RUN dispatch
( 'enable-fields'
:U
).
712 /* _UIB-CODE-BLOCK-END
*/
716 &Scoped-define SELF-NAME RP.Int2
717 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
718 ON LEAVE OF RP.Int2
IN FRAME F-Main
/* Year
*/
720 DO WITH FRAME {&FRAME-NAME}:
721 IF INPUT {&SELF-NAME} <> {&SELF-NAME} THEN DO:
723 RUN assign-month-labels.
724 RUN dispatch
( 'enable-fields'
:U
).
729 /* _UIB-CODE-BLOCK-END
*/
735 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
738 /* *************************** Main Block
*************************** */
740 fil_BudgetClosed
= budget-closed-date .
742 /* _UIB-CODE-BLOCK-END
*/
746 /* ********************** Internal Procedures
*********************** */
748 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-find-using-key V-table-Win adm/support/_key-fnd.p
749 PROCEDURE adm-find-using-key
:
750 /*------------------------------------------------------------------------------
751 Purpose
: Finds the current record using the contents of
752 the 'Key-Name' and 'Key-Value' attributes.
754 ------------------------------------------------------------------------------*/
756 /* No Foreign keys are accepted by this SmartObject.
*/
760 /* _UIB-CODE-BLOCK-END
*/
763 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
764 PROCEDURE adm-row-available
:
765 /*------------------------------------------------------------------------------
766 Purpose
: Dispatched to this procedure when the Record-
767 Source has a new row available. This procedure
768 tries to get the new row
(or foriegn keys
) from
769 the Record-Source and process it.
771 ------------------------------------------------------------------------------*/
773 /* Define variables needed by this internal procedure.
*/
774 {src
/adm
/template
/row-head.i
}
776 /* Create a list of all the tables that we need to get.
*/
777 {src
/adm
/template
/row-list.i
"RP"}
779 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
780 {src
/adm
/template
/row-get.i
}
782 /* FIND each record specified by the RECORD-SOURCE.
*/
783 {src
/adm
/template
/row-find.i
"RP"}
785 /* Process the newly available records
(i.e. display fields
,
786 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
787 {src
/adm
/template
/row-end.i
}
791 /* _UIB-CODE-BLOCK-END
*/
794 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE assign-budgets V-table-Win
795 PROCEDURE assign-budgets
:
796 /*------------------------------------------------------------------------------
797 Purpose
: Assign the budget figures to the AccountBalance
798 ------------------------------------------------------------------------------*/
799 DEF VAR et
AS CHAR NO-UNDO.
800 DEF VAR ec
AS INT NO-UNDO.
801 DEF VAR ac
AS DEC NO-UNDO.
802 DEF VAR bals
AS DEC EXTENT 12 NO-UNDO.
803 DEF VAR i
AS INT NO-UNDO.
805 DO WITH FRAME {&FRAME-NAME}:
806 bals
[1] = INPUT fil_Month-1.
807 bals
[2] = INPUT fil_Month-2.
808 bals
[3] = INPUT fil_Month-3.
809 bals
[4] = INPUT fil_Month-4.
810 bals
[5] = INPUT fil_Month-5.
811 bals
[6] = INPUT fil_Month-6.
812 bals
[7] = INPUT fil_Month-7.
813 bals
[8] = INPUT fil_Month-8.
814 bals
[9] = INPUT fil_Month-9.
815 bals
[10] = INPUT fil_Month-10.
816 bals
[11] = INPUT fil_Month-11.
817 bals
[12] = INPUT fil_Month-12.
823 DO TRANSACTION WITH FRAME {&FRAME-NAME}:
825 FOR EACH Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK:
826 IF i
> 12 THEN LEAVE.
827 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
828 AND AccountBalance.EntityCode
= ec
829 AND AccountBalance.AccountCode
= ac
830 AND AccountBalance.MonthCode
= Month.MonthCode
EXCLUSIVE-LOCK NO-ERROR.
831 IF NOT AVAILABLE(AccountBalance
) THEN DO:
832 CREATE AccountBalance.
833 ASSIGN AccountBalance.EntityType
= et
834 AccountBalance.EntityCode
= ec
835 AccountBalance.AccountCode
= ac
836 AccountBalance.MonthCode
= Month.MonthCode.
838 AccountBalance.RevisedBudget
= bals
[i
] .
839 IF Month.StartDate
> budget-closed-date
THEN
840 AccountBalance.Budget
= bals
[i
] .
847 /* _UIB-CODE-BLOCK-END
*/
850 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE assign-month-labels V-table-Win
851 PROCEDURE assign-month-labels
:
852 /*------------------------------------------------------------------------------
853 Purpose
: Assign the names of the months
854 ------------------------------------------------------------------------------*/
855 DO WITH FRAME {&FRAME-NAME}:
856 FIND FIRST Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
857 IF AVAILABLE(Month
) THEN DO:
858 fil_Month-1
:LABEL = Month.MonthName.
860 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
861 END.
ELSE HIDE fil_Month-1.
862 IF AVAILABLE(Month
) THEN DO:
863 fil_Month-2
:LABEL = Month.MonthName.
865 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
866 END.
ELSE HIDE fil_Month-2.
867 IF AVAILABLE(Month
) THEN DO:
868 fil_Month-3
:LABEL = Month.MonthName.
870 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
871 END.
ELSE HIDE fil_Month-3.
872 IF AVAILABLE(Month
) THEN DO:
873 fil_Month-4
:LABEL = Month.MonthName.
875 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
876 END.
ELSE HIDE fil_Month-4.
877 IF AVAILABLE(Month
) THEN DO:
878 fil_Month-5
:LABEL = Month.MonthName.
880 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
881 END.
ELSE HIDE fil_Month-5.
882 IF AVAILABLE(Month
) THEN DO:
883 fil_Month-6
:LABEL = Month.MonthName.
885 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
886 END.
ELSE HIDE fil_Month-6.
887 IF AVAILABLE(Month
) THEN DO:
888 fil_Month-7
:LABEL = Month.MonthName.
890 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
891 END.
ELSE HIDE fil_Month-7.
892 IF AVAILABLE(Month
) THEN DO:
893 fil_Month-8
:LABEL = Month.MonthName.
895 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
896 END.
ELSE HIDE fil_Month-8.
897 IF AVAILABLE(Month
) THEN DO:
898 fil_Month-9
:LABEL = Month.MonthName.
900 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
901 END.
ELSE HIDE fil_Month-9.
902 IF AVAILABLE(Month
) THEN DO:
903 fil_Month-10
:LABEL = Month.MonthName.
905 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
906 END.
ELSE HIDE fil_Month-10.
907 IF AVAILABLE(Month
) THEN DO:
908 fil_Month-11
:LABEL = Month.MonthName.
910 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
911 END.
ELSE HIDE fil_Month-11.
912 IF AVAILABLE(Month
) THEN DO:
913 fil_Month-12
:LABEL = Month.MonthName.
915 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
916 END.
ELSE HIDE fil_Month-12.
921 /* _UIB-CODE-BLOCK-END
*/
924 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
925 PROCEDURE disable_UI
:
926 /*------------------------------------------------------------------------------
927 Purpose
: DISABLE the User Interface
929 Notes
: Here we clean-up the user-interface by deleting
930 dynamic widgets we have created and
/or hide
931 frames. This procedure is usually called when
932 we are ready to
"clean-up" after running.
933 ------------------------------------------------------------------------------*/
934 /* Hide all frames.
*/
936 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
939 /* _UIB-CODE-BLOCK-END
*/
942 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-account-summary V-table-Win
943 PROCEDURE get-account-summary
:
944 /*------------------------------------------------------------------------------
946 ------------------------------------------------------------------------------*/
947 DEF OUTPUT PARAMETER et
AS CHAR NO-UNDO.
948 DEF OUTPUT PARAMETER ec
AS INT NO-UNDO.
949 DEF OUTPUT PARAMETER ac
AS DEC NO-UNDO.
951 DEF VAR key-value
AS CHAR NO-UNDO.
952 DEF VAR wh
AS WIDGET-HANDLE NO-UNDO.
954 RUN get-link-handle
IN adm-broker-hdl
( INPUT THIS-PROCEDURE, 'record-source'
:U
,
955 OUTPUT source-link-name
).
956 wh
= WIDGET-HANDLE(source-link-name
).
957 IF VALID-HANDLE(wh
) THEN DO:
958 RUN send-key
IN WIDGET-HANDLE(source-link-name
) ( source-table
, OUTPUT key-value
).
959 IF source-table
= "AccountSummary" AND NUM-ENTRIES(key-value
, "/") > 2 THEN DO:
960 et
= ENTRY( 1, key-value
, "/").
961 ec
= INT( ENTRY( 2, key-value
, "/")).
962 ac
= DEC( ENTRY( 3, key-value
, "/")).
968 /* _UIB-CODE-BLOCK-END
*/
971 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-current-budgets V-table-Win
972 PROCEDURE get-current-budgets
:
973 /*------------------------------------------------------------------------------
974 Purpose
: Get the current budget figures
975 ------------------------------------------------------------------------------*/
976 DEF VAR et
AS CHAR NO-UNDO.
977 DEF VAR ec
AS INT NO-UNDO.
978 DEF VAR ac
AS DEC NO-UNDO.
980 DO WITH FRAME {&FRAME-NAME}:
984 FIND FIRST Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
985 IF AVAILABLE(Month
) THEN DO:
986 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
987 AND AccountBalance.EntityCode
= ec
988 AND AccountBalance.AccountCode
= ac
989 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
990 fil_Month-1
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
992 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
993 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-1.
ELSE ENABLE fil_Month-1.
995 ELSE HIDE fil_Month-1.
996 IF AVAILABLE(Month
) THEN DO:
997 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
998 AND AccountBalance.EntityCode
= ec
999 AND AccountBalance.AccountCode
= ac
1000 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1001 fil_Month-2
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1002 DISPLAY fil_Month-2.
1003 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-2.
ELSE ENABLE fil_Month-2.
1004 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1006 ELSE HIDE fil_Month-2.
1007 IF AVAILABLE(Month
) THEN DO:
1008 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1009 AND AccountBalance.EntityCode
= ec
1010 AND AccountBalance.AccountCode
= ac
1011 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1012 fil_Month-3
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1013 DISPLAY fil_Month-3.
1014 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-3.
ELSE ENABLE fil_Month-3.
1015 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1017 ELSE HIDE fil_Month-3.
1018 IF AVAILABLE(Month
) THEN DO:
1019 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1020 AND AccountBalance.EntityCode
= ec
1021 AND AccountBalance.AccountCode
= ac
1022 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1023 fil_Month-4
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1024 DISPLAY fil_Month-4.
1025 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-4.
ELSE ENABLE fil_Month-4.
1026 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1028 ELSE HIDE fil_Month-4.
1029 IF AVAILABLE(Month
) THEN DO:
1030 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1031 AND AccountBalance.EntityCode
= ec
1032 AND AccountBalance.AccountCode
= ac
1033 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1034 fil_Month-5
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1035 DISPLAY fil_Month-5.
1036 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-5.
ELSE ENABLE fil_Month-5.
1037 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1039 ELSE HIDE fil_Month-5.
1040 IF AVAILABLE(Month
) THEN DO:
1041 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1042 AND AccountBalance.EntityCode
= ec
1043 AND AccountBalance.AccountCode
= ac
1044 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1045 fil_Month-6
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1046 DISPLAY fil_Month-6.
1047 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-6.
ELSE ENABLE fil_Month-6.
1048 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1050 ELSE HIDE fil_Month-6.
1051 IF AVAILABLE(Month
) THEN DO:
1052 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1053 AND AccountBalance.EntityCode
= ec
1054 AND AccountBalance.AccountCode
= ac
1055 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1056 fil_Month-7
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1057 DISPLAY fil_Month-7.
1058 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-7.
ELSE ENABLE fil_Month-7.
1059 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1061 ELSE HIDE fil_Month-7.
1062 IF AVAILABLE(Month
) THEN DO:
1063 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1064 AND AccountBalance.EntityCode
= ec
1065 AND AccountBalance.AccountCode
= ac
1066 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1067 fil_Month-8
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1068 DISPLAY fil_Month-8.
1069 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-8.
ELSE ENABLE fil_Month-8.
1070 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1072 ELSE HIDE fil_Month-8.
1073 IF AVAILABLE(Month
) THEN DO:
1074 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1075 AND AccountBalance.EntityCode
= ec
1076 AND AccountBalance.AccountCode
= ac
1077 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1078 fil_Month-9
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1079 DISPLAY fil_Month-9.
1080 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-9.
ELSE ENABLE fil_Month-9.
1081 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1083 ELSE HIDE fil_Month-9.
1084 IF AVAILABLE(Month
) THEN DO:
1085 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1086 AND AccountBalance.EntityCode
= ec
1087 AND AccountBalance.AccountCode
= ac
1088 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1089 fil_Month-10
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1090 DISPLAY fil_Month-10.
1091 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-10.
ELSE ENABLE fil_Month-10.
1092 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1094 ELSE HIDE fil_Month-10.
1095 IF AVAILABLE(Month
) THEN DO:
1096 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1097 AND AccountBalance.EntityCode
= ec
1098 AND AccountBalance.AccountCode
= ac
1099 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1100 fil_Month-11
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1101 DISPLAY fil_Month-11.
1102 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-11.
ELSE ENABLE fil_Month-11.
1103 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1105 ELSE HIDE fil_Month-11.
1106 IF AVAILABLE(Month
) THEN DO:
1107 FIND AccountBalance
WHERE AccountBalance.EntityType
= et
1108 AND AccountBalance.EntityCode
= ec
1109 AND AccountBalance.AccountCode
= ac
1110 AND AccountBalance.MonthCode
= Month.MonthCode
NO-LOCK NO-ERROR.
1111 fil_Month-12
= (IF AVAILABLE(AccountBalance
) THEN AccountBalance.Budget
ELSE 0 ).
1112 DISPLAY fil_Month-12.
1113 IF INPUT RP.Char3
= "A" THEN DISABLE fil_Month-12.
ELSE ENABLE fil_Month-12.
1115 ELSE HIDE fil_Month-12.
1117 RUN set-annual-amount.
1121 /* _UIB-CODE-BLOCK-END
*/
1124 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
1125 PROCEDURE inst-enable-fields
:
1126 /*------------------------------------------------------------------------------
1127 Purpose
: Enable
/disable fields appropriately
1128 ------------------------------------------------------------------------------*/
1129 DEF VAR ok-enabled
AS LOGICAL INITIAL yes
NO-UNDO.
1131 DO WITH FRAME {&FRAME-NAME}:
1132 FIND FinancialYear
WHERE FinancialYear.FinancialYearCode
= INPUT RP.Int2
NO-LOCK NO-ERROR.
1133 IF AVAILABLE( FinancialYear
) THEN DO:
1134 fil_YearDescription
= FinancialYear.Description .
1135 DISPLAY fil_YearDescription .
1140 fil_EntityName
= "" .
1141 CASE INPUT RP.Char2
:
1143 FIND Property
WHERE Property.PropertyCode
= INPUT RP.Int1
NO-LOCK NO-ERROR.
1144 IF AVAILABLE( Property
) THEN
1145 fil_EntityName
= Property.Name.
1150 FIND Project
WHERE Project.ProjectCode
= INPUT RP.Int1
NO-LOCK NO-ERROR.
1151 IF AVAILABLE( Project
) THEN
1152 fil_EntityName
= Project.Name.
1157 FIND Company
WHERE Company.CompanyCode
= INPUT RP.Int1
NO-LOCK NO-ERROR.
1158 IF AVAILABLE( Company
) THEN
1159 fil_EntityName
= Company.LegalName.
1164 DISPLAY fil_EntityName.
1166 FIND ChartOfAccount
WHERE ChartOfAccount.AccountCode
= INPUT RP.Dec1
NO-LOCK NO-ERROR.
1167 IF AVAILABLE(ChartOfAccount
) THEN DO:
1168 fil_AccountName
= ChartOfAccount.Name .
1169 DISPLAY fil_AccountName .
1175 ENABLE Btn_OK Btn_Apply.
1177 DISABLE Btn_OK Btn_Apply.
1179 IF ok-enabled
THEN RUN get-current-budgets.
1181 IF INPUT RP.Char3
= "A" THEN
1182 ENABLE fil_AnnualBudget.
1184 DISABLE fil_AnnualBudget.
1191 /* _UIB-CODE-BLOCK-END
*/
1194 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
1195 PROCEDURE inst-initialize
:
1196 /*------------------------------------------------------------------------------
1197 Purpose
: Initialise the necessary bits and pieces
1198 ------------------------------------------------------------------------------*/
1200 &SCOP RPT-NAME "BudgetMaintenance"
1201 RUN get-username
IN sec-mgr
( OUTPUT user-name
).
1203 FIND RP
WHERE RP.ReportID
= {&RPT-NAME}
1204 AND RP.UserName
= user-name
1205 EXCLUSIVE-LOCK NO-ERROR.
1207 IF NOT AVAILABLE( RP
) THEN DO:
1208 /* Find the current Financial Year
*/
1209 FIND LAST Month
WHERE Month.StartDate
<= TODAY NO-LOCK NO-ERROR.
1212 RP.ReportID
= {&RPT-NAME}
1213 RP.UserName
= user-name
1214 RP.Int2
= (IF AVAILABLE(Month
) THEN Month.FinancialYearCode
ELSE 0)
1217 IF key-name
= "AccountSummary" THEN DO:
1222 FIND CURRENT RP
SHARE-LOCK.
1225 RUN assign-month-labels.
1226 RUN dispatch
( 'display-fields'
:U
).
1227 RUN dispatch
( 'enable-fields'
:U
).
1231 /* _UIB-CODE-BLOCK-END
*/
1234 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-row-available V-table-Win
1235 PROCEDURE inst-row-available
:
1236 /*------------------------------------------------------------------------------
1238 ------------------------------------------------------------------------------*/
1239 IF key-name
= "AccountSummary" THEN DO WITH FRAME {&FRAME-NAME}:
1240 RUN get-account-summary
( OUTPUT ext-et
, OUTPUT ext-ec
, OUTPUT ext-ac
).
1244 /* _UIB-CODE-BLOCK-END
*/
1247 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
1248 PROCEDURE pre-destroy
:
1249 /*------------------------------------------------------------------------------
1251 ------------------------------------------------------------------------------*/
1252 RUN check-modified
( 'clear'
:U
).
1255 /* _UIB-CODE-BLOCK-END
*/
1258 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-row-available V-table-Win
1259 PROCEDURE pre-row-available
:
1260 /*------------------------------------------------------------------------------
1261 Purpose
: Figure out which table we're using a row-available from
1262 ------------------------------------------------------------------------------*/
1263 IF have-records
THEN RETURN.
1265 RUN get-link-handle
IN adm-broker-hdl
( INPUT THIS-PROCEDURE, 'record-source'
:U
,
1266 OUTPUT source-link-name
).
1267 IF NOT VALID-HANDLE(WIDGET-HANDLE(source-link-name
)) THEN RETURN.
1269 RUN get-attribute
IN WIDGET-HANDLE(source-link-name
) ('internal-tables'
:U
).
1270 source-table
= RETURN-VALUE.
1272 IF INDEX( source-table
, "AccountSummary" ) > 0 THEN source-table
= "AccountSummary".
1273 ELSE IF INDEX( source-table
, "AccountBalance" ) > 0 THEN source-table
= "AccountBalance".
1277 /* _UIB-CODE-BLOCK-END
*/
1280 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key V-table-Win adm/support/_key-snd.p
1281 PROCEDURE send-key
:
1282 /*------------------------------------------------------------------------------
1283 Purpose
: Sends a requested
KEY value back to the calling
1285 Parameters
: <see adm
/template
/sndkytop.i
>
1286 ------------------------------------------------------------------------------*/
1288 /* Define variables needed by this internal procedure.
*/
1289 {src
/adm
/template
/sndkytop.i
}
1291 /* Return the key value associated with each key case.
*/
1292 {src
/adm
/template
/sndkycas.i
"EntityType" "AccountSummary" "EntityType"}
1293 {src
/adm
/template
/sndkycas.i
"EntityCode" "AccountSummary" "EntityCode"}
1294 {src
/adm
/template
/sndkycas.i
"AccountCode" "AccountSummary" "AccountCode"}
1296 /* Close the
CASE statement and end the procedure.
*/
1297 {src
/adm
/template
/sndkyend.i
}
1301 /* _UIB-CODE-BLOCK-END
*/
1304 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
1305 PROCEDURE send-records
:
1306 /*------------------------------------------------------------------------------
1307 Purpose
: Send record
ROWID's for all tables used by
1309 Parameters
: see template
/snd-head.i
1310 ------------------------------------------------------------------------------*/
1312 /* Define variables needed by this internal procedure.
*/
1313 {src
/adm
/template
/snd-head.i
}
1315 /* For each requested table
, put it's
ROWID in the output list.
*/
1316 {src
/adm
/template
/snd-list.i
"RP"}
1318 /* Deal with any unexpected table requests before closing.
*/
1319 {src
/adm
/template
/snd-end.i
}
1323 /* _UIB-CODE-BLOCK-END
*/
1326 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE set-annual-amount V-table-Win
1327 PROCEDURE set-annual-amount
:
1328 /*------------------------------------------------------------------------------
1329 Purpose
: Total the monthly fields to come up with an annual figure
1330 ------------------------------------------------------------------------------*/
1331 DEF VAR annual-total
AS DECIMAL INITIAL 0 NO-UNDO.
1333 DO WITH FRAME {&FRAME-NAME}:
1334 FIND FIRST Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1335 IF AVAILABLE(Month
) THEN DO:
1336 annual-total
= annual-total
+ INPUT fil_Month-1.
1337 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1339 IF AVAILABLE(Month
) THEN DO:
1340 annual-total
= annual-total
+ INPUT fil_Month-2.
1341 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1343 IF AVAILABLE(Month
) THEN DO:
1344 annual-total
= annual-total
+ INPUT fil_Month-3.
1345 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1347 IF AVAILABLE(Month
) THEN DO:
1348 annual-total
= annual-total
+ INPUT fil_Month-4.
1349 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1351 IF AVAILABLE(Month
) THEN DO:
1352 annual-total
= annual-total
+ INPUT fil_Month-5.
1353 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1355 IF AVAILABLE(Month
) THEN DO:
1356 annual-total
= annual-total
+ INPUT fil_Month-6.
1357 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1359 IF AVAILABLE(Month
) THEN DO:
1360 annual-total
= annual-total
+ INPUT fil_Month-7.
1361 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1363 IF AVAILABLE(Month
) THEN DO:
1364 annual-total
= annual-total
+ INPUT fil_Month-8.
1365 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1367 IF AVAILABLE(Month
) THEN DO:
1368 annual-total
= annual-total
+ INPUT fil_Month-9.
1369 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1371 IF AVAILABLE(Month
) THEN DO:
1372 annual-total
= annual-total
+ INPUT fil_Month-10.
1373 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1375 IF AVAILABLE(Month
) THEN DO:
1376 annual-total
= annual-total
+ INPUT fil_Month-11.
1377 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1379 IF AVAILABLE(Month
) THEN DO:
1380 annual-total
= annual-total
+ INPUT fil_Month-12.
1381 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK NO-ERROR.
1383 fil_AnnualBudget
= annual-total.
1384 DISPLAY fil_AnnualBudget.
1389 /* _UIB-CODE-BLOCK-END
*/
1392 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE set-monthly-amounts V-table-Win
1393 PROCEDURE set-monthly-amounts
:
1394 /*------------------------------------------------------------------------------
1395 Purpose
: Set each month to
1/2th of the annual figure
1396 ------------------------------------------------------------------------------*/
1397 DEF VAR one-month
AS DECIMAL NO-UNDO.
1399 DO WITH FRAME {&FRAME-NAME}:
1400 one-month
= ROUND( (INPUT fil_AnnualBudget
) / no-months
, 2).
1402 FIND FIRST Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1403 IF AVAILABLE(Month
) THEN DO:
1404 fil_Month-1
= one-month.
1405 DISPLAY fil_Month-1.
1406 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1408 IF AVAILABLE(Month
) THEN DO:
1409 fil_Month-2
= one-month.
1410 DISPLAY fil_Month-2.
1411 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1413 IF AVAILABLE(Month
) THEN DO:
1414 fil_Month-3
= one-month.
1415 DISPLAY fil_Month-3.
1416 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1418 IF AVAILABLE(Month
) THEN DO:
1419 fil_Month-4
= one-month.
1420 DISPLAY fil_Month-4.
1421 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1423 IF AVAILABLE(Month
) THEN DO:
1424 fil_Month-5
= one-month.
1425 DISPLAY fil_Month-5.
1426 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1428 IF AVAILABLE(Month
) THEN DO:
1429 fil_Month-6
= one-month.
1430 DISPLAY fil_Month-6.
1431 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1433 IF AVAILABLE(Month
) THEN DO:
1434 fil_Month-7
= one-month.
1435 DISPLAY fil_Month-7.
1436 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1438 IF AVAILABLE(Month
) THEN DO:
1439 fil_Month-8
= one-month.
1440 DISPLAY fil_Month-8.
1441 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1443 IF AVAILABLE(Month
) THEN DO:
1444 fil_Month-9
= one-month.
1445 DISPLAY fil_Month-9.
1446 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1448 IF AVAILABLE(Month
) THEN DO:
1449 fil_Month-10
= one-month.
1450 DISPLAY fil_Month-10.
1451 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1453 IF AVAILABLE(Month
) THEN DO:
1454 fil_Month-11
= one-month.
1455 DISPLAY fil_Month-11.
1456 FIND NEXT Month
WHERE Month.FinancialYearCode
= RP.Int2
NO-LOCK.
1458 IF AVAILABLE(Month
) THEN DO:
1459 fil_Month-12
= (INPUT fil_AnnualBudget
) - (one-month
* 11).
1460 DISPLAY fil_Month-12.
1465 /* _UIB-CODE-BLOCK-END
*/
1468 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
1469 PROCEDURE state-changed
:
1470 /* -----------------------------------------------------------
1474 -------------------------------------------------------------*/
1475 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
1476 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
1479 /* Object instance CASEs can go here to replace standard behavior
1480 or add new cases.
*/
1481 {src
/adm
/template
/vstates.i
}
1485 /* _UIB-CODE-BLOCK-END
*/
1488 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name V-table-Win
1489 PROCEDURE use-Key-Name
:
1490 /*------------------------------------------------------------------------------
1492 ------------------------------------------------------------------------------*/
1493 DEF INPUT PARAMETER new-name
AS CHAR NO-UNDO.
1494 key-name
= new-name.
1498 /* _UIB-CODE-BLOCK-END
*/
1501 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Value V-table-Win
1502 PROCEDURE use-Key-Value
:
1503 /*------------------------------------------------------------------------------
1505 ------------------------------------------------------------------------------*/
1506 DEF INPUT PARAMETER new-value
AS CHAR NO-UNDO.
1507 key-value
= new-value.
1508 IF key-name
= "EntityType" THEN DO:
1510 ELSE IF key-name
= "EntityCode" THEN DO:
1512 ELSE IF key-name
= "AccountCode" THEN DO:
1516 /* _UIB-CODE-BLOCK-END
*/