RCDPEREC ;ALB/TMK/KML/PJH - RECONCILIATION REPORT FOR EDI LOCKBOX FMS DOCS ; 8/2/10 4:17pm
;;4.5;Accounts Receivable;**208,244,269,283**;Mar 20, 1995;Build 8
;;Per VHA Directive 2004-038, this routine should not be modified.
;
EN ; Entrypoint for producing the report
N RCDDT,RCSEL,ZTRTN,ZTDESC,ZTSAVE,ZTSK,%ZIS,POP,DIR,DTOUT,DUOUT
S DIR(0)="DA^3000101:"_DT_":AEPX",DIR("A")="SELECT THE EFT DEPOSIT DATE TO START WITH: " W ! D ^DIR K DIR
S RCDDT=$S($D(DTOUT)!$D(DUOUT):"",1:Y)
Q:'RCDDT
S DIR("B")="ALL"
S DIR(0)="SA^A:ALL;N:NOT FULLY TRANSFERRED",DIR("A")="DO YOU WANT (A)LL DEPOSITS OR ONLY THOSE (N)OT FULLY TRANSFERRED?: " W ! D ^DIR K DIR
S RCSEL=$S($D(DTOUT)!$D(DUOUT):"",1:Y)
Q:RCSEL=""
W !
S %ZIS="QM" D ^%ZIS Q:POP
I $D(IO("Q")) D Q
. S ZTRTN="ENQUE^RCDPEREC",ZTDESC="AR - CR/TR RELATED DOCUMENTS FOR e-PAYMENTS"
. S ZTSAVE("RCDDT")="",ZTSAVE("RCSEL")=""
. D ^%ZTLOAD
. W !!,$S($D(ZTSK):"Your task number"_ZTSK_" has been queued.",1:"Unable to queue this job.")
. K ZTSK,IO("Q") D HOME^%ZIS
U IO
D ENQUE
Q
;
ENQUE ; Queued entrypoint for the report
; RCDDT = starting EFT deposit date
; RCSEL = 'A' if all deposits included ... 'N' if only those not fully
; transferred out of 8NZZ
;
N Z,Z0,RCSTOP,RCD,RCR,RCSTAT,RCDEP,RCEFT,RCEFT1,RCT,RC0,RC00,RC000,RCTOT,RCTOT1,RCTRANS
K ^TMP($J,"RCDEP")
;
S (RCSTOP,RCT)=0,RCDDT=RCDDT-.1
F S RCDDT=$O(^RCY(344.3,"ADEP",RCDDT)) Q:'RCDDT!RCSTOP S RCDEP=0 F S RCDEP=$O(^RCY(344.3,"ADEP",RCDDT,RCDEP)) Q:'RCDEP S RCEFT=0 F S RCEFT=$O(^RCY(344.3,"ADEP",RCDDT,RCDEP,RCEFT)) Q:'RCEFT!RCSTOP D
. S RCTOT=0,RC0=$G(^RCY(344.3,RCEFT,0))
. S RCD=$E(RCDDT_$J("",8),1,8)_RCDEP
. S RCEFT1=0 F S RCEFT1=$O(^RCY(344.31,"B",RCEFT,RCEFT1)) Q:'RCEFT1!RCSTOP S RC00=$G(^RCY(344.31,RCEFT1,0)) D
.. ;
.. I $D(ZTQUEUED) S RCT=RCT+1 I '(RCT#100),$$S^%ZTLOAD S (RCSTOP,ZTSTOP)=1 K ZTREQ Q
.. ;
.. I '$D(^TMP($J,"RCDEP",RCD)) S ^TMP($J,"RCDEP",RCD)=$P(RC0,U,6,11),^TMP($J,"RCDEP",RCD,0)=$S($P(RC00,U,9):$$FMSSTAT^RCDPUREC($P(RC00,U,9)),1:"NO CR DOCUMENT"),^TMP($J,"RCDEP",RCD,"EFT")=RCEFT
.. S RCTRANS=+$P(RC00,U,14) S:'RCTRANS RCTRANS=1
.. ;
.. I '$P(RC00,U,8) S ^TMP($J,"RCDEP",RCD,RCTRANS,"RCUNM")=RCEFT1 Q ; Not matched
.. ;
.. I '$O(^RCY(344,"AEFT",RCEFT1,0)) D Q ; No receipt
... I $P(RC00,U,16)'="" D Q ; EFT detail entered on-line
.... S ^TMP($J,"RCDEP",RCD,RCTRANS)=RCEFT1_U_"ENTERED ON-LINE"_U_$S($P(RC000,U,18):"ERA #"_$P($G(^RCY(344.4,+$P(RC00,U,10),0)),U),1:"PAPER EOB")_U_$P(RC00,U,16)_U_"NO RECEIPT",RCTOT=RCTOT+$P(RC00,U,7)
... S ^TMP($J,"RCDEP",RCD,RCTRANS)=RCEFT1_U_"NO TR DOC"_U_$S($P(RC00,U,10):"ERA #"_$P($G(^RCY(344.4,+$P(RC00,U,10),0)),U),1:"PAPER EOB")_"^^NO RECEIPT"
.. ;
.. S RCR=0 F S RCR=$O(^RCY(344,"AEFT",RCEFT1,RCR)) Q:'RCR S RC000=$G(^RCY(344,RCR,0)) D
... S RCTOT=RCTOT+$$PAYTOTAL^RCDPURED(RCR)
... S RCSTAT=$$FMSSTAT^RCDPUREC(RCR) S:$P(RCSTAT,U)="" RCSTAT="NO TR DOC"
... S ^TMP($J,"RCDEP",RCD,RCTRANS)=RCEFT1_U_$P(RCSTAT,U)_U_$S($P(RC000,U,18):"ERA #"_$P($G(^RCY(344.4,+$P(RC000,U,18),0)),U),1:"PAPER EOB")_U_$P(RCSTAT,U,2)_U_RCR
. Q:RCSTOP
. I RCSEL="N",+RCTOT=+$P(RC0,U,8) K ^TMP($J,"RCDEP",RCD) Q
. S ^TMP($J,"RCDEP",RCD,"TOT")=RCTOT_U_$P(RC0,U,8)
;
; Output the report
S RCD="",RCPG=0
I RCSTOP K ^TMP($J,"RCDEP")
F S RCD=$O(^TMP($J,"RCDEP",RCD)) Q:RCD=""!RCSTOP D Q:RCSTOP D TOT(RCD,.RCSTOP,.RCPG)
. S RC0=$G(^TMP($J,"RCDEP",RCD)) D EFTDEP(RCD,.RCSTOP,.RCPG) ; EFT dep
. Q:RCSTOP
. S RCTRANS=0 F S RCTRANS=$O(^TMP($J,"RCDEP",RCD,RCTRANS)) Q:'RCTRANS!RCSTOP S RC00=$G(^(RCTRANS)) D ; EFT detail deposits
.. S RCSTOP=$$NEWPG(.RCPG) Q:RCSTOP
.. I RC00="",$D(^TMP($J,"RCDEP",RCD,RCTRANS,"RCUNM")) S Z=$G(^("RCUNM")) D Q ; Unmatched
... W !,?3,$J("",6)," UNMATCHED ",$E($P(Z,U,2)_$J("",30),1,30)_" "_$E($P(Z,U,3)_$J("",20),1,20)
... W !,?13,$P(Z,U,4)
.. ;
.. I RC00="" W !,?3,"ERROR IN EFT DETAIL LINE #: ",RCTRANS Q ; Error
.. ;
.. S Z=$G(^RCY(344.31,+RC00,0))
.. W !,?3,$E(+RC00_$J("",6),1,6)_" "_$E($P(RC00,U,3)_$J("",10),1,10)_" "_$E($P(Z,U,2)_$J("",30),1,30)_" "_$E($P(Z,U,3)_$J("",20),1,20)
..; HIPAA 5010 - to accommodate the extended length of the Trace # field from 30 to 50 characters the Trace # will be printed on its own line.
.. W !,?13,$E($P(Z,U,4)_$J("",50),1,50)
.. W !,?43,$E($P(RC00,U,5)_$J("",10),1,10),!,?15,$E($P(RC00,U,2)_$J("",10),1,10)_" "_$E($P(RC00,U,4)_$J("",15),1,15)
;
I 'RCSTOP,RCPG D ASK(.RCSTOP)
;
I $D(ZTQUEUED) D
. I $G(RCSTOP) D HDR1(0) W !,"TASK STOPPED BY USER" Q
. S ZTREQ="@"
I '$D(ZTQUEUED) D ^%ZISC
K ^TMP($J,"RCDEP")
Q
;
EFTDEP(RCD,RCSTOP,RCPG) ;
; RCD = deposit date (FM) concatenated with the deposit #
N Z,Z0
I $D(ZTQUEUED),$$S^%ZTLOAD S (RCSTOP,ZTSTOP)=1 K ZTREQ Q
S Z=$G(^TMP($J,"RCDEP",RCD)),Z0=$G(^(RCD,0))
S RCSTOP=$$NEWPG(.RCPG) Q:RCSTOP
I $Y+7>IOSL W !! S RCSTOP=$$NEWPG(.RCPG) Q:RCSTOP
W:'$P(RCPG,U,2) !!
; PRCA*4.5*283 - Change $E 'TO' position from 6 to 9 to allow for 9 digit DEP #'s
W !,$E($$FMTE^XLFDT($P(Z,U,2),"2D")_$J("",8),1,8)," ",$E(+$G(^TMP($J,"RCDEP",RCD,"EFT"))_$J("",6),1,6)," ",$E($P(Z,U)_$J("",9),1,9)," ",$J($P(Z,U,3),13,2)," ",$E($S($P(Z,U,6):$$FMTE^XLFDT($P(Z,U,6),"2D"),1:"UNPOSTED")_$J("",8),1,8)
W !,?5,$E($P(Z0,U)_$J("",20),1,20)," ",$P(Z0,U,2)
Q
;
TOT(RCD,RCSTOP,RCPG) ; Output the total lines for the deposit
S RCSTOP=$$NEWPG(.RCPG) Q:RCSTOP
W !,$J("",26),"TOTAL AMOUNT SENT VIA 'TR' DOCUMENTS: ",$J($G(^TMP($J,"RCDEP",RCD,"TOT")),15,2)
W !,$J("",26),"TOTAL AMOUNT STILL TO BE TRANSFERRED: ",$J($P($G(^TMP($J,"RCDEP",RCD,"TOT")),U,2)-$G(^TMP($J,"RCD",RCD,"TOT")),15,2)
Q
;
NEWPG(RCPG) ; Check for new page needed, output header
; Function returns 1 if user chooses to stop output
N RCX,RCZ
S RCZ=0,RCX=$P(RCPG,U,2)
I 'RCPG!(($Y+5)>IOSL) D
. D:RCPG ASK(.RCZ) I RCZ Q
. D HDR1(.RCPG)
I RCX S $P(RCPG,U,2)=0
Q RCZ
;
SELECT() ; Select first deposit #
; Function returns values selected for first deposit #
;
N DIR,X,Y,DTOUT,DUOUT
;
HDR1(RCPG) ;Print report hdr
; RCPG = last page #^0/1 for top of page indicator
N Z,Z0,X
I RCPG!($E(IOST,1,2)="C-") W @IOF,*13
S RCPG=$G(RCPG)+1_U_1
W !,"EDI LOCKBOX FUND 5287.4/8NZZ RECONCILIATION REPORT",?55,$$FMTE^XLFDT(DT,2),?70,"Page: ",+RCPG
; PRCA*4.5*283 - Move TOTAL DEP AMT to right 3 space (27 to 30) to allow for 9 digit DEP #'s
W !!,"DEP DATE ENTRY# DEP # TOTAL DEP AMT POST DT RECEIPT #",!,?5,"CR DOCUMENT CR DOC STATUS"
W !,?3,"EFT # MATCHED TO PAYER NAME PAYER ID ",!,?13,"TRACE #"
; HIPAA 5010 - put receipt # on a separate line to accomodate the increased length of the TRACE #
W !,?20,"RECEIPT #"
W !,?15,"TR DOCUMENT TR DOC STATUS"
W !,$TR($J("",IOM)," ","=")
Q
;
ASK(RCSTOP) ;
I $E(IOST,1,2)'["C-" Q
N DIR,DIROUT,DIRUT,DTOUT,DUOUT
S DIR(0)="E" W ! D ^DIR
I ($D(DIRUT))!($D(DUOUT)) S RCSTOP=1 Q
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HRCDPEREC 6974 printed Nov 22, 2024@16:55:21 Page 2
RCDPEREC ;ALB/TMK/KML/PJH - RECONCILIATION REPORT FOR EDI LOCKBOX FMS DOCS ; 8/2/10 4:17pm
+1 ;;4.5;Accounts Receivable;**208,244,269,283**;Mar 20, 1995;Build 8
+2 ;;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
EN ; Entrypoint for producing the report
+1 NEW RCDDT,RCSEL,ZTRTN,ZTDESC,ZTSAVE,ZTSK,%ZIS,POP,DIR,DTOUT,DUOUT
+2 SET DIR(0)="DA^3000101:"_DT_":AEPX"
SET DIR("A")="SELECT THE EFT DEPOSIT DATE TO START WITH: "
WRITE !
DO ^DIR
KILL DIR
+3 SET RCDDT=$SELECT($DATA(DTOUT)!$DATA(DUOUT):"",1:Y)
+4 if 'RCDDT
QUIT
+5 SET DIR("B")="ALL"
+6 SET DIR(0)="SA^A:ALL;N:NOT FULLY TRANSFERRED"
SET DIR("A")="DO YOU WANT (A)LL DEPOSITS OR ONLY THOSE (N)OT FULLY TRANSFERRED?: "
WRITE !
DO ^DIR
KILL DIR
+7 SET RCSEL=$SELECT($DATA(DTOUT)!$DATA(DUOUT):"",1:Y)
+8 if RCSEL=""
QUIT
+9 WRITE !
+10 SET %ZIS="QM"
DO ^%ZIS
if POP
QUIT
+11 IF $DATA(IO("Q"))
Begin DoDot:1
+12 SET ZTRTN="ENQUE^RCDPEREC"
SET ZTDESC="AR - CR/TR RELATED DOCUMENTS FOR e-PAYMENTS"
+13 SET ZTSAVE("RCDDT")=""
SET ZTSAVE("RCSEL")=""
+14 DO ^%ZTLOAD
+15 WRITE !!,$SELECT($DATA(ZTSK):"Your task number"_ZTSK_" has been queued.",1:"Unable to queue this job.")
+16 KILL ZTSK,IO("Q")
DO HOME^%ZIS
End DoDot:1
QUIT
+17 USE IO
+18 DO ENQUE
+19 QUIT
+20 ;
ENQUE ; Queued entrypoint for the report
+1 ; RCDDT = starting EFT deposit date
+2 ; RCSEL = 'A' if all deposits included ... 'N' if only those not fully
+3 ; transferred out of 8NZZ
+4 ;
+5 NEW Z,Z0,RCSTOP,RCD,RCR,RCSTAT,RCDEP,RCEFT,RCEFT1,RCT,RC0,RC00,RC000,RCTOT,RCTOT1,RCTRANS
+6 KILL ^TMP($JOB,"RCDEP")
+7 ;
+8 SET (RCSTOP,RCT)=0
SET RCDDT=RCDDT-.1
+9 FOR
SET RCDDT=$ORDER(^RCY(344.3,"ADEP",RCDDT))
if 'RCDDT!RCSTOP
QUIT
SET RCDEP=0
FOR
SET RCDEP=$ORDER(^RCY(344.3,"ADEP",RCDDT,RCDEP))
if 'RCDEP
QUIT
SET RCEFT=0
FOR
SET RCEFT=$ORDER(^RCY(344.3,"ADEP",RCDDT,RCDEP,RCEFT))
if 'RCEFT!RCSTOP
QUIT
Begin DoDot:1
+10 SET RCTOT=0
SET RC0=$GET(^RCY(344.3,RCEFT,0))
+11 SET RCD=$EXTRACT(RCDDT_$JUSTIFY("",8),1,8)_RCDEP
+12 SET RCEFT1=0
FOR
SET RCEFT1=$ORDER(^RCY(344.31,"B",RCEFT,RCEFT1))
if 'RCEFT1!RCSTOP
QUIT
SET RC00=$GET(^RCY(344.31,RCEFT1,0))
Begin DoDot:2
+13 ;
+14 IF $DATA(ZTQUEUED)
SET RCT=RCT+1
IF '(RCT#100)
IF $$S^%ZTLOAD
SET (RCSTOP,ZTSTOP)=1
KILL ZTREQ
QUIT
+15 ;
+16 IF '$DATA(^TMP($JOB,"RCDEP",RCD))
SET ^TMP($JOB,"RCDEP",RCD)=$PIECE(RC0,U,6,11)
SET ^TMP($JOB,"RCDEP",RCD,0)=$SELECT($PIECE(RC00,U,9):$$FMSSTAT^RCDPUREC($PIECE(RC00,U,9)),1:"NO CR DOCUMENT")
SET ^TMP($JOB,"RCDEP",RCD,"EFT")=RCEFT
+17 SET RCTRANS=+$PIECE(RC00,U,14)
if 'RCTRANS
SET RCTRANS=1
+18 ;
+19 ; Not matched
IF '$PIECE(RC00,U,8)
SET ^TMP($JOB,"RCDEP",RCD,RCTRANS,"RCUNM")=RCEFT1
QUIT
+20 ;
+21 ; No receipt
IF '$ORDER(^RCY(344,"AEFT",RCEFT1,0))
Begin DoDot:3
+22 ; EFT detail entered on-line
IF $PIECE(RC00,U,16)'=""
Begin DoDot:4
+23 SET ^TMP($JOB,"RCDEP",RCD,RCTRANS)=RCEFT1_U_"ENTERED ON-LINE"_U_$SELECT($PIECE(RC000,U,18):"ERA #"_$PIECE($GET(^RCY(344.4,+$PIECE(RC00,U,10),0)),U),1:"PAPER EOB")_U_$PIECE(RC00,U,16)_U_"NO RECEIPT"
SET RCTOT=RCTOT+$PIECE(RC00,U,7)
End DoDot:4
QUIT
+24 SET ^TMP($JOB,"RCDEP",RCD,RCTRANS)=RCEFT1_U_"NO TR DOC"_U_$SELECT($PIECE(RC00,U,10):"ERA #"_$PIECE($GET(^RCY(344.4,+$PIECE(RC00,U,10),0)),U),1:"PAPER EOB")_"^^NO RECEIPT"
End DoDot:3
QUIT
+25 ;
+26 SET RCR=0
FOR
SET RCR=$ORDER(^RCY(344,"AEFT",RCEFT1,RCR))
if 'RCR
QUIT
SET RC000=$GET(^RCY(344,RCR,0))
Begin DoDot:3
+27 SET RCTOT=RCTOT+$$PAYTOTAL^RCDPURED(RCR)
+28 SET RCSTAT=$$FMSSTAT^RCDPUREC(RCR)
if $PIECE(RCSTAT,U)=""
SET RCSTAT="NO TR DOC"
+29 SET ^TMP($JOB,"RCDEP",RCD,RCTRANS)=RCEFT1_U_$PIECE(RCSTAT,U)_U_$SELECT($PIECE(RC000,U,18):"ERA #"_$PIECE($GET(^RCY(344.4,+$PIECE(RC000,U,18),0)),U),1:"PAPER EOB")_U_$PIECE(RCSTAT,U,2)_U_RCR
End DoDot:3
End DoDot:2
+30 if RCSTOP
QUIT
+31 IF RCSEL="N"
IF +RCTOT=+$PIECE(RC0,U,8)
KILL ^TMP($JOB,"RCDEP",RCD)
QUIT
+32 SET ^TMP($JOB,"RCDEP",RCD,"TOT")=RCTOT_U_$PIECE(RC0,U,8)
End DoDot:1
+33 ;
+34 ; Output the report
+35 SET RCD=""
SET RCPG=0
+36 IF RCSTOP
KILL ^TMP($JOB,"RCDEP")
+37 FOR
SET RCD=$ORDER(^TMP($JOB,"RCDEP",RCD))
if RCD=""!RCSTOP
QUIT
Begin DoDot:1
+38 ; EFT dep
SET RC0=$GET(^TMP($JOB,"RCDEP",RCD))
DO EFTDEP(RCD,.RCSTOP,.RCPG)
+39 if RCSTOP
QUIT
+40 ; EFT detail deposits
SET RCTRANS=0
FOR
SET RCTRANS=$ORDER(^TMP($JOB,"RCDEP",RCD,RCTRANS))
if 'RCTRANS!RCSTOP
QUIT
SET RC00=$GET(^(RCTRANS))
Begin DoDot:2
+41 SET RCSTOP=$$NEWPG(.RCPG)
if RCSTOP
QUIT
+42 ; Unmatched
IF RC00=""
IF $DATA(^TMP($JOB,"RCDEP",RCD,RCTRANS,"RCUNM"))
SET Z=$GET(^("RCUNM"))
Begin DoDot:3
+43 WRITE !,?3,$JUSTIFY("",6)," UNMATCHED ",$EXTRACT($PIECE(Z,U,2)_$JUSTIFY("",30),1,30)_" "_$EXTRACT($PIECE(Z,U,3)_$JUSTIFY("",20),1,20)
+44 WRITE !,?13,$PIECE(Z,U,4)
End DoDot:3
QUIT
+45 ;
+46 ; Error
IF RC00=""
WRITE !,?3,"ERROR IN EFT DETAIL LINE #: ",RCTRANS
QUIT
+47 ;
+48 SET Z=$GET(^RCY(344.31,+RC00,0))
+49 WRITE !,?3,$EXTRACT(+RC00_$JUSTIFY("",6),1,6)_" "_$EXTRACT($PIECE(RC00,U,3)_$JUSTIFY("",10),1,10)_" "_$EXTRACT($PIECE(Z,U,2)_$JUSTIFY("",30),1,30)_" "_$EXTRACT($PIECE(Z,U,3)_$JUSTIFY("",20),1,20)
+50 ; HIPAA 5010 - to accommodate the extended length of the Trace # field from 30 to 50 characters the Trace # will be printed on its own line.
+51 WRITE !,?13,$EXTRACT($PIECE(Z,U,4)_$JUSTIFY("",50),1,50)
+52 WRITE !,?43,$EXTRACT($PIECE(RC00,U,5)_$JUSTIFY("",10),1,10),!,?15,$EXTRACT($PIECE(RC00,U,2)_$JUSTIFY("",10),1,10)_" "_$EXTRACT($PIECE(RC00,U,4)_$JUSTIFY("",15),1,15)
End DoDot:2
End DoDot:1
if RCSTOP
QUIT
DO TOT(RCD,.RCSTOP,.RCPG)
+53 ;
+54 IF 'RCSTOP
IF RCPG
DO ASK(.RCSTOP)
+55 ;
+56 IF $DATA(ZTQUEUED)
Begin DoDot:1
+57 IF $GET(RCSTOP)
DO HDR1(0)
WRITE !,"TASK STOPPED BY USER"
QUIT
+58 SET ZTREQ="@"
End DoDot:1
+59 IF '$DATA(ZTQUEUED)
DO ^%ZISC
+60 KILL ^TMP($JOB,"RCDEP")
+61 QUIT
+62 ;
EFTDEP(RCD,RCSTOP,RCPG) ;
+1 ; RCD = deposit date (FM) concatenated with the deposit #
+2 NEW Z,Z0
+3 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET (RCSTOP,ZTSTOP)=1
KILL ZTREQ
QUIT
+4 SET Z=$GET(^TMP($JOB,"RCDEP",RCD))
SET Z0=$GET(^(RCD,0))
+5 SET RCSTOP=$$NEWPG(.RCPG)
if RCSTOP
QUIT
+6 IF $Y+7>IOSL
WRITE !!
SET RCSTOP=$$NEWPG(.RCPG)
if RCSTOP
QUIT
+7 if '$PIECE(RCPG,U,2)
WRITE !!
+8 ; PRCA*4.5*283 - Change $E 'TO' position from 6 to 9 to allow for 9 digit DEP #'s
+9 WRITE !,$EXTRACT($$FMTE^XLFDT($PIECE(Z,U,2),"2D")_$JUSTIFY("",8),1,8)," ",...
... $EXTRACT(+$GET(^TMP($JOB,"RCDEP",RCD,"EFT"))_$JUSTIFY("",6),1,6)," ",$EXTRACT($PIECE(Z,U)_$JUSTIFY("",9),1,9)," ",$JUSTIFY($PIECE(Z,U,3),13,2)," ",$EXTRACT($SELECT($PIECE(Z,U,6):$$FMTE^XLFDT($PIECE(Z,U,6),"2D"),1:"UNPOSTED")_$JUSTIFY("",
8),1,8)
+10 WRITE !,?5,$EXTRACT($PIECE(Z0,U)_$JUSTIFY("",20),1,20)," ",$PIECE(Z0,U,2)
+11 QUIT
+12 ;
TOT(RCD,RCSTOP,RCPG) ; Output the total lines for the deposit
+1 SET RCSTOP=$$NEWPG(.RCPG)
if RCSTOP
QUIT
+2 WRITE !,$JUSTIFY("",26),"TOTAL AMOUNT SENT VIA 'TR' DOCUMENTS: ",$JUSTIFY($GET(^TMP($JOB,"RCDEP",RCD,"TOT")),15,2)
+3 WRITE !,$JUSTIFY("",26),"TOTAL AMOUNT STILL TO BE TRANSFERRED: ",$JUSTIFY($PIECE($GET(^TMP($JOB,"RCDEP",RCD,"TOT")),U,2)-$GET(^TMP($JOB,"RCD",RCD,"TOT")),15,2)
+4 QUIT
+5 ;
NEWPG(RCPG) ; Check for new page needed, output header
+1 ; Function returns 1 if user chooses to stop output
+2 NEW RCX,RCZ
+3 SET RCZ=0
SET RCX=$PIECE(RCPG,U,2)
+4 IF 'RCPG!(($Y+5)>IOSL)
Begin DoDot:1
+5 if RCPG
DO ASK(.RCZ)
IF RCZ
QUIT
+6 DO HDR1(.RCPG)
End DoDot:1
+7 IF RCX
SET $PIECE(RCPG,U,2)=0
+8 QUIT RCZ
+9 ;
SELECT() ; Select first deposit #
+1 ; Function returns values selected for first deposit #
+2 ;
+3 NEW DIR,X,Y,DTOUT,DUOUT
+4 ;
HDR1(RCPG) ;Print report hdr
+1 ; RCPG = last page #^0/1 for top of page indicator
+2 NEW Z,Z0,X
+3 IF RCPG!($EXTRACT(IOST,1,2)="C-")
WRITE @IOF,*13
+4 SET RCPG=$GET(RCPG)+1_U_1
+5 WRITE !,"EDI LOCKBOX FUND 5287.4/8NZZ RECONCILIATION REPORT",?55,$$FMTE^XLFDT(DT,2),?70,"Page: ",+RCPG
+6 ; PRCA*4.5*283 - Move TOTAL DEP AMT to right 3 space (27 to 30) to allow for 9 digit DEP #'s
+7 WRITE !!,"DEP DATE ENTRY# DEP # TOTAL DEP AMT POST DT RECEIPT #",!,?5,"CR DOCUMENT CR DOC STATUS"
+8 WRITE !,?3,"EFT # MATCHED TO PAYER NAME PAYER ID ",!,?13,"TRACE #"
+9 ; HIPAA 5010 - put receipt # on a separate line to accomodate the increased length of the TRACE #
+10 WRITE !,?20,"RECEIPT #"
+11 WRITE !,?15,"TR DOCUMENT TR DOC STATUS"
+12 WRITE !,$TRANSLATE($JUSTIFY("",IOM)," ","=")
+13 QUIT
+14 ;
ASK(RCSTOP) ;
+1 IF $EXTRACT(IOST,1,2)'["C-"
QUIT
+2 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT
+3 SET DIR(0)="E"
WRITE !
DO ^DIR
+4 IF ($DATA(DIRUT))!($DATA(DUOUT))
SET RCSTOP=1
QUIT
+5 QUIT
+6 ;