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 /*------------------------------------------------------------------------
9 ------------------------------------------------------------------------*/
13 DEF VAR mth-desc
AS CHAR NO-UNDO.
15 DEFINE TEMP-TABLE MthFigs
NO-UNDO
16 FIELD MonthCode
AS INT
17 FIELD StartDate
AS CHAR FORMAT '
X(13)'
COLUMN-LABEL ' From'
18 FIELD EndDate
AS CHAR FORMAT '
X(13)'
COLUMN-LABEL ' To'
19 FIELD FigsFrom
AS CHAR FORMAT '
X'
COLUMN-LABEL 'Type'
20 FIELD Description
AS CHAR FORMAT '
X(32)'
COLUMN-LABEL 'Description'
21 INDEX IX-A
IS UNIQUE PRIMARY MonthCode
ASCENDING.
23 DEF VAR set-list
AS CHAR NO-UNDO INITIAL "".
25 /* _UIB-CODE-BLOCK-END
*/
29 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
31 /* ******************** Preprocessor Definitions
******************** */
33 &Scoped-define PROCEDURE-TYPE SmartViewer
35 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
37 /* Name of first Frame and
/or Browse and
/or first Query
*/
38 &Scoped-define FRAME-NAME F-Main
41 &Scoped-define EXTERNAL-TABLES RP
42 &Scoped-define FIRST-EXTERNAL-TABLE RP
45 /* Need to scope the external tables to this procedure
*/
46 DEFINE QUERY external_tables
FOR RP.
47 /* Standard List Definitions
*/
48 &Scoped-Define ENABLED-FIELDS RP.Char1 RP.Int2 RP.Int3 RP.Char2 RP.Dec1 ~
49 RP.Dec2 RP.Log1 RP.Log2 RP.Char5 RP.Log3
50 &Scoped-define FIELD-PAIRS~
51 ~
{&FP1}Char1 ~{&FP2}Char1 ~{&FP3}~
52 ~
{&FP1}Int2 ~{&FP2}Int2 ~{&FP3}~
53 ~
{&FP1}Int3 ~{&FP2}Int3 ~{&FP3}~
54 ~
{&FP1}Dec1 ~{&FP2}Dec1 ~{&FP3}~
55 ~
{&FP1}Dec2 ~{&FP2}Dec2 ~{&FP3}~
56 ~
{&FP1}Char5 ~{&FP2}Char5 ~{&FP3}
57 &Scoped-define ENABLED-TABLES RP
58 &Scoped-define FIRST-ENABLED-TABLE RP
59 &Scoped-Define ENABLED-OBJECTS RECT-2 cmb_AccountGroups cmb_To btn_Browse ~
61 &Scoped-Define DISPLAYED-FIELDS RP.Char1 RP.Int2 RP.Int3 RP.Char2 RP.Dec1 ~
62 RP.Dec2 RP.Log1 RP.Log2 RP.Char5 RP.Log3
63 &Scoped-Define DISPLAYED-OBJECTS fil_Entity-1 fil_Entity-2 ~
64 cmb_AccountGroups fil_account1 fil_account2 cmb_To
66 /* Custom List Definitions
*/
67 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
69 /* _UIB-PREPROCESSOR-BLOCK-END
*/
73 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" V-table-Win _INLINE
74 /* Actions
: ? adm
/support
/keyedit.w ? ? ?
*/
82 **************************
83 * Set attributes related to FOREIGN
KEYS
85 RUN set-attribute-list
(
87 Keys-Supplied
= ""'
:U
).
88 /**************************
91 /* _UIB-CODE-BLOCK-END
*/
95 /* *********************** Control Definitions
********************** */
98 /* Definitions of the field level widgets
*/
99 DEFINE BUTTON btn_Browse
103 DEFINE BUTTON btn_OK
DEFAULT
108 DEFINE VARIABLE cmb_To
AS DATE FORMAT "99/99/9999":U
110 VIEW-AS COMBO-BOX INNER-LINES 18
111 LIST-ITEMS "31/12/97"
112 SIZE 15 BY 1 NO-UNDO.
114 DEFINE VARIABLE fil_account1
AS CHARACTER FORMAT "X(256)":U
119 DEFINE VARIABLE fil_account2
AS CHARACTER FORMAT "X(256)":U
124 DEFINE VARIABLE fil_Entity-1
AS CHARACTER FORMAT "X(256)":U
129 DEFINE VARIABLE fil_Entity-2
AS CHARACTER FORMAT "X(256)":U
134 DEFINE RECTANGLE RECT-2
135 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
138 DEFINE VARIABLE cmb_AccountGroups
AS CHARACTER
139 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
140 SIZE 62.29 BY 7 NO-UNDO.
143 /* ************************ Frame Definitions
*********************** */
146 RP.Char1
AT ROW 1.4 COL 7 COLON-ALIGNED
147 LABEL "Entity" FORMAT "X"
150 RP.Int2
AT ROW 1.4 COL 9.86 COLON-ALIGNED HELP
151 "" NO-LABEL FORMAT "99999"
154 fil_Entity-1
AT ROW 1.4 COL 16.72 COLON-ALIGNED NO-LABEL
155 RP.Int3
AT ROW 2.55 COL 9.86 COLON-ALIGNED HELP
156 "" NO-LABEL FORMAT "99999"
159 fil_Entity-2
AT ROW 2.55 COL 16.72 COLON-ALIGNED NO-LABEL
160 RP.Char2
AT ROW 4.2 COL 1.57 HELP
162 VIEW-AS RADIO-SET HORIZONTAL
164 "Account Range", "Range":U
,
165 "Account Groups", "Groups":U
167 cmb_AccountGroups
AT ROW 5.2 COL 9 NO-LABEL
168 RP.Dec1
AT ROW 6 COL 7 COLON-ALIGNED HELP
170 LABEL "From" FORMAT "9999.99"
173 fil_account1
AT ROW 6 COL 18.57 COLON-ALIGNED NO-LABEL
174 RP.Dec2
AT ROW 7 COL 7 COLON-ALIGNED HELP
176 LABEL "to" FORMAT "9999.99"
179 fil_account2
AT ROW 7 COL 18.57 COLON-ALIGNED NO-LABEL
180 RP.Log1
AT ROW 12.4 COL 9 HELP
185 RP.Log2
AT ROW 12.4 COL 28.43 HELP
187 LABEL "Merge sub-accounts"
190 cmb_To
AT ROW 13.6 COL 7 COLON-ALIGNED
191 RP.Char5
AT ROW 15 COL 7 COLON-ALIGNED
192 LABEL "File" FORMAT "X(256)"
195 btn_Browse
AT ROW 15 COL 62.72
196 RP.Log3
AT ROW 16.2 COL 9 HELP
198 VIEW-AS RADIO-SET VERTICAL
200 "Entity Rows - Account Columns", TRUE,
201 "Account Rows - Entity Columns", FALSE
203 btn_OK
AT ROW 16.8 COL 60.43
204 RECT-2
AT ROW 1 COL 1
205 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
206 SIDE-LABELS NO-UNDERLINE THREE-D
207 AT COL 1 ROW 1 SCROLLABLE
209 DEFAULT-BUTTON btn_OK.
212 /* *********************** Procedure Settings
************************ */
214 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
215 /* Settings for
THIS-PROCEDURE
217 External Tables
: ttpl.RP
218 Allow
: Basic
,DB-Fields
220 Add Fields to
: EXTERNAL-TABLES
221 Other Settings
: PERSISTENT-ONLY
COMPILE
224 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
225 /* then cleanup and return.
*/
226 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
227 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
228 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
232 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
234 /* ************************* Create Window
************************** */
236 &ANALYZE-SUSPEND _CREATE-WINDOW
237 /* DESIGN Window definition
(used by the UIB
)
238 CREATE WINDOW V-table-Win
ASSIGN
241 /* END WINDOW DEFINITION
*/
246 /* *************** Runtime Attributes and UIB Settings
************** */
248 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
249 /* SETTINGS
FOR WINDOW V-table-Win
250 VISIBLE,,RUN-PERSISTENT
*/
251 /* SETTINGS
FOR FRAME F-Main
252 NOT-VISIBLE Size-to-Fit
*/
254 FRAME F-Main
:SCROLLABLE = FALSE
255 FRAME F-Main
:HIDDEN = TRUE.
257 /* SETTINGS
FOR FILL-IN RP.Char1
IN FRAME F-Main
258 EXP-LABEL EXP-FORMAT
*/
259 /* SETTINGS
FOR RADIO-SET RP.Char2
IN FRAME F-Main
261 /* SETTINGS
FOR FILL-IN RP.Char5
IN FRAME F-Main
262 EXP-LABEL EXP-FORMAT
*/
263 /* SETTINGS
FOR FILL-IN RP.Dec1
IN FRAME F-Main
264 EXP-LABEL EXP-FORMAT EXP-HELP
*/
265 /* SETTINGS
FOR FILL-IN RP.Dec2
IN FRAME F-Main
266 EXP-LABEL EXP-FORMAT EXP-HELP
*/
267 /* SETTINGS
FOR FILL-IN fil_account1
IN FRAME F-Main
269 /* SETTINGS
FOR FILL-IN fil_account2
IN FRAME F-Main
271 /* SETTINGS
FOR FILL-IN fil_Entity-1
IN FRAME F-Main
273 /* SETTINGS
FOR FILL-IN fil_Entity-2
IN FRAME F-Main
275 /* SETTINGS
FOR FILL-IN RP.Int2
IN FRAME F-Main
276 EXP-LABEL EXP-FORMAT EXP-HELP
*/
277 /* SETTINGS
FOR FILL-IN RP.Int3
IN FRAME F-Main
278 EXP-LABEL EXP-FORMAT EXP-HELP
*/
279 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
280 EXP-LABEL EXP-HELP
*/
281 /* SETTINGS
FOR TOGGLE-BOX RP.Log2
IN FRAME F-Main
282 EXP-LABEL EXP-HELP
*/
283 /* SETTINGS
FOR RADIO-SET RP.Log3
IN FRAME F-Main
285 /* _RUN-TIME-ATTRIBUTES-END
*/
289 /* Setting information for Queries and Browse Widgets fields
*/
291 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
292 /* Query rebuild information for
FRAME F-Main
295 */ /* FRAME F-Main
*/
301 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
302 /* ************************* Included-Libraries
*********************** */
304 {src
/adm
/method
/viewer.i
}
305 {inc
/method
/m-mntvwr.i
}
307 /* _UIB-CODE-BLOCK-END
*/
313 /* ************************ Control Triggers
************************ */
315 &Scoped-define SELF-NAME btn_Browse
316 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_Browse V-table-Win
317 ON CHOOSE OF btn_Browse
IN FRAME F-Main
/* Browse
*/
319 RUN select-file-dialog.
322 /* _UIB-CODE-BLOCK-END
*/
326 &Scoped-define SELF-NAME btn_OK
327 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_OK V-table-Win
328 ON CHOOSE OF btn_OK
IN FRAME F-Main
/* OK */
330 DISABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
332 ENABLE {&SELF-NAME} WITH FRAME {&FRAME-NAME}.
335 /* _UIB-CODE-BLOCK-END
*/
339 &Scoped-define SELF-NAME RP.Char1
340 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
341 ON LEAVE OF RP.Char1
IN FRAME F-Main
/* Entity
*/
343 IF NOT SELF:MODIFIED THEN RETURN.
344 DO WITH FRAME {&FRAME-NAME}:
345 SELF:SCREEN-VALUE = CAPS(SELF:SCREEN-VALUE).
346 RUN get-entity-name
( SELF:SCREEN-VALUE, INT(RP.Int2
:SCREEN-VALUE), OUTPUT fil_Entity-1
).
347 RUN get-entity-name
( SELF:SCREEN-VALUE, INT(RP.Int2
:SCREEN-VALUE), OUTPUT fil_Entity-2
).
348 DISPLAY fil_Entity-1 fil_Entity-2 .
352 /* _UIB-CODE-BLOCK-END
*/
356 &Scoped-define SELF-NAME RP.Char2
357 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char2 V-table-Win
358 ON VALUE-CHANGED
OF RP.Char2
IN FRAME F-Main
/* Char2
*/
360 RUN account-selection-changed.
363 /* _UIB-CODE-BLOCK-END
*/
367 &Scoped-define SELF-NAME cmb_AccountGroups
368 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AccountGroups V-table-Win
369 ON U1
OF cmb_AccountGroups
IN FRAME F-Main
371 {inc
/selcmb
/sel-acg1.i
"RP" "Char6"}
374 /* _UIB-CODE-BLOCK-END
*/
378 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AccountGroups V-table-Win
379 ON U2
OF cmb_AccountGroups
IN FRAME F-Main
381 {inc
/selcmb
/sel-acg2.i
"RP" "Char6"}
384 /* _UIB-CODE-BLOCK-END
*/
388 &Scoped-define SELF-NAME cmb_To
389 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_To V-table-Win
390 ON U1
OF cmb_To
IN FRAME F-Main
/* To
*/
392 {inc
/selcmb
/scmthe1.i
"RP" "Int6"}
395 /* _UIB-CODE-BLOCK-END
*/
399 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_To V-table-Win
400 ON U2
OF cmb_To
IN FRAME F-Main
/* To
*/
402 {inc
/selcmb
/scmthe2.i
"RP" "Int6"}
405 /* _UIB-CODE-BLOCK-END
*/
409 &Scoped-define SELF-NAME RP.Dec1
410 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec1 V-table-Win
411 ON LEAVE OF RP.Dec1
IN FRAME F-Main
/* From
*/
413 {inc
/selcde
/cdcoa.i
"fil_account1"}
416 /* _UIB-CODE-BLOCK-END
*/
420 &Scoped-define SELF-NAME RP.Dec2
421 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Dec2 V-table-Win
422 ON LEAVE OF RP.Dec2
IN FRAME F-Main
/* to
*/
424 {inc
/selcde
/cdcoa.i
"fil_account2"}
427 /* _UIB-CODE-BLOCK-END
*/
431 &Scoped-define SELF-NAME fil_account1
432 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
433 ON U1
OF fil_account1
IN FRAME F-Main
435 {inc
/selfil
/sfcoa1.i
"RP" "Dec1"}
438 /* _UIB-CODE-BLOCK-END
*/
442 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
443 ON U2
OF fil_account1
IN FRAME F-Main
445 {inc
/selfil
/sfcoa2.i
"RP" "Dec1"}
448 /* _UIB-CODE-BLOCK-END
*/
452 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account1 V-table-Win
453 ON U3
OF fil_account1
IN FRAME F-Main
455 {inc
/selfil
/sfcoa3.i
"RP" "Dec1"}
458 /* _UIB-CODE-BLOCK-END
*/
462 &Scoped-define SELF-NAME fil_account2
463 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
464 ON U1
OF fil_account2
IN FRAME F-Main
466 {inc
/selfil
/sfcoa1.i
"RP" "Dec2"}
469 /* _UIB-CODE-BLOCK-END
*/
473 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
474 ON U2
OF fil_account2
IN FRAME F-Main
476 {inc
/selfil
/sfcoa2.i
"RP" "Dec2"}
479 /* _UIB-CODE-BLOCK-END
*/
483 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_account2 V-table-Win
484 ON U3
OF fil_account2
IN FRAME F-Main
486 {inc
/selfil
/sfcoa3.i
"RP" "Dec2"}
489 /* _UIB-CODE-BLOCK-END
*/
493 &Scoped-define SELF-NAME RP.Int2
494 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
495 ON LEAVE OF RP.Int2
IN FRAME F-Main
/* Int2
*/
497 DO WITH FRAME {&FRAME-NAME}:
498 RUN get-entity-name
( RP.Char1
:SCREEN-VALUE, INT(SELF:SCREEN-VALUE), OUTPUT fil_Entity-1
).
499 DISPLAY fil_Entity-1.
503 /* _UIB-CODE-BLOCK-END
*/
507 &Scoped-define SELF-NAME RP.Int3
508 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int3 V-table-Win
509 ON LEAVE OF RP.Int3
IN FRAME F-Main
/* Int3
*/
511 DO WITH FRAME {&FRAME-NAME}:
512 RUN get-entity-name
( RP.Char1
:SCREEN-VALUE, INT(SELF:SCREEN-VALUE), OUTPUT fil_Entity-2
).
513 DISPLAY fil_Entity-2 .
517 /* _UIB-CODE-BLOCK-END
*/
521 &Scoped-define SELF-NAME RP.Log1
522 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log1 V-table-Win
523 ON VALUE-CHANGED
OF RP.Log1
IN FRAME F-Main
/* Detailed
*/
525 RUN detail-flag-changed.
528 /* _UIB-CODE-BLOCK-END
*/
534 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
537 /* *************************** Main Block
*************************** */
539 /* _UIB-CODE-BLOCK-END
*/
543 /* ********************** Internal Procedures
*********************** */
545 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE account-selection-changed V-table-Win
546 PROCEDURE account-selection-changed
:
547 /*------------------------------------------------------------------------------
549 ------------------------------------------------------------------------------*/
550 DO WITH FRAME {&FRAME-NAME}:
551 IF INPUT RP.Char2
= "Range" THEN DO:
552 VIEW RP.Dec1 RP.Dec2 fil_account1 fil_account2.
553 HIDE cmb_AccountGroups RP.Log1.
556 HIDE RP.Dec1 RP.Dec2 fil_account1 fil_account2.
557 VIEW cmb_AccountGroups RP.Log1.
559 RUN detail-flag-changed.
563 /* _UIB-CODE-BLOCK-END
*/
567 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
568 PROCEDURE adm-row-available
:
569 /*------------------------------------------------------------------------------
570 Purpose
: Dispatched to this procedure when the Record-
571 Source has a new row available. This procedure
572 tries to get the new row
(or foriegn keys
) from
573 the Record-Source and process it.
575 ------------------------------------------------------------------------------*/
577 /* Define variables needed by this internal procedure.
*/
578 {src
/adm
/template
/row-head.i
}
580 /* Create a list of all the tables that we need to get.
*/
581 {src
/adm
/template
/row-list.i
"RP"}
583 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
584 {src
/adm
/template
/row-get.i
}
586 /* FIND each record specified by the RECORD-SOURCE.
*/
587 {src
/adm
/template
/row-find.i
"RP"}
589 /* Process the newly available records
(i.e. display fields
,
590 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
591 {src
/adm
/template
/row-end.i
}
595 /* _UIB-CODE-BLOCK-END
*/
599 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE detail-flag-changed V-table-Win
600 PROCEDURE detail-flag-changed
:
601 /*------------------------------------------------------------------------------
603 ------------------------------------------------------------------------------*/
604 DO WITH FRAME {&FRAME-NAME}:
605 IF INPUT RP.Log1
AND INPUT RP.Char2
= "Groups" THEN DO:
614 /* _UIB-CODE-BLOCK-END
*/
618 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
619 PROCEDURE disable_UI
:
620 /*------------------------------------------------------------------------------
621 Purpose
: DISABLE the User Interface
623 Notes
: Here we clean-up the user-interface by deleting
624 dynamic widgets we have created and
/or hide
625 frames. This procedure is usually called when
626 we are ready to
"clean-up" after running.
627 ------------------------------------------------------------------------------*/
628 /* Hide all frames.
*/
630 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
633 /* _UIB-CODE-BLOCK-END
*/
637 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-entity-name V-table-Win
638 PROCEDURE get-entity-name
:
639 /*------------------------------------------------------------------------------
643 ------------------------------------------------------------------------------*/
644 DEF INPUT PARAMETER et
AS CHAR NO-UNDO.
645 DEF INPUT PARAMETER ec
AS INT NO-UNDO.
646 DEF OUTPUT PARAMETER o-entityname
AS CHAR NO-UNDO.
650 FIND Company
WHERE Company.CompanyCode
= ec
NO-LOCK NO-ERROR.
651 IF AVAILABLE(Company
) THEN o-EntityName
= Company.LegalName.
652 ELSE o-EntityName
= "* * * Company not on file * * *".
655 FIND Property
WHERE Property.PropertyCode
= ec
NO-LOCK NO-ERROR.
656 IF AVAILABLE(Property
) THEN o-EntityName
= Property.Name.
657 ELSE o-EntityName
= "* * * Property not on file * * *".
660 FIND Project
WHERE Project.ProjectCode
= ec
NO-LOCK NO-ERROR.
661 IF AVAILABLE(Project
) THEN o-EntityName
= Project.Name.
662 ELSE o-EntityName
= "* * * Project not on file * * *".
665 FIND FixedAsset
WHERE FixedAsset.AssetCode
= ec
NO-LOCK NO-ERROR.
666 IF AVAILABLE(FixedAsset
) THEN o-EntityName
= FixedAsset.Description.
667 ELSE o-EntityName
= "* * * Fixed Asset not on file * * *".
669 /* T and C should be fairly unlikely but we'll do them anyway
*/
671 FIND Creditor
WHERE Creditor.CreditorCode
= ec
NO-LOCK NO-ERROR.
672 IF AVAILABLE(Creditor
) THEN o-EntityName
= Creditor.Name.
673 ELSE o-EntityName
= "* * * Creditor not on file * * *".
676 FIND Tenant
WHERE Tenant.TenantCode
= ec
NO-LOCK NO-ERROR.
677 IF AVAILABLE(Tenant
) THEN o-EntityName
= Tenant.Name.
678 ELSE o-EntityName
= "* * * Tenant not on file * * *".
684 /* _UIB-CODE-BLOCK-END
*/
688 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-display-fields V-table-Win
689 PROCEDURE inst-display-fields
:
690 /*------------------------------------------------------------------------------
692 ------------------------------------------------------------------------------*/
693 DO WITH FRAME {&FRAME-NAME}:
694 RUN get-entity-name
( INPUT RP.Char1
, INPUT RP.Int2
, OUTPUT fil_Entity-1
).
695 RUN get-entity-name
( INPUT RP.Char1
, INPUT RP.Int3
, OUTPUT fil_Entity-2
).
696 DISPLAY UNLESS-HIDDEN fil_Entity-1 fil_Entity-2.
700 /* _UIB-CODE-BLOCK-END
*/
704 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
705 PROCEDURE inst-enable-fields
:
706 /*------------------------------------------------------------------------------
708 ------------------------------------------------------------------------------*/
709 RUN account-selection-changed.
712 /* _UIB-CODE-BLOCK-END
*/
716 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
717 PROCEDURE inst-initialize
:
718 /*------------------------------------------------------------------------------
720 ------------------------------------------------------------------------------*/
721 DEF VAR user-name
AS CHAR NO-UNDO.
{inc
/username.i
"user-name"}
722 &SCOP REPORT-ID "Account Balance Export"
724 FIND RP
WHERE RP.ReportID
= {&REPORT-ID} AND RP.UserName = user-name EXCLUSIVE-LOCK NO-ERROR .
725 IF NOT AVAILABLE(RP
) THEN DO:
726 FIND LAST Month
WHERE Month.StartDate
<= TODAY NO-LOCK NO-ERROR.
729 RP.ReportID
= {&REPORT-ID}
730 RP.UserName
= user-name
735 RUN dispatch
( 'display-fields'
:U
).
736 RUN dispatch
( 'disable-fields'
:U
).
737 RUN dispatch
( 'enable-fields'
:U
).
741 /* _UIB-CODE-BLOCK-END
*/
745 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
746 PROCEDURE pre-destroy
:
747 /*------------------------------------------------------------------------------
749 ------------------------------------------------------------------------------*/
750 RUN check-modified
( 'clear'
:U
).
753 /* _UIB-CODE-BLOCK-END
*/
757 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
758 PROCEDURE run-report
:
759 /*------------------------------------------------------------------------------
760 Purpose
: Actually run the report
761 ------------------------------------------------------------------------------*/
762 DEF VAR report-options
AS CHAR NO-UNDO.
764 DO WITH FRAME {&FRAME-NAME}:
766 RUN dispatch
( 'update-record'
:U
).
768 report-options
= "EntityType," + RP.Char1
769 + "~nEntityRange," + STRING(RP.Int2
) + "," + STRING( RP.Int3
)
770 + (IF RP.Char2
= "Range" THEN
771 "~nAccountRange," + STRING(RP.Dec1
) + "," + STRING(RP.Dec2
)
773 "~nAccountGroups," + RP.Char6
774 + (IF RP.Log1
THEN "~nDetailed" ELSE "")
775 + (IF RP.Log1
AND RP.Log2
THEN "~nMergeAccounts" ELSE "")
777 + "~nToMonth," + STRING(RP.Int6
)
778 + "~nColumns," + (IF RP.Log3
THEN "Accounts" ELSE "Entities")
779 + "~nFileName," + RP.Char5 .
781 RUN notify
( 'set-busy
,container-source'
:U
).
782 RUN process
/export
/export-balances.p
( report-options
).
783 RUN notify
( 'set-idle
,container-source'
:U
).
787 /* _UIB-CODE-BLOCK-END
*/
791 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE select-file-dialog V-table-Win
792 PROCEDURE select-file-dialog
:
793 /*------------------------------------------------------------------------------
795 ------------------------------------------------------------------------------*/
796 DEF VAR select-ok
AS LOGICAL INITIAL Yes
NO-UNDO.
797 DEF VAR file-name
AS CHAR NO-UNDO.
798 DEF VAR start-dir
AS CHAR NO-UNDO.
800 file-name
= INPUT FRAME {&FRAME-NAME} RP.Char5 .
801 start-dir
= SUBSTRING( file-name
, 1, R-INDEX(file-name
, "\" ) ).
803 SYSTEM-DIALOG GET-FILE file-name
FILTERS "Comma-separated values" "*.CSV"
804 SAVE-AS ASK-OVERWRITE CREATE-TEST-FILE DEFAULT-EXTENSION ".CSV"
805 INITIAL-DIR start-dir
RETURN-TO-START-DIR
806 TITLE "" USE-FILENAME UPDATE select-ok.
808 IF select-ok
THEN DO:
809 IF SUBSTRING( file-name
, R-INDEX( file-name
, ".") ) <> ".CSV" THEN DO:
810 IF (LENGTH( file-name
) - R-INDEX( file-name
, "." )) < 4 THEN
811 file-name
= SUBSTRING( file-name
, 1, R-INDEX( file-name
, ".")) + "CSV" .
813 RP.Char5
:SCREEN-VALUE IN FRAME {&FRAME-NAME} = file-name.
818 /* _UIB-CODE-BLOCK-END
*/
822 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
823 PROCEDURE send-records
:
824 /*------------------------------------------------------------------------------
825 Purpose
: Send record
ROWID's for all tables used by
827 Parameters
: see template
/snd-head.i
828 ------------------------------------------------------------------------------*/
830 /* Define variables needed by this internal procedure.
*/
831 {src
/adm
/template
/snd-head.i
}
833 /* For each requested table
, put it's
ROWID in the output list.
*/
834 {src
/adm
/template
/snd-list.i
"RP"}
836 /* Deal with any unexpected table requests before closing.
*/
837 {src
/adm
/template
/snd-end.i
}
841 /* _UIB-CODE-BLOCK-END
*/
845 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
846 PROCEDURE state-changed
:
847 /* -----------------------------------------------------------
851 -------------------------------------------------------------*/
852 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
853 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
856 /* Object instance CASEs can go here to replace standard behavior
858 {src
/adm
/template
/vstates.i
}
862 /* _UIB-CODE-BLOCK-END
*/