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

ACRFRR31.m

Go to the documentation of this file.
ACRFRR31 ;IHS/OIRM/DSD/THL,AEF - RECEIVING REPORTS CONTINUED; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;CONTINUATION OF ACRFRR
RECEIVE ;EP;
 D TOTRCD1
 I ACRRCDX'<ACRRQD D  Q:ACRACPX'<ACRRQD
 .W !!,ACRRQD," of these items ",$S(ACRRQD=1:"was",1:"were")," ordered,"
 .W !,ACRRCDX,$S(ACRRCDX=1:" has",1:" have")," already been received and."
 .W !,ACRACPX,$S(ACRACPX=1:" has",1:" have")," already been accepted."
 .W:ACRACPX'<ACRRQD !,"No further receiving action should be taken for this item."
 .D PAUSE^ACRFWARN
 ;S DIR(0)="FOA^1:10:I X?1N.6N.""."".N"
 S DIR(0)="NOA^0:"_(ACRRQD-ACRACP)_":3"
 S DIR("A")="NUMBER RECEIVED.....: "
 S DIR("?")="Enter the actual number received"
 S DIR("B")=ACRUNRCD
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) D INCOMPLT Q
 S ACRRCDX=Y
 S ACRRCD=ACRRCD+Y
 S DIR(0)="FOA^1:10^I X?1N.6N.""."".N"
 S DIR("A")="NUMBER ACCEPTED.....: "
 S DIR("?")="Enter the actual number accepted"
 S DIR("B")=ACRRCDX
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) D INCOMPLT Q
 S ACRACPX=Y
 S ACRACP=ACRACP+Y
 D DATE
 D ADD:'$D(ACRQUIT)
 Q
ADD ;EP;ADD RECEIVING REPORT
 ;
 N ACRNOW
 D NOW^%DTC
 S ACRNOW=%
 S X=ACRSSDA
 S DIC="^ACRRR("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRSSPO_";.03////"_ACRSSRQ_";.04////"_ACRRRNO_";.05////"_DUZ_";.06////"_ACRNOW_";2////"_ACRRCDX_";3////"_ACRACPX_";4////"_ACRDATE
 D FILE^ACRFDIC
 I Y<1 S ACRQUIT="" Q
 S ACRRRDA=+Y
 S X=ACRNOW
 S DA(1)=ACRRRDA
 S DIC="^ACRRR("_ACRRRDA_",11,"
 S DIC(0)="L"
 S DIC("DR")=".02////"_DUZ_";.03////1"
 S:'$D(@(DIC_"0)")) ^ACRRR(ACRRRDA,11,0)="^9002193.2111D"
 D FILE^ACRFDIC
C1 ;EP
 D TOTAL
 S DA=ACRSSDA
 S DIE="^ACRSS("
 S DR=$S($D(ACRRR)#2:"14////"_ACRRCD_";15////"_ACRACP,1:"16////"_(ACRIVD*ACRUC)_";17////"_ACRIVD)
 S ACROBJ=$P(^ACRSS(ACRSSDA,0),U,4)
 I ACROBJ,$D(^AUTTOBJC(ACROBJ,0)) D
 .S ACROBJ=$P(^AUTTOBJC(ACROBJ,0),U)
 .S:$E(ACROBJ,1,2)=26 DR=DR_";33T"
 D DIE^ACRFDIC
 I ACRACP<ACRRCD D
 .S DA=ACRSSDA
 .S DIE="^ACRSS("
 .S DR="[ACR REJECTION/CANCELLATION]"
 .D DIE^ACRFDIC
 Q
INCOMPLT ;
 W *7,*7
 W !!,"Data entry for ITEM NO. ",ACRJ," not completed, entry not accepted."
 D PAUSE^ACRFWARN
 Q
TOTAL S (X,ACRRCD,ACRACP)=0
 F  S X=$O(^ACRRR("B",ACRSSDA,X)) Q:'X  D
 .S ACRRRDT=$G(^ACRRR(X,"DT"))
 .S ACRRCD=ACRRCD+$P(ACRRRDT,U,2)
 .S ACRACP=ACRACP+$P(ACRRRDT,U,3)
 Q
RRNO ;EP;TO DETERMINE THE NO OF RECEIVING REPORTS ON FILE
 S (X,Z)=0
 F  S X=$O(^ACRRR("AC",ACRDOCDA,X)) Q:'X  S Z=Z+1
 S ACRRRNO=Z
 Q
TOTCHK ;EP;CALLED BY INPUT TRANSFOR TO ENSURE THAT THE QUANTITY REC'D ON A
 ;RECEIVING ACTION DOES NOT MAKE THE TOTAL QUANTITY REC'D GREATER THAN
 ;TOTAL QUANTITY ORDERED
 D TOTRCD
 S:$D(^ACRRR(DA,"DT")) ACRRCDX=ACRRCDX-$P(^("DT"),U,2)
 I ACRRCDX+X>ACRRQD D
 .W *7,*7
 .W !!,"The quantity received on this receiving action cannot make the total quantity"
 .W !,"received greater than the total quantity ordered (",ACRRQD,")"
 .W !
 .K X
 Q
TOTRCD ;EP;TO CALCULATE THE TOTAL RECEIVED FOR AN ITEM
 S ACRRCDX=0
 I '$D(ACRRRDA),'$D(DA) D TOTRCD1 Q
 I '$D(DA),$D(ACRRRDA) S DA=ACRRRDA
 N ACRRRDA,ACRSSDA
 S ACRRRDA=DA
 Q:'$D(^ACRRR(+DA,0))
 S ACRSSDA=+^ACRRR(DA,0)
TOTRCD1 Q:'$D(^ACRSS(ACRSSDA,"DT"))
 S ACRRQD=+^ACRSS(ACRSSDA,"DT")
 S (ACRRCDX,ACRRRX,ACRACPX)=0
 F  S ACRRRX=$O(^ACRRR("B",ACRSSDA,ACRRRX)) Q:'ACRRRX  D
 .S ACRRCDX=ACRRCDX+$P($G(^ACRRR(ACRRRX,"DT")),U,2)
 .S ACRACPX=ACRACPX+$P($G(^ACRRR(ACRRRX,"DT")),U,3)
 K ACRRRX
 Q
DATE ;EP;
 S DIR(0)="DA^::EP"
 S DIR("A")="DATE RECEIVED.......: "
 S DIR("?",1)="Enter the date the items were actually received,"
 S DIR("?")="not the date you are doing the Receiving Report."
 I $G(ACRDATE) D
 .S Y=$P(ACRDATE,".")
 .X ^DD("DD")
 .S DIR("B")=Y
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT),$D(ACRJ),ACRJ D INCOMPLT Q
 S ACRDATE=Y
 Q