BARUFTDN ; IHS/SD/SDR - Format TDN with FY ;
;;1.8;IHS ACCOUNTS RECEIVABLE;**6**;OCT 26, 2005
;
BATCH(Y,D0) ;EP - Add FY8 to FY08 TDNs
; Y=TDN
; D0=Collection Batch IEN
N BARBDT,BARTDN
S BARBDT=$P($P($G(^BARCOL(DUZ(2),D0,0)),U,4),".")
S BARTDN=$P($G(^BARCOL(DUZ(2),D0,0)),U,28)
S Y=$S($L(Y)<6:Y,(BARTDN["NONP"):Y,BARTDN["PRE-UFMS":Y,((BARBDT>3070930)&(BARBDT<3081001)):"FY8"_Y,1:Y)
Q Y
ITEM(Y,D0,D1) ;EP - Add FY8 to FY08 TDNs
; Y=TDN
; D0=Collection Batch IEN
; D1=Item IEN
N BARBDT,BARTDN
S BARBDT=$P($P($G(^BARCOL(DUZ(2),D0,0)),U,4),".")
S BARTDN=$S($P($G(^BARCOL(DUZ(2),D0,1,D1,0)),U,20)'="":$P(^BARCOL(DUZ(2),D0,1,D1,0),U,20),1:$P($G(^BARCOL(DUZ(2),D0,0)),U,28))
S Y=$S($L(Y)<6:Y,(BARTDN["NONP"):Y,BARTDN["PRE-UFMS":Y,((BARBDT>3070930)&(BARBDT<3081001)):"FY8"_Y,1:Y)
Q Y
TRANS(Y,D0) ;EP - Add FY8 to FY08 TDNs
; Y=TDN
; D0=A/R Transaction IEN
N BARBDT,BARTDN,BARRDT,BARRCOL
S BARRDT=$P($G(^BARTR(DUZ(2),D0,1)),U,10)
Q:BARRDT="" Y
S BARRCOL=$P($G(^BARTR(DUZ(2),BARRDT,0)),U,14)
Q:BARRCOL="" Y
S BARBDT=$P($P($G(^BARCOL(DUZ(2),BARRCOL,0)),U,4),".")
S BARTDN=$P($G(^BARCOL(DUZ(2),BARRCOL,0)),U,28)
S Y=$S($L(Y)<6:Y,BARTDN["NONP":Y,BARTDN["PRE-UFMS":Y,((BARBDT>3070930)&(BARBDT<3081001)):"FY8"_Y,1:Y)
Q Y
BARUFTDN ; IHS/SD/SDR - Format TDN with FY ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**6**;OCT 26, 2005
+2 ;
BATCH(Y,D0) ;EP - Add FY8 to FY08 TDNs
+1 ; Y=TDN
+2 ; D0=Collection Batch IEN
+3 NEW BARBDT,BARTDN
+4 SET BARBDT=$PIECE($PIECE($GET(^BARCOL(DUZ(2),D0,0)),U,4),".")
+5 SET BARTDN=$PIECE($GET(^BARCOL(DUZ(2),D0,0)),U,28)
+6 SET Y=$SELECT($LENGTH(Y)<6:Y,(BARTDN["NONP"):Y,BARTDN["PRE-UFMS":Y,((BARBDT>3070930)&(BARBDT<3081001)):"FY8"_Y,1:Y)
+7 QUIT Y
ITEM(Y,D0,D1) ;EP - Add FY8 to FY08 TDNs
+1 ; Y=TDN
+2 ; D0=Collection Batch IEN
+3 ; D1=Item IEN
+4 NEW BARBDT,BARTDN
+5 SET BARBDT=$PIECE($PIECE($GET(^BARCOL(DUZ(2),D0,0)),U,4),".")
+6 SET BARTDN=$SELECT($PIECE($GET(^BARCOL(DUZ(2),D0,1,D1,0)),U,20)'="":$PIECE(^BARCOL(DUZ(2),D0,1,D1,0),U,20),1:$PIECE($GET(^BARCOL(DUZ(2),D0,0)),U,28))
+7 SET Y=$SELECT($LENGTH(Y)<6:Y,(BARTDN["NONP"):Y,BARTDN["PRE-UFMS":Y,((BARBDT>3070930)&(BARBDT<3081001)):"FY8"_Y,1:Y)
+8 QUIT Y
TRANS(Y,D0) ;EP - Add FY8 to FY08 TDNs
+1 ; Y=TDN
+2 ; D0=A/R Transaction IEN
+3 NEW BARBDT,BARTDN,BARRDT,BARRCOL
+4 SET BARRDT=$PIECE($GET(^BARTR(DUZ(2),D0,1)),U,10)
+5 IF BARRDT=""
QUIT Y
+6 SET BARRCOL=$PIECE($GET(^BARTR(DUZ(2),BARRDT,0)),U,14)
+7 IF BARRCOL=""
QUIT Y
+8 SET BARBDT=$PIECE($PIECE($GET(^BARCOL(DUZ(2),BARRCOL,0)),U,4),".")
+9 SET BARTDN=$PIECE($GET(^BARCOL(DUZ(2),BARRCOL,0)),U,28)
+10 SET Y=$SELECT($LENGTH(Y)<6:Y,BARTDN["NONP":Y,BARTDN["PRE-UFMS":Y,((BARBDT>3070930)&(BARBDT<3081001)):"FY8"_Y,1:Y)
+11 QUIT Y