Changes related to the Direct Credit details. New table and maintenance windows for
[capital-apms-progress.git] / vwr / drl / b-usrdcd.w
blob8467b6b38a28dc28f77bfd7895197a9d49886d23
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 /* Connected Databases
4 */
5 &Scoped-define WINDOW-NAME CURRENT-WINDOW
6 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS B-table-Win
7 /*------------------------------------------------------------------------
9 File:
11 Description:
13 ------------------------------------------------------------------------*/
15 CREATE WIDGET-POOL.
17 /* *************************** Definitions ************************** */
19 DEF VAR show-all AS LOGI NO-UNDO.
21 /* _UIB-CODE-BLOCK-END */
22 &ANALYZE-RESUME
25 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
27 /* ******************** Preprocessor Definitions ******************** */
29 &Scoped-define PROCEDURE-TYPE SmartBrowser
31 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
33 /* Name of first Frame and/or Browse and/or first Query */
34 &Scoped-define FRAME-NAME F-Main
35 &Scoped-define BROWSE-NAME br_table
37 /* Internal Tables (found by Frame, Query & Browse Queries) */
38 &Scoped-define INTERNAL-TABLES UsrDCDetail BankAccount Person Usr
40 /* Define KEY-PHRASE in case it is used by any query. */
41 &Scoped-define KEY-PHRASE TRUE
43 /* Definitions for BROWSE br_table */
44 &Scoped-define FIELDS-IN-QUERY-br_table UsrDCDetail.BankAccountCode ~
45 BankAccount.BankName Usr.UserName
46 &Scoped-define ENABLED-FIELDS-IN-QUERY-br_table UsrDCDetail.BankAccountCode ~
47 BankAccount.BankName Usr.UserName
48 &Scoped-define SELF-NAME br_table
49 &Scoped-define ENABLED-TABLES-IN-QUERY-br_table UsrDCDetail
50 &Scoped-define FIRST-ENABLED-TABLE-IN-QUERY-br_table UsrDCDetail
51 &Scoped-define OPEN-QUERY-br_table OPEN QUERY {&SELF-NAME} FOR EACH UsrDCDetail NO-LOCK, ~
52 FIRST BankAccount WHERE BankAccount.BankAccountCode = UsrDCDetail.BankAccountCode NO-LOCK, ~
53 FIRST Person WHERE Person.PersonCode = UsrDCDetail.PersonCode NO-LOCK, ~
54 FIRST Usr WHERE Usr.PersonCode = Person.PersonCode OUTER-JOIN ~{&SORTBY-PHRASE}.
55 /* FIRST Person WHERE Person.PersonCode = UsrDCDetail.PersonCode NO-LOCK, ~
56 FIRST Usr WHERE Usr.PersonCode = Person.PersonCode NO-LOCK ~{&SORTBY-PHRASE}. */
57 &Scoped-define TABLES-IN-QUERY-br_table UsrDCDetail BankAccount Person Usr
58 &Scoped-define FIRST-TABLE-IN-QUERY-br_table UsrDCDetail
61 /* Definitions for FRAME F-Main */
63 /* Standard List Definitions */
64 &Scoped-Define ENABLED-OBJECTS br_table
66 /* Custom List Definitions */
67 /* List-1,List-2,List-3,List-4,List-5,List-6 */
69 /* _UIB-PREPROCESSOR-BLOCK-END */
70 &ANALYZE-RESUME
73 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Foreign Keys" B-table-Win _INLINE
74 /* Actions: ? adm/support/keyedit.w ? ? ? */
75 /* STRUCTURED-DATA
76 <KEY-OBJECT>
77 &BROWSE-NAME
78 </KEY-OBJECT>
79 <FOREIGN-KEYS>
80 BankAccountCode||y|ttpl.BankAccount.BankAccountCode
81 </FOREIGN-KEYS>
82 <EXECUTING-CODE>
83 **************************
84 * Set attributes related to FOREIGN KEYS
86 RUN set-attribute-list (
87 'Keys-Accepted = ,
88 Keys-Supplied = "BankAccountCode"':U).
90 /* Tell the ADM to use the OPEN-QUERY-CASES. */
91 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
92 /**************************
93 </EXECUTING-CODE> */
94 /* _UIB-CODE-BLOCK-END */
95 &ANALYZE-RESUME
97 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _XFTR "Advanced Query Options" B-table-Win _INLINE
98 /* Actions: ? adm/support/advqedit.w ? ? ? */
99 /* STRUCTURED-DATA
100 <KEY-OBJECT>
101 &BROWSE-NAME
102 </KEY-OBJECT>
103 <SORTBY-OPTIONS>
104 </SORTBY-OPTIONS>
105 <SORTBY-RUN-CODE>
106 ************************
107 * Set attributes related to SORTBY-OPTIONS */
108 RUN set-attribute-list (
109 'SortBy-Options = ""':U).
110 /************************
111 </SORTBY-RUN-CODE>
112 <FILTER-ATTRIBUTES>
113 ************************
114 * Initialize Filter Attributes */
115 RUN set-attribute-list IN THIS-PROCEDURE ('
116 FilterBy-Case=Active':U).
118 /* This SmartObject is a valid Filter-Target. */
119 &IF '{&user-supported-links}':U ne '':U &THEN
120 &Scoped-define user-supported-links {&user-supported-links},Filter-Target
121 &ELSE
122 &Scoped-define user-supported-links Filter-Target
123 &ENDIF
124 /* Tell the ADM to use the OPEN-QUERY-CASES. */
125 &Scoped-define OPEN-QUERY-CASES RUN dispatch ('open-query-cases':U).
126 /************************
127 </FILTER-ATTRIBUTES> */
129 /* _UIB-CODE-BLOCK-END */
130 &ANALYZE-RESUME
133 /* *********************** Control Definitions ********************** */
136 /* Definitions of the field level widgets */
137 /* Query definitions */
138 &ANALYZE-SUSPEND
139 DEFINE QUERY br_table FOR
140 UsrDCDetail,
141 BankAccount,
142 Person,
143 Usr SCROLLING.
144 &ANALYZE-RESUME
146 /* Browse definitions */
147 DEFINE BROWSE br_table
148 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _DISPLAY-FIELDS br_table B-table-Win _FREEFORM
149 QUERY br_table NO-LOCK DISPLAY
150 UsrDCDetail.BankAccountCode COLUMN-LABEL "A/C" WIDTH 5
151 BankAccount.BankName LABEL "Bank Name"
152 Usr.UserName LABEL "User"
153 /* _UIB-CODE-BLOCK-END */
154 &ANALYZE-RESUME
155 WITH NO-ASSIGN SEPARATORS SIZE 60.43 BY 14.9
156 BGCOLOR 16 FONT 10.
159 /* ************************ Frame Definitions *********************** */
161 DEFINE FRAME F-Main
162 br_table AT ROW 1 COL 1
163 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
164 SIDE-LABELS NO-UNDERLINE THREE-D
165 AT COL 1 ROW 1 SCROLLABLE
166 BGCOLOR 8 FGCOLOR 0 FONT 10.
169 /* *********************** Procedure Settings ************************ */
171 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
172 /* Settings for THIS-PROCEDURE
173 Type: SmartBrowser
174 Allow: Basic,Browse
175 Frames: 1
176 Add Fields to: EXTERNAL-TABLES
177 Other Settings: PERSISTENT-ONLY COMPILE
180 /* This procedure should always be RUN PERSISTENT. Report the error, */
181 /* then cleanup and return. */
182 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
183 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
184 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
185 RETURN.
186 END.
188 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
190 /* ************************* Create Window ************************** */
192 &ANALYZE-SUSPEND _CREATE-WINDOW
193 /* DESIGN Window definition (used by the UIB)
194 CREATE WINDOW B-table-Win ASSIGN
195 HEIGHT = 15.75
196 WIDTH = 108.72.
197 /* END WINDOW DEFINITION */
199 &ANALYZE-RESUME
202 /* *************** Runtime Attributes and UIB Settings ************** */
204 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
205 /* SETTINGS FOR WINDOW B-table-Win
206 NOT-VISIBLE,,RUN-PERSISTENT */
207 /* SETTINGS FOR FRAME F-Main
208 NOT-VISIBLE Size-to-Fit */
209 /* BROWSE-TAB br_table 1 F-Main */
210 ASSIGN
211 FRAME F-Main:SCROLLABLE = FALSE
212 FRAME F-Main:HIDDEN = TRUE.
214 /* _RUN-TIME-ATTRIBUTES-END */
215 &ANALYZE-RESUME
218 /* Setting information for Queries and Browse Widgets fields */
220 &ANALYZE-SUSPEND _QUERY-BLOCK BROWSE br_table
221 /* Query rebuild information for BROWSE br_table
222 _START_FREEFORM
223 OPEN QUERY {&SELF-NAME} FOR EACH BankAccount WHERE (show-all OR BankAccount.Active) NO-LOCK
224 ~{&SORTBY-PHRASE}.
225 _END_FREEFORM
226 _Options = "NO-LOCK KEY-PHRASE SORTBY-PHRASE"
227 _Query is NOT OPENED
228 */ /* BROWSE br_table */
229 &ANALYZE-RESUME
231 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
232 /* Query rebuild information for FRAME F-Main
233 _Options = "NO-LOCK"
234 _Query is NOT OPENED
235 */ /* FRAME F-Main */
236 &ANALYZE-RESUME
241 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB B-table-Win
242 /* ************************* Included-Libraries *********************** */
244 {src/adm/method/browser.i}
245 {inc/method/m-drlvwr.i}
247 /* _UIB-CODE-BLOCK-END */
248 &ANALYZE-RESUME
253 /* ************************ Control Triggers ************************ */
255 &Scoped-define BROWSE-NAME br_table
256 &Scoped-define SELF-NAME br_table
257 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
258 ON ROW-ENTRY OF br_table IN FRAME F-Main
260 /* This code displays initial values for newly added or copied rows. */
261 {src/adm/template/brsentry.i}
262 END.
264 /* _UIB-CODE-BLOCK-END */
265 &ANALYZE-RESUME
268 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
269 ON ROW-LEAVE OF br_table IN FRAME F-Main
271 /* Do not disable this code or no updates will take place except
272 by pressing the Save button on an Update SmartPanel. */
273 {src/adm/template/brsleave.i}
274 END.
276 /* _UIB-CODE-BLOCK-END */
277 &ANALYZE-RESUME
280 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL br_table B-table-Win
281 ON VALUE-CHANGED OF br_table IN FRAME F-Main
283 /* This ADM trigger code must be preserved in order to notify other
284 objects when the browser's current row changes. */
285 {src/adm/template/brschnge.i}
287 END.
289 /* _UIB-CODE-BLOCK-END */
290 &ANALYZE-RESUME
293 &UNDEFINE SELF-NAME
295 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK B-table-Win
298 /* *************************** Main Block *************************** */
300 RUN set-attribute-list( 'FilterBy-Options = Active|All, FilterBy-Case = Active':U ).
302 /* _UIB-CODE-BLOCK-END */
303 &ANALYZE-RESUME
306 /* ********************** Internal Procedures *********************** */
308 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-open-query-cases B-table-Win adm/support/_adm-opn.p
309 PROCEDURE adm-open-query-cases :
310 /*------------------------------------------------------------------------------
311 Purpose: Opens different cases of the query based on attributes
312 such as the 'Key-Name', or 'SortBy-Case'
313 Parameters: <none>
314 ------------------------------------------------------------------------------*/
315 DEF VAR FilterBy-Case AS CHAR NO-UNDO.
317 /* Copy 'Filter-Attributes' into local variables. */
318 RUN get-attribute ('FilterBy-Case':U).
319 FilterBy-Case = RETURN-VALUE.
321 /* No Foreign keys are accepted by this SmartObject. */
323 {&OPEN-QUERY-{&BROWSE-NAME}}
325 END PROCEDURE.
327 /* _UIB-CODE-BLOCK-END */
328 &ANALYZE-RESUME
331 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available B-table-Win _ADM-ROW-AVAILABLE
332 PROCEDURE adm-row-available :
333 /*------------------------------------------------------------------------------
334 Purpose: Dispatched to this procedure when the Record-
335 Source has a new row available. This procedure
336 tries to get the new row (or foriegn keys) from
337 the Record-Source and process it.
338 Parameters: <none>
339 ------------------------------------------------------------------------------*/
341 /* Define variables needed by this internal procedure. */
342 {src/adm/template/row-head.i}
344 /* Process the newly available records (i.e. display fields,
345 open queries, and/or pass records on to any RECORD-TARGETS). */
346 {src/adm/template/row-end.i}
348 END PROCEDURE.
350 /* _UIB-CODE-BLOCK-END */
351 &ANALYZE-RESUME
354 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI B-table-Win _DEFAULT-DISABLE
355 PROCEDURE disable_UI :
356 /*------------------------------------------------------------------------------
357 Purpose: DISABLE the User Interface
358 Parameters: <none>
359 Notes: Here we clean-up the user-interface by deleting
360 dynamic widgets we have created and/or hide
361 frames. This procedure is usually called when
362 we are ready to "clean-up" after running.
363 ------------------------------------------------------------------------------*/
364 /* Hide all frames. */
365 HIDE FRAME F-Main.
366 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
367 END PROCEDURE.
369 /* _UIB-CODE-BLOCK-END */
370 &ANALYZE-RESUME
373 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-key B-table-Win adm/support/_key-snd.p
374 PROCEDURE send-key :
375 /*------------------------------------------------------------------------------
376 Purpose: Sends a requested KEY value back to the calling
377 SmartObject.
378 Parameters: <see adm/template/sndkytop.i>
379 ------------------------------------------------------------------------------*/
381 /* Define variables needed by this internal procedure. */
382 {src/adm/template/sndkytop.i}
384 /* Return the key value associated with each key case. */
385 {src/adm/template/sndkycas.i "BankAccountCode" "UsrDCDetail" "BankAccountCode"}
387 /* Close the CASE statement and end the procedure. */
388 {src/adm/template/sndkyend.i}
390 END PROCEDURE.
392 /* _UIB-CODE-BLOCK-END */
393 &ANALYZE-RESUME
396 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records B-table-Win _ADM-SEND-RECORDS
397 PROCEDURE send-records :
398 /*------------------------------------------------------------------------------
399 Purpose: Send record ROWID's for all tables used by
400 this file.
401 Parameters: see template/snd-head.i
402 ------------------------------------------------------------------------------*/
404 /* Define variables needed by this internal procedure. */
405 {src/adm/template/snd-head.i}
407 /* For each requested table, put it's ROWID in the output list. */
408 {src/adm/template/snd-list.i "UsrDCDetail"}
410 /* Deal with any unexpected table requests before closing. */
411 {src/adm/template/snd-end.i}
413 END PROCEDURE.
415 /* _UIB-CODE-BLOCK-END */
416 &ANALYZE-RESUME
419 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed B-table-Win
420 PROCEDURE state-changed :
421 /* -----------------------------------------------------------
422 Purpose:
423 Parameters: <none>
424 Notes:
425 -------------------------------------------------------------*/
426 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
427 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
429 CASE p-state:
430 /* Object instance CASEs can go here to replace standard behavior
431 or add new cases. */
432 {src/adm/template/bstates.i}
433 END CASE.
434 END PROCEDURE.
436 /* _UIB-CODE-BLOCK-END */
437 &ANALYZE-RESUME
440 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-FilterBy-Case B-table-Win
441 PROCEDURE use-FilterBy-Case :
442 /*------------------------------------------------------------------------------
443 Purpose:
444 ------------------------------------------------------------------------------*/
445 DEF INPUT PARAMETER new-case AS CHAR NO-UNDO.
446 show-all = (new-case = "All").
447 END PROCEDURE.
449 /* _UIB-CODE-BLOCK-END */
450 &ANALYZE-RESUME