BARUFLOG ; IHS/SD/TPF - SESSION LOG IN AND LOG OUT ;
;;1.8;IHS ACCOUNTS RECEIVABLE;**3,21,23**;OCT 26, 2005
;OCT 2012 P.OTTIS NOHEAT#01: ALLOW RE-CONNECT TO LAST OPEN SESSION AFTER LOG-OFF / OR
; SWITCHING FALICITIES
Q
;
SIGNOUT ;EP - SIGN OUT AND RECONCILE
;
I $$OUTORREC^BARUFUT(UFMSESID) Q ;ask user if the wish to reconcile or simply get out
;
D DISPLAYT(DUZ,UFMSESID,"OUT") ;display counts and totals
;
;BAR*1.8*21 IHS/SD/TPF 8/12/2011 HEAT20490 DON'T ASK IF THEY WISH TO LOG OUT
I '$$OPENSTAT^BARUFUT(DUZ) D Q
.;IF SESSION HAS BEEN CLOSED BY SUPER
.K UFMSESID ;LOGOUT FLAG
.K DIR
.S DIR(0)="E"
.D ^DIR
;
W !
K DIR
S DIR("A")="Do you wish to log out now?"
S DIR("B")="Yes"
S DIR(0)="YO"
D ^DIR
I 'Y D Q
.W !!,"YOUR CASHIER SESSION IS STILL OPEN."
.W !,"AT SOME POINT YOU MUST LOG OUT"
.W !,"TO RECONCILE THIS SESSION"
.;S X=$$DELFLG^BARUFUT1(DUZ,UFMSESID)
.;K UFMSESID
;
I '$O(^BARSESS(DUZ(2),DUZ,11,UFMSESID,2,0)) D Q
.W !!,"There is no posting activity for this session. Therefore"
.W !,"it cannot be reconciled. If you log out this session will be"
.W !,"deleted. Or you can continue in cashier mode."
.W !
.K DIR
.S DIR("A")="Delete session and log out?"
.S DIR("B")="Yes"
.S DIR(0)="YO"
.D ^DIR
.Q:'Y
.S X=$$DELFLG^BARUFUT1(DUZ,UFMSESID)
.D DELETE^BARUFUT1(DUZ,UFMSESID)
.K UFMSESID
;
;
W !
K DIR
S DIR("A")="By logging out, you are confirming the system balances. Are you sure you wish to log out?"
S DIR("B")="Yes"
S DIR(0)="YO"
D ^DIR
I 'Y D Q
.W !!,"YOUR CASHIER SESSION IS STILL OPEN."
.W !,"AT SOME POINT YOU MUST LOG OUT"
.W !,"TO RECONCILE THIS SESSION"
.D ASKFORRT^BARUFUT
;
;
W !!,"Fine, the session "_$G(UFMSESID)_" will be sent to your manager for processing."
W !,"Status for Session ",$G(UFMSESID)," has been set to RECONCILED"
D ASKFORRT^BARUFUT
;
S X=$$DELFLG^BARUFUT1(DUZ,UFMSESID) ;CLEAR 'ALREADY ASSIGNED' FLAG
S X=$$SETSESS^BARUFUT(DUZ,UFMSESID,"RC") ;EP - SET SESSION STATUS 'BARSTAT'
;
K UFMSESID,MODE ;CLEAR SESSION ID
Q
;
SIGNIN ;EP - CASHIER SIGN IN
;
I '$$CSMENU^BARUFUT1(DUZ(2)) Q ;P.OTT - CAS SESSION MENU DISABLED!
I $G(UFMSESID)'="",$$CURSTAT^BARUFUT(DUZ,UFMSESID,"E")="OPEN" D Q ;bar*1.8*21 SDR
. D SIGNOUT
. Q
;
NEW SESSDT ;P.OTT
S SESSDT=$$OPENSTAT^BARUFUT(DUZ) I SESSDT="" G NEWSESS ; NO SESS OPEN FOR THIS USER
S UFMSESID=SESSDT
S Y=SESSDT X ^DD("DD") S SESSDT=Y
W !!,"RECONNECTING TO A OPEN SESSION IN "_$P(^DIC(4,DUZ(2),0),U)_"."
W !!,"YOU HAVE A SESSION STILL OPEN FROM "_SESSDT
W !,"YOU WILL BE ASSIGNED THIS SESSION ID TO CONTINUE"
W !!!
D ASKFORRT^BARUFUT
S MODE="CASHIER"
K SESSDT
K DIR,DIE,DR,DIC,DA
S DA(1)=DUZ
S DA=UFMSESID
S DR=".05///1"
S DIE="^BARSESS(DUZ(2),"_DA(1)_",11,"
D ^DIE
D DISPLAYT(DUZ,UFMSESID,"OUT","NO")
QUIT
;
NEWSESS ;
W !!,"YOU ARE SIGNING *IN* FOR CASHIERING"
W !!
D SIG^XUSESIG
Q:X1=""
;
S UFMSESID=$$GETSESID^BARUFUT(DUZ) ;ASSIGN SESSION ID. CREATE AN ENTRY IN THE ^BARSESS FILE
;
I UFMSESID=0 D Q
. W !!,"COULD NOT CREATE SESSION ID IN THE 'A/R UFMS CASHIER SESSION LOG' FILE"
. W !,"MAKE SURE THE CASHIER HAS 'V' FILEMAN ACCESS. IF THEY ALREADY DO THERE MAY"
. W !,"A LOCK ON THE FILE"
. D ASKFORRT^BARUFUT
. K UFMSESID
. Q
;AND SET STATUS = OPEN
K DIR,DIE,DR,DIC,DA
S DA(1)=DUZ
S DA=UFMSESID
S DR=".05///1"
S DIE="^BARSESS(DUZ(2),"_DA(1)_",11,"
D ^DIE
S MODE="CASHIERING"
D DISPLAYT(DUZ,UFMSESID,"NEW","NO")
Q
;
DISPLAYT(UDUZ,SESSID,MODE,ERASTAT) ;EP - DISPLAY SESSION TOTALS
DISPAGAI ;EP - DO IT AGAIN
;MODE - "NEW", "OUT", "VIEW", "CASHIER"
;SESSID - CASHIER SESSION
N BARTR,ARCREDIT,ARDEBIT,TRANTYPE,AMT,TOTALS,IENS,CAT
D DISHDR(UDUZ,SESSID,MODE)
;LOOP THROUGH USERS SESSION ENTRIES
S TOTALS("AAA PAYMENT")=0
S TOTALS("AAA PAYMENT","CNT")=0
S TOTALS("ADJ CO-PAY")=0
S TOTALS("ADJ CO-PAY","CNT")=0
S TOTALS("ADJ DEDUCTIBLE")=0
S TOTALS("ADJ DEDUCTIBLE","CNT")=0
S TOTALS("ADJ NON PAYMENT")=0
S TOTALS("ADJ NON PAYMENT","CNT")=0
S TOTALS("ADJ WRITE OFF")=0
S TOTALS("ADJ WRITE OFF","CNT")=0
S TOTALS("ADJ PENALTY")=0
S TOTALS("ADJ PENALTY","CNT")=0
S TOTALS("ADJ GROUPER ALLOWANCE")=0
S TOTALS("ADJ GROUPER ALLOWANCE","CNT")=0
S TOTALS("ADJ PAYMENT CREDIT")=0
S TOTALS("ADJ PAYMENT CREDIT","CNT")=0
S TOTALS("ZZZ REFUND")=0
S TOTALS("ZZZ REFUND","CNT")=0
;
S BARTR=0
F S BARTR=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,BARTR)) Q:'BARTR D
.S IENS=BARTR_","
.S ARBILL=$$GET1^DIQ(90050.03,IENS,4,"E") ;A/R TRANSACTIONS, BILL (A/R)
.Q:ARBILL=""
.S ARCREDIT=$$GET1^DIQ(90050.03,IENS,2,"E") ;A/R TRANSACTIONS, CREDIT
.S ARDEBIT=$$GET1^DIQ(90050.03,IENS,3,"E") ;A/R TRANSACTIONS, DEBIT
.S AMT=ARCREDIT-ARDEBIT
.S TRANTYPE=$$GET1^DIQ(90050.03,IENS,101,"E") ;A/R TRANSACTIONS, ADJUSTMENT TYPE
.S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E") ;A/R TRANSACTIONS, ADJUSTMENT CATEGORY
.I TRANTYPE="PAYMENT" S CAT="AAA "_TRANTYPE D TOT(CAT,AMT,.TOTALS) Q
.S CAT=ADJCAT
.I CAT="REFUND" S CAT="ZZZ "_CAT D TOT(CAT,AMT,.TOTALS) Q
.I CAT="" S CAT="ADJ UNDEF" D TOT(CAT,AMT,.TOTALS) Q
.S CAT="ADJ "_CAT D TOT(CAT,AMT,.TOTALS) Q
D LIST(.TOTALS,MODE)
Q
;
TOT(CAT,AMT,TOTALS) ;
S TOTALS(CAT)=$G(TOTALS(CAT))+AMT
S TOTALS(CAT,"CNT")=$G(TOTALS(CAT,"CNT"))+1
Q
;
LIST(TOTALS,MODE) ;EP - DISPLAY CALCULATED TOTALS
N CATEGORY,ADJCAT,ADJCNT,ADJAMT
S (ADJCNT,ADJAMT,REFCNT,REFAMT)=0
S (CATEGORY,SUBHDR)=""
F S CATEGORY=$O(TOTALS(CATEGORY)) Q:CATEGORY="" D
.I $P(CATEGORY," ")'=SUBHDR D
..W !!?5,"Cashiering Function - "
..W $S($P(CATEGORY," ")="AAA":"Payments",$P(CATEGORY," ")="ZZZ":"Refunds",1:"Adjustments")
..;
.I $P(CATEGORY," ")="ADJ" D
..S ADJCNT=ADJCNT+TOTALS(CATEGORY,"CNT")
..S ADJAMT=ADJAMT+TOTALS(CATEGORY)
..;
.I $P(CATEGORY," ",2)="REFUND" D
..S REFCNT=REFCNT+TOTALS(CATEGORY,"CNT")
..S REFAMT=REFAMT+TOTALS(CATEGORY)
.S SUBHDR=$P(CATEGORY," ")
.I SUBHDR="ADJ" W !?10,$P(CATEGORY," ",2,3)
.E W !?10,"Count"
.W ?28,"- ",$J(TOTALS(CATEGORY,"CNT"),4)
.W ?50,"$"_$J(TOTALS(CATEGORY),10,2)
.I $O(TOTALS(CATEGORY))[("ZZZ") D
..W !?8,"Total Adjustments"
..W ?28,"= ",$J(ADJCNT,4)
..W ?50,"$"_$J(ADJAMT,10,2)
W !
;IF THE SESSION HAS BEEN TRANSMITTED SHOW THE FILE
I $D(^BARSESS(DUZ(2),UDUZ,11,SESSID,21)) D
.W !,"TRANSMITTED ON: "
.N TRANREC,TRANTIME,IENS,TRANFILE,TRANBY,CNT
.S TRANREC=0
.F CNT=1:1 S TRANREC=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,TRANREC)) Q:'TRANREC D
..S IENS=TRANREC_","_SESSID_","_UDUZ_","
..S TRANTIME=$$GET1^DIQ(90057.210101,IENS,.01,"E")
..S TRANFILE=$$GET1^DIQ(90057.210101,IENS,.02,"E")
..S TRANBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
..W:CNT'=1 !
..W ?16,TRANTIME," BY ",TRANBY
..W !?16,TRANFILE
;
S RESPONSE=""
D ASKACT^BARUFUT(UDUZ,SESSID,.RESPONSE,MODE,$G(ERASTAT)) ;ASK FOR AN ACTION TO TAKE
Q:MODE="OUT"&(RESPONSE="RC")!(RESPONSE="D") ;CASHIER HAS RECONCILED
Q:RESPONSE[U!(RESPONSE="")!(RESPONSE="Q")
G DISPAGAI
Q
;
DISHDR(UDUZ,SESSID,MODE) ;EP - DISPLAY HEADER
W @IOF
;I MODE="VIEW" W !,$$CJ^XLFSTR("SUPERVISOR MODE",IOM)
W !,$$CJ^XLFSTR($S(MODE="VIEW":"SUPERVISOR MODE",MODE="CASHIER"!(MODE="NEW")!(MODE="OUT"):"CASHIERING MODE",1:"UNKNOWN MODE"),IOM)
W !,$$CJ^XLFSTR("CASHIERING DISPLAY FOR CASHIER "_$P($G(^VA(200,UDUZ,0)),U),IOM)
W !,$$CJ^XLFSTR("WITH SESSION ID "_SESSID_" SESSION STATUS: "_$$CURSTAT^BARUFUT(UDUZ,SESSID,"E"),IOM)
Q
;
PRINTDUM(UFMSESID) ;EP - PRINT EMPTY BEGINNING COUNTS
;W !,$$CJ^XLFSTR("CURRENTLY THERE IS NO POSTING ACTIVITY",IOM)
W !!?5,"Cashiering Function - Payments"
W !?8,"Beginning Count",?28,"- 0",?50,"$ 0.00"
W !!?5,"Cashiering Function - Adjustments"
W !?8,"Beginning Counts"
W !?10,"CO-PAYS",?28,"- 0",?50,"$ 0.00"
W !?10,"DEDCUTIBLES",?28,"- 0",?50,"$ 0.00"
W !?10,"NON-PAYMENTS",?28,"- 0",?50,"$ 0.00"
W !?10,"WRITE OFFS",?28,"- 0",?50,"$ 0.00"
W !?10,"PENALTIES",?28,"- 0",?50,"$ 0.00"
W !?10,"GROUPER ALLOWANCE",?28,"- 0",?50,"$ 0.00"
W !?10,"PAYMENT CREDITS",?28,"- 0",?50,"$ 0.00"
W !?8,"Total Adjustments",?28,"= 0",?50,"$ 0.00"
W !!?5,"Cashiering Function - Refunds"
W !?8,"Beginning Count",?28,"- 0",?50,"$ 0.00"
W:MODE="NEW" !!?1,"Assigning session number: ",$G(UFMSESID)
W:MODE="OUT" !!?1,"Session number: ",$G(UFMSESID)
W !
D ASKFORRT^BARUFUT
Q
BARUFLOG ; IHS/SD/TPF - SESSION LOG IN AND LOG OUT ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,21,23**;OCT 26, 2005
+2 ;OCT 2012 P.OTTIS NOHEAT#01: ALLOW RE-CONNECT TO LAST OPEN SESSION AFTER LOG-OFF / OR
+3 ; SWITCHING FALICITIES
+4 QUIT
+5 ;
SIGNOUT ;EP - SIGN OUT AND RECONCILE
+1 ;
+2 ;ask user if the wish to reconcile or simply get out
IF $$OUTORREC^BARUFUT(UFMSESID)
QUIT
+3 ;
+4 ;display counts and totals
DO DISPLAYT(DUZ,UFMSESID,"OUT")
+5 ;
+6 ;BAR*1.8*21 IHS/SD/TPF 8/12/2011 HEAT20490 DON'T ASK IF THEY WISH TO LOG OUT
+7 IF '$$OPENSTAT^BARUFUT(DUZ)
Begin DoDot:1
+8 ;IF SESSION HAS BEEN CLOSED BY SUPER
+9 ;LOGOUT FLAG
KILL UFMSESID
+10 KILL DIR
+11 SET DIR(0)="E"
+12 DO ^DIR
End DoDot:1
QUIT
+13 ;
+14 WRITE !
+15 KILL DIR
+16 SET DIR("A")="Do you wish to log out now?"
+17 SET DIR("B")="Yes"
+18 SET DIR(0)="YO"
+19 DO ^DIR
+20 IF 'Y
Begin DoDot:1
+21 WRITE !!,"YOUR CASHIER SESSION IS STILL OPEN."
+22 WRITE !,"AT SOME POINT YOU MUST LOG OUT"
+23 WRITE !,"TO RECONCILE THIS SESSION"
+24 ;S X=$$DELFLG^BARUFUT1(DUZ,UFMSESID)
+25 ;K UFMSESID
End DoDot:1
QUIT
+26 ;
+27 IF '$ORDER(^BARSESS(DUZ(2),DUZ,11,UFMSESID,2,0))
Begin DoDot:1
+28 WRITE !!,"There is no posting activity for this session. Therefore"
+29 WRITE !,"it cannot be reconciled. If you log out this session will be"
+30 WRITE !,"deleted. Or you can continue in cashier mode."
+31 WRITE !
+32 KILL DIR
+33 SET DIR("A")="Delete session and log out?"
+34 SET DIR("B")="Yes"
+35 SET DIR(0)="YO"
+36 DO ^DIR
+37 IF 'Y
QUIT
+38 SET X=$$DELFLG^BARUFUT1(DUZ,UFMSESID)
+39 DO DELETE^BARUFUT1(DUZ,UFMSESID)
+40 KILL UFMSESID
End DoDot:1
QUIT
+41 ;
+42 ;
+43 WRITE !
+44 KILL DIR
+45 SET DIR("A")="By logging out, you are confirming the system balances. Are you sure you wish to log out?"
+46 SET DIR("B")="Yes"
+47 SET DIR(0)="YO"
+48 DO ^DIR
+49 IF 'Y
Begin DoDot:1
+50 WRITE !!,"YOUR CASHIER SESSION IS STILL OPEN."
+51 WRITE !,"AT SOME POINT YOU MUST LOG OUT"
+52 WRITE !,"TO RECONCILE THIS SESSION"
+53 DO ASKFORRT^BARUFUT
End DoDot:1
QUIT
+54 ;
+55 ;
+56 WRITE !!,"Fine, the session "_$GET(UFMSESID)_" will be sent to your manager for processing."
+57 WRITE !,"Status for Session ",$GET(UFMSESID)," has been set to RECONCILED"
+58 DO ASKFORRT^BARUFUT
+59 ;
+60 ;CLEAR 'ALREADY ASSIGNED' FLAG
SET X=$$DELFLG^BARUFUT1(DUZ,UFMSESID)
+61 ;EP - SET SESSION STATUS 'BARSTAT'
SET X=$$SETSESS^BARUFUT(DUZ,UFMSESID,"RC")
+62 ;
+63 ;CLEAR SESSION ID
KILL UFMSESID,MODE
+64 QUIT
+65 ;
SIGNIN ;EP - CASHIER SIGN IN
+1 ;
+2 ;P.OTT - CAS SESSION MENU DISABLED!
IF '$$CSMENU^BARUFUT1(DUZ(2))
QUIT
+3 ;bar*1.8*21 SDR
IF $GET(UFMSESID)'=""
IF $$CURSTAT^BARUFUT(DUZ,UFMSESID,"E")="OPEN"
Begin DoDot:1
+4 DO SIGNOUT
+5 QUIT
End DoDot:1
QUIT
+6 ;
+7 ;P.OTT
NEW SESSDT
+8 ; NO SESS OPEN FOR THIS USER
SET SESSDT=$$OPENSTAT^BARUFUT(DUZ)
IF SESSDT=""
GOTO NEWSESS
+9 SET UFMSESID=SESSDT
+10 SET Y=SESSDT
XECUTE ^DD("DD")
SET SESSDT=Y
+11 WRITE !!,"RECONNECTING TO A OPEN SESSION IN "_$PIECE(^DIC(4,DUZ(2),0),U)_"."
+12 WRITE !!,"YOU HAVE A SESSION STILL OPEN FROM "_SESSDT
+13 WRITE !,"YOU WILL BE ASSIGNED THIS SESSION ID TO CONTINUE"
+14 WRITE !!!
+15 DO ASKFORRT^BARUFUT
+16 SET MODE="CASHIER"
+17 KILL SESSDT
+18 KILL DIR,DIE,DR,DIC,DA
+19 SET DA(1)=DUZ
+20 SET DA=UFMSESID
+21 SET DR=".05///1"
+22 SET DIE="^BARSESS(DUZ(2),"_DA(1)_",11,"
+23 DO ^DIE
+24 DO DISPLAYT(DUZ,UFMSESID,"OUT","NO")
+25 QUIT
+26 ;
NEWSESS ;
+1 WRITE !!,"YOU ARE SIGNING *IN* FOR CASHIERING"
+2 WRITE !!
+3 DO SIG^XUSESIG
+4 IF X1=""
QUIT
+5 ;
+6 ;ASSIGN SESSION ID. CREATE AN ENTRY IN THE ^BARSESS FILE
SET UFMSESID=$$GETSESID^BARUFUT(DUZ)
+7 ;
+8 IF UFMSESID=0
Begin DoDot:1
+9 WRITE !!,"COULD NOT CREATE SESSION ID IN THE 'A/R UFMS CASHIER SESSION LOG' FILE"
+10 WRITE !,"MAKE SURE THE CASHIER HAS 'V' FILEMAN ACCESS. IF THEY ALREADY DO THERE MAY"
+11 WRITE !,"A LOCK ON THE FILE"
+12 DO ASKFORRT^BARUFUT
+13 KILL UFMSESID
+14 QUIT
End DoDot:1
QUIT
+15 ;AND SET STATUS = OPEN
+16 KILL DIR,DIE,DR,DIC,DA
+17 SET DA(1)=DUZ
+18 SET DA=UFMSESID
+19 SET DR=".05///1"
+20 SET DIE="^BARSESS(DUZ(2),"_DA(1)_",11,"
+21 DO ^DIE
+22 SET MODE="CASHIERING"
+23 DO DISPLAYT(DUZ,UFMSESID,"NEW","NO")
+24 QUIT
+25 ;
DISPLAYT(UDUZ,SESSID,MODE,ERASTAT) ;EP - DISPLAY SESSION TOTALS
DISPAGAI ;EP - DO IT AGAIN
+1 ;MODE - "NEW", "OUT", "VIEW", "CASHIER"
+2 ;SESSID - CASHIER SESSION
+3 NEW BARTR,ARCREDIT,ARDEBIT,TRANTYPE,AMT,TOTALS,IENS,CAT
+4 DO DISHDR(UDUZ,SESSID,MODE)
+5 ;LOOP THROUGH USERS SESSION ENTRIES
+6 SET TOTALS("AAA PAYMENT")=0
+7 SET TOTALS("AAA PAYMENT","CNT")=0
+8 SET TOTALS("ADJ CO-PAY")=0
+9 SET TOTALS("ADJ CO-PAY","CNT")=0
+10 SET TOTALS("ADJ DEDUCTIBLE")=0
+11 SET TOTALS("ADJ DEDUCTIBLE","CNT")=0
+12 SET TOTALS("ADJ NON PAYMENT")=0
+13 SET TOTALS("ADJ NON PAYMENT","CNT")=0
+14 SET TOTALS("ADJ WRITE OFF")=0
+15 SET TOTALS("ADJ WRITE OFF","CNT")=0
+16 SET TOTALS("ADJ PENALTY")=0
+17 SET TOTALS("ADJ PENALTY","CNT")=0
+18 SET TOTALS("ADJ GROUPER ALLOWANCE")=0
+19 SET TOTALS("ADJ GROUPER ALLOWANCE","CNT")=0
+20 SET TOTALS("ADJ PAYMENT CREDIT")=0
+21 SET TOTALS("ADJ PAYMENT CREDIT","CNT")=0
+22 SET TOTALS("ZZZ REFUND")=0
+23 SET TOTALS("ZZZ REFUND","CNT")=0
+24 ;
+25 SET BARTR=0
+26 FOR
SET BARTR=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,BARTR))
IF 'BARTR
QUIT
Begin DoDot:1
+27 SET IENS=BARTR_","
+28 ;A/R TRANSACTIONS, BILL (A/R)
SET ARBILL=$$GET1^DIQ(90050.03,IENS,4,"E")
+29 IF ARBILL=""
QUIT
+30 ;A/R TRANSACTIONS, CREDIT
SET ARCREDIT=$$GET1^DIQ(90050.03,IENS,2,"E")
+31 ;A/R TRANSACTIONS, DEBIT
SET ARDEBIT=$$GET1^DIQ(90050.03,IENS,3,"E")
+32 SET AMT=ARCREDIT-ARDEBIT
+33 ;A/R TRANSACTIONS, ADJUSTMENT TYPE
SET TRANTYPE=$$GET1^DIQ(90050.03,IENS,101,"E")
+34 ;A/R TRANSACTIONS, ADJUSTMENT CATEGORY
SET ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
+35 IF TRANTYPE="PAYMENT"
SET CAT="AAA "_TRANTYPE
DO TOT(CAT,AMT,.TOTALS)
QUIT
+36 SET CAT=ADJCAT
+37 IF CAT="REFUND"
SET CAT="ZZZ "_CAT
DO TOT(CAT,AMT,.TOTALS)
QUIT
+38 IF CAT=""
SET CAT="ADJ UNDEF"
DO TOT(CAT,AMT,.TOTALS)
QUIT
+39 SET CAT="ADJ "_CAT
DO TOT(CAT,AMT,.TOTALS)
QUIT
End DoDot:1
+40 DO LIST(.TOTALS,MODE)
+41 QUIT
+42 ;
TOT(CAT,AMT,TOTALS) ;
+1 SET TOTALS(CAT)=$GET(TOTALS(CAT))+AMT
+2 SET TOTALS(CAT,"CNT")=$GET(TOTALS(CAT,"CNT"))+1
+3 QUIT
+4 ;
LIST(TOTALS,MODE) ;EP - DISPLAY CALCULATED TOTALS
+1 NEW CATEGORY,ADJCAT,ADJCNT,ADJAMT
+2 SET (ADJCNT,ADJAMT,REFCNT,REFAMT)=0
+3 SET (CATEGORY,SUBHDR)=""
+4 FOR
SET CATEGORY=$ORDER(TOTALS(CATEGORY))
IF CATEGORY=""
QUIT
Begin DoDot:1
+5 IF $PIECE(CATEGORY," ")'=SUBHDR
Begin DoDot:2
+6 WRITE !!?5,"Cashiering Function - "
+7 WRITE $SELECT($PIECE(CATEGORY," ")="AAA":"Payments",$PIECE(CATEGORY," ")="ZZZ":"Refunds",1:"Adjustments")
+8 ;
End DoDot:2
+9 IF $PIECE(CATEGORY," ")="ADJ"
Begin DoDot:2
+10 SET ADJCNT=ADJCNT+TOTALS(CATEGORY,"CNT")
+11 SET ADJAMT=ADJAMT+TOTALS(CATEGORY)
+12 ;
End DoDot:2
+13 IF $PIECE(CATEGORY," ",2)="REFUND"
Begin DoDot:2
+14 SET REFCNT=REFCNT+TOTALS(CATEGORY,"CNT")
+15 SET REFAMT=REFAMT+TOTALS(CATEGORY)
End DoDot:2
+16 SET SUBHDR=$PIECE(CATEGORY," ")
+17 IF SUBHDR="ADJ"
WRITE !?10,$PIECE(CATEGORY," ",2,3)
+18 IF '$TEST
WRITE !?10,"Count"
+19 WRITE ?28,"- ",$JUSTIFY(TOTALS(CATEGORY,"CNT"),4)
+20 WRITE ?50,"$"_$JUSTIFY(TOTALS(CATEGORY),10,2)
+21 IF $ORDER(TOTALS(CATEGORY))[("ZZZ")
Begin DoDot:2
+22 WRITE !?8,"Total Adjustments"
+23 WRITE ?28,"= ",$JUSTIFY(ADJCNT,4)
+24 WRITE ?50,"$"_$JUSTIFY(ADJAMT,10,2)
End DoDot:2
End DoDot:1
+25 WRITE !
+26 ;IF THE SESSION HAS BEEN TRANSMITTED SHOW THE FILE
+27 IF $DATA(^BARSESS(DUZ(2),UDUZ,11,SESSID,21))
Begin DoDot:1
+28 WRITE !,"TRANSMITTED ON: "
+29 NEW TRANREC,TRANTIME,IENS,TRANFILE,TRANBY,CNT
+30 SET TRANREC=0
+31 FOR CNT=1:1
SET TRANREC=$ORDER(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,TRANREC))
IF 'TRANREC
QUIT
Begin DoDot:2
+32 SET IENS=TRANREC_","_SESSID_","_UDUZ_","
+33 SET TRANTIME=$$GET1^DIQ(90057.210101,IENS,.01,"E")
+34 SET TRANFILE=$$GET1^DIQ(90057.210101,IENS,.02,"E")
+35 SET TRANBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
+36 IF CNT'=1
WRITE !
+37 WRITE ?16,TRANTIME," BY ",TRANBY
+38 WRITE !?16,TRANFILE
End DoDot:2
End DoDot:1
+39 ;
+40 SET RESPONSE=""
+41 ;ASK FOR AN ACTION TO TAKE
DO ASKACT^BARUFUT(UDUZ,SESSID,.RESPONSE,MODE,$GET(ERASTAT))
+42 ;CASHIER HAS RECONCILED
IF MODE="OUT"&(RESPONSE="RC")!(RESPONSE="D")
QUIT
+43 IF RESPONSE[U!(RESPONSE="")!(RESPONSE="Q")
QUIT
+44 GOTO DISPAGAI
+45 QUIT
+46 ;
DISHDR(UDUZ,SESSID,MODE) ;EP - DISPLAY HEADER
+1 WRITE @IOF
+2 ;I MODE="VIEW" W !,$$CJ^XLFSTR("SUPERVISOR MODE",IOM)
+3 WRITE !,$$CJ^XLFSTR($SELECT(MODE="VIEW":"SUPERVISOR MODE",MODE="CASHIER"!(MODE="NEW")!(MODE="OUT"):"CASHIERING MODE",1:"UNKNOWN MODE"),IOM)
+4 WRITE !,$$CJ^XLFSTR("CASHIERING DISPLAY FOR CASHIER "_$PIECE($GET(^VA(200,UDUZ,0)),U),IOM)
+5 WRITE !,$$CJ^XLFSTR("WITH SESSION ID "_SESSID_" SESSION STATUS: "_$$CURSTAT^BARUFUT(UDUZ,SESSID,"E"),IOM)
+6 QUIT
+7 ;
PRINTDUM(UFMSESID) ;EP - PRINT EMPTY BEGINNING COUNTS
+1 ;W !,$$CJ^XLFSTR("CURRENTLY THERE IS NO POSTING ACTIVITY",IOM)
+2 WRITE !!?5,"Cashiering Function - Payments"
+3 WRITE !?8,"Beginning Count",?28,"- 0",?50,"$ 0.00"
+4 WRITE !!?5,"Cashiering Function - Adjustments"
+5 WRITE !?8,"Beginning Counts"
+6 WRITE !?10,"CO-PAYS",?28,"- 0",?50,"$ 0.00"
+7 WRITE !?10,"DEDCUTIBLES",?28,"- 0",?50,"$ 0.00"
+8 WRITE !?10,"NON-PAYMENTS",?28,"- 0",?50,"$ 0.00"
+9 WRITE !?10,"WRITE OFFS",?28,"- 0",?50,"$ 0.00"
+10 WRITE !?10,"PENALTIES",?28,"- 0",?50,"$ 0.00"
+11 WRITE !?10,"GROUPER ALLOWANCE",?28,"- 0",?50,"$ 0.00"
+12 WRITE !?10,"PAYMENT CREDITS",?28,"- 0",?50,"$ 0.00"
+13 WRITE !?8,"Total Adjustments",?28,"= 0",?50,"$ 0.00"
+14 WRITE !!?5,"Cashiering Function - Refunds"
+15 WRITE !?8,"Beginning Count",?28,"- 0",?50,"$ 0.00"
+16 IF MODE="NEW"
WRITE !!?1,"Assigning session number: ",$GET(UFMSESID)
+17 IF MODE="OUT"
WRITE !!?1,"Session number: ",$GET(UFMSESID)
+18 WRITE !
+19 DO ASKFORRT^BARUFUT
+20 QUIT