BARUFRP1 ; IHS/SD/TPF - UFMS REPORTS SECONDARY CALLS ; 12/22/2008
;;1.8;IHS ACCOUNTS RECEIVABLE;**3,6,10,20**;OCT 26, 2005
Q
;
ASKDEV(START,END,RPTTYP) ;EP - ENTRY POINT FROM BARUFRPT
S %ZIS="MQ"
D ^%ZIS
Q:POP
I $D(IO("Q")) D QUE Q
I IO'=IO(0) U IO
D PRINT,^%ZISC
Q
QUE ; EP - QUE REPORT
I RPTTYP="G" S ZTRTN="GRNTOT^BARUFRP1(START,END)"
I RPTTYP="SS" S ZTRTN="SUMSESS^BARUFRP1(START,END)"
I RPTTYP="D" S ZTRTN="DETAIL^BARUFRP1(START,END)"
I RPTTYP="F" S ZTRTN="BATFILE^BARUFRP1(START,END)"
I RPTTYP="SC" S ZTRTN="SUMCASH^BARUFRP1(START,END)"
I RPTTYP="SF" S ZTRTN="SUMBAT^BARUFRP1(START,END)"
S ZTDESC=$S(RPTTYP="S":"FILE TOTALS BY SESSION",RPTTYP="D":"DETAIL",RPTTYP="G":"GRAND TOTAL ALL FILES",RPTTYP="F":"FILE & FILE NAMES",RPTTYP="SF":"FILE TOTALS",RPTTYP="SC":"BATCH TOTAL BY CASHIER",1:"")_" REPORT"
S ZTSAVE("START")=""
S ZTSAVE("END")=""
S ZTSAVE("RPTTYP")=""
S ZTSAVE("DASH")=""
D ^%ZTLOAD
I $D(ZTSK)[0 W !!?5,"Report Cancelled!"
E W !!?5,"Report task #: ",$G(ZTSK)
D HOME^%ZIS
Q
;
PRINT ;EP - ENTER FROM TASKMAN
I RPTTYP="SS" D SUMSESS^BARUFRP1(START,END) ;SESSION TOTALS
I RPTTYP="SC" D SUMCASH^BARUFRP1(START,END) ;CASHIER TOTALS
I RPTTYP="SF" D SUMBAT^BARUFRP1(START,END) ;FILE TOTALS
I RPTTYP="G" D GRNTOT^BARUFRP1(START,END) ;GRANDTOTAL ALL FILES
I RPTTYP="D" D DETAIL^BARUFRP1(START,END) ;DETAIL
I RPTTYP="F" D BATFILE^BARUFRP1(START,END) ;FILE DATES AND FILE NAME
Q
;
DETAIL(START,END) ;EP - PRINT View File DETAIL REPORT
;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND PRINTS
;OUT TRANSACTION DETAILS FOR EACH TRANSACTION TRANSMITTED AS WELL AS THE FILES
;CREATED
K PAGE
D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
S Y=START X ^DD("DD") S EXSTART=Y
S Y=END X ^DD("DD") S EXEND=Y
S RPTTYP="D"
S ESC=0
D BATHDR^BARUFRPT(DATE,RPTTYP)
D BATDET^BARUFRPT("")
S:END'[(".") END=END_".999999"
S BATCH=START-.000001
F S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END) D
.I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP)
.W !,"SESSION FILE: ",BATCH
.S UDUZ=""
.F S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC) D
..S SESSID=""
..F S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC) D
...S TRDATE=0
...F S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC) D
.... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
.... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
.... I $P(TRQUIT,U,2)'=1 Q ; Not Transmitted
.... S TRQUIT=$P(TRQUIT,U,4) ; Date this TRX EXPORT to UFMS
.... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
.... ; END 1.8*20
....S IENS=TRDATE_","
....;Begin new code ;MRS:BAR*1.8*10 H1087
....D GETDATA^BARUFRP3
....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
....Q:'BILL
....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
....;End new code ;MRS:BAR*1.8*10 H1087
....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH)
....W !?3,BILL
....S Y=TRDATE X ^DD("DD") S EXDATE=Y
....W ?25,EXDATE
....W !?10,ENTRYBY
....W ?35,CREDDEBT
....W ?52,$E(TRANTYP,1,15)
....W ?70,$E(ADJCAT,1,10)
....;GET TRANSMIT FILES
....Q:'$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0))
....W !!?35,"TRANSMISSION FILES: "
....S (RECORD,LN)=0
....F S RECORD=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,RECORD)) Q:'RECORD!(ESC) D
.....S IENS=RECORD_","_SESSID_","_UDUZ_","
.....S FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
.....Q:FILENAME=""
.....S LN=LN+1
.....S DELDATE=$P(FILENAME,"_",7)
.....S DELDATE=$E(DELDATE,7,8)_"/"_$E(DELDATE,5,6)_"/"_$E(DELDATE,1,4)
.....S DELTIME=$P($P(FILENAME,"_",8),".")
.....S DELTIME=$E(DELTIME,1,2)_":"_$E(DELTIME,3,4)
.....S TRANSBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
.....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH)
.....W !?35,FILENAME
....W !
I $D(IO("S")) W @IOF Q ;flush buffer
Q:ESC
I '$D(ZTQUEUED)&(IO=IO(0)) D
.K DIR
.S DIR(0)="E"
.W !
.D ^DIR
Q
;
SUMSESS(START,END) ;EP - PRINT TOTALS FOR EACH SESSION
;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
;IN THE DATE RANGE
K PAGE
D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
S Y=START X ^DD("DD") S EXSTART=Y
S Y=END X ^DD("DD") S EXEND=Y
S ESC=0
S RPTTYP="SS"
D BATHDR^BARUFRPT(DATE,RPTTYP)
S:END'[(".") END=END_".999999"
S BATCH=START-.000001
F BATCNT=1:1 S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END) D
.S UDUZ=""
.I '(BATCNT#2),(IO'=IO(0)) D BATHDR^BARUFRPT(DATE,RPTTYP)
.F S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC) D
..D SUMINIT^BARUFRPT
..S SESSID=""
..F SESSCNT=1:1 S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC) D
...I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP)
...W !,"SESSION FILE: ",BATCH
...W ?25,"CASHIER: ",$P($G(^VA(200,UDUZ,0)),U)
...W ?53,"SESSION ID: ",SESSID
...S TRDATE=0
...F S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC) D
.... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
.... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
.... I $P(TRQUIT,U,2)'=1 Q ; Not Transmitted
.... S TRQUIT=$P(TRQUIT,U,4) ; Date this TRX EXPORT to UFMS
.... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
.... ; END 1.8*20
....S IENS=TRDATE_","
....;Begin new code ;MRS:BAR*1.8*10 H1087
....D GETDATA^BARUFRP3
....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
....Q:'BILL
....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
....;End new code ;MRS:BAR*1.8*10 H1087
....D COUNT^BARUFRPT(.TOTALS)
..D LIST^BARUFRPT(.TOTALS)
..I '$D(ZTQUEUED)&(IO=IO(0)) D
...Q:$D(IO("S"))
...K DIR
...S DIR(0)="E"
...D ^DIR
...S ESC=U=X
...Q:ESC
...D BATHDR^BARUFRPT(DATE,RPTTYP)
I $D(IO("S")) W @IOF ;flush buffer
Q
;
SUMCASH(START,END) ;EP - PRINT TOTALS FOR EACH CASHIER
;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
;IN THE DATE RANGE
K PAGE
D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
S Y=START X ^DD("DD") S EXSTART=Y
S Y=END X ^DD("DD") S EXEND=Y
S ESC=0
S RPTTYP="SC"
D BATHDR^BARUFRPT(DATE,RPTTYP)
S:END'[(".") END=END_".999999"
S BATCH=START-.000001
F BATCNT=1:1 S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END) D
.I '(BATCNT#3),(IO'=IO(0)) D BATHDR^BARUFRPT(DATE,RPTTYP)
.S UDUZ=""
.F S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC) D
..D SUMINIT^BARUFRPT
..W !,"SESSION FILE: ",BATCH
..W ?25,"CASHIER: ",$P($G(^VA(200,UDUZ,0)),U)
..S SESSID=""
..F SESSCNT=1:1 S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC) D
...W:SESSCNT'=1 !
...W ?53,"SESSION ID: ",SESSID
...S TRDATE=0
...F S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC) D
.... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
.... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
.... I $P(TRQUIT,U,2)'=1 Q ; Not Transmitted
.... S TRQUIT=$P(TRQUIT,U,4) ; Date this TRX EXPORT to UFMS
.... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
.... ; END 1.8*20
....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP)
....S IENS=TRDATE_","
....;Begin new code ;MRS:BAR*1.8*10 H1087
....D GETDATA^BARUFRP3
....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
....Q:'BILL
....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
....;End new code ;MRS:BAR*1.8*10 H1087
....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP)
....D COUNT^BARUFRPT(.TOTALS)
..D LIST^BARUFRPT(.TOTALS)
.;
.I '$D(ZTQUEUED)&(IO=IO(0)) D
..K DIR
..S DIR(0)="E"
..D ^DIR
..S ESC=U=X
..Q:ESC
..Q:'$O(^BARSESS(DUZ(2),"F",BATCH))
..D BATHDR^BARUFRPT(DATE,RPTTYP)
I $D(IO("S")) W @IOF Q ;flush buffer
Q
;
SUMBAT(START,END) ;EP - PRINT TOTALS FOR EACH BATCH
;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
;IN THE DATE RANGE
K PAGE
D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
S Y=START X ^DD("DD") S EXSTART=Y
S Y=END X ^DD("DD") S EXEND=Y
S ESC=0
S RPTTYP="SF"
D BATHDR^BARUFRPT(DATE,RPTTYP)
S:END'[(".") END=END_".999999"
S BATCH=START-.000001
F S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END) D
.D SUMINIT^BARUFRPT
.S UDUZ=""
.F S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC) D
..S SESSID=""
..F SESSCNT=1:1 S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC) D
...I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP)
...W !,"SESSION FILE: ",BATCH
...W ?25,"CASHIER: ",$P($G(^VA(200,UDUZ,0)),U)
...W ?53,"SESSION ID: ",SESSID
...S TRDATE=0
...F S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC) D
.... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
.... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
.... I $P(TRQUIT,U,2)'=1 Q ; Not Transmitted
.... S TRQUIT=$P(TRQUIT,U,4) ; Date this TRX EXPORT to UFMS
.... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
.... ; END 1.8*20
....S IENS=TRDATE_","
....;Begin new code ;MRS:BAR*1.8*10 H1087,IM30577
....D GETDATA^BARUFRP3
....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
....Q:'BILL
....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
....;End new code ;MRS:BAR*1.8*10 H1087,IM30577
....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP)
....D COUNT^BARUFRPT(.TOTALS)
.Q:$G(ESC)
.D LIST^BARUFRPT(.TOTALS)
I $D(IO("S")) W @IOF
Q
;
GRNTOT(START,END) ;EP - PRINT GRAND TOTAL (ALL BATCHES) REPORT
;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND PRINTS THE
;TOTAL ALL THE TRANSACTIONS ACTIVITY FOR THOSE BATCHES TRANSMITTED IN THAT
;DATE RANGE
D GRNTOT^BARUFRP3 ;split routine due to size
Q
;
BATFILE(START,END) ;EP - PRINT View Batch/File BATCH & FILE REPORT
;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND SHOW WHAT FILES
;WERE TRANSMITTED ON THAT DATE.
S $P(DASH,"-",81)=""
K PAGE
D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
S Y=START X ^DD("DD") S EXSTART=Y
S Y=END X ^DD("DD") S EXEND=Y
S ESC=0
S RPTTYP="F"
D BATHDR^BARUFRPT(DATE,RPTTYP)
D BFHDR
S:END'[(".") END=END_".999999"
S BATCH=START-.000001
F S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END) D
.S UDUZ=""
.F S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC) D
..S SESSID=""
..F S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC) D
...;GET TRANSMIT FILES
...Q:'$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0))
...S (RECORD,LN)=0
...F S RECORD=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,RECORD)) Q:'RECORD!(ESC) D
....S IENS=RECORD_","_SESSID_","_UDUZ_","
....S FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
....Q:FILENAME=""
....S LN=LN+1
....S DELDATE=$P(FILENAME,"_",7)
....S DELDATE=$E(DELDATE,7,8)_"/"_$E(DELDATE,5,6)_"/"_$E(DELDATE,1,4)
....S DELTIME=$P($P(FILENAME,"_",8),".")
....S DELTIME=$E(DELTIME,1,2)_":"_$E(DELTIME,3,4)
....S TRANSBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP),BFHDR Q:$D(IO("S")) K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC D BATHDR^BARUFRPT(DATE,RPTTYP),BFHDR
....; IHS/SD/PKD 1.8*20 2/9/11 HEAT24212 Print Session DATE.Time, not Export DATE.TIME
....;W:LN=1 !!,BATCH
....W:LN=1 !!,SESSID
....W:LN'=1 !
....W ?35,FILENAME
I $D(IO("S")) W @IOF ;flush buffer
Q
BFHDR ;EP - FILE DETAIL
W !?5,"SESSION FILE"
W ?45,"TRANSMISSION FILES"
W !,DASH
Q
BARUFRP1 ; IHS/SD/TPF - UFMS REPORTS SECONDARY CALLS ; 12/22/2008
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,6,10,20**;OCT 26, 2005
+2 QUIT
+3 ;
ASKDEV(START,END,RPTTYP) ;EP - ENTRY POINT FROM BARUFRPT
+1 SET %ZIS="MQ"
+2 DO ^%ZIS
+3 IF POP
QUIT
+4 IF $DATA(IO("Q"))
DO QUE
QUIT
+5 IF IO'=IO(0)
USE IO
+6 DO PRINT
DO ^%ZISC
+7 QUIT
QUE ; EP - QUE REPORT
+1 IF RPTTYP="G"
SET ZTRTN="GRNTOT^BARUFRP1(START,END)"
+2 IF RPTTYP="SS"
SET ZTRTN="SUMSESS^BARUFRP1(START,END)"
+3 IF RPTTYP="D"
SET ZTRTN="DETAIL^BARUFRP1(START,END)"
+4 IF RPTTYP="F"
SET ZTRTN="BATFILE^BARUFRP1(START,END)"
+5 IF RPTTYP="SC"
SET ZTRTN="SUMCASH^BARUFRP1(START,END)"
+6 IF RPTTYP="SF"
SET ZTRTN="SUMBAT^BARUFRP1(START,END)"
+7 SET ZTDESC=$SELECT(RPTTYP="S":"FILE TOTALS BY SESSION",RPTTYP="D":"DETAIL",RPTTYP="G":"GRAND TOTAL ALL FILES",RPTTYP="F":"FILE & FILE NAMES",RPTTYP="SF":"FILE TOTALS",RPTTYP="SC":"BATCH TOTAL BY CASHIER",1:"")_" REPORT"
+8 SET ZTSAVE("START")=""
+9 SET ZTSAVE("END")=""
+10 SET ZTSAVE("RPTTYP")=""
+11 SET ZTSAVE("DASH")=""
+12 DO ^%ZTLOAD
+13 IF $DATA(ZTSK)[0
WRITE !!?5,"Report Cancelled!"
+14 IF '$TEST
WRITE !!?5,"Report task #: ",$GET(ZTSK)
+15 DO HOME^%ZIS
+16 QUIT
+17 ;
PRINT ;EP - ENTER FROM TASKMAN
+1 ;SESSION TOTALS
IF RPTTYP="SS"
DO SUMSESS^BARUFRP1(START,END)
+2 ;CASHIER TOTALS
IF RPTTYP="SC"
DO SUMCASH^BARUFRP1(START,END)
+3 ;FILE TOTALS
IF RPTTYP="SF"
DO SUMBAT^BARUFRP1(START,END)
+4 ;GRANDTOTAL ALL FILES
IF RPTTYP="G"
DO GRNTOT^BARUFRP1(START,END)
+5 ;DETAIL
IF RPTTYP="D"
DO DETAIL^BARUFRP1(START,END)
+6 ;FILE DATES AND FILE NAME
IF RPTTYP="F"
DO BATFILE^BARUFRP1(START,END)
+7 QUIT
+8 ;
DETAIL(START,END) ;EP - PRINT View File DETAIL REPORT
+1 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
+2 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND PRINTS
+3 ;OUT TRANSACTION DETAILS FOR EACH TRANSACTION TRANSMITTED AS WELL AS THE FILES
+4 ;CREATED
+5 KILL PAGE
+6 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE=Y
+7 SET Y=START
XECUTE ^DD("DD")
SET EXSTART=Y
+8 SET Y=END
XECUTE ^DD("DD")
SET EXEND=Y
+9 SET RPTTYP="D"
+10 SET ESC=0
+11 DO BATHDR^BARUFRPT(DATE,RPTTYP)
+12 DO BATDET^BARUFRPT("")
+13 IF END'[(".")
SET END=END_".999999"
+14 SET BATCH=START-.000001
+15 FOR
SET BATCH=$ORDER(^BARSESS(DUZ(2),"F",BATCH))
IF 'BATCH!(ESC)!(BATCH>END)
QUIT
Begin DoDot:1
+16 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+17 WRITE !,"SESSION FILE: ",BATCH
+18 SET UDUZ=""
+19 FOR
SET UDUZ=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ))
IF 'UDUZ!(ESC)
QUIT
Begin DoDot:2
+20 SET SESSID=""
+21 FOR
SET SESSID=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID))
IF 'SESSID!(ESC)
QUIT
Begin DoDot:3
+22 SET TRDATE=0
+23 FOR
SET TRDATE=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE))
IF 'TRDATE!(ESC)
QUIT
Begin DoDot:4
+24 ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
+25 NEW TRQUIT
SET TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
+26 ; Not Transmitted
IF $PIECE(TRQUIT,U,2)'=1
QUIT
+27 ; Date this TRX EXPORT to UFMS
SET TRQUIT=$PIECE(TRQUIT,U,4)
+28 IF TRQUIT<(START-.000001)!(TRQUIT>END)
QUIT
+29 ; END 1.8*20
+30 SET IENS=TRDATE_","
+31 ;Begin new code ;MRS:BAR*1.8*10 H1087
+32 DO GETDATA^BARUFRP3
+33 ;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
+34 ;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
+35 ;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
+36 ;S BILL=$$GET1^DIQ(90050.03,IENS,4)
+37 IF 'BILL
QUIT
+38 ;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
+39 ;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
+40 ;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
+41 ;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
+42 ;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
+43 ;End new code ;MRS:BAR*1.8*10 H1087
+44 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
DO BATDET^BARUFRPT(BATCH)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
DO BATDET^BARUFRPT(BATCH)
+45 WRITE !?3,BILL
+46 SET Y=TRDATE
XECUTE ^DD("DD")
SET EXDATE=Y
+47 WRITE ?25,EXDATE
+48 WRITE !?10,ENTRYBY
+49 WRITE ?35,CREDDEBT
+50 WRITE ?52,$EXTRACT(TRANTYP,1,15)
+51 WRITE ?70,$EXTRACT(ADJCAT,1,10)
+52 ;GET TRANSMIT FILES
+53 IF '$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0))
QUIT
+54 WRITE !!?35,"TRANSMISSION FILES: "
+55 SET (RECORD,LN)=0
+56 FOR
SET RECORD=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,RECORD))
IF 'RECORD!(ESC)
QUIT
Begin DoDot:5
+57 SET IENS=RECORD_","_SESSID_","_UDUZ_","
+58 SET FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
+59 IF FILENAME=""
QUIT
+60 SET LN=LN+1
+61 SET DELDATE=$PIECE(FILENAME,"_",7)
+62 SET DELDATE=$EXTRACT(DELDATE,7,8)_"/"_$EXTRACT(DELDATE,5,6)_"/"_$EXTRACT(DELDATE,1,4)
+63 SET DELTIME=$PIECE($PIECE(FILENAME,"_",8),".")
+64 SET DELTIME=$EXTRACT(DELTIME,1,2)_":"_$EXTRACT(DELTIME,3,4)
+65 SET TRANSBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
+66 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
DO BATDET^BARUFRPT(BATCH)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
DO BATDET^BARUFRPT(BATCH)
+67 WRITE !?35,FILENAME
End DoDot:5
+68 WRITE !
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+69 ;flush buffer
IF $DATA(IO("S"))
WRITE @IOF
QUIT
+70 IF ESC
QUIT
+71 IF '$DATA(ZTQUEUED)&(IO=IO(0))
Begin DoDot:1
+72 KILL DIR
+73 SET DIR(0)="E"
+74 WRITE !
+75 DO ^DIR
End DoDot:1
+76 QUIT
+77 ;
SUMSESS(START,END) ;EP - PRINT TOTALS FOR EACH SESSION
+1 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
+2 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
+3 ;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
+4 ;IN THE DATE RANGE
+5 KILL PAGE
+6 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE=Y
+7 SET Y=START
XECUTE ^DD("DD")
SET EXSTART=Y
+8 SET Y=END
XECUTE ^DD("DD")
SET EXEND=Y
+9 SET ESC=0
+10 SET RPTTYP="SS"
+11 DO BATHDR^BARUFRPT(DATE,RPTTYP)
+12 IF END'[(".")
SET END=END_".999999"
+13 SET BATCH=START-.000001
+14 FOR BATCNT=1:1
SET BATCH=$ORDER(^BARSESS(DUZ(2),"F",BATCH))
IF 'BATCH!(ESC)!(BATCH>END)
QUIT
Begin DoDot:1
+15 SET UDUZ=""
+16 IF '(BATCNT#2)
IF (IO'=IO(0))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+17 FOR
SET UDUZ=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ))
IF 'UDUZ!(ESC)
QUIT
Begin DoDot:2
+18 DO SUMINIT^BARUFRPT
+19 SET SESSID=""
+20 FOR SESSCNT=1:1
SET SESSID=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID))
IF 'SESSID!(ESC)
QUIT
Begin DoDot:3
+21 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+22 WRITE !,"SESSION FILE: ",BATCH
+23 WRITE ?25,"CASHIER: ",$PIECE($GET(^VA(200,UDUZ,0)),U)
+24 WRITE ?53,"SESSION ID: ",SESSID
+25 SET TRDATE=0
+26 FOR
SET TRDATE=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE))
IF 'TRDATE!(ESC)
QUIT
Begin DoDot:4
+27 ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
+28 NEW TRQUIT
SET TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
+29 ; Not Transmitted
IF $PIECE(TRQUIT,U,2)'=1
QUIT
+30 ; Date this TRX EXPORT to UFMS
SET TRQUIT=$PIECE(TRQUIT,U,4)
+31 IF TRQUIT<(START-.000001)!(TRQUIT>END)
QUIT
+32 ; END 1.8*20
+33 SET IENS=TRDATE_","
+34 ;Begin new code ;MRS:BAR*1.8*10 H1087
+35 DO GETDATA^BARUFRP3
+36 ;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
+37 ;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
+38 ;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
+39 ;S BILL=$$GET1^DIQ(90050.03,IENS,4)
+40 IF 'BILL
QUIT
+41 ;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
+42 ;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
+43 ;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
+44 ;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
+45 ;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
+46 ;End new code ;MRS:BAR*1.8*10 H1087
+47 DO COUNT^BARUFRPT(.TOTALS)
End DoDot:4
End DoDot:3
+48 DO LIST^BARUFRPT(.TOTALS)
+49 IF '$DATA(ZTQUEUED)&(IO=IO(0))
Begin DoDot:3
+50 IF $DATA(IO("S"))
QUIT
+51 KILL DIR
+52 SET DIR(0)="E"
+53 DO ^DIR
+54 SET ESC=U=X
+55 IF ESC
QUIT
+56 DO BATHDR^BARUFRPT(DATE,RPTTYP)
End DoDot:3
End DoDot:2
End DoDot:1
+57 ;flush buffer
IF $DATA(IO("S"))
WRITE @IOF
+58 QUIT
+59 ;
SUMCASH(START,END) ;EP - PRINT TOTALS FOR EACH CASHIER
+1 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
+2 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
+3 ;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
+4 ;IN THE DATE RANGE
+5 KILL PAGE
+6 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE=Y
+7 SET Y=START
XECUTE ^DD("DD")
SET EXSTART=Y
+8 SET Y=END
XECUTE ^DD("DD")
SET EXEND=Y
+9 SET ESC=0
+10 SET RPTTYP="SC"
+11 DO BATHDR^BARUFRPT(DATE,RPTTYP)
+12 IF END'[(".")
SET END=END_".999999"
+13 SET BATCH=START-.000001
+14 FOR BATCNT=1:1
SET BATCH=$ORDER(^BARSESS(DUZ(2),"F",BATCH))
IF 'BATCH!(ESC)!(BATCH>END)
QUIT
Begin DoDot:1
+15 IF '(BATCNT#3)
IF (IO'=IO(0))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+16 SET UDUZ=""
+17 FOR
SET UDUZ=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ))
IF 'UDUZ!(ESC)
QUIT
Begin DoDot:2
+18 DO SUMINIT^BARUFRPT
+19 WRITE !,"SESSION FILE: ",BATCH
+20 WRITE ?25,"CASHIER: ",$PIECE($GET(^VA(200,UDUZ,0)),U)
+21 SET SESSID=""
+22 FOR SESSCNT=1:1
SET SESSID=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID))
IF 'SESSID!(ESC)
QUIT
Begin DoDot:3
+23 IF SESSCNT'=1
WRITE !
+24 WRITE ?53,"SESSION ID: ",SESSID
+25 SET TRDATE=0
+26 FOR
SET TRDATE=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE))
IF 'TRDATE!(ESC)
QUIT
Begin DoDot:4
+27 ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
+28 NEW TRQUIT
SET TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
+29 ; Not Transmitted
IF $PIECE(TRQUIT,U,2)'=1
QUIT
+30 ; Date this TRX EXPORT to UFMS
SET TRQUIT=$PIECE(TRQUIT,U,4)
+31 IF TRQUIT<(START-.000001)!(TRQUIT>END)
QUIT
+32 ; END 1.8*20
+33 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+34 SET IENS=TRDATE_","
+35 ;Begin new code ;MRS:BAR*1.8*10 H1087
+36 DO GETDATA^BARUFRP3
+37 ;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
+38 ;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
+39 ;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
+40 ;S BILL=$$GET1^DIQ(90050.03,IENS,4)
+41 IF 'BILL
QUIT
+42 ;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
+43 ;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
+44 ;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
+45 ;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
+46 ;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
+47 ;End new code ;MRS:BAR*1.8*10 H1087
+48 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+49 DO COUNT^BARUFRPT(.TOTALS)
End DoDot:4
End DoDot:3
+50 DO LIST^BARUFRPT(.TOTALS)
End DoDot:2
+51 ;
+52 IF '$DATA(ZTQUEUED)&(IO=IO(0))
Begin DoDot:2
+53 KILL DIR
+54 SET DIR(0)="E"
+55 DO ^DIR
+56 SET ESC=U=X
+57 IF ESC
QUIT
+58 IF '$ORDER(^BARSESS(DUZ(2),"F",BATCH))
QUIT
+59 DO BATHDR^BARUFRPT(DATE,RPTTYP)
End DoDot:2
End DoDot:1
+60 ;flush buffer
IF $DATA(IO("S"))
WRITE @IOF
QUIT
+61 QUIT
+62 ;
SUMBAT(START,END) ;EP - PRINT TOTALS FOR EACH BATCH
+1 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
+2 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
+3 ;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
+4 ;IN THE DATE RANGE
+5 KILL PAGE
+6 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE=Y
+7 SET Y=START
XECUTE ^DD("DD")
SET EXSTART=Y
+8 SET Y=END
XECUTE ^DD("DD")
SET EXEND=Y
+9 SET ESC=0
+10 SET RPTTYP="SF"
+11 DO BATHDR^BARUFRPT(DATE,RPTTYP)
+12 IF END'[(".")
SET END=END_".999999"
+13 SET BATCH=START-.000001
+14 FOR
SET BATCH=$ORDER(^BARSESS(DUZ(2),"F",BATCH))
IF 'BATCH!(ESC)!(BATCH>END)
QUIT
Begin DoDot:1
+15 DO SUMINIT^BARUFRPT
+16 SET UDUZ=""
+17 FOR
SET UDUZ=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ))
IF 'UDUZ!(ESC)
QUIT
Begin DoDot:2
+18 SET SESSID=""
+19 FOR SESSCNT=1:1
SET SESSID=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID))
IF 'SESSID!(ESC)
QUIT
Begin DoDot:3
+20 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+21 WRITE !,"SESSION FILE: ",BATCH
+22 WRITE ?25,"CASHIER: ",$PIECE($GET(^VA(200,UDUZ,0)),U)
+23 WRITE ?53,"SESSION ID: ",SESSID
+24 SET TRDATE=0
+25 FOR
SET TRDATE=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE))
IF 'TRDATE!(ESC)
QUIT
Begin DoDot:4
+26 ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
+27 NEW TRQUIT
SET TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
+28 ; Not Transmitted
IF $PIECE(TRQUIT,U,2)'=1
QUIT
+29 ; Date this TRX EXPORT to UFMS
SET TRQUIT=$PIECE(TRQUIT,U,4)
+30 IF TRQUIT<(START-.000001)!(TRQUIT>END)
QUIT
+31 ; END 1.8*20
+32 SET IENS=TRDATE_","
+33 ;Begin new code ;MRS:BAR*1.8*10 H1087,IM30577
+34 DO GETDATA^BARUFRP3
+35 ;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
+36 ;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
+37 ;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
+38 ;S BILL=$$GET1^DIQ(90050.03,IENS,4)
+39 IF 'BILL
QUIT
+40 ;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
+41 ;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
+42 ;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
+43 ;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
+44 ;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
+45 ;End new code ;MRS:BAR*1.8*10 H1087,IM30577
+46 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
+47 DO COUNT^BARUFRPT(.TOTALS)
End DoDot:4
End DoDot:3
End DoDot:2
+48 IF $GET(ESC)
QUIT
+49 DO LIST^BARUFRPT(.TOTALS)
End DoDot:1
+50 IF $DATA(IO("S"))
WRITE @IOF
+51 QUIT
+52 ;
GRNTOT(START,END) ;EP - PRINT GRAND TOTAL (ALL BATCHES) REPORT
+1 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
+2 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND PRINTS THE
+3 ;TOTAL ALL THE TRANSACTIONS ACTIVITY FOR THOSE BATCHES TRANSMITTED IN THAT
+4 ;DATE RANGE
+5 ;split routine due to size
DO GRNTOT^BARUFRP3
+6 QUIT
+7 ;
BATFILE(START,END) ;EP - PRINT View Batch/File BATCH & FILE REPORT
+1 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
+2 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND SHOW WHAT FILES
+3 ;WERE TRANSMITTED ON THAT DATE.
+4 SET $PIECE(DASH,"-",81)=""
+5 KILL PAGE
+6 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE=Y
+7 SET Y=START
XECUTE ^DD("DD")
SET EXSTART=Y
+8 SET Y=END
XECUTE ^DD("DD")
SET EXEND=Y
+9 SET ESC=0
+10 SET RPTTYP="F"
+11 DO BATHDR^BARUFRPT(DATE,RPTTYP)
+12 DO BFHDR
+13 IF END'[(".")
SET END=END_".999999"
+14 SET BATCH=START-.000001
+15 FOR
SET BATCH=$ORDER(^BARSESS(DUZ(2),"F",BATCH))
IF 'BATCH!(ESC)!(BATCH>END)
QUIT
Begin DoDot:1
+16 SET UDUZ=""
+17 FOR
SET UDUZ=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ))
IF 'UDUZ!(ESC)
QUIT
Begin DoDot:2
+18 SET SESSID=""
+19 FOR
SET SESSID=$ORDER(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID))
IF 'SESSID!(ESC)
QUIT
Begin DoDot:3
+20 ;GET TRANSMIT FILES
+21 IF '$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0))
QUIT
+22 SET (RECORD,LN)=0
+23 FOR
SET RECORD=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,RECORD))
IF 'RECORD!(ESC)
QUIT
Begin DoDot:4
+24 SET IENS=RECORD_","_SESSID_","_UDUZ_","
+25 SET FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
+26 IF FILENAME=""
QUIT
+27 SET LN=LN+1
+28 SET DELDATE=$PIECE(FILENAME,"_",7)
+29 SET DELDATE=$EXTRACT(DELDATE,7,8)_"/"_$EXTRACT(DELDATE,5,6)_"/"_$EXTRACT(DELDATE,1,4)
+30 SET DELTIME=$PIECE($PIECE(FILENAME,"_",8),".")
+31 SET DELTIME=$EXTRACT(DELTIME,1,2)_":"_$EXTRACT(DELTIME,3,4)
+32 SET TRANSBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
+33 IF $Y>(IOSL-4)
WRITE !
IF $DATA(IO("S"))
DO BATHDR^BARUFRPT(DATE,RPTTYP)
DO BFHDR
IF $DATA(IO("S"))
QUIT
KILL DIR
SET DIR(0)="E"
IF '$DATA(ZTQUEUED)&(IO=IO(0))
DO ^DIR
SET ESC=X=U
IF ESC
QUIT
DO BATHDR^BARUFRPT(DATE,RPTTYP)
DO BFHDR
+34 ; IHS/SD/PKD 1.8*20 2/9/11 HEAT24212 Print Session DATE.Time, not Export DATE.TIME
+35 ;W:LN=1 !!,BATCH
+36 IF LN=1
WRITE !!,SESSID
+37 IF LN'=1
WRITE !
+38 WRITE ?35,FILENAME
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+39 ;flush buffer
IF $DATA(IO("S"))
WRITE @IOF
+40 QUIT
BFHDR ;EP - FILE DETAIL
+1 WRITE !?5,"SESSION FILE"
+2 WRITE ?45,"TRANSMISSION FILES"
+3 WRITE !,DASH
+4 QUIT