1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
7 DEF VAR user-name
AS CHAR NO-UNDO.
8 {inc
/username.i
"user-name"}
9 DEF VAR timeStamp
AS CHAR FORMAT "X(44)" NO-UNDO.
10 timeStamp
= STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
12 DEF VAR preview
AS LOGI
NO-UNDO INIT Yes.
13 DEF VAR prt-ctrl
AS CHAR NO-UNDO.
14 DEF VAR rows
AS DEC NO-UNDO.
15 DEF VAR cols
AS DEC NO-UNDO.
17 /* _UIB-CODE-BLOCK-END
*/
21 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
23 /* ******************** Preprocessor Definitions
******************** */
25 &Scoped-define PROCEDURE-TYPE Procedure
29 /* _UIB-PREPROCESSOR-BLOCK-END
*/
34 /* *********************** Procedure Settings
************************ */
36 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
37 /* Settings for
THIS-PROCEDURE
41 Add Fields to
: Neither
42 Other Settings
: CODE-ONLY
COMPILE
44 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
46 /* ************************* Create Window
************************** */
48 &ANALYZE-SUSPEND _CREATE-WINDOW
49 /* DESIGN Window definition
(used by the UIB
)
50 CREATE WINDOW Procedure
ASSIGN
53 /* END WINDOW DEFINITION
*/
59 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
60 /* ************************* Included-Libraries
*********************** */
62 {inc
/method
/m-txtrep.i
}
65 /* _UIB-CODE-BLOCK-END
*/
70 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
73 /* *************************** Main Block
*************************** */
75 /* Post all replicated ToPost batches from offices other than
76 this one and that have not been posted
*/
78 RUN make-control-string
( "PCL", "reset,portrait,tm,2,a4,lm,6,courier,cpi,18,lpi,9",
79 OUTPUT prt-ctrl
, OUTPUT rows
, OUTPUT cols
).
81 RUN output-control-file
( prt-ctrl
).
82 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE VALUE(rows
).
86 /* Page header for output report
*/
88 PUT UNFORMATTED "Printed: " + timeStamp
SKIP(1).
90 "Batch" SPACE( 2 ) "Date " SPACE( 2 ) "Time " SPACE( 2 )
91 "Originated" SPACE( 2 ) "Description" SKIP(1).
93 /* Post the batches
*/
96 ToPost.Officecode
<> Office.OfficeCode
AND
97 ToPost.PostStatus
= "REPL"
100 FIND FIRST NewBatch
WHERE NewBatch.BatchCode
= ToPost.BatchCode
103 IF NOT AVAILABLE NewBatch
THEN
105 RUN print-line
( ToPost.BatchCode
, ToPost.OfficeCode
, "Batch does not exist" ).
106 ASSIGN ToPost.PostStatus
= "ERRO".
111 RUN process
/tru.p
( NewBatch.BatchCode
, "delete,quiet,no-replicate" ).
113 IF RETURN-VALUE <> "" THEN
115 ASSIGN ToPost.PostStatus
= "ERRO".
116 RUN print-line
( ToPost.BatchCode
, ToPost.OfficeCode
, RETURN-VALUE ).
120 ASSIGN ToPost.PostStatus
= "POST".
121 RUN print-line
( ToPost.BatchCode
, ToPost.OfficeCode
, "Batch Posted successfully" ).
131 RUN view-output-file
( preview
).
132 IF preview
THEN WAIT-FOR CLOSE OF txtrep-preview-window.
134 /* _UIB-CODE-BLOCK-END
*/
138 /* ********************** Internal Procedures
*********************** */
140 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-line Procedure
141 PROCEDURE print-line
:
142 /*------------------------------------------------------------------------------
146 ------------------------------------------------------------------------------*/
148 DEF INPUT PARAMETER batch-code
LIKE Batch.Batchcode
NO-UNDO.
149 DEF INPUT PARAMETER office-code
LIKE Office.OfficeCode
NO-UNDO.
150 DEF INPUT PARAMETER description
AS CHAR NO-UNDO.
153 STRING( batch-code
, "99999" ) SPACE(2)
154 STRING( TODAY, "99/99/9999" ) SPACE(2)
155 STRING( TIME, "HH:MM:SS" ) SPACE(2)
156 STRING( office-code
, "X(10)" ) SPACE(2)
157 STRING( description
, "X(50)" ) SKIP.
161 /* _UIB-CODE-BLOCK-END
*/