source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCHNPO5.m@ 1162

Last change on this file since 1162 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 6.4 KB
Line 
1PRCHNPO5 ;WISC/RSD,RHD/DL-INPUT TRANSFORM FOR FILE 440,441,442 ;9/5/00 10:59
2V ;;5.1;IFCAP;**113**;Oct 20, 2000;Build 4
3 ;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5EN1 ;FILE 442, FCP #1
6 I '$D(PRCHAMND),$D(^PRCS(410,+$P(^PRC(442,DA,0),U,12),0)),+$P(^(0),"-",4)'=+X W !,"Fund Control Point cannot be changed since 2237 has been selected." K X Q
7 S Z0=$E($P(^PRC(442,DA,0),"-",2),1,2),Z1=+X D EN4^PRCHNPO6 I '$T K X,Z0,Z1 Q
8 S DIC="^PRC(420,PRC(""SITE""),1,",DIC(0)="QEMNZ"
9 S:$D(PRCHPUSH) DIC("S")="I $P(^(0),U,12)=2"
10 I $G(PRCHPC)!$G(PRCHDELV) S DIC("S")="I $D(^PRC(420,""C"",DUZ,PRC(""SITE""),+Y))"
11 S D="B^C" D MIX^DIC1 K:Y<0!('$D(PRC("FY"))) X K DIC,PRCHCPO,Z0,Z1 Q:'$D(X)
12 N CCNODE S CCNODE=$G(^PRC(420,PRC("SITE"),1,+Y,2,0)) I $P(CCNODE,U,4)'>0!(CCNODE="") W !,"The Fund Control Point selected by you, does not have any",!,"Cost Centers listed under it.",!,$P(Y,U,2) K X Q
13 I $P(Y(0),U,12)'=2,$P(Y(0),U,18)="" W $C(7),!,"LOG Department Number is missing!!" K X Q
14 S Z0=$P(^PRC(442,DA,0),U,2),Z1=$P(Y(0),U,12) I Z1 I ((Z0=3)&(Z1=3)) S Z0=$P(^PRCD(442.5,Z0,0),U,1) W $C(7),!,"Fund Control Point not valid for a "_Z0_" order." K Z0,Z1,X Q
15 S Z0=$P(Y(0),U,1),PRC("FY")=$E(100+$E(PRC("FY"),2,3)+$E(PRC("FY"),4),2,3) S:$P(Y(0),U,10)]"" PRCHN("SVC")=$P($G(^DIC(49,+$P(Y(0),U,10),0)),U,1)
16 I $D(^PRC(420,PRC("SITE"),1,+Y,2,0)),$P(^(0),U,4)=1,$D(^($P(^(0),U,3),0)),$D(^PRCD(420.1,+^(0),0)) S PRCHN("CC")=$P(^(0)," ",1)
17 S PRC("APP")="",X=Z0,PRC("BBFY")=$$BBFY^PRCSUT(PRC("SITE"),PRC("FY"),+X) I PRC("BBFY")="" Q
18 S PRC("APP")=$P($$ACC^PRC0C(PRC("SITE"),+X_"^"_PRC("FY")_"^"_PRC("BBFY")),U,11) K Z0,Z1
19 I $P($G(^PRC(420,PRC("SITE"),1,+X,0)),U,19)=1 W !,"Sorry, this FCP is inactive!",! K X Q
20 Q
21 ;
22EN2 ;FILE 442, COST CENTER #2
23 S PRCFA("ALL")=1,DIC="^PRCD(420.1,",DIC(0)="QEMZ" D ^DIC K DIC,PRCFA("ALL") I Y'>0 W !,"The Cost Center entered by you is not in the COST CENTER FILE.",! K X,Y,Z0 Q
24 I $P(Y(0),U,2)=1 W !,"The Cost Center entered by you has been DEACTIVATED.",! K X,Y,Z0 Q
25 S X=+Y(0)
26 S Z1=$G(^PRC(420,PRC("SITE"),1,Z0,2,+Y(0),0)) I Z1'>0!(Z1="") W !,"This Cost Center isn't found in FCP "_$P(^PRC(420,PRC("SITE"),1,Z0,0),U,1)_".",! K X,Y,Z0,Z1 Q
27 N BOCNOD S BOCNOD=$G(^PRCD(420.1,+Y,1,0)) I $P(BOCNOD,U,4)'>0!(BOCNOD="") W !,"The Cost Center selected by you, does not have any BOCs listed",!,"under it.",! K X
28 K Y,Z0,Z1 Q
29 ;
30EN3 ;FILE 442, VENDOR #5
31 N REP,REP1
32 I DIE["PRC(442,",$D(DA),$D(^PRC(442,DA,2,"AE")) K X
33 Q:'$D(X)!$G(PRCHPC)
34 I '$G(PRCHDELV) D Q:'$G(X)
35 . S DIC("S")="S Z0=+$P($G(^(2)),U,2) I "_$E("'",'$D(PRCHNRQ))_"Z0,'$D(^PRC(440,""AC"",""S"",Y))" I $D(PRCHPUSH) S DIC("S")=DIC("S")_",(Z0=1!(Z0=3))"
36 . D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X Q:'$D(X) S PRCHNVF=Y
37 Q:'$D(^PRC(440,X,2)) S Z0=^(2) I $P(^PRC(442,DA,0),U,2)=4,$P(Z0,U,11)'="Y" W $C(7),!,"This Vendor is not set up as a GUARANTEED DELIVERY Vendor!." K X,Z0 Q
38 ;
39 ; SEE IF VENDOR IS INACTIVE.
40 ;
41 I $P($G(^PRC(440,X,10)),U,5)=1 K X Q
42 ;
43 ;
44 ;
45 K PRCHEDI I $P($G(^PRC(440,X,3)),U,2)="Y" S PRCHEDI="" ;CHECK FOR EDI VENDOR
46 I $D(^PRCD(420.8,+$P(Z0,U,2),0)) S PRCHN("SC")=$P(^(0),U,1)
47 K Z0
48 Q
49 ;
50EN4 ;FILE 442, EST. SHIPPING AND/OR HANDLING #13
51 S %A=" FOB is Destination, Are you sure you want Handling Charges ",%B="",%=1 D ^PRCFYN I %'=1 K X W !?3,"<DELETED>",$C(7)
52 Q
53 ;
54EN5 ;FILE 442, REPETITIVE (PR CARD) NO. #1.5
55 I $P(^PRC(442,DA(1),0),U,3)=""!($P(^(1),U,1)="") W !!,"Fund Control Point and Vendor must be entered before items !",$C(7) K X Q
56 S:'$D(PRC("SITE")) PRC("SITE")=+^PRC(442,DA(1),0) D LCK^PRCHCRD
57 Q
58 ;
59EN6 ;FILE 442, UNIT OF PURCHASE #3
60 D VEN Q:'$D(X)!($P(^PRC(442,DA(1),2,DA,0),U,5)="")
61 S:'$D(PRC("SITE")) PRC("SITE")=$P($P(^PRC(442,DA(1),0),U,1),"-",1) S PRCHCV=$P(^PRC(442,DA(1),1),U,1),PRCHCI=$P(^(2,DA,0),U,5),PRCHCPO=DA(1) D EN0^PRCHCRD
62 Q
63 ;
64EN8 ;FILE 442, CONTRACT FIELD #4
65 D VEN Q:'$D(X) K DIC("S")
66 S Z0=$P(^PRC(442,DA(1),1),U,1),ZA=DA,ZA(1)=DA(1)
67 S DA(1)=Z0,DIC="^PRC(440,Z0,4,",DIC(0)="QELMZ",DLAYGO=440
68 I $G(PRCHPC)!$G(PRCHDELV) S DIC(0)="QEMZ"
69 D EN10,^DIC S X=$P(Y,U,2),DA=ZA,DA(1)=ZA(1) K ZA K:Y'>0 X
70 I $D(X),$D(DT),$P(Y(0),U,2)-DT<0 W !?10,"**CONTRACT HAS EXPIRED**",$C(7),$C(7) K X,DLAYGO Q
71 S:'$D(PRC("SITE")) PRC("SITE")=$P($P(^PRC(442,DA(1),0),U,1),"-",1) I $P(^PRC(442,DA(1),2,DA,0),U,5)]"" S PRCHCI=$P(^(0),U,5),PRCHCV=Z0,PRCHCPO=DA(1) D EN2^PRCHCRD
72 K DLAYGO
73 Q
74 ;
75EN9 ;FILE 442, ACTUAL UNIT COST #5
76 D VEN Q:'$D(X)!($P(^PRC(442,DA(1),2,DA,0),U,5)="")
77 S:'$D(PRC("SITE")) PRC("SITE")=$P($P(^PRC(442,DA(1),0),U,1),"-",1) S PRCHCV=$P(^PRC(442,DA(1),1),U,1),PRCHCI=$P(^(2,DA,0),U,5),PRCHCPO=DA(1) D EN1^PRCHCRD
78 Q
79 ;
80EN10 ;FILE 440 CONTRACT NUMBER
81 I $D(Z0) S:'$D(^PRC(440,Z0,4,0)) ^PRC(440,Z0,4,0)="^440.03I^^"
82 Q
83 ;
84EN11 ;FILE 441 CONTRACT
85 D EN10 S DIC="^PRC(440,Z0,4,",DIC(0)="QEMLZ",DLAYGO=440,ZD=DA(1),DA(1)=Z0 D ^DIC S X=+Y K:Y'>0 X S DA(1)=ZD K ZD,Z0,DIC
86 I $D(X),$D(DT),$P(Y(0),U,2)-DT<0 W !?10,"**CONTRACT HAS EXPIRED**",$C(7),$C(7) K X
87 K DLAYGO
88 Q
89 ;
90EN12 ;FILE 442, VENDOR STOCK NO.#9
91 D VEN Q:'$D(X)!($P(^PRC(442,DA(1),2,DA,0),U,5)="")
92 S:'$D(PRC("SITE")) PRC("SITE")=+^PRC(442,DA(1),0) S PRCHCV=+$P(^PRC(442,DA(1),1),U,1),PRCHCI=+$P(^(2,DA,0),U,5),PRCHCPO=DA(1) D EN6^PRCHCRD
93 Q
94 ;
95EN13 ;DIC("S") for a look-up in CONTRACT field (File 442.01,4)
96 S PRCHSCOD=$P($G(^PRC(442,D0,1)),U,7)
97 I $E(X)="?" S DIC("S")=$S(PRCHSCOD=2:"I $P(^PRC(440,Z0,4,+Y,0),U,6)'=""B""",1:"I 1")
98 Q
99 ;
100EN14 ;input transform of Contract Flag field 5, file 440
101 ;If PO exists, if source code=2 & contract flag is not 'C' set it 'C'
102 I $G(PRCHPO)>0 D
103 . S PRCHNOD1=$G(^PRC(442,PRCHPO,1))
104 . S PRCHSOCO=$P(PRCHNOD1,U,7)
105 . I PRCHSOCO=2 Q:X="C" D Q
106 . . S X="C"
107 . . S ARR(1)=""
108 . . S ARR(2)=" Note: "
109 . . S ARR(3)=" This PO's Source Code is Open Market, only Contract # is a valid entry."
110 . . S ARR(4)=" 'C' has been entered for the Contract Flag prompt."
111 . . S ARR(5)=" 'B' is not allowed, system allows only 'C'."
112 . . S ARR(6)=""
113 . . D EN^DDIOL(.ARR)
114 . . S XQH="PRCH CONTRACT FLAG HELP" D:$E(X)="??" EN^XQH
115 . . Q
116 . Q
117 ; If Source code is not equal to 2, C or B is ok for contr. flag
118 S MSG(1)=""
119 S MSG(2)="Enter 'C' if the Contract Number field is a Contract #."
120 S MSG(2,"F")="!,?5"
121 S MSG(3)="Otherwise enter 'B' if it is a Basic Ordering Agreement(BOA) #."
122 S MSG(3,"F")="!,?5"
123 S MSG(4)=""
124 ;I PRCHSOCO'=2 D EN^DDIOL(.MSG) H 2
125 ;any other route than via po
126 I X="B" D
127 . S Z=$P(^PRC(440,DA(1),4,DA,0),U)
128 . K:'(Z?.UN) X
129 . I '$D(X) S XQH="PRCH BOA" D EN^XQH
130 . K Z,XQH
131 . Q
132 Q
133 ;
134VEN I $S('$D(^PRC(442,DA(1),1)):1,$P(^(1),U,1)="":1,1:0) W !!,"Vendor must be entered before items ! ",$C(7) K X
135 Q
Note: See TracBrowser for help on using the repository browser.