Really, this should be it, for the passing income.
[capital-apms-progress.git] / vwr / mnt / v-cheque.w
blob752b46023573e07529382aeda2f31c98929de10f
1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12 GUI ADM1
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 File:
10 Description:
11 ------------------------------------------------------------------------*/
13 CREATE WIDGET-POOL.
15 /* *************************** Definitions ************************** */
16 DEF VAR key-name AS CHAR NO-UNDO.
17 DEF VAR key-value AS CHAR NO-UNDO.
18 DEF VAR bank-account AS CHAR NO-UNDO.
19 DEF VAR mode AS CHAR NO-UNDO.
21 {inc/ofc-this.i}
22 {inc/ofc-acct.i "CREDITORS" "sundry-creditors"}
24 /* _UIB-CODE-BLOCK-END */
25 &ANALYZE-RESUME
28 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
30 /* ******************** Preprocessor Definitions ******************** */
32 &Scoped-define PROCEDURE-TYPE SmartViewer
33 &Scoped-define DB-AWARE no
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
40 /* External Tables */
41 &Scoped-define EXTERNAL-TABLES Cheque
42 &Scoped-define FIRST-EXTERNAL-TABLE Cheque
45 /* Need to scope the external tables to this procedure */
46 DEFINE QUERY external_tables FOR Cheque.
47 /* Standard List Definitions */
48 &Scoped-Define ENABLED-FIELDS Cheque.DatePresented
49 &Scoped-define ENABLED-TABLES Cheque
50 &Scoped-define FIRST-ENABLED-TABLE Cheque
51 &Scoped-define DISPLAYED-TABLES Cheque
52 &Scoped-define FIRST-DISPLAYED-TABLE Cheque
53 &Scoped-Define ENABLED-OBJECTS RECT-1
54 &Scoped-Define DISPLAYED-FIELDS Cheque.CreditorCode Cheque.PayeeName ~
55 Cheque.BankAccountCode Cheque.ChequeNo Cheque.Date Cheque.BatchCode ~
56 Cheque.DatePresented Cheque.DocumentCode Cheque.Cancelled Cheque.Amount
57 &Scoped-Define DISPLAYED-OBJECTS fil_CreditorName fil_BankDescription
59 /* Custom List Definitions */
60 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
62 /* _UIB-PREPROCESSOR-BLOCK-END */
63 &ANALYZE-RESUME
67 /* *********************** Control Definitions ********************** */
70 /* Definitions of the field level widgets */
71 DEFINE VARIABLE fil_BankDescription AS CHARACTER FORMAT "X(256)":U
72 VIEW-AS FILL-IN
73 SIZE 61.14 BY 1
74 BGCOLOR 16 NO-UNDO.
76 DEFINE VARIABLE fil_CreditorName AS CHARACTER FORMAT "X(256)":U
77 VIEW-AS FILL-IN
78 SIZE 61.14 BY 1
79 BGCOLOR 16 NO-UNDO.
81 DEFINE RECTANGLE RECT-1
82 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
83 SIZE 80.57 BY 6.6.
86 /* ************************ Frame Definitions *********************** */
88 DEFINE FRAME F-Main
89 Cheque.CreditorCode AT ROW 1.2 COL 11 COLON-ALIGNED
90 VIEW-AS FILL-IN
91 SIZE 6.43 BY 1
92 BGCOLOR 16
93 fil_CreditorName AT ROW 1.2 COL 17.86 COLON-ALIGNED NO-LABEL
94 Cheque.PayeeName AT ROW 2.2 COL 11 COLON-ALIGNED
95 LABEL "Payee"
96 VIEW-AS FILL-IN
97 SIZE 68 BY 1
98 BGCOLOR 16
99 Cheque.BankAccountCode AT ROW 3.2 COL 11 COLON-ALIGNED
100 VIEW-AS FILL-IN
101 SIZE 6.43 BY 1
102 BGCOLOR 16
103 fil_BankDescription AT ROW 3.2 COL 17.86 COLON-ALIGNED NO-LABEL
104 Cheque.ChequeNo AT ROW 4.2 COL 11 COLON-ALIGNED
105 VIEW-AS FILL-IN
106 SIZE 7.43 BY 1
107 BGCOLOR 16
108 Cheque.Date AT ROW 4.2 COL 36.72 COLON-ALIGNED
109 LABEL "Cheque Date"
110 VIEW-AS FILL-IN
111 SIZE 11.43 BY 1
112 BGCOLOR 16
113 Cheque.BatchCode AT ROW 4.2 COL 80.01 RIGHT-ALIGNED
114 LABEL "Batch" FORMAT "99999"
115 VIEW-AS FILL-IN
116 SIZE 6.29 BY .9
117 BGCOLOR 16
118 Cheque.DatePresented AT ROW 5.2 COL 36.72 COLON-ALIGNED
119 LABEL "Presented On"
120 VIEW-AS FILL-IN
121 SIZE 11.43 BY 1
122 BGCOLOR 16
123 Cheque.DocumentCode AT ROW 5.2 COL 72.72 COLON-ALIGNED
124 LABEL "Document"
125 VIEW-AS FILL-IN
126 SIZE 6.29 BY .9
127 BGCOLOR 16
128 Cheque.Cancelled AT ROW 6.4 COL 11 COLON-ALIGNED
129 VIEW-AS FILL-IN
130 SIZE 4.43 BY 1
131 BGCOLOR 16
132 Cheque.Amount AT ROW 6.4 COL 61.86 COLON-ALIGNED FORMAT "ZZZ,ZZZ,ZZ9.99"
133 VIEW-AS FILL-IN
134 SIZE 17.14 BY 1
135 BGCOLOR 16
136 RECT-1 AT ROW 1 COL 1
137 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
138 SIDE-LABELS NO-UNDERLINE THREE-D
139 AT COL 1 ROW 1 SCROLLABLE .
142 /* *********************** Procedure Settings ************************ */
144 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
145 /* Settings for THIS-PROCEDURE
146 Type: SmartViewer
147 External Tables: ttpl.Cheque
148 Allow: Basic,DB-Fields
149 Frames: 1
150 Add Fields to: EXTERNAL-TABLES
151 Other Settings: PERSISTENT-ONLY COMPILE
154 /* This procedure should always be RUN PERSISTENT. Report the error, */
155 /* then cleanup and return. */
156 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
157 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
158 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
159 RETURN.
160 END.
162 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
164 /* ************************* Create Window ************************** */
166 &ANALYZE-SUSPEND _CREATE-WINDOW
167 /* DESIGN Window definition (used by the UIB)
168 CREATE WINDOW V-table-Win ASSIGN
169 HEIGHT = 11.65
170 WIDTH = 98.43.
171 /* END WINDOW DEFINITION */
173 &ANALYZE-RESUME
175 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
176 /* ************************* Included-Libraries *********************** */
178 {src/adm/method/viewer.i}
179 {inc/method/m-drlvwr.i}
181 /* _UIB-CODE-BLOCK-END */
182 &ANALYZE-RESUME
187 /* *********** Runtime Attributes and AppBuilder Settings *********** */
189 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
190 /* SETTINGS FOR WINDOW V-table-Win
191 VISIBLE,,RUN-PERSISTENT */
192 /* SETTINGS FOR FRAME F-Main
193 NOT-VISIBLE Size-to-Fit */
194 ASSIGN
195 FRAME F-Main:SCROLLABLE = FALSE
196 FRAME F-Main:HIDDEN = TRUE.
198 /* SETTINGS FOR FILL-IN Cheque.Amount IN FRAME F-Main
199 NO-ENABLE EXP-FORMAT */
200 /* SETTINGS FOR FILL-IN Cheque.BankAccountCode IN FRAME F-Main
201 NO-ENABLE */
202 /* SETTINGS FOR FILL-IN Cheque.BatchCode IN FRAME F-Main
203 NO-ENABLE ALIGN-R EXP-LABEL EXP-FORMAT */
204 /* SETTINGS FOR FILL-IN Cheque.Cancelled IN FRAME F-Main
205 NO-ENABLE */
206 /* SETTINGS FOR FILL-IN Cheque.ChequeNo IN FRAME F-Main
207 NO-ENABLE */
208 /* SETTINGS FOR FILL-IN Cheque.CreditorCode IN FRAME F-Main
209 NO-ENABLE */
210 /* SETTINGS FOR FILL-IN Cheque.Date IN FRAME F-Main
211 NO-ENABLE EXP-LABEL */
212 /* SETTINGS FOR FILL-IN Cheque.DatePresented IN FRAME F-Main
213 EXP-LABEL */
214 /* SETTINGS FOR FILL-IN Cheque.DocumentCode IN FRAME F-Main
215 NO-ENABLE EXP-LABEL */
216 /* SETTINGS FOR FILL-IN fil_BankDescription IN FRAME F-Main
217 NO-ENABLE */
218 /* SETTINGS FOR FILL-IN fil_CreditorName IN FRAME F-Main
219 NO-ENABLE */
220 /* SETTINGS FOR FILL-IN Cheque.PayeeName IN FRAME F-Main
221 NO-ENABLE EXP-LABEL */
222 /* _RUN-TIME-ATTRIBUTES-END */
223 &ANALYZE-RESUME
226 /* Setting information for Queries and Browse Widgets fields */
228 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
229 /* Query rebuild information for FRAME F-Main
230 _Options = "NO-LOCK"
231 _Query is NOT OPENED
232 */ /* FRAME F-Main */
233 &ANALYZE-RESUME
239 /* ************************ Control Triggers ************************ */
241 &Scoped-define SELF-NAME Cheque.DatePresented
242 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Cheque.DatePresented V-table-Win
243 ON ANY-KEY OF Cheque.DatePresented IN FRAME F-Main /* Presented On */
245 IF LAST-EVENT:LABEL = "DEL" THEN DO:
246 SELF:SCREEN-VALUE = "".
247 {&SELF-NAME} = ?.
248 RETURN NO-APPLY.
249 END.
250 END.
252 /* _UIB-CODE-BLOCK-END */
253 &ANALYZE-RESUME
256 &UNDEFINE SELF-NAME
258 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
261 /* *************************** Main Block *************************** */
263 /* _UIB-CODE-BLOCK-END */
264 &ANALYZE-RESUME
267 /* ********************** Internal Procedures *********************** */
269 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
270 PROCEDURE adm-row-available :
271 /*------------------------------------------------------------------------------
272 Purpose: Dispatched to this procedure when the Record-
273 Source has a new row available. This procedure
274 tries to get the new row (or foriegn keys) from
275 the Record-Source and process it.
276 Parameters: <none>
277 ------------------------------------------------------------------------------*/
279 /* Define variables needed by this internal procedure. */
280 {src/adm/template/row-head.i}
282 /* Create a list of all the tables that we need to get. */
283 {src/adm/template/row-list.i "Cheque"}
285 /* Get the record ROWID's from the RECORD-SOURCE. */
286 {src/adm/template/row-get.i}
288 /* FIND each record specified by the RECORD-SOURCE. */
289 {src/adm/template/row-find.i "Cheque"}
291 /* Process the newly available records (i.e. display fields,
292 open queries, and/or pass records on to any RECORD-TARGETS). */
293 {src/adm/template/row-end.i}
295 END PROCEDURE.
297 /* _UIB-CODE-BLOCK-END */
298 &ANALYZE-RESUME
300 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
301 PROCEDURE cancel-changes :
302 /*------------------------------------------------------------------------------
303 Purpose:
304 ------------------------------------------------------------------------------*/
305 RUN check-modified( 'clear':U ).
306 RUN dispatch( 'exit':U ).
307 END PROCEDURE.
309 /* _UIB-CODE-BLOCK-END */
310 &ANALYZE-RESUME
312 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-cheque V-table-Win
313 PROCEDURE cancel-cheque :
314 /*------------------------------------------------------------------------------
315 Purpose: Cancel the cheque.
316 ------------------------------------------------------------------------------*/
317 DEF VAR yes-do-it AS LOGICAL INITIAL no NO-UNDO.
318 DEF VAR cheque-month LIKE Month.MonthCode INITIAL ? NO-UNDO.
319 DEF VAR closing-group LIKE AcctTran.ClosingGroup INITIAL ? NO-UNDO.
320 DEF VAR docref-code AS INT NO-UNDO.
322 IF Cheque.Cancelled = Yes THEN DO:
323 MESSAGE "The cheque is already cancelled!"
324 VIEW-AS ALERT-BOX ERROR TITLE "Cheque Already Cancelled".
325 RETURN.
326 END.
328 IF Cheque.DatePresented <> ? THEN DO:
329 MESSAGE "The cheque cannot be cancelled as it has already been presented!"
330 VIEW-AS ALERT-BOX ERROR TITLE "Cheque Already Presented".
331 RETURN.
332 END.
334 MESSAGE "Are you sure you want to cancel this cheque?"
335 VIEW-AS ALERT-BOX QUESTION BUTTONS OK-CANCEL TITLE "Cancel Cheque"
336 UPDATE yes-do-it.
338 IF NOT yes-do-it THEN RETURN.
340 DEF VAR cheque-string AS CHAR NO-UNDO.
341 cheque-string = TRIM( STRING( Cheque.ChequeNo, ">>>>>>>9")).
343 FIND Document WHERE Document.BatchCode = Cheque.BatchCode
344 AND Document.DocumentCode = Cheque.DocumentCode
345 NO-LOCK NO-ERROR.
347 IF AVAILABLE(Document) THEN ASSIGN docref-code = INTEGER(Document.Reference) NO-ERROR.
348 IF AVAILABLE(Document) AND docref-code = Cheque.ChequeNo THEN DO:
349 FIND FIRST AcctTran OF Document NO-LOCK NO-ERROR.
350 cheque-month = AcctTran.MonthCode.
351 END.
352 ELSE DO:
353 FOR EACH AcctTran NO-LOCK WHERE AcctTran.EntityType = "C"
354 AND AcctTran.EntityCode = Cheque.CreditorCode
355 AND AcctTran.AccountCode = sundry-creditors,
356 FIRST Document OF AcctTran NO-LOCK WHERE Document.Reference = cheque-string:
357 cheque-month = AcctTran.MonthCode.
358 LEAVE.
359 END.
360 END.
362 FIND FIRST BankAccount WHERE BankAccount.BankAccountCode = Cheque.BankAccountCode NO-LOCK.
364 cancel-block:
365 DO TRANSACTION:
367 FIND CURRENT Cheque EXCLUSIVE-LOCK.
368 Cheque.Cancelled = yes.
370 CREATE NewBatch.
371 ASSIGN NewBatch.BatchType = "NORM"
372 NewBatch.Description = "Cancel cheque " + cheque-string.
374 CREATE NewDocument.
375 ASSIGN NewDocument.BatchCode = NewBatch.BatchCode
376 NewDocument.DocumentCode = 1
377 NewDocument.Reference = cheque-string
378 NewDocument.Description = "CANCEL CHEQUE " + cheque-string.
380 /* Credit the creditor to reverse payment */
381 RUN create-trans( NewBatch.BatchCode, "C", Cheque.CreditorCode, sundry-creditors,
382 Cheque.Date, - Cheque.Amount, "" ).
384 /* debit the bank account to reverse payment */
385 RUN create-trans( NewBatch.BatchCode, "L", BankAccount.CompanyCode, BankAccount.AccountCode,
386 Cheque.Date, Cheque.Amount, "" ).
388 /* unapprove and unallocate all the vouchers */
389 FIND FIRST Voucher WHERE Voucher.ChequeNo = Cheque.ChequeNo NO-LOCK NO-ERROR.
390 IF AVAILABLE(Voucher) AND Voucher.BatchCode > 0 AND Voucher.DocumentCode > 0 THEN
391 FIND FIRST AcctTran WHERE AcctTran.BatchCode = Voucher.BatchCode
392 AND AcctTran.DocumentCode = Voucher.DocumentCode
393 AND AcctTran.ConsequenceOf = 0 NO-LOCK NO-ERROR.
394 IF NOT (AVAILABLE(Voucher) AND Voucher.BatchCode > 0 AND Voucher.DocumentCode > 0 AND AVAILABLE(AcctTran)) THEN DO:
395 yes-do-it = No.
396 MESSAGE "No transactions for vouchers related to the cheque can be found!" SKIP(2)
397 "The voucher batch may not yet have been updated yet. If you " SKIP
398 "continue, you will need to reverse the voucher allocation manually." SKIP(2)
399 "Are you sure you still want to cancel this cheque?"
400 VIEW-AS ALERT-BOX QUESTION BUTTONS OK-CANCEL TITLE "Allocations for Vouchers of Cheque could not be found!"
401 UPDATE yes-do-it.
403 IF NOT yes-do-it THEN
404 UNDO cancel-block, LEAVE cancel-block.
405 END.
406 FOR EACH Voucher WHERE Voucher.ChequeNo = Cheque.ChequeNo:
407 IF Voucher.BatchCode > 0 AND Voucher.DocumentCode > 0 THEN DO:
408 FOR EACH AcctTran WHERE AcctTran.BatchCode = Voucher.BatchCode
409 AND AcctTran.DocumentCode = Voucher.DocumentCode
410 AND AcctTran.ConsequenceOf = 0
411 NO-LOCK:
412 RUN create-trans( NewBatch.BatchCode, AcctTran.EntityType, AcctTran.EntityCode, AcctTran.AccountCode,
413 AcctTran.Date, - AcctTran.Amount, "CANCEL CHEQUE - " + Cheque.PayeeName ).
414 END.
415 END.
416 ASSIGN Voucher.VoucherStatus = "C"
417 Voucher.ChequeNo = ?
418 Voucher.BatchCode = ?
419 Voucher.DocumentCode = ?
421 END.
422 END.
423 RUN dispatch( 'row-available':U ).
425 END PROCEDURE.
427 /* _UIB-CODE-BLOCK-END */
428 &ANALYZE-RESUME
430 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
431 PROCEDURE confirm-changes :
432 /*------------------------------------------------------------------------------
433 Purpose:
434 ------------------------------------------------------------------------------*/
435 RUN dispatch( 'update-record':U ).
436 RUN dispatch( 'exit':U ).
437 END PROCEDURE.
439 /* _UIB-CODE-BLOCK-END */
440 &ANALYZE-RESUME
442 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE create-trans V-table-Win
443 PROCEDURE create-trans :
444 /*------------------------------------------------------------------------------
445 Purpose:
446 ------------------------------------------------------------------------------*/
447 DEF INPUT PARAMETER bcode AS INTEGER NO-UNDO.
448 DEF INPUT PARAMETER et AS CHAR NO-UNDO.
449 DEF INPUT PARAMETER ec AS INT NO-UNDO.
450 DEF INPUT PARAMETER ac AS DEC NO-UNDO.
451 DEF INPUT PARAMETER dt AS DATE NO-UNDO.
452 DEF INPUT PARAMETER amt AS DEC NO-UNDO.
453 DEF INPUT PARAMETER dsc AS CHAR NO-UNDO.
455 CREATE NewAcctTrans.
456 ASSIGN NewAcctTrans.BatchCode = bcode
457 NewAcctTrans.DocumentCode = 1
458 NewAcctTrans.Reference = (IF AVAILABLE(Voucher) THEN "VCHR" + STRING(Voucher.VoucherSeq) ELSE "")
459 NewAcctTrans.EntityType = et
460 NewAcctTrans.EntityCode = ec
461 NewAcctTrans.AccountCode = ac
462 NewAcctTrans.Date = dt
463 NewAcctTrans.Amount = amt
464 NewAcctTrans.Description = dsc.
466 END PROCEDURE.
468 /* _UIB-CODE-BLOCK-END */
469 &ANALYZE-RESUME
471 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
472 PROCEDURE disable_UI :
473 /*------------------------------------------------------------------------------
474 Purpose: DISABLE the User Interface
475 Parameters: <none>
476 Notes: Here we clean-up the user-interface by deleting
477 dynamic widgets we have created and/or hide
478 frames. This procedure is usually called when
479 we are ready to "clean-up" after running.
480 ------------------------------------------------------------------------------*/
481 /* Hide all frames. */
482 HIDE FRAME F-Main.
483 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
484 END PROCEDURE.
486 /* _UIB-CODE-BLOCK-END */
487 &ANALYZE-RESUME
489 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
490 PROCEDURE inst-enable-fields :
491 /*------------------------------------------------------------------------------
492 Purpose:
493 ------------------------------------------------------------------------------*/
494 DO WITH FRAME {&FRAME-NAME}:
495 IF mode = "View" OR Cheque.Cancelled THEN Cheque.DatePresented:SENSITIVE = No.
496 END.
497 END PROCEDURE.
499 /* _UIB-CODE-BLOCK-END */
500 &ANALYZE-RESUME
502 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE next-cheque V-table-Win
503 PROCEDURE next-cheque :
504 /*------------------------------------------------------------------------------
505 Purpose:
506 ------------------------------------------------------------------------------*/
507 RUN dispatch( 'update-record':U ).
508 RUN notify( 'next-record,record-source':U ).
509 END PROCEDURE.
511 /* _UIB-CODE-BLOCK-END */
512 &ANALYZE-RESUME
514 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE post-row-available V-table-Win
515 PROCEDURE post-row-available :
516 /*------------------------------------------------------------------------------
517 Purpose:
518 ------------------------------------------------------------------------------*/
519 IF NOT AVAILABLE(Cheque) THEN RETURN.
521 FIND Creditor WHERE Creditor.CreditorCode = Cheque.CreditorCode NO-LOCK NO-ERROR.
522 IF AVAILABLE(Creditor) THEN fil_CreditorName = Creditor.Name.
524 RUN refresh-window-title IN sys-mgr ( THIS-PROCEDURE ).
526 FIND BankAccount WHERE BankAccount.BankAccountCode = Cheque.BankAccountCode NO-LOCK NO-ERROR.
527 IF AVAILABLE(BankAccount) THEN
528 fil_BankDescription = STRING( BankAccount.CompanyCode, "999") + "-" + STRING( BankAccount.AccountCode, "9999.99") + " - "
529 + BankAccount.BankName + ", " + BankAccount.BankBranchName .
531 DISPLAY fil_CreditorName fil_BankDescription WITH FRAME {&FRAME-NAME}.
532 RUN dispatch( 'enable-fields':U ).
534 END PROCEDURE.
536 /* _UIB-CODE-BLOCK-END */
537 &ANALYZE-RESUME
539 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-row-available V-table-Win
540 PROCEDURE pre-row-available :
541 /*------------------------------------------------------------------------------
542 Purpose:
543 ------------------------------------------------------------------------------*/
544 have-records = no.
545 END PROCEDURE.
547 /* _UIB-CODE-BLOCK-END */
548 &ANALYZE-RESUME
550 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE present-cheque V-table-Win
551 PROCEDURE present-cheque :
552 /*------------------------------------------------------------------------------
553 Purpose: Mark the cheque as presented
554 ------------------------------------------------------------------------------*/
555 ENABLE Cheque.DatePresented WITH FRAME {&FRAME-NAME}.
556 APPLY "ENTRY":U TO Cheque.DatePresented.
557 END PROCEDURE.
559 /* _UIB-CODE-BLOCK-END */
560 &ANALYZE-RESUME
562 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE previous-cheque V-table-Win
563 PROCEDURE previous-cheque :
564 /*------------------------------------------------------------------------------
565 Purpose:
566 ------------------------------------------------------------------------------*/
567 RUN dispatch( 'update-record':U ).
568 RUN notify( 'prev-record,record-source':U ).
569 END PROCEDURE.
571 /* _UIB-CODE-BLOCK-END */
572 &ANALYZE-RESUME
574 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
575 PROCEDURE send-records :
576 /*------------------------------------------------------------------------------
577 Purpose: Send record ROWID's for all tables used by
578 this file.
579 Parameters: see template/snd-head.i
580 ------------------------------------------------------------------------------*/
582 /* Define variables needed by this internal procedure. */
583 {src/adm/template/snd-head.i}
585 /* For each requested table, put it's ROWID in the output list. */
586 {src/adm/template/snd-list.i "Cheque"}
588 /* Deal with any unexpected table requests before closing. */
589 {src/adm/template/snd-end.i}
591 END PROCEDURE.
593 /* _UIB-CODE-BLOCK-END */
594 &ANALYZE-RESUME
596 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
597 PROCEDURE state-changed :
598 /* -----------------------------------------------------------
599 Purpose:
600 Parameters: <none>
601 Notes:
602 -------------------------------------------------------------*/
603 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
604 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
606 CASE p-state:
607 /* Object instance CASEs can go here to replace standard behavior
608 or add new cases. */
609 {src/adm/template/vstates.i}
610 END CASE.
611 END PROCEDURE.
613 /* _UIB-CODE-BLOCK-END */
614 &ANALYZE-RESUME
616 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Name V-table-Win
617 PROCEDURE use-Key-Name :
618 /*------------------------------------------------------------------------------
619 Purpose:
620 ------------------------------------------------------------------------------*/
621 DEF INPUT PARAMETER new-name AS CHAR NO-UNDO.
622 key-name = new-name.
623 END PROCEDURE.
625 /* _UIB-CODE-BLOCK-END */
626 &ANALYZE-RESUME
628 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Key-Value V-table-Win
629 PROCEDURE use-Key-Value :
630 /*------------------------------------------------------------------------------
631 Purpose:
632 ------------------------------------------------------------------------------*/
633 DEF INPUT PARAMETER new-value AS CHAR NO-UNDO.
635 key-value = new-value.
637 IF key-name = "ChequeNo" THEN DO:
638 bank-account = find-parent-key( "BankAccountCode" ).
639 FIND Cheque WHERE Cheque.BankAccountCode = bank-account
640 AND Cheque.ChequeNo = INT(key-value)
641 NO-LOCK NO-ERROR.
642 END.
643 END PROCEDURE.
645 /* _UIB-CODE-BLOCK-END */
646 &ANALYZE-RESUME
648 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Mode V-table-Win
649 PROCEDURE use-Mode :
650 /*------------------------------------------------------------------------------
651 Purpose:
652 ------------------------------------------------------------------------------*/
653 DEF INPUT PARAMETER new-mode AS CHAR NO-UNDO.
654 mode = new-mode.
655 END PROCEDURE.
657 /* _UIB-CODE-BLOCK-END */
658 &ANALYZE-RESUME