Changes for Catalyst APMS. Added PDF checkboxes to screens the generate remittance...
[capital-apms-progress.git] / vwr / mnt / v-garntr.w
blob3ea887c4021c8c84bcce4f28de28f72fb2aec94b
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 /*------------------------------------------------------------------------
10 File:
12 Description: from VIEWER.W - Template for SmartViewer Objects
14 Input Parameters:
15 <none>
17 Output Parameters:
18 <none>
20 ------------------------------------------------------------------------*/
21 /* This .W file was created with the Progress UIB. */
22 /*----------------------------------------------------------------------*/
24 /* Create an unnamed pool to store all the widgets created
25 by this procedure. This is a good default which assures
26 that this procedure's triggers and internal procedures
27 will execute in this procedure's storage, and that proper
28 cleanup will occur on deletion of the procedure. */
30 CREATE WIDGET-POOL.
32 /* *************************** Definitions ************************** */
34 /* Parameters Definitions --- */
36 /* Local Variable Definitions --- */
38 DEF VAR mode AS CHAR NO-UNDO.
39 DEF BUFFER FaxDetail FOR PhoneDetail.
40 DEF BUFFER MobDetail FOR PhoneDetail.
42 /* _UIB-CODE-BLOCK-END */
43 &ANALYZE-RESUME
46 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
48 /* ******************** Preprocessor Definitions ******************** */
50 &Scoped-define PROCEDURE-TYPE SmartViewer
52 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
54 /* Name of first Frame and/or Browse and/or first Query */
55 &Scoped-define FRAME-NAME F-Main
57 /* External Tables */
58 &Scoped-define EXTERNAL-TABLES Guarantor
59 &Scoped-define FIRST-EXTERNAL-TABLE Guarantor
62 /* Need to scope the external tables to this procedure */
63 DEFINE QUERY external_tables FOR Guarantor.
64 /* Standard List Definitions */
65 &Scoped-Define ENABLED-FIELDS Guarantor.Limit
66 &Scoped-define FIELD-PAIRS~
67 ~{&FP1}Limit ~{&FP2}Limit ~{&FP3}
68 &Scoped-define ENABLED-TABLES Guarantor
69 &Scoped-define FIRST-ENABLED-TABLE Guarantor
70 &Scoped-Define ENABLED-OBJECTS RECT-1 RECT-2 cmb_Type loc_FirstName ~
71 loc_LastName loc_Company edt_address loc_City loc_state loc_Country loc_Zip ~
72 loc_Mobile loc_Expires
73 &Scoped-Define DISPLAYED-FIELDS Guarantor.Limit
74 &Scoped-Define DISPLAYED-OBJECTS cmb_Type loc_FirstName loc_LastName ~
75 loc_Company edt_address loc_City loc_state loc_Country loc_Zip loc_Phone ~
76 loc_Fax loc_Mobile loc_Expires
78 /* Custom List Definitions */
79 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
81 /* _UIB-PREPROCESSOR-BLOCK-END */
82 &ANALYZE-RESUME
86 /* *********************** Control Definitions ********************** */
89 /* Definitions of the field level widgets */
90 DEFINE VARIABLE cmb_Type AS CHARACTER FORMAT "X(20)"
91 LABEL "Type"
92 VIEW-AS COMBO-BOX INNER-LINES 10
93 LIST-ITEMS "B - Bank Guarantee","S - Security Deposit","I - Individual","C - Company"
94 SIZE 25.14 BY 1.
96 DEFINE VARIABLE edt_address AS CHARACTER
97 VIEW-AS EDITOR SCROLLBAR-VERTICAL
98 SIZE 33.14 BY 4.2 NO-UNDO.
100 DEFINE VARIABLE loc_City AS CHARACTER FORMAT "X(30)"
101 LABEL "City"
102 VIEW-AS FILL-IN
103 SIZE 20 BY 1
104 FONT 10.
106 DEFINE VARIABLE loc_Company AS CHARACTER FORMAT "X(256)":U
107 LABEL "Company"
108 VIEW-AS FILL-IN
109 SIZE 63.43 BY 1 NO-UNDO.
111 DEFINE VARIABLE loc_Country AS CHARACTER FORMAT "X(30)"
112 LABEL "Country"
113 VIEW-AS FILL-IN
114 SIZE 20 BY 1
115 FONT 10.
117 DEFINE VARIABLE loc_Expires AS DATE FORMAT "99/99/9999":U
118 LABEL "Expires"
119 VIEW-AS FILL-IN
120 SIZE 10.29 BY 1 NO-UNDO.
122 DEFINE VARIABLE loc_Fax AS CHARACTER FORMAT "X(256)":U
123 LABEL "Fax"
124 VIEW-AS FILL-IN
125 SIZE 20 BY 1 NO-UNDO.
127 DEFINE VARIABLE loc_FirstName AS CHARACTER FORMAT "X(256)":U
128 LABEL "First Name"
129 VIEW-AS FILL-IN
130 SIZE 25 BY 1 NO-UNDO.
132 DEFINE VARIABLE loc_LastName AS CHARACTER FORMAT "X(256)":U
133 LABEL "Last Name"
134 VIEW-AS FILL-IN
135 SIZE 25 BY 1 NO-UNDO.
137 DEFINE VARIABLE loc_Mobile AS CHARACTER FORMAT "X(256)":U
138 LABEL "Mobile"
139 VIEW-AS FILL-IN
140 SIZE 20 BY 1 NO-UNDO.
142 DEFINE VARIABLE loc_Phone AS CHARACTER FORMAT "X(256)":U
143 LABEL "Ph"
144 VIEW-AS FILL-IN
145 SIZE 20 BY 1 NO-UNDO.
147 DEFINE VARIABLE loc_state AS CHARACTER FORMAT "X(15)"
148 LABEL "State"
149 VIEW-AS FILL-IN
150 SIZE 20 BY 1
151 FONT 10.
153 DEFINE VARIABLE loc_Zip AS CHARACTER FORMAT "X(20)"
154 LABEL "Zip"
155 VIEW-AS FILL-IN
156 SIZE 20 BY 1
157 FONT 10.
159 DEFINE RECTANGLE RECT-1
160 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
161 SIZE 77.72 BY 13.5.
163 DEFINE RECTANGLE RECT-2
164 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
165 SIZE 75.43 BY 11.
168 /* ************************ Frame Definitions *********************** */
170 DEFINE FRAME F-Main
171 Guarantor.Limit AT ROW 1.4 COL 11 COLON-ALIGNED
172 VIEW-AS FILL-IN
173 SIZE 14.43 BY .9
174 cmb_Type AT ROW 1.4 COL 34.43
175 loc_FirstName AT ROW 4 COL 11 COLON-ALIGNED
176 loc_LastName AT ROW 4 COL 49.29 COLON-ALIGNED
177 loc_Company AT ROW 5.4 COL 11 COLON-ALIGNED
178 edt_address AT ROW 6.8 COL 13 NO-LABEL
179 loc_City AT ROW 6.8 COL 54.43 COLON-ALIGNED
180 loc_state AT ROW 7.8 COL 54.43 COLON-ALIGNED
181 loc_Country AT ROW 8.8 COL 54.43 COLON-ALIGNED
182 loc_Zip AT ROW 9.8 COL 54.43 COLON-ALIGNED
183 loc_Phone AT ROW 11.5 COL 11 COLON-ALIGNED
184 loc_Fax AT ROW 11.5 COL 54.43 COLON-ALIGNED
185 loc_Mobile AT ROW 12.5 COL 11 COLON-ALIGNED
186 loc_Expires AT ROW 12.6 COL 54.43 COLON-ALIGNED
187 RECT-1 AT ROW 1 COL 1
188 "Contact Details" VIEW-AS TEXT
189 SIZE 15.43 BY 1 AT ROW 2.6 COL 3.86
190 FONT 14
191 RECT-2 AT ROW 3 COL 2.14
192 "Address:" VIEW-AS TEXT
193 SIZE 6.29 BY 1 AT ROW 6.4 COL 5.57
194 FONT 10
195 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
196 SIDE-LABELS NO-UNDERLINE THREE-D
197 AT COL 1 ROW 1 SCROLLABLE
198 FONT 9.
201 /* *********************** Procedure Settings ************************ */
203 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
204 /* Settings for THIS-PROCEDURE
205 Type: SmartViewer
206 External Tables: ttpl.Guarantor
207 Allow: Basic,DB-Fields
208 Frames: 1
209 Add Fields to: EXTERNAL-TABLES
210 Other Settings: PERSISTENT-ONLY COMPILE
213 /* This procedure should always be RUN PERSISTENT. Report the error, */
214 /* then cleanup and return. */
215 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
216 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT."
217 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
218 RETURN.
219 END.
221 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
223 /* ************************* Create Window ************************** */
225 &ANALYZE-SUSPEND _CREATE-WINDOW
226 /* DESIGN Window definition (used by the UIB)
227 CREATE WINDOW V-table-Win ASSIGN
228 HEIGHT = 13.5
229 WIDTH = 79.43.
230 /* END WINDOW DEFINITION */
232 &ANALYZE-RESUME
235 /* *************** Runtime Attributes and UIB Settings ************** */
237 &ANALYZE-SUSPEND _RUN-TIME-ATTRIBUTES
238 /* SETTINGS FOR WINDOW V-table-Win
239 VISIBLE,,RUN-PERSISTENT */
240 /* SETTINGS FOR FRAME F-Main
241 NOT-VISIBLE Size-to-Fit */
242 ASSIGN
243 FRAME F-Main:SCROLLABLE = FALSE
244 FRAME F-Main:HIDDEN = TRUE.
246 /* SETTINGS FOR COMBO-BOX cmb_Type IN FRAME F-Main
247 ALIGN-L */
248 ASSIGN
249 edt_address:RETURN-INSERTED IN FRAME F-Main = TRUE.
251 /* SETTINGS FOR FILL-IN loc_Fax IN FRAME F-Main
252 NO-ENABLE */
253 /* SETTINGS FOR FILL-IN loc_Phone IN FRAME F-Main
254 NO-ENABLE */
255 /* _RUN-TIME-ATTRIBUTES-END */
256 &ANALYZE-RESUME
259 /* Setting information for Queries and Browse Widgets fields */
261 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
262 /* Query rebuild information for FRAME F-Main
263 _Options = "NO-LOCK"
264 _Query is NOT OPENED
265 */ /* FRAME F-Main */
266 &ANALYZE-RESUME
271 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
272 /* ************************* Included-Libraries *********************** */
274 {src/adm/method/viewer.i}
275 {inc/method/m-mntvwr.i}
277 /* _UIB-CODE-BLOCK-END */
278 &ANALYZE-RESUME
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
285 /* *************************** Main Block *************************** */
287 /* _UIB-CODE-BLOCK-END */
288 &ANALYZE-RESUME
291 /* ********************** Internal Procedures *********************** */
293 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
294 PROCEDURE adm-row-available :
295 /*------------------------------------------------------------------------------
296 Purpose: Dispatched to this procedure when the Record-
297 Source has a new row available. This procedure
298 tries to get the new row (or foriegn keys) from
299 the Record-Source and process it.
300 Parameters: <none>
301 ------------------------------------------------------------------------------*/
303 /* Define variables needed by this internal procedure. */
304 {src/adm/template/row-head.i}
306 /* Create a list of all the tables that we need to get. */
307 {src/adm/template/row-list.i "Guarantor"}
309 /* Get the record ROWID's from the RECORD-SOURCE. */
310 {src/adm/template/row-get.i}
312 /* FIND each record specified by the RECORD-SOURCE. */
313 {src/adm/template/row-find.i "Guarantor"}
315 /* Process the newly available records (i.e. display fields,
316 open queries, and/or pass records on to any RECORD-TARGETS). */
317 {src/adm/template/row-end.i}
319 END PROCEDURE.
321 /* _UIB-CODE-BLOCK-END */
322 &ANALYZE-RESUME
325 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE cancel-changes V-table-Win
326 PROCEDURE cancel-changes :
327 /*------------------------------------------------------------------------------
328 Purpose:
329 Parameters: <none>
330 Notes:
331 ------------------------------------------------------------------------------*/
333 RUN notify( 'hide, CONTAINER-SOURCE':U ).
334 IF mode = "Add" THEN RUN delete-guarantor. ELSE RUN check-modified( "CLEAR" ).
335 RUN dispatch( 'exit':U ).
337 END PROCEDURE.
339 /* _UIB-CODE-BLOCK-END */
340 &ANALYZE-RESUME
343 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE confirm-changes V-table-Win
344 PROCEDURE confirm-changes :
345 /*------------------------------------------------------------------------------
346 Purpose:
347 Parameters: <none>
348 Notes:
349 ------------------------------------------------------------------------------*/
351 RUN verify-guarantor.
352 IF RETURN-VALUE = "FAIL" THEN RETURN.
354 RUN notify( 'hide, CONTAINER-SOURCE':U ).
355 IF mode = "Add" THEN RUN notify( 'open-query,record-source':U ).
356 RUN dispatch( 'update-record':U ).
357 RUN dispatch( 'exit':U ).
359 END PROCEDURE.
361 /* _UIB-CODE-BLOCK-END */
362 &ANALYZE-RESUME
365 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE delete-guarantor V-table-Win
366 PROCEDURE delete-guarantor :
367 /*------------------------------------------------------------------------------
368 Purpose:
369 Parameters: <none>
370 Notes:
371 ------------------------------------------------------------------------------*/
373 FIND CURRENT Guarantor EXCLUSIVE-LOCK NO-ERROR.
374 IF AVAILABLE Guarantor THEN DELETE Guarantor.
376 FIND CURRENT Person EXCLUSIVE-LOCK NO-ERROR.
377 IF AVAILABLE Person THEN DELETE Person.
379 FIND CURRENT PostalDetail EXCLUSIVE-LOCK NO-ERROR.
380 IF AVAILABLE PostalDetail THEN DELETE PostalDetail.
382 FIND CURRENT PhoneDetail EXCLUSIVE-LOCK NO-ERROR.
383 IF AVAILABLE PhoneDetail THEN DELETE PhoneDetail.
385 FIND CURRENT FaxDetail EXCLUSIVE-LOCK NO-ERROR.
386 IF AVAILABLE FaxDetail THEN DELETE FaxDetail.
388 END PROCEDURE.
390 /* _UIB-CODE-BLOCK-END */
391 &ANALYZE-RESUME
394 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
395 PROCEDURE disable_UI :
396 /*------------------------------------------------------------------------------
397 Purpose: DISABLE the User Interface
398 Parameters: <none>
399 Notes: Here we clean-up the user-interface by deleting
400 dynamic widgets we have created and/or hide
401 frames. This procedure is usually called when
402 we are ready to "clean-up" after running.
403 ------------------------------------------------------------------------------*/
404 /* Hide all frames. */
405 HIDE FRAME F-Main.
406 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
407 END PROCEDURE.
409 /* _UIB-CODE-BLOCK-END */
410 &ANALYZE-RESUME
413 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE get-contact-details V-table-Win
414 PROCEDURE get-contact-details :
415 /*------------------------------------------------------------------------------
416 Purpose:
417 Parameters: <none>
418 Notes:
419 ------------------------------------------------------------------------------*/
421 IF NOT AVAILABLE Guarantor THEN RETURN.
423 FIND FIRST Person WHERE Person.PersonCode = Guarantor.PersonCode NO-ERROR.
425 IF NOT AVAILABLE Person THEN
427 CREATE Person.
428 CREATE Contact.
429 ASSIGN
430 Contact.PersonCode = Person.PersonCode
431 Contact.ContactType = 'GTOR'
432 Guarantor.PersonCode = Person.PersonCode.
433 END.
435 FIND FIRST PostalDetail WHERE PostalDetail.PersonCode = Person.PersonCode
436 AND PostalDetail.PostalType = 'MAIN' NO-ERROR.
438 IF NOT AVAILABLE PostalDetail THEN
440 CREATE PostalDetail.
441 ASSIGN
442 PostalDetail.PersonCode = Person.PersonCode
443 PostalDetail.PostalType = 'MAIN'.
444 END.
446 FIND FIRST PhoneDetail WHERE PhoneDetail.PersonCode = Guarantor.PersonCode
447 AND PhoneDetail.PhoneType = "BUS" NO-ERROR.
449 IF NOT AVAILABLE PhoneDetail THEN
451 CREATE PhoneDetail.
452 ASSIGN
453 PhoneDetail.PhoneType = 'BUS'
454 PhoneDetail.PersonCode = Person.PersonCode.
455 END.
457 FIND FIRST FaxDetail WHERE FaxDetail.PersonCode = Guarantor.PersonCode
458 AND FaxDetail.PhoneType = "FAX" NO-ERROR.
460 IF NOT AVAILABLE FaxDetail THEN
462 CREATE FaxDetail.
463 ASSIGN
464 FaxDetail.PhoneType = 'FAX'
465 FaxDetail.PersonCode = Person.PersonCode.
466 END.
468 FIND FIRST MobDetail WHERE MobDetail.PersonCode = Guarantor.PersonCode
469 AND MobDetail.PhoneType = "Mob" NO-ERROR.
471 IF NOT AVAILABLE MobDetail THEN
473 CREATE MobDetail.
474 ASSIGN
475 MobDetail.PhoneType = 'MOB'
476 MobDetail.PersonCode = Person.PersonCode.
477 END.
479 END PROCEDURE.
481 /* _UIB-CODE-BLOCK-END */
482 &ANALYZE-RESUME
485 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-assign-statement V-table-Win
486 PROCEDURE inst-assign-statement :
487 /*------------------------------------------------------------------------------
488 Purpose:
489 Parameters: <none>
490 Notes:
491 ------------------------------------------------------------------------------*/
493 ASSIGN FRAME {&FRAME-NAME}
494 cmb_Type
495 edt_Address
496 loc_City loc_State loc_Country loc_Zip
497 loc_Phone loc_Fax loc_Mobile
498 loc_FirstName loc_LastName loc_Company
499 loc_Expires .
501 ASSIGN
502 Guarantor.Type = SUBSTR( cmb_Type, 1, 1 )
503 PostalDetail.Address = edt_Address
504 PostalDetail.City = loc_City
505 PostalDetail.State = loc_State
506 PostalDetail.Country = loc_Country
507 PostalDetail.Zip = loc_Zip
508 PhoneDetail.Number = loc_Phone
509 FaxDetail.Number = loc_Fax
510 MobDetail.Number = loc_Mobile
511 Person.FirstName = loc_FirstName
512 Person.LastName = loc_LastName
513 Person.Company = loc_Company
514 Guarantor.AnyData = "Expiry," + STRING(loc_Expires, "99/99/9999").
517 END PROCEDURE.
519 /* _UIB-CODE-BLOCK-END */
520 &ANALYZE-RESUME
523 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-display-fields V-table-Win
524 PROCEDURE inst-display-fields :
525 /*------------------------------------------------------------------------------
526 Purpose:
527 ------------------------------------------------------------------------------*/
528 IF NOT AVAILABLE(Guarantor) THEN RETURN.
530 IF mode = "Maintain" THEN RUN get-contact-details.
532 cmb_Type =
533 IF Guarantor.Type = "I" THEN "I - Individual" ELSE
534 IF Guarantor.Type = "B" THEN "B - Bank Guarantee" ELSE
535 IF Guarantor.Type = "S" THEN "S - Security Deposit" ELSE
536 IF Guarantor.Type = "C" THEN "C - Company" ELSE "".
538 ASSIGN edt_Address = PostalDetail.Address.
540 IF NUM-ENTRIES( Guarantor.AnyData ) > 1 THEN
541 loc_Expires = DATE( ENTRY( 2, Guarantor.AnyData ) ).
543 DISPLAY
544 cmb_Type
545 edt_Address
546 loc_Expires
547 PostalDetail.City @ loc_City
548 PostalDetail.State @ loc_State
549 PostalDetail.Country @ loc_Country
550 PostalDetail.Zip @ loc_Zip
551 PhoneDetail.Number @ loc_Phone
552 FaxDetail.Number @ loc_Fax
553 MobDetail.Number @ loc_Mobile
554 Person.FirstName @ loc_FirstName
555 Person.LastName @ loc_LastName
556 Person.Company @ loc_Company
557 WITH FRAME {&FRAME-NAME}.
559 END PROCEDURE.
561 /* _UIB-CODE-BLOCK-END */
562 &ANALYZE-RESUME
565 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-enable-fields V-table-Win
566 PROCEDURE inst-enable-fields :
567 /*------------------------------------------------------------------------------
568 Purpose:
569 Parameters: <none>
570 Notes:
571 ------------------------------------------------------------------------------*/
573 ENABLE
574 edt_Address
575 loc_City loc_State loc_Country loc_Zip
576 loc_Phone loc_Fax loc_Mobile
577 loc_FirstName loc_LastName loc_Company
578 WITH FRAME {&FRAME-NAME}.
580 END PROCEDURE.
582 /* _UIB-CODE-BLOCK-END */
583 &ANALYZE-RESUME
586 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
587 PROCEDURE inst-initialize :
588 /*------------------------------------------------------------------------------
589 Purpose:
590 ------------------------------------------------------------------------------*/
592 IF mode = "Add" THEN RUN dispatch( 'add-record':U ).
593 ELSE RUN dispatch( 'enable-fields' ).
595 END PROCEDURE.
597 /* _UIB-CODE-BLOCK-END */
598 &ANALYZE-RESUME
601 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE override-add-record V-table-Win
602 PROCEDURE override-add-record :
603 /*------------------------------------------------------------------------------
604 Purpose:
605 Parameters: <none>
606 Notes:
607 ------------------------------------------------------------------------------*/
609 DEF VAR c-recsrc AS CHAR NO-UNDO.
610 DEF VAR rowid-list AS CHAR NO-UNDO.
612 RUN get-link-handle IN adm-broker-hdl( THIS-PROCEDURE, 'RECORD-SOURCE':U, OUTPUT c-recsrc ).
613 RUN send-records IN WIDGET-HANDLE( c-recsrc ) ( "TenancyLease", OUTPUT rowid-list ).
614 FIND TenancyLease WHERE ROWID( TenancyLease ) = TO-ROWID( rowid-list ) NO-LOCK.
616 CREATE Guarantor.
617 RUN get-contact-details.
618 ASSIGN
619 Guarantor.TenancyLeaseCode = TenancyLease.TenancyLeaseCode
620 Guarantor.Type = "I".
622 CURRENT-WINDOW:TITLE = "Adding a Guarantor to Lease " +
623 STRING( TenancyLease.TenancyLeaseCode ).
625 RUN dispatch( 'display-fields' ).
626 RUN dispatch( 'enable-fields' ).
628 END PROCEDURE.
630 /* _UIB-CODE-BLOCK-END */
631 &ANALYZE-RESUME
634 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
635 PROCEDURE pre-destroy :
636 /*------------------------------------------------------------------------------
637 Purpose:
638 Parameters: <none>
639 Notes:
640 ------------------------------------------------------------------------------*/
642 IF LAST-EVENT:FUNCTION = "WINDOW-CLOSE" THEN RUN cancel-changes.
644 END PROCEDURE.
646 /* _UIB-CODE-BLOCK-END */
647 &ANALYZE-RESUME
650 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-row-available V-table-Win
651 PROCEDURE pre-row-available :
652 /*------------------------------------------------------------------------------
653 Purpose:
654 Parameters: <none>
655 Notes:
657 ------------------------------------------------------------------------------*/
659 IF mode = "Add" THEN have-records = Yes.
661 END PROCEDURE.
663 /* _UIB-CODE-BLOCK-END */
664 &ANALYZE-RESUME
667 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
668 PROCEDURE send-records :
669 /*------------------------------------------------------------------------------
670 Purpose: Send record ROWID's for all tables used by
671 this file.
672 Parameters: see template/snd-head.i
673 ------------------------------------------------------------------------------*/
675 /* Define variables needed by this internal procedure. */
676 {src/adm/template/snd-head.i}
678 /* For each requested table, put it's ROWID in the output list. */
679 {src/adm/template/snd-list.i "Guarantor"}
681 /* Deal with any unexpected table requests before closing. */
682 {src/adm/template/snd-end.i}
684 END PROCEDURE.
686 /* _UIB-CODE-BLOCK-END */
687 &ANALYZE-RESUME
690 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
691 PROCEDURE state-changed :
692 /* -----------------------------------------------------------
693 Purpose:
694 Parameters: <none>
695 Notes:
696 -------------------------------------------------------------*/
697 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
698 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
700 CASE p-state:
701 /* Object instance CASEs can go here to replace standard behavior
702 or add new cases. */
703 {src/adm/template/vstates.i}
704 END CASE.
705 END PROCEDURE.
707 /* _UIB-CODE-BLOCK-END */
708 &ANALYZE-RESUME
711 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE use-Mode V-table-Win
712 PROCEDURE use-Mode :
713 /*------------------------------------------------------------------------------
714 Purpose: Called when the mode attribute is set.
715 ------------------------------------------------------------------------------*/
716 DEF INPUT PARAMETER new-mode AS CHAR NO-UNDO.
718 mode = new-mode.
720 END PROCEDURE.
722 /* _UIB-CODE-BLOCK-END */
723 &ANALYZE-RESUME
726 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-guarantor V-table-Win
727 PROCEDURE verify-guarantor :
728 /*------------------------------------------------------------------------------
729 Purpose:
730 Parameters: <none>
731 Notes:
732 ------------------------------------------------------------------------------*/
734 DO WITH FRAME {&FRAME-NAME}:
736 DEF VAR g-type AS CHAR NO-UNDO.
737 g-type = SUBSTR( INPUT cmb_Type, 1, 1 ).
740 IF g-type = "I" AND
741 ( INPUT loc_FirstName = "" OR
742 INPUT loc_LastName = "" ) THEN
744 MESSAGE "Individuals must have a first and a last name."
745 VIEW-AS ALERT-BOX ERROR.
746 IF INPUT loc_FirstName = "" THEN APPLY 'ENTRY':U TO loc_FirstName.
747 IF INPUT loc_LastName = "" THEN APPLY 'ENTRY':U TO loc_LastName.
748 RETURN "FAIL".
749 END.
750 ELSE IF g-type = "C" AND INPUT loc_Company = "" THEN
752 MESSAGE "Companies must have a company name."
753 VIEW-AS ALERT-BOX ERROR.
754 APPLY 'ENTRY':U TO loc_Company.
755 RETURN "FAIL".
756 END.
758 END.
760 END PROCEDURE.
762 /* _UIB-CODE-BLOCK-END */
763 &ANALYZE-RESUME