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

ACRFPVN.m

Go to the documentation of this file.
ACRFPVN ;IHS/OIRM/DSD/THL,AEF - PROPERTY VOUCHER NUMBER MANAGEMENT; [ 07/20/2006   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**20**;NOV 05, 2001
 ;;ROUTINE FOR PROPERTY VOUCHER NUMBER MANAGEMENT
CREATE ;
 S:'$D(^ACRPO(ACRPODA,40,0))#2 ^ACRPO(ACRPODA,40,0)="^9002199.441P"
 I '$D(^ACRPO(ACRPODA,40,ACRLCDA,0))#2 S DA(1)=ACRPODA,(X,DINUM)=ACRLCDA,DIC="^ACRPO("_ACRPODA_",40,",DIC(0)="L" D FILE^ACRFDIC
 S:'$D(^ACRPO(ACRPODA,40,ACRLCDA,1,0))#2 ^ACRPO(ACRPODA,40,ACRLCDA,1,0)="^9002199.4411"
 I '$D(^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,0))#2 S DA(2)=ACRPODA,DA(1)=ACRLCDA,(X,DINUM)=ACRFY,DIC="^ACRPO("_ACRPODA_",40,"_ACRLCDA_",1,",DIC(0)="L" D FILE^ACRFDIC D
 .S:'$D(^ACRPO(ACRPODA,40,ACRLCDA,1,"B",ACRFY)) ^ACRPO(ACRPODA,40,ACRLCDA,1,"B",ACRFY,ACRFY)=""
 S:'$D(^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,0))#2 ^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,0)="^9002199.4419"
 I '$D(^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,ACRMONTH,0))#2 D
 .S DA(3)=ACRPODA,DA(2)=ACRLCDA,DA(1)=ACRFY,(X,DINUM)=ACRMONTH,DIC="^ACRPO("_ACRPODA_",40,"_ACRLCDA_",1,"_ACRFY_",1,",DIC("DR")=".02////8000",DIC(0)="L" D FILE^ACRFDIC
 Q
SET ;EP;TO SET THE PROPERTY VOUCHER SERIAL NUMBER FOR A NEW RECEIVING REPORT
 I '$D(ACRPODA) S ACRPODA=$P(^ACRDOC(ACRDOCDA,0),U,8)
 Q:'ACRPODA
 Q:'$D(^ACRPO(ACRPODA,0))#2
 I '$D(^ACRPO(ACRPODA,40,0))#2 D CREATE
 I '$D(^ACRPO(ACRPODA,40,ACRLCDA,1,0))#2 D CREATE
 I '$D(^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,0))#2 D CREATE
 I '$D(^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,ACRMONTH,0))#2 D CREATE
 ;L +^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,ACRMONTH,0):4  ;ACR*2.1*20.05 IM17144
 ;G:'$T SET  ;ACR*2.1*20.05 IM17144
 L +^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,ACRMONTH,0):4 I '$T D  G SET  ;ACR*2.1*20.05 IM17144
 .W !,"Purchasing Office file in use by other user"     ;ACR*2.1*20.05 IM17144
 .W !!,"If you get this message more than 5 times, "    ;ACR*2.1*20.05 IM17144
 .W !,"Please notify the site manager"  ;ACR*2.1*20.05 IM17144
 .H 5                                   ;ACR*2.1*20.05 IM17144
 .Q                                     ;ACR*2.1*20.05 IM17144
PVN1 S ACRPVN=$P(^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,ACRMONTH,0),U,2)+1,$P(^(0),U,2)=ACRPVN
 I $D(^ACRDOC("PVN",($P(^AUTTLCOD(ACRLCDA,0),U)_"-"_ACRFY_"-"_$S(ACRMONTH<10:0,1:"")_ACRMONTH_"-"_ACRPVN))) G PVN1
 L -^ACRPO(ACRPODA,40,ACRLCDA,1,ACRFY,1,ACRMONTH,0):0
 ;PVNCHK ;EP;                                     ;ACR*2.1*20.05  IM17144
 ;S ACRPVN=$P(^AUTTLCOD(ACRLCDA,0),U)_"-"_ACRFY_"-"_$S(ACRMONTH<10:0,1:"")_ACRMONTH_"-"_$S($G(ACRPVN)]"":ACRPVN,1:"XXXX")  ;ACR*2.1*20.05 IM17144
 ;Q                                               ;ACR*2.1*20.05 IM17144
 S ACRPVN=$$PVNCHK(ACRLCDA,ACRFY,ACRMONTH,ACRPVN) ;ACR*2.1*20.05 IM17144
 Q
PVNCHK(W,X,Y,Z) ;EP; EXTRINSIC FUNCTION                  ;ACR*2.1*20.05 IM17144
 ; ENTERS WITH W - LOCATION CODE IEN
 ;             X - FISCAL YEAR
 ;             Y - MONTH
 ;             Z - PROPERTY VOUCHER SEQUENCE NUMBER, IF KNOWN
 ; RETURNS PROPERTY VOUCHER NUMBER
 ;
 N ACRSTR
 S ACRSTR=$P(^AUTTLCOD(W,0),U)
 S ACRSTR=ACRSTR_"-"_X
 S ACRSTR=ACRSTR_"-"_$S(Y<10:0,1:"")_Y
 S ACRSTR=ACRSTR_"-"_$S($G(Z)]"":Z,1:"XXXX")
 Q ACRSTR