Changes for Catalyst APMS. Added PDF checkboxes to screens the generate remittance...
[capital-apms-progress.git] / vwr / mnt / v-bnkact.w
blob8cb4dd514644b158f0ad0ac8c2ab7c492ff4cadd
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI
2 &ANALYZE-RESUME
3 /* Connected Databases
4 ttpl PROGRESS
5 */
6 &Scoped-define WINDOW-NAME CURRENT-WINDOW
7 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS V-table-Win
8 /*------------------------------------------------------------------------
9 ------------------------------------------------------------------------*/
10 CREATE WIDGET-POOL.
11 /* *************************** Definitions ************************** */
13 DEF VAR mode AS CHAR NO-UNDO.
14 {inc/topic/tpbnkact.i}
16 {inc/ofc-this.i}
17 {inc/ofc-set.i "BankAccount-Format" "bank-format"}
18 IF NOT AVAILABLE(OfficeSetting) THEN DO:
19 CASE Office.OfficeCode:
20 WHEN "AKLD" THEN bank-format = "99-9999-9999999-99X".
21 WHEN "SDNY" THEN bank-format = "999-999-9999999XXX".
22 OTHERWISE bank-format = "99-9999-9999999-99X".
23 END CASE.
24 END.
26 /* _UIB-CODE-BLOCK-END */
27 &ANALYZE-RESUME
30 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
32 /* ******************** Preprocessor Definitions ******************** */
34 &Scoped-define PROCEDURE-TYPE SmartViewer
36 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
38 /* Name of first Frame and/or Browse and/or first Query */
39 &Scoped-define FRAME-NAME F-Main
41 /* External Tables */
42 &Scoped-define EXTERNAL-TABLES BankAccount
43 &Scoped-define FIRST-EXTERNAL-TABLE BankAccount
46 /* Need to scope the external tables to this procedure */
47 DEFINE QUERY external_tables FOR BankAccount.
48 /* Standard List Definitions */
49 &Scoped-Define ENABLED-FIELDS BankAccount.BankAccountCode ~
50 BankAccount.Active BankAccount.CompanyCode BankAccount.AccountCode ~
51 BankAccount.BankName BankAccount.BankBranchName BankAccount.AccountName ~
52 BankAccount.BankAccount BankAccount.ChequeAccount
53 &Scoped-define FIELD-PAIRS~
54 ~{&FP1}BankAccountCode ~{&FP2}BankAccountCode ~{&FP3}~
55 ~{&FP1}CompanyCode ~{&FP2}CompanyCode ~{&FP3}~
56 ~{&FP1}AccountCode ~{&FP2}AccountCode ~{&FP3}~
57 ~{&FP1}BankName ~{&FP2}BankName ~{&FP3}~
58 ~{&FP1}BankBranchName ~{&FP2}BankBranchName ~{&FP3}~
59 ~{&FP1}BankAccount ~{&FP2}BankAccount ~{&FP3}
60 &Scoped-define ENABLED-TABLES BankAccount
61 &Scoped-define FIRST-ENABLED-TABLE BankAccount
62 &Scoped-Define ENABLED-OBJECTS RECT-2
63 &Scoped-Define DISPLAYED-FIELDS BankAccount.BankAccountCode ~
64 BankAccount.Active BankAccount.CompanyCode BankAccount.AccountCode ~
65 BankAccount.BankName BankAccount.BankBranchName BankAccount.AccountName ~
66 BankAccount.BankAccount BankAccount.ChequeAccount
67 &Scoped-Define DISPLAYED-OBJECTS fil_Company fil_Account
69 /* Custom List Definitions */
70 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
72 /* _UIB-PREPROCESSOR-BLOCK-END */
73 &ANALYZE-RESUME
77 /* *********************** Control Definitions ********************** */
80 /* Definitions of the field level widgets */
81 DEFINE VARIABLE fil_Account AS CHARACTER FORMAT "X(50)":U
82 VIEW-AS FILL-IN
83 SIZE 48.43 BY 1
84 FONT 11 NO-UNDO.
86 DEFINE VARIABLE fil_Company AS CHARACTER FORMAT "X(50)":U
87 VIEW-AS FILL-IN
88 SIZE 48.43 BY 1
89 FONT 11 NO-UNDO.
91 DEFINE RECTANGLE RECT-2
92 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
93 SIZE 72.29 BY 10.
96 /* ************************ Frame Definitions *********************** */
98 DEFINE FRAME F-Main
99 BankAccount.BankAccountCode AT ROW 1 COL 10.86 COLON-ALIGNED
100 LABEL "Bank A/C"
101 VIEW-AS FILL-IN
102 SIZE 5 BY 1
103 FONT 11
104 BankAccount.Active AT ROW 1 COL 63.72
105 VIEW-AS TOGGLE-BOX
106 SIZE 8.72 BY 1.05
107 BankAccount.CompanyCode AT ROW 2.5 COL 10.86 COLON-ALIGNED
108 VIEW-AS FILL-IN
109 SIZE 8.14 BY 1
110 FONT 11
111 fil_Company AT ROW 2.5 COL 22.29 COLON-ALIGNED NO-LABEL
112 BankAccount.AccountCode AT ROW 3.5 COL 10.86 COLON-ALIGNED
113 VIEW-AS FILL-IN
114 SIZE 8.14 BY 1
115 FONT 11
116 fil_Account AT ROW 3.5 COL 22.29 COLON-ALIGNED NO-LABEL
117 BankAccount.BankName AT ROW 5 COL 10.86 COLON-ALIGNED
118 VIEW-AS FILL-IN
119 SIZE 60 BY 1
120 FONT 11
121 BankAccount.BankBranchName AT ROW 6 COL 10.86 COLON-ALIGNED
122 VIEW-AS FILL-IN
123 SIZE 60 BY 1
124 FONT 11
125 BankAccount.AccountName AT ROW 7.5 COL 12.86 NO-LABEL
126 VIEW-AS EDITOR NO-WORD-WRAP
127 SIZE 60 BY 2.5
128 FONT 11
129 BankAccount.BankAccount AT ROW 10 COL 10.86 COLON-ALIGNED
130 LABEL "Account No" FORMAT "99-9999-9999999-999"
131 VIEW-AS FILL-IN
132 SIZE 20 BY 1
133 BankAccount.ChequeAccount AT ROW 10.05 COL 51.72
134 VIEW-AS TOGGLE-BOX
135 SIZE 21 BY .8
136 RECT-2 AT ROW 1 COL 1
137 "Account Name:" VIEW-AS TEXT
138 SIZE 10.86 BY 1 AT ROW 7.5 COL 1.86
139 FONT 10
140 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
141 SIDE-LABELS NO-UNDERLINE THREE-D
142 AT COL 1 ROW 1 SCROLLABLE
143 FONT 10.
146 /* *********************** Procedure Settings ************************ */
148 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
149 /* Settings for THIS-PROCEDURE
150 Type: SmartViewer
151 External Tables: TTPL.BankAccount
152 Allow: Basic,DB-Fields
153 Frames: 1
154 Add Fields to: EXTERNAL-TABLES
155 Other Settings: PERSISTENT-ONLY COMPILE
158 /* This procedure should always be RUN PERSISTENT. Report the error, */
159 /* then cleanup and return. */
160 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
161 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
162 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
163 RETURN.
164 END.
166 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
168 /* ************************* Create Window ************************** */
170 &ANALYZE-SUSPEND _CREATE-WINDOW
171 /* DESIGN Window definition (used by the UIB)
172 CREATE WINDOW V-table-Win ASSIGN
173 HEIGHT = 11.1
174 WIDTH = 85.
175 /* END WINDOW DEFINITION */
177 &ANALYZE-RESUME
180 /* *************** Runtime Attributes and UIB Settings ************** */
182 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
183 /* SETTINGS FOR WINDOW V-table-Win
184 VISIBLE,,RUN-PERSISTENT */
185 /* SETTINGS FOR FRAME F-Main
186 NOT-VISIBLE Size-to-Fit */
187 ASSIGN
188 FRAME F-Main:SCROLLABLE = FALSE
189 FRAME F-Main:HIDDEN = TRUE.
191 /* SETTINGS FOR EDITOR BankAccount.AccountName IN FRAME F-Main
192 EXP-LABEL */
193 /* SETTINGS FOR FILL-IN BankAccount.BankAccount IN FRAME F-Main
194 EXP-LABEL EXP-FORMAT */
195 /* SETTINGS FOR FILL-IN BankAccount.BankAccountCode IN FRAME F-Main
196 EXP-LABEL */
197 /* SETTINGS FOR FILL-IN fil_Account IN FRAME F-Main
198 NO-ENABLE */
199 /* SETTINGS FOR FILL-IN fil_Company IN FRAME F-Main
200 NO-ENABLE DEF-LABEL */
201 /* _RUN-TIME-ATTRIBUTES-END */
202 &ANALYZE-RESUME
205 /* Setting information for Queries and Browse Widgets fields */
207 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
208 /* Query rebuild information for FRAME F-Main
209 _Options = "NO-LOCK"
210 _Query is NOT OPENED
211 */ /* FRAME F-Main */
212 &ANALYZE-RESUME
217 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
218 /* ************************* Included-Libraries *********************** */
220 {src/adm/method/viewer.i}
221 {inc/method/m-mntvwr.i}
223 /* _UIB-CODE-BLOCK-END */
224 &ANALYZE-RESUME
229 /* ************************ Control Triggers ************************ */
231 &Scoped-define SELF-NAME BankAccount.AccountCode
232 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL BankAccount.AccountCode V-table-Win
233 ON LEAVE OF BankAccount.AccountCode IN FRAME F-Main /* GL Account */
235 {inc/selcde/cdcoa.i "fil_Account"}
236 END.
238 /* _UIB-CODE-BLOCK-END */
239 &ANALYZE-RESUME
242 &Scoped-define SELF-NAME BankAccount.CompanyCode
243 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL BankAccount.CompanyCode V-table-Win
244 ON LEAVE OF BankAccount.CompanyCode IN FRAME F-Main /* Company */
246 {inc/selcde/cdcmp.i "fil_Company"}
247 END.
249 /* _UIB-CODE-BLOCK-END */
250 &ANALYZE-RESUME
253 &Scoped-define SELF-NAME fil_Account
254 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Account V-table-Win
255 ON U1 OF fil_Account IN FRAME F-Main
257 {inc/selfil/sfcoa1.i "BankAccount" "AccountCode"}
258 END.
260 /* _UIB-CODE-BLOCK-END */
261 &ANALYZE-RESUME
264 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Account V-table-Win
265 ON U2 OF fil_Account IN FRAME F-Main
267 {inc/selfil/sfcoa2.i "BankAccount" "AccountCode"}
268 END.
270 /* _UIB-CODE-BLOCK-END */
271 &ANALYZE-RESUME
274 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Account V-table-Win
275 ON U3 OF fil_Account IN FRAME F-Main
277 {inc/selfil/sfcoa3.i "BankAccount" "AccountCode"}
278 END.
280 /* _UIB-CODE-BLOCK-END */
281 &ANALYZE-RESUME
284 &Scoped-define SELF-NAME fil_Company
285 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Company V-table-Win
286 ON U1 OF fil_Company IN FRAME F-Main
288 {inc/selfil/sfcmp1.i "BankAccount" "CompanyCode"}
289 END.
291 /* _UIB-CODE-BLOCK-END */
292 &ANALYZE-RESUME
295 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Company V-table-Win
296 ON U2 OF fil_Company IN FRAME F-Main
298 {inc/selfil/sfcmp2.i "BankAccount" "CompanyCode"}
299 END.
301 /* _UIB-CODE-BLOCK-END */
302 &ANALYZE-RESUME
305 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_Company V-table-Win
306 ON U3 OF fil_Company IN FRAME F-Main
308 {inc/selfil/sfcmp3.i "BankAccount" "CompanyCode"}
309 END.
311 /* _UIB-CODE-BLOCK-END */
312 &ANALYZE-RESUME
315 &UNDEFINE SELF-NAME
317 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
320 /* *************************** Main Block *************************** */
323 BankAccount.BankAccount:FORMAT = bank-format.
325 /* _UIB-CODE-BLOCK-END */
326 &ANALYZE-RESUME
329 /* ********************** Internal Procedures *********************** */
331 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-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 /* Create a list of all the tables that we need to get. */
345 {src/adm/template/row-list.i "BankAccount"}
347 /* Get the record ROWID's from the RECORD-SOURCE. */
348 {src/adm/template/row-get.i}
350 /* FIND each record specified by the RECORD-SOURCE. */
351 {src/adm/template/row-find.i "BankAccount"}
353 /* Process the newly available records (i.e. display fields,
354 open queries, and/or pass records on to any RECORD-TARGETS). */
355 {src/adm/template/row-end.i}
357 END PROCEDURE.
359 /* _UIB-CODE-BLOCK-END */
360 &ANALYZE-RESUME
363 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
364 PROCEDURE cancel-changes :
365 /*------------------------------------------------------------------------------
366 Purpose:
367 Parameters: <none>
368 Notes:
369 ------------------------------------------------------------------------------*/
371 RUN notify( 'hide, CONTAINER-SOURCE':U ).
372 IF mode = "Add" THEN RUN delete-bank-account.
373 RUN check-modified( "CLEAR" ).
374 RUN dispatch( 'exit':U ).
376 END PROCEDURE.
378 /* _UIB-CODE-BLOCK-END */
379 &ANALYZE-RESUME
382 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
383 PROCEDURE confirm-changes :
384 /*------------------------------------------------------------------------------
385 Purpose:
386 Parameters: <none>
387 Notes:
388 ------------------------------------------------------------------------------*/
390 RUN notify( 'hide, CONTAINER-SOURCE':U ).
391 IF mode = "Add" THEN RUN notify( 'open-query,record-source':U ).
392 RUN dispatch( 'update-record':U ).
393 RUN dispatch( 'exit':U ).
395 END PROCEDURE.
397 /* _UIB-CODE-BLOCK-END */
398 &ANALYZE-RESUME
401 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE delete-bank-account V-table-Win
402 PROCEDURE delete-bank-account :
403 /*------------------------------------------------------------------------------
404 Purpose:
405 Parameters: <none>
406 Notes:
407 ------------------------------------------------------------------------------*/
409 FIND CURRENT BankAccount EXCLUSIVE-LOCK.
410 DELETE BankAccount.
412 END PROCEDURE.
414 /* _UIB-CODE-BLOCK-END */
415 &ANALYZE-RESUME
418 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
419 PROCEDURE disable_UI :
420 /*------------------------------------------------------------------------------
421 Purpose: DISABLE the User Interface
422 Parameters: <none>
423 Notes: Here we clean-up the user-interface by deleting
424 dynamic widgets we have created and/or hide
425 frames. This procedure is usually called when
426 we are ready to "clean-up" after running.
427 ------------------------------------------------------------------------------*/
428 /* Hide all frames. */
429 HIDE FRAME F-Main.
430 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
431 END PROCEDURE.
433 /* _UIB-CODE-BLOCK-END */
434 &ANALYZE-RESUME
437 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
438 PROCEDURE inst-initialize :
439 /*------------------------------------------------------------------------------
440 Purpose:
441 Parameters: <none>
442 Notes:
443 ------------------------------------------------------------------------------*/
445 RUN get-attribute( 'mode':U ).
446 mode = RETURN-VALUE.
448 IF mode = "Add" THEN
450 have-records = yes.
451 RUN dispatch( 'add-record':U ).
452 END.
453 ELSE RUN dispatch( 'enable-fields':U ).
455 END PROCEDURE.
457 /* _UIB-CODE-BLOCK-END */
458 &ANALYZE-RESUME
461 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE override-add-record V-table-Win
462 PROCEDURE override-add-record :
463 /*------------------------------------------------------------------------------
464 Purpose:
465 Parameters: <none>
466 Notes:
467 ------------------------------------------------------------------------------*/
469 CREATE BankAccount.
470 ASSIGN BankAccount.BankAccount = FILL( "0", 16 ).
471 RUN dispatch( 'display-fields':U ).
472 RUN dispatch( 'enable-fields':U ).
473 RUN dispatch( 'update-record':U ).
475 CURRENT-WINDOW:TITLE = "Adding a new Bank Account".
477 END PROCEDURE.
479 /* _UIB-CODE-BLOCK-END */
480 &ANALYZE-RESUME
483 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
484 PROCEDURE pre-destroy :
485 /*------------------------------------------------------------------------------
486 Purpose:
487 ------------------------------------------------------------------------------*/
489 IF LAST-EVENT:FUNCTION = 'WINDOW-CLOSE':U THEN RUN cancel-changes.
491 END PROCEDURE.
493 /* _UIB-CODE-BLOCK-END */
494 &ANALYZE-RESUME
497 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
498 PROCEDURE send-records :
499 /*------------------------------------------------------------------------------
500 Purpose: Send record ROWID's for all tables used by
501 this file.
502 Parameters: see template/snd-head.i
503 ------------------------------------------------------------------------------*/
505 /* Define variables needed by this internal procedure. */
506 {src/adm/template/snd-head.i}
508 /* For each requested table, put it's ROWID in the output list. */
509 {src/adm/template/snd-list.i "BankAccount"}
511 /* Deal with any unexpected table requests before closing. */
512 {src/adm/template/snd-end.i}
514 END PROCEDURE.
516 /* _UIB-CODE-BLOCK-END */
517 &ANALYZE-RESUME
520 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
521 PROCEDURE state-changed :
522 /* -----------------------------------------------------------
523 Purpose:
524 Parameters: <none>
525 Notes:
526 -------------------------------------------------------------*/
527 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
528 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
530 CASE p-state:
531 /* Object instance CASEs can go here to replace standard behavior
532 or add new cases. */
533 {src/adm/template/vstates.i}
534 END CASE.
535 END PROCEDURE.
537 /* _UIB-CODE-BLOCK-END */
538 &ANALYZE-RESUME
541 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-mode V-table-Win
542 PROCEDURE use-mode :
543 /*------------------------------------------------------------------------------
544 Purpose:
545 ------------------------------------------------------------------------------*/
546 DEF INPUT PARAMETER new-mode AS CHAR NO-UNDO.
547 mode = new-mode.
548 END PROCEDURE.
550 /* _UIB-CODE-BLOCK-END */
551 &ANALYZE-RESUME