Changes for Catalyst APMS. Added PDF checkboxes to screens the generate remittance...
[capital-apms-progress.git] / vwr / mnt / v-pcntct.w
blobf1f02b1333ea8909be10055163000df0f140d7a8
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 ------------------------------------------------------------------------*/
12 CREATE WIDGET-POOL.
13 /* *************************** Definitions ************************** */
15 DEF VAR user-name AS CHAR NO-UNDO.
16 DEF VAR contact-list AS CHAR INITIAL "" NO-UNDO.
17 DEF VAR my-delim AS CHAR INITIAL "|" NO-UNDO.
19 /* _UIB-CODE-BLOCK-END */
20 &ANALYZE-RESUME
23 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
25 /* ******************** Preprocessor Definitions ******************** */
27 &Scoped-define PROCEDURE-TYPE SmartViewer
28 &Scoped-define DB-AWARE no
30 &Scoped-define ADM-SUPPORTED-LINKS Record-Source,Record-Target,TableIO-Target
32 /* Name of first Frame and/or Browse and/or first Query */
33 &Scoped-define FRAME-NAME F-Main
35 /* External Tables */
36 &Scoped-define EXTERNAL-TABLES RP
37 &Scoped-define FIRST-EXTERNAL-TABLE RP
40 /* Need to scope the external tables to this procedure */
41 DEFINE QUERY external_tables FOR RP.
42 /* Standard List Definitions */
43 &Scoped-Define ENABLED-FIELDS RP.Int1 RP.Int2 RP.Log2 RP.Log1
44 &Scoped-define ENABLED-TABLES RP
45 &Scoped-define FIRST-ENABLED-TABLE RP
46 &Scoped-define DISPLAYED-TABLES RP
47 &Scoped-define FIRST-DISPLAYED-TABLE RP
48 &Scoped-Define ENABLED-OBJECTS cmb_AddressType cmb_EcType Btn_OK RECT-1
49 &Scoped-Define DISPLAYED-FIELDS RP.Int1 RP.Int2 RP.Log2 RP.Log1
50 &Scoped-Define DISPLAYED-OBJECTS fil_prop1 fil_prop2 cmb_AddressType ~
51 cmb_EcType
53 /* Custom List Definitions */
54 /* ADM-CREATE-FIELDS,ADM-ASSIGN-FIELDS,List-3,List-4,List-5,List-6 */
55 &Scoped-define ADM-CREATE-FIELDS RP.Log1
56 &Scoped-define ADM-ASSIGN-FIELDS RP.Log1
58 /* _UIB-PREPROCESSOR-BLOCK-END */
59 &ANALYZE-RESUME
63 /* *********************** Control Definitions ********************** */
66 /* Definitions of the field level widgets */
67 DEFINE BUTTON Btn_OK AUTO-GO DEFAULT
68 LABEL "OK"
69 SIZE 12 BY 1.2
70 BGCOLOR 8 FONT 9.
72 DEFINE VARIABLE cmb_AddressType AS CHARACTER FORMAT "X(50)"
73 LABEL "Address type"
74 VIEW-AS COMBO-BOX INNER-LINES 10
75 LIST-ITEMS "POST","COUR","HOME"
76 DROP-DOWN-LIST
77 SIZE 37.72 BY 1
78 FONT 10.
80 DEFINE VARIABLE fil_prop1 AS CHARACTER FORMAT "X(256)":U
81 VIEW-AS FILL-IN
82 SIZE 44.86 BY 1
83 BGCOLOR 16 NO-UNDO.
85 DEFINE VARIABLE fil_prop2 AS CHARACTER FORMAT "X(256)":U
86 VIEW-AS FILL-IN
87 SIZE 44.86 BY 1
88 BGCOLOR 16 NO-UNDO.
90 DEFINE RECTANGLE RECT-1
91 EDGE-PIXELS 2 GRAPHIC-EDGE NO-FILL
92 SIZE 61.72 BY 15.2.
94 DEFINE VARIABLE cmb_EcType AS CHARACTER
95 VIEW-AS SELECTION-LIST MULTIPLE SCROLLBAR-VERTICAL
96 SIZE 37.72 BY 8 NO-UNDO.
99 /* ************************ Frame Definitions *********************** */
101 DEFINE FRAME F-Main
102 RP.Int1 AT ROW 1.2 COL 5.86 COLON-ALIGNED
103 LABEL "Property" FORMAT "99999"
104 VIEW-AS FILL-IN
105 SIZE 6.29 BY 1
106 fil_prop1 AT ROW 1.2 COL 15.57 COLON-ALIGNED NO-LABEL
107 RP.Int2 AT ROW 2.2 COL 5.86 COLON-ALIGNED
108 LABEL "to" FORMAT "99999"
109 VIEW-AS FILL-IN
110 SIZE 6.29 BY 1
111 fil_prop2 AT ROW 2.2 COL 15.57 COLON-ALIGNED NO-LABEL
112 RP.Log2 AT ROW 4 COL 18
113 LABEL "One page per tenant"
114 VIEW-AS TOGGLE-BOX
115 SIZE 18 BY .85
116 cmb_AddressType AT ROW 5 COL 8.43
117 cmb_EcType AT ROW 6.25 COL 18 NO-LABEL
118 Btn_OK AT ROW 14.7 COL 50.14
119 RP.Log1 AT ROW 14.9 COL 4.72 HELP
121 LABEL "Preview"
122 VIEW-AS TOGGLE-BOX
123 SIZE 11.72 BY 1
124 FONT 10
125 RECT-1 AT ROW 1 COL 1
126 "Contact types:" VIEW-AS TEXT
127 SIZE 10 BY .8 AT ROW 6.25 COL 8
128 WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
129 SIDE-LABELS NO-UNDERLINE THREE-D
130 AT COL 1 ROW 1 SCROLLABLE
131 FONT 10
132 DEFAULT-BUTTON Btn_OK.
135 /* *********************** Procedure Settings ************************ */
137 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
138 /* Settings for THIS-PROCEDURE
139 Type: SmartViewer
140 External Tables: ttpl.RP
141 Allow: Basic,DB-Fields
142 Frames: 1
143 Add Fields to: EXTERNAL-TABLES
144 Other Settings: PERSISTENT-ONLY COMPILE
147 /* This procedure should always be RUN PERSISTENT. Report the error, */
148 /* then cleanup and return. */
149 IF NOT THIS-PROCEDURE:PERSISTENT THEN DO:
150 MESSAGE "{&FILE-NAME} should only be RUN PERSISTENT.":U
151 VIEW-AS ALERT-BOX ERROR BUTTONS OK.
152 RETURN.
153 END.
155 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
157 /* ************************* Create Window ************************** */
159 &ANALYZE-SUSPEND _CREATE-WINDOW
160 /* DESIGN Window definition (used by the UIB)
161 CREATE WINDOW V-table-Win ASSIGN
162 HEIGHT = 17.9
163 WIDTH = 66.29.
164 /* END WINDOW DEFINITION */
166 &ANALYZE-RESUME
168 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB V-table-Win
169 /* ************************* Included-Libraries *********************** */
171 {src/adm/method/viewer.i}
172 {inc/method/m-mntvwr.i}
174 /* _UIB-CODE-BLOCK-END */
175 &ANALYZE-RESUME
180 /* *********** Runtime Attributes and AppBuilder 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 COMBO-BOX cmb_AddressType IN FRAME F-Main
192 ALIGN-L */
193 /* SETTINGS FOR FILL-IN fil_prop1 IN FRAME F-Main
194 NO-ENABLE */
195 /* SETTINGS FOR FILL-IN fil_prop2 IN FRAME F-Main
196 NO-ENABLE */
197 /* SETTINGS FOR FILL-IN RP.Int1 IN FRAME F-Main
198 EXP-LABEL EXP-FORMAT */
199 /* SETTINGS FOR FILL-IN RP.Int2 IN FRAME F-Main
200 EXP-LABEL EXP-FORMAT */
201 /* SETTINGS FOR TOGGLE-BOX RP.Log1 IN FRAME F-Main
202 1 2 EXP-LABEL EXP-HELP */
203 /* SETTINGS FOR TOGGLE-BOX RP.Log2 IN FRAME F-Main
204 EXP-LABEL */
205 /* _RUN-TIME-ATTRIBUTES-END */
206 &ANALYZE-RESUME
209 /* Setting information for Queries and Browse Widgets fields */
211 &ANALYZE-SUSPEND _QUERY-BLOCK FRAME F-Main
212 /* Query rebuild information for FRAME F-Main
213 _Options = "NO-LOCK"
214 _Query is NOT OPENED
215 */ /* FRAME F-Main */
216 &ANALYZE-RESUME
222 /* ************************ Control Triggers ************************ */
224 &Scoped-define SELF-NAME Btn_OK
225 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL Btn_OK V-table-Win
226 ON CHOOSE OF Btn_OK IN FRAME F-Main /* OK */
228 RUN notify( 'set-busy, CONTAINER-SOURCE':U ).
229 SELF:SENSITIVE = No.
230 RUN run-report.
231 SELF:SENSITIVE = Yes.
232 RUN notify( 'set-idle, CONTAINER-SOURCE':U ).
233 END.
235 /* _UIB-CODE-BLOCK-END */
236 &ANALYZE-RESUME
239 &Scoped-define SELF-NAME cmb_AddressType
240 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AddressType V-table-Win
241 ON U1 OF cmb_AddressType IN FRAME F-Main /* Address type */
243 {inc/selcmb/scpdt1.i "RP" "Char2"}
244 END.
246 /* _UIB-CODE-BLOCK-END */
247 &ANALYZE-RESUME
250 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_AddressType V-table-Win
251 ON U2 OF cmb_AddressType IN FRAME F-Main /* Address type */
253 {inc/selcmb/scpdt2.i "RP" "Char2"}
254 END.
256 /* _UIB-CODE-BLOCK-END */
257 &ANALYZE-RESUME
260 &Scoped-define SELF-NAME cmb_EcType
261 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_EcType V-table-Win
262 ON U1 OF cmb_EcType IN FRAME F-Main
264 {inc/selcmb/sel-ectyp1.i "RP" "Char6"}
265 END.
267 /* _UIB-CODE-BLOCK-END */
268 &ANALYZE-RESUME
271 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL cmb_EcType V-table-Win
272 ON U2 OF cmb_EcType IN FRAME F-Main
274 {inc/selcmb/sel-ectyp2.i "RP" "Char6"}
275 END.
277 /* _UIB-CODE-BLOCK-END */
278 &ANALYZE-RESUME
281 &Scoped-define SELF-NAME fil_prop1
282 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop1 V-table-Win
283 ON U1 OF fil_prop1 IN FRAME F-Main
285 {inc/selfil/sfpro1.i "RP" "Int1"}
286 END.
288 /* _UIB-CODE-BLOCK-END */
289 &ANALYZE-RESUME
292 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop1 V-table-Win
293 ON U2 OF fil_prop1 IN FRAME F-Main
295 {inc/selfil/sfpro2.i "RP" "Int1"}
296 END.
298 /* _UIB-CODE-BLOCK-END */
299 &ANALYZE-RESUME
302 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop1 V-table-Win
303 ON U3 OF fil_prop1 IN FRAME F-Main
305 {inc/selfil/sfpro3.i "RP" "Int1"}
306 END.
308 /* _UIB-CODE-BLOCK-END */
309 &ANALYZE-RESUME
312 &Scoped-define SELF-NAME fil_prop2
313 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop2 V-table-Win
314 ON U1 OF fil_prop2 IN FRAME F-Main
316 {inc/selfil/sfpro1.i "RP" "Int2"}
317 END.
319 /* _UIB-CODE-BLOCK-END */
320 &ANALYZE-RESUME
323 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop2 V-table-Win
324 ON U2 OF fil_prop2 IN FRAME F-Main
326 {inc/selfil/sfpro2.i "RP" "Int2"}
327 END.
329 /* _UIB-CODE-BLOCK-END */
330 &ANALYZE-RESUME
333 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL fil_prop2 V-table-Win
334 ON U3 OF fil_prop2 IN FRAME F-Main
336 {inc/selfil/sfpro3.i "RP" "Int2"}
337 END.
339 /* _UIB-CODE-BLOCK-END */
340 &ANALYZE-RESUME
343 &Scoped-define SELF-NAME RP.Int1
344 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int1 V-table-Win
345 ON LEAVE OF RP.Int1 IN FRAME F-Main /* Property */
347 {inc/selcde/cdpro.i "fil_prop1"}
348 END.
350 /* _UIB-CODE-BLOCK-END */
351 &ANALYZE-RESUME
354 &Scoped-define SELF-NAME RP.Int2
355 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL RP.Int2 V-table-Win
356 ON LEAVE OF RP.Int2 IN FRAME F-Main /* to */
358 {inc/selcde/cdpro.i "fil_prop2"}
359 END.
361 /* _UIB-CODE-BLOCK-END */
362 &ANALYZE-RESUME
365 &UNDEFINE SELF-NAME
367 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK V-table-Win
370 /* *************************** Main Block *************************** */
372 /* _UIB-CODE-BLOCK-END */
373 &ANALYZE-RESUME
376 /* ********************** Internal Procedures *********************** */
378 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE adm-row-available V-table-Win _ADM-ROW-AVAILABLE
379 PROCEDURE adm-row-available :
380 /*------------------------------------------------------------------------------
381 Purpose: Dispatched to this procedure when the Record-
382 Source has a new row available. This procedure
383 tries to get the new row (or foriegn keys) from
384 the Record-Source and process it.
385 Parameters: <none>
386 ------------------------------------------------------------------------------*/
388 /* Define variables needed by this internal procedure. */
389 {src/adm/template/row-head.i}
391 /* Create a list of all the tables that we need to get. */
392 {src/adm/template/row-list.i "RP"}
394 /* Get the record ROWID's from the RECORD-SOURCE. */
395 {src/adm/template/row-get.i}
397 /* FIND each record specified by the RECORD-SOURCE. */
398 {src/adm/template/row-find.i "RP"}
400 /* Process the newly available records (i.e. display fields,
401 open queries, and/or pass records on to any RECORD-TARGETS). */
402 {src/adm/template/row-end.i}
404 END PROCEDURE.
406 /* _UIB-CODE-BLOCK-END */
407 &ANALYZE-RESUME
409 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE disable_UI V-table-Win _DEFAULT-DISABLE
410 PROCEDURE disable_UI :
411 /*------------------------------------------------------------------------------
412 Purpose: DISABLE the User Interface
413 Parameters: <none>
414 Notes: Here we clean-up the user-interface by deleting
415 dynamic widgets we have created and/or hide
416 frames. This procedure is usually called when
417 we are ready to "clean-up" after running.
418 ------------------------------------------------------------------------------*/
419 /* Hide all frames. */
420 HIDE FRAME F-Main.
421 IF THIS-PROCEDURE:PERSISTENT THEN DELETE PROCEDURE THIS-PROCEDURE.
422 END PROCEDURE.
424 /* _UIB-CODE-BLOCK-END */
425 &ANALYZE-RESUME
427 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE enable-appropriate-fields V-table-Win
428 PROCEDURE enable-appropriate-fields :
429 /*------------------------------------------------------------------------------
430 Purpose: As its name!
431 ------------------------------------------------------------------------------*/
433 DO WITH FRAME {&FRAME-NAME}:
434 END.
436 END PROCEDURE.
438 /* _UIB-CODE-BLOCK-END */
439 &ANALYZE-RESUME
441 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-initialize V-table-Win
442 PROCEDURE inst-initialize :
443 /*------------------------------------------------------------------------------
444 Purpose: Initialise the necessary bits and pieces
445 ------------------------------------------------------------------------------*/
447 RUN get-username IN sec-mgr ( OUTPUT user-name ).
448 FIND RP WHERE RP.ReportID = "ctlst"
449 AND RP.UserName = user-name
450 NO-ERROR.
452 IF NOT AVAILABLE( RP ) THEN DO:
453 CREATE RP.
454 ASSIGN
455 RP.ReportID = "pctlst"
456 RP.UserName = user-name
458 END.
460 RUN dispatch ( 'display-fields':U ).
461 RUN dispatch ( 'enable-fields':U ).
462 RUN enable-appropriate-fields.
464 END PROCEDURE.
466 /* _UIB-CODE-BLOCK-END */
467 &ANALYZE-RESUME
469 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE pre-destroy V-table-Win
470 PROCEDURE pre-destroy :
471 /*------------------------------------------------------------------------------
472 Purpose:
473 Parameters: <none>
474 Notes:
475 ------------------------------------------------------------------------------*/
476 RUN check-modified( 'clear':U ).
477 END PROCEDURE.
479 /* _UIB-CODE-BLOCK-END */
480 &ANALYZE-RESUME
482 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE run-report V-table-Win
483 PROCEDURE run-report :
484 /*------------------------------------------------------------------------------
485 Purpose: Actually run the report program.
486 ------------------------------------------------------------------------------*/
488 DO WITH FRAME {&FRAME-NAME}:
490 DEF VAR contact-types AS CHAR NO-UNDO.
491 DEF VAR sv AS CHAR NO-UNDO.
492 DEF VAR delim AS CHAR NO-UNDO.
493 DEF VAR i AS INT NO-UNDO.
494 DEF VAR report-options AS CHAR NO-UNDO.
496 RUN verify-report.
497 IF RETURN-VALUE = "FAIL" THEN RETURN.
499 RUN dispatch( 'update-record':U ).
501 report-options = "PostalTypes," + RP.Char2
502 + "~nExclude," + ( IF RP.Char3 = "EXC" THEN "Yes" ELSE "No" )
503 + "~nEntity,P" + "," + STRING( RP.Int1 ) + "," + STRING( RP.Int2 )
504 + (IF RP.Log1 THEN "~nPreview,Yes" ELSE "")
505 + (IF RP.Log2 THEN "~nPagePerTenant" ELSE "")
506 + "~nContactTypes," + RP.Char6.
508 {inc/bq-do.i "process/report/contacts.p" "report-options" "(NOT RP.Log1)"}
510 END.
512 END PROCEDURE.
514 /* _UIB-CODE-BLOCK-END */
515 &ANALYZE-RESUME
517 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE send-records V-table-Win _ADM-SEND-RECORDS
518 PROCEDURE send-records :
519 /*------------------------------------------------------------------------------
520 Purpose: Send record ROWID's for all tables used by
521 this file.
522 Parameters: see template/snd-head.i
523 ------------------------------------------------------------------------------*/
525 /* Define variables needed by this internal procedure. */
526 {src/adm/template/snd-head.i}
528 /* For each requested table, put it's ROWID in the output list. */
529 {src/adm/template/snd-list.i "RP"}
531 /* Deal with any unexpected table requests before closing. */
532 {src/adm/template/snd-end.i}
534 END PROCEDURE.
536 /* _UIB-CODE-BLOCK-END */
537 &ANALYZE-RESUME
539 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE state-changed V-table-Win
540 PROCEDURE state-changed :
541 /* -----------------------------------------------------------
542 Purpose:
543 Parameters: <none>
544 Notes:
545 -------------------------------------------------------------*/
546 DEFINE INPUT PARAMETER p-issuer-hdl AS HANDLE NO-UNDO.
547 DEFINE INPUT PARAMETER p-state AS CHARACTER NO-UNDO.
549 CASE p-state:
550 /* Object instance CASEs can go here to replace standard behavior
551 or add new cases. */
552 {src/adm/template/vstates.i}
553 END CASE.
554 END PROCEDURE.
556 /* _UIB-CODE-BLOCK-END */
557 &ANALYZE-RESUME
559 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE verify-report V-table-Win
560 PROCEDURE verify-report :
561 /*------------------------------------------------------------------------------
562 Purpose:
563 Parameters: <none>
564 Notes:
565 ------------------------------------------------------------------------------*/
567 DO WITH FRAME {&FRAME-NAME}:
569 END.
571 END PROCEDURE.
573 /* _UIB-CODE-BLOCK-END */
574 &ANALYZE-RESUME