1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
11 ------------------------------------------------------------------------*/
13 /* *************************** Definitions
************************** */
15 &SCOPED-DEFINE REPORT-ID "Month End OG Accrual"
19 /* _UIB-CODE-BLOCK-END
*/
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions
******************** */
27 &Scoped-define PROCEDURE-TYPE SmartViewer
29 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
31 /* Name of first Frame and
/or Browse and
/or first Query
*/
32 &Scoped-define FRAME-NAME F-Main
35 &Scoped-define EXTERNAL-TABLES RP
36 &Scoped-define FIRST-EXTERNAL-TABLE RP
39 /* Need to scope the external tables to this procedure
*/
40 DEFINE QUERY external_tables
FOR RP.
41 /* Standard List Definitions
*/
42 &Scoped-Define ENABLED-FIELDS RP.Char1 RP.Int1 RP.Log2 RP.Log3 RP.Log4 ~
44 &Scoped-define FIELD-PAIRS~
45 ~
{&FP1}Int1 ~{&FP2}Int1 ~{&FP3}
46 &Scoped-define ENABLED-TABLES RP
47 &Scoped-define FIRST-ENABLED-TABLE RP
48 &Scoped-Define ENABLED-OBJECTS RECT-23 cmb_MonthEnding btn_print
49 &Scoped-Define DISPLAYED-FIELDS RP.Char1 RP.Int1 RP.Log2 RP.Log3 RP.Log4 ~
51 &Scoped-Define DISPLAYED-OBJECTS fil_Property cmb_MonthEnding
53 /* Custom List Definitions
*/
54 /* ADM-CREATE-FIELDS
,ADM-ASSIGN-FIELDS
,List-3
,List-4
,List-5
,List-6
*/
56 /* _UIB-PREPROCESSOR-BLOCK-END
*/
61 /* *********************** Control Definitions
********************** */
64 /* Definitions of the field level widgets
*/
65 DEFINE BUTTON btn_print
70 DEFINE VARIABLE cmb_MonthEnding
AS CHARACTER FORMAT "X(256)":U
72 VIEW-AS COMBO-BOX INNER-LINES 24
76 DEFINE VARIABLE fil_Property
AS CHARACTER FORMAT "X(256)":U
81 DEFINE RECTANGLE RECT-23
82 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
86 /* ************************ Frame Definitions
*********************** */
89 RP.Char1
AT ROW 1.2 COL 2 NO-LABEL
90 VIEW-AS RADIO-SET VERTICAL
92 "All properties", "All":U
,
93 "Single Property", "OneProperty":U
96 RP.Int1
AT ROW 2 COL 13.86 COLON-ALIGNED NO-LABEL FORMAT "99999"
100 fil_Property
AT ROW 2 COL 23.57 COLON-ALIGNED NO-LABEL
101 cmb_MonthEnding
AT ROW 3.8 COL 13.86 COLON-ALIGNED
102 RP.Log2
AT ROW 6 COL 6.14
106 RP.Log3
AT ROW 6.8 COL 6.14 HELP
108 LABEL "Generate accrual journal"
111 RP.Log4
AT ROW 7.6 COL 6.14
115 RP.Log1
AT ROW 9 COL 6.14
120 btn_print
AT ROW 9 COL 58.14
121 RECT-23
AT ROW 1 COL 1
122 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
123 SIDE-LABELS NO-UNDERLINE THREE-D
124 AT COL 1 ROW 1 SCROLLABLE
126 DEFAULT-BUTTON btn_print.
129 /* *********************** Procedure Settings
************************ */
131 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
132 /* Settings for
THIS-PROCEDURE
134 External Tables
: ttpl.RP
135 Allow
: Basic
,DB-Fields
137 Add Fields to
: EXTERNAL-TABLES
138 Other Settings
: PERSISTENT-ONLY
COMPILE
141 /* This procedure should always be
RUN PERSISTENT. Report the error
, */
142 /* then cleanup and return.
*/
143 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
144 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
145 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
149 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
151 /* ************************* Create Window
************************** */
153 &ANALYZE-SUSPEND _CREATE-WINDOW
154 /* DESIGN Window definition
(used by the UIB
)
155 CREATE WINDOW V-table-Win
ASSIGN
158 /* END WINDOW DEFINITION
*/
163 /* *************** Runtime Attributes and UIB Settings
************** */
165 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
166 /* SETTINGS
FOR WINDOW V-table-Win
167 VISIBLE,,RUN-PERSISTENT
*/
168 /* SETTINGS
FOR FRAME F-Main
169 NOT-VISIBLE Size-to-Fit
*/
171 FRAME F-Main
:SCROLLABLE = FALSE
172 FRAME F-Main
:HIDDEN = TRUE.
174 /* SETTINGS
FOR FILL-IN fil_Property
IN FRAME F-Main
176 /* SETTINGS
FOR FILL-IN RP.Int1
IN FRAME F-Main
177 EXP-LABEL EXP-FORMAT
*/
178 /* SETTINGS
FOR TOGGLE-BOX RP.Log1
IN FRAME F-Main
180 /* SETTINGS
FOR TOGGLE-BOX RP.Log2
IN FRAME F-Main
182 /* SETTINGS
FOR TOGGLE-BOX RP.Log3
IN FRAME F-Main
183 EXP-LABEL EXP-HELP
*/
184 /* SETTINGS
FOR TOGGLE-BOX RP.Log4
IN FRAME F-Main
186 /* _RUN-TIME-ATTRIBUTES-END
*/
190 /* Setting information for Queries and Browse Widgets fields
*/
192 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
193 /* Query rebuild information for
FRAME F-Main
196 */ /* FRAME F-Main
*/
202 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
203 /* ************************* Included-Libraries
*********************** */
205 {src
/adm
/method
/viewer.i
}
206 {inc
/method
/m-mntvwr.i
}
208 /* _UIB-CODE-BLOCK-END
*/
214 /* ************************ Control Triggers
************************ */
216 &Scoped-define SELF-NAME btn_print
217 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btn_print V-table-Win
218 ON CHOOSE OF btn_print
IN FRAME F-Main
/* OK */
222 SELF:SENSITIVE = Yes.
225 /* _UIB-CODE-BLOCK-END
*/
229 &Scoped-define SELF-NAME RP.Char1
230 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Char1 V-table-Win
231 ON VALUE-CHANGED
OF RP.Char1
IN FRAME F-Main
/* Char1
*/
233 RUN tenant-options-changed.
236 /* _UIB-CODE-BLOCK-END
*/
240 &Scoped-define SELF-NAME cmb_MonthEnding
241 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_MonthEnding V-table-Win
242 ON U1
OF cmb_MonthEnding
IN FRAME F-Main
/* Month ending
*/
244 {inc
/selcmb
/scmthe1.i
"RP" "Int3"}
247 /* _UIB-CODE-BLOCK-END
*/
251 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_MonthEnding V-table-Win
252 ON U2
OF cmb_MonthEnding
IN FRAME F-Main
/* Month ending
*/
254 {inc
/selcmb
/scmthe2.i
"RP" "Int3"}
257 /* _UIB-CODE-BLOCK-END
*/
261 &Scoped-define SELF-NAME fil_Property
262 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Property V-table-Win
263 ON U1
OF fil_Property
IN FRAME F-Main
265 {inc
/selfil
/sfpro1.i
"RP" "Int1"}
268 /* _UIB-CODE-BLOCK-END
*/
272 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Property V-table-Win
273 ON U2
OF fil_Property
IN FRAME F-Main
275 {inc
/selfil
/sfpro2.i
"RP" "Int1"}
278 /* _UIB-CODE-BLOCK-END
*/
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Property V-table-Win
283 ON U3
OF fil_Property
IN FRAME F-Main
285 {inc
/selfil
/sfpro3.i
"RP" "Int1"}
288 /* _UIB-CODE-BLOCK-END
*/
292 &Scoped-define SELF-NAME RP.Int1
293 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
294 ON LEAVE OF RP.Int1
IN FRAME F-Main
/* Int1
*/
296 {inc
/selcde
/cdpro.i
"fil_Property"}
299 /* _UIB-CODE-BLOCK-END
*/
303 &Scoped-define SELF-NAME RP.Log2
304 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log2 V-table-Win
305 ON VALUE-CHANGED
OF RP.Log2
IN FRAME F-Main
/* Summary
*/
307 RUN enable-appropriate-fields.
310 /* _UIB-CODE-BLOCK-END
*/
314 &Scoped-define SELF-NAME RP.Log3
315 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Log3 V-table-Win
316 ON VALUE-CHANGED
OF RP.Log3
IN FRAME F-Main
/* Generate accrual journal
*/
318 RUN enable-appropriate-fields.
321 /* _UIB-CODE-BLOCK-END
*/
327 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
330 /* *************************** Main Block
*************************** */
332 /* _UIB-CODE-BLOCK-END
*/
336 /* ********************** Internal Procedures
*********************** */
338 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win
339 PROCEDURE adm-row-available
:
340 /*------------------------------------------------------------------------------
341 Purpose
: Override
(thoroughly
!) the Progress adm-row-available
342 ------------------------------------------------------------------------------*/
344 /* Define variables needed by this internal procedure.
*/
345 {src
/adm
/template
/row-head.i
}
347 /* Create a list of all the tables that we need to get.
*/
348 {src
/adm
/template
/row-list.i
"Creditor"}
350 /* Get the record
ROWID's from the RECORD-SOURCE.
*/
351 {src
/adm
/template
/row-get.i
}
353 /* FIND each record specified by the RECORD-SOURCE.
*/
354 {src
/adm
/template
/row-find.i
"Creditor"}
356 /* Process the newly available records
(i.e. display fields
,
357 open queries
, and
/or pass records on to any RECORD-TARGETS
).
*/
358 {src
/adm
/template
/row-end.i
}
362 /* _UIB-CODE-BLOCK-END
*/
366 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
367 PROCEDURE disable_UI
:
368 /*------------------------------------------------------------------------------
369 Purpose
: DISABLE the User Interface
371 Notes
: Here we clean-up the user-interface by deleting
372 dynamic widgets we have created and
/or hide
373 frames. This procedure is usually called when
374 we are ready to
"clean-up" after running.
375 ------------------------------------------------------------------------------*/
376 /* Hide all frames.
*/
378 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
381 /* _UIB-CODE-BLOCK-END
*/
385 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
386 PROCEDURE enable-appropriate-fields
:
387 /*------------------------------------------------------------------------------
389 ------------------------------------------------------------------------------*/
390 DO WITH FRAME {&FRAME-NAME}:
392 IF INPUT RP.Log2
THEN DISABLE RP.Log3 RP.Log4.
ELSE ENABLE RP.Log3 RP.Log4.
393 IF NOT INPUT RP.Log2
AND INPUT RP.Log3
THEN ENABLE RP.Log4.
ELSE DISABLE RP.Log4.
395 RUN tenant-options-changed.
399 /* _UIB-CODE-BLOCK-END
*/
403 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
404 PROCEDURE inst-enable-fields
:
405 /*------------------------------------------------------------------------------
407 ------------------------------------------------------------------------------*/
409 RUN enable-appropriate-fields.
413 /* _UIB-CODE-BLOCK-END
*/
417 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
418 PROCEDURE inst-initialize
:
419 /*------------------------------------------------------------------------------
421 ------------------------------------------------------------------------------*/
422 DEF VAR user-name
AS CHAR NO-UNDO.
424 RUN get-username
IN sys-mgr
( OUTPUT user-name
).
426 FIND RP
WHERE RP.UserName
= user-name
AND RP.ReportID
= {&REPORT-ID} NO-ERROR.
428 IF NOT AVAILABLE RP
THEN DO WITH FRAME {&FRAME-NAME}:
430 ASSIGN RP.ReportID
= {&REPORT-ID}
431 RP.UserName
= user-name
432 RP.Char1
= "OneProperty"
437 RUN dispatch
( 'display-fields'
:U
).
438 RUN dispatch
( 'enable-fields'
:U
).
442 /* _UIB-CODE-BLOCK-END
*/
446 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
447 PROCEDURE pre-destroy
:
448 /*------------------------------------------------------------------------------
452 ------------------------------------------------------------------------------*/
454 RUN check-modified
( "CLEAR" ).
458 /* _UIB-CODE-BLOCK-END
*/
462 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
463 PROCEDURE run-report
:
464 /*------------------------------------------------------------------------------
465 Purpose
: Actually run the report through RB engine.
466 ------------------------------------------------------------------------------*/
467 DEF VAR report-options
AS CHAR NO-UNDO.
468 DEF VAR open-only
AS LOGI
NO-UNDO INITIAL No.
471 IF RETURN-VALUE = "FAIL" THEN RETURN.
473 RUN dispatch
( 'update-record'
:U
).
476 IF RP.Log3
THEN open-only
= Yes.
478 report-options
= RP.Char1
479 + (IF RP.Char1
= "OneProperty" THEN "~nProperty," + STRING( RP.Int1
) ELSE "")
480 + (IF RP.Log1
THEN "~nPreview" ELSE "")
481 + (IF RP.Log2
THEN "~nSummary" ELSE "")
482 + (IF NOT RP.Log2
AND RP.Log3
THEN "~nMakeTransactions" ELSE "")
483 + (IF NOT RP.Log2
AND RP.Log3
AND RP.Log4
THEN "~nYearEnd" ELSE "")
484 + "~nMonthEnding," + STRING( RP.Int3
)
488 RUN notify
( 'set-busy
, CONTAINER-SOURCE'
:U
).
489 RUN process
/report
/month-end-og-accrual.p
( report-options
).
490 RUN notify
( 'set-idle
, CONTAINER-SOURCE'
:U
).
493 RUN make-bq-entry
IN sys-mgr
( "process/report/month-end-og-accrual.p", report-options
, ?
, ?
).
498 /* _UIB-CODE-BLOCK-END
*/
502 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win
503 PROCEDURE send-records
:
504 /*------------------------------------------------------------------------------
506 ------------------------------------------------------------------------------*/
508 /* Define variables needed by this internal procedure.
*/
509 {src
/adm
/template
/snd-head.i
}
511 /* For each requested table
, put it's
ROWID in the output list.
*/
512 {src
/adm
/template
/snd-list.i
"Creditor"}
514 /* Deal with any unexpected table requests before closing.
*/
515 {src
/adm
/template
/snd-end.i
}
519 /* _UIB-CODE-BLOCK-END
*/
523 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
524 PROCEDURE state-changed
:
525 /* -----------------------------------------------------------
529 -------------------------------------------------------------*/
530 DEFINE INPUT PARAMETER p-issuer-hdl
AS HANDLE NO-UNDO.
531 DEFINE INPUT PARAMETER p-state
AS CHARACTER NO-UNDO.
534 /* Object instance CASEs can go here to replace standard behavior
536 {src
/adm
/template
/vstates.i
}
540 /* _UIB-CODE-BLOCK-END
*/
544 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE tenant-options-changed V-table-Win
545 PROCEDURE tenant-options-changed
:
546 /*------------------------------------------------------------------------------
548 ------------------------------------------------------------------------------*/
549 DEF VAR options
AS CHAR NO-UNDO.
551 options
= INPUT FRAME {&FRAME-NAME} RP.Char1.
555 DO WITH FRAME {&FRAME-NAME}:
556 HIDE RP.Int1 fil_Property.
557 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_Property
:HANDLE ), "HIDDEN = Yes":U
).
560 WHEN "OneProperty" THEN
561 DO WITH FRAME {&FRAME-NAME}:
562 VIEW RP.Int1 fil_Property.
563 RUN set-link-attributes
IN sys-mgr
( THIS-PROCEDURE, STRING( fil_Property
:HANDLE ), "HIDDEN = No":U
).
570 /* _UIB-CODE-BLOCK-END
*/
574 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-report V-table-Win
575 PROCEDURE verify-report
:
576 /*------------------------------------------------------------------------------
578 ------------------------------------------------------------------------------*/
580 CASE INPUT FRAME {&FRAME-NAME} RP.Char1:
582 WHEN 'OneProperty'
THEN
583 IF NOT CAN-FIND( FIRST Property
WHERE Property.PropertyCode
=
584 INPUT FRAME {&FRAME-NAME} RP.Int1 ) THEN
586 MESSAGE "You must select a property" VIEW-AS ALERT-BOX ERROR.
587 APPLY '
ENTRY'
:U
TO RP.Int1
IN FRAME {&FRAME-NAME}.
594 /* _UIB-CODE-BLOCK-END
*/