1 &ANALYZE-SUSPEND _VERSION-NUMBER UIB_v8r12
3 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _DEFINITIONS Procedure
4 /*--------------------------------------------------------------------------
5 ------------------------------------------------------------------------*/
7 DEF INPUT PARAMETER report-options
AS CHAR NO-UNDO.
9 DEF VAR preview
AS LOGI
NO-UNDO INIT No.
10 DEF VAR posted-batch
AS INT NO-UNDO INIT ?.
11 DEF VAR unposted-batch
AS INT NO-UNDO INIT ?.
12 DEF VAR reverse
AS LOGI
NO-UNDO INITIAL No.
16 DEF VAR user-name
AS CHAR NO-UNDO.
17 {inc
/username.i
"user-name"}
18 DEF VAR timeStamp
AS CHAR FORMAT "X(44)" NO-UNDO.
19 timeStamp
= STRING( TODAY, "99/99/9999") + ", " + STRING( TIME, "HH:MM:SS") + " for " + user-name.
21 DEF VAR line
AS CHAR NO-UNDO.
23 DEF VAR time-font
AS CHAR NO-UNDO INITIAL "helvetica,proportional,point,6,normal".
24 DEF VAR base-font
AS CHAR NO-UNDO INITIAL "courier,fixed,cpi,16,lpi,9,normal".
25 DEF VAR header-font
AS CHAR NO-UNDO INITIAL "Times,Point,11,lpi,6,Proportional,Normal".
28 DEFINE TEMP-TABLE MyTran
LIKE NewAcctTran
29 INDEX XPKMyTran
IS PRIMARY EntityType EntityCode AccountCode Amount.
31 /* _UIB-CODE-BLOCK-END
*/
35 &ANALYZE-SUSPEND _UIB-PREPROCESSOR-BLOCK
37 /* ******************** Preprocessor Definitions
******************** */
39 &Scoped-define PROCEDURE-TYPE Procedure
40 &Scoped-define DB-AWARE no
44 /* _UIB-PREPROCESSOR-BLOCK-END
*/
49 /* *********************** Procedure Settings
************************ */
51 &ANALYZE-SUSPEND _PROCEDURE-SETTINGS
52 /* Settings for
THIS-PROCEDURE
56 Add Fields to
: Neither
57 Other Settings
: CODE-ONLY
COMPILE
59 &ANALYZE-RESUME _END-PROCEDURE-SETTINGS
61 /* ************************* Create Window
************************** */
63 &ANALYZE-SUSPEND _CREATE-WINDOW
64 /* DESIGN Window definition
(used by the UIB
)
65 CREATE WINDOW Procedure
ASSIGN
68 /* END WINDOW DEFINITION
*/
72 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _INCLUDED-LIB Procedure
73 /* ************************* Included-Libraries
*********************** */
75 {inc
/method
/m-txtrep.i
}
80 /* _UIB-CODE-BLOCK-END
*/
87 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _CUSTOM _MAIN-BLOCK Procedure
90 /* *************************** Main Block
*************************** */
92 OUTPUT TO VALUE(txtrep-print-file
) KEEP-MESSAGES PAGE-SIZE 0.
94 RUN pclrep-start
( preview
, "reset,portrait,tm,2,a4,lm,6,courier,cpi,18,lpi,9").
102 /* _UIB-CODE-BLOCK-END
*/
106 /* ********************** Internal Procedures
*********************** */
108 &IF DEFINED(EXCLUDE-compare-batches) = 0 &THEN
110 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE compare-batches Procedure
111 PROCEDURE compare-batches
:
112 /*------------------------------------------------------------------------------
114 ------------------------------------------------------------------------------*/
115 RUN load-posted-batch.
116 RUN remove-unposted-equal.
117 RUN print-differences.
120 /* _UIB-CODE-BLOCK-END
*/
125 &IF DEFINED(EXCLUDE-inst-page-footer) = 0 &THEN
127 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-footer Procedure
128 PROCEDURE inst-page-footer
:
129 /*------------------------------------------------------------------------------
130 Purpose
: Print any page footer
131 ------------------------------------------------------------------------------*/
135 /* _UIB-CODE-BLOCK-END
*/
140 &IF DEFINED(EXCLUDE-inst-page-header) = 0 &THEN
142 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE inst-page-header Procedure
143 PROCEDURE inst-page-header
:
144 /*------------------------------------------------------------------------------
146 ------------------------------------------------------------------------------*/
149 line
= line
+ CHR(13) + SPC
(275) + "Page: " + STRING( pclrep-page-number
).
150 RUN pclrep-line
( time-font
, line
).
152 RUN pclrep-down-by
(2).
153 RUN pclrep-line
( header-font
, SPC
(35) + "Comparing posted batch " + STRING(posted-batch
) + " with unposted batch " + STRING(unposted-batch
) ).
154 RUN pclrep-down-by
(1).
158 /* _UIB-CODE-BLOCK-END
*/
163 &IF DEFINED(EXCLUDE-load-posted-batch) = 0 &THEN
165 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE load-posted-batch Procedure
166 PROCEDURE load-posted-batch
:
167 /*------------------------------------------------------------------------------
169 ------------------------------------------------------------------------------*/
170 FOR EACH AcctTran
WHERE BatchCode
= posted-batch
,
171 FIRST Document
OF AcctTran
NO-LOCK:
172 IF AcctTran.ConsequenceOf
> 0 THEN NEXT.
173 IF Document.DocumentType
= 'INTC'
THEN NEXT.
175 BUFFER-COPY AcctTran
TO MyTran.
179 /* _UIB-CODE-BLOCK-END
*/
184 &IF DEFINED(EXCLUDE-parse-parameters) = 0 &THEN
186 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE parse-parameters Procedure
187 PROCEDURE parse-parameters
:
188 /*------------------------------------------------------------------------------
190 ------------------------------------------------------------------------------*/
191 {inc
/showopts.i
"report-options"}
193 DEF VAR token
AS CHAR NO-UNDO.
194 DEF VAR i
AS INT NO-UNDO.
196 DO i
= 1 TO NUM-ENTRIES( report-options
, "~n" ):
197 token
= ENTRY( i
, report-options
, "~n" ).
199 CASE ENTRY( 1, token
):
200 WHEN "Preview" THEN preview
= Yes.
201 WHEN "Reverse" THEN reverse
= Yes.
202 WHEN "PostedBatch" THEN posted-batch
= INT( ENTRY(2,token
) ).
203 WHEN "UnpostedBatch" THEN unposted-batch
= INT( ENTRY(2,token
) ).
210 /* _UIB-CODE-BLOCK-END
*/
215 &IF DEFINED(EXCLUDE-print-differences) = 0 &THEN
217 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE print-differences Procedure
218 PROCEDURE print-differences
:
219 /*------------------------------------------------------------------------------
221 ------------------------------------------------------------------------------*/
222 FOR EACH MyTran
BY EntityType
BY EntityCode
BY AccountCode
BY Amount
:
223 line
= MyTran.EntityType
+ " "
224 + STRING( MyTran.EntityCode
, "99999") + " "
225 + STRING( MyTran.AccountCode
, "9999.99") + " "
226 + STRING( MyTran.Amount
, "->>,>>>,>>9.99" ) + " "
227 + STRING( MyTran.BatchCode
, ">>9999").
228 RUN pclrep-line
( base-font
, line
).
232 /* _UIB-CODE-BLOCK-END
*/
237 &IF DEFINED(EXCLUDE-remove-unposted-equal) = 0 &THEN
239 &ANALYZE-SUSPEND _UIB-CODE-BLOCK _PROCEDURE remove-unposted-equal Procedure
240 PROCEDURE remove-unposted-equal
:
241 /*------------------------------------------------------------------------------
243 ------------------------------------------------------------------------------*/
244 FOR EACH NewAcctTran
WHERE BatchCode
= unposted-batch
NO-LOCK:
245 FIND FIRST MyTran
WHERE MyTran.EntityType
= NewAcctTran.EntityType
246 AND MyTran.EntityCode
= NewAcctTran.EntityCode
247 AND MyTran.AccountCode
= NewAcctTran.AccountCode
248 AND MyTran.Amount
= NewAcctTran.Amount
NO-ERROR.
249 IF AVAILABLE(MyTran
) THEN
253 BUFFER-COPY NewAcctTran
TO MyTran.
259 /* _UIB-CODE-BLOCK-END
*/