Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFRR33

ACRFRR33.m

Go to the documentation of this file.
ACRFRR33 ;IHS/OIRM/DSD/THL,AEF - RECEIVING REPORT/INVOICE AUDIT CONT'D;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;CONTINUATION OF ACRFRR
ADD ;EP;TO ADD A NEW RECEIVING REPORT
 D RRNO^ACRFRR31
 S ACRRRNO=ACRRRNO+1
 I ACRRRNO=1 G ADD1
 S DIR(0)="YO"
 S DIR("A")="Add Receiving Report No. "_ACRRRNO
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:Y'=1!$D(ACRQUIT)!$D(ACROUT)
ADD1 ;EP;TO ADD ADDITIONAL ITEMS TO EXISTING RR
 S ACRJ=""
 K ACRDATE
 W !
 D DATE^ACRFRR31
 Q:$D(ACRQUIT)!$D(ACROUT)
 S DIR(0)="LO^1:"_ACRSSMAX
 S DIR("A")="Which PO Items(s)"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 S ACRXX=Y
 I $G(Y(1))]"" S %X="Y(",%X="ACRXX(" D %XY^%RCR
 S DIR(0)="SO^1:Partial "_$S($D(ACRRR)#2:"Receipt",1:"Invoice")_";2:Total "_$S($D(ACRRR)#2:"Receipt",1:"Invoice")
 S DIR("B")="Partial "_$S($D(ACRRR)#2:"Receipt",1:"Invoice")
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 I Y=2 D  I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT,ACRTOTAL Q
 .I $D(ACRRR)#2 D
 ..S DIR(0)="YO"
 ..S DIR("A")="Are you certain that ALL quantities ordered were RECEIVED and ACCEPTED"
 .I $D(ACRIV)#2 D
 ..S DIR(0)="YO"
 ..S DIR("A",1)="Are you certain that ALL Invoice quantities and costs are identical"
 ..S DIR("A")="to the costs and quantities ordered and received"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .I Y'=1 S ACRQUIT="" Q
 .S ACRTOTAL=""
 .W !
 .D DATE^ACRFRR31
 .I '$D(ACRDATE) S ACRQUIT="" Q
E0 D:$E($G(IOST),1,2)="C-" WAIT^DICD
 D E01
 N ACRJJ
 S ACRJJ=0
 F  S ACRJJ=$O(ACRXX(ACRJJ)) Q:'ACRJJ  S ACRXX=ACRXX(ACRJJ) D E01
 Q
E01 F ACRK=1:1:$L(ACRXX,",") S ACRX=$P(ACRXX,",",ACRK) Q:ACRX=""  D E1:$D(ACRSS(ACRX))#2
 K ACRTOTAL
 Q
E1 S ACRX=ACRSS(ACRX)
 S ACRSSDA=+ACRX
 S ACRSS0=^ACRSS(ACRSSDA,0)
 S ACRSSDT=^ACRSS(ACRSSDA,"DT")
 S ACRUC=$P(ACRSSDT,U,3)
 S ACRRCD=$P(ACRSSDT,U,5)
 S ACRACP=$P(ACRSSDT,U,6)
 S ACRSSRQ=$P(ACRSS0,U,2)
 S ACRSSPO=+^ACRSS(ACRSSDA,"PO")
 S ACRUNRCD=+ACRSSDT-ACRACP
 S ACRIVD=$P(ACRSSDT,U,19)
 S ACRUNINV=ACRACP-ACRIVD,ACRIVDX=ACRUNINV
 I $D(ACRRR)#2,ACRUNRCD=0 D  Q
 .W !!,"No additional quantities need to be received for this item."
 .D PAUSE^ACRFWARN
 I $D(ACRIV)#2,ACRUNINV=0 D  Q
 .W !!,"No additional quantities need to be invoiced for this item."
 .D PAUSE^ACRFWARN
 I $D(ACRTOTAL),ACRUNRCD>0 D  Q
 .S (ACRRCD,ACRRCDX,ACRACP,ACRACPX)=ACRUNRCD
 .D ADD^ACRFRR31:$D(ACRRR)#2
 .D ADD^ACRFIV31:$D(ACRIV)#2
 .K ACRQUIT
 D EDIE
 Q
EDIE W @IOF
 W !?20,"INFORMATION FOR SELECTED "
 W !?20,@ACRON,"SERVICE OR SUPPLY",@ACROF
 W !!
 N DXS,DIP,DC,DN,D0
 S D0=ACRSSDA
 D ^ACRPII
 W !!
 D:$D(ACRRR)#2 ^ACRFRR31
 D:$D(ACRIV)#2 ^ACRFIV31
 Q