source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCFDE1.m@ 613

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1PRCFDE1 ;WISC@ALTOONA/CTB-CONTINUATION OF PRCFDE ;9/15/95 10:45
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 K DIC S DIE="^PRCF(421.5,",DA=PRCF("CIDA")
5 K %DT S X="T" D ^%DT S PRCFD("TODAY")=Y
6 S DR="[PRCF CI VOUCHER AUDIT]" D ^DIE ;Q:$D(PRCFD("PAY"))
7 D ENTER^PRCFDCIP
8 K PRCF("VENDA"),PRCFD("DOI"),PRCFD("PODA"),PRCFD("DOP"),PRCFD("DIR")
9 K PRCFD("INV TYPE"),PRCF("PTR"),PRCF("DAYS"),PRCF("NAME"),PRCF("X")
10 K PRCF("PT"),PRCFD("DOD"),ZX
11 I $D(Y) S X=$S($D(PRCFD("LOGIN")):10,1:0) D STATUS,NA G VEX
12 D I %<0 D NA S PRCFD("^")="" G VEX
13 . S %A="Accept invoice for further processing",%B="",%=1 D ^PRCFYN
14 . Q:%'=2 S %A="Return invoice to vendor",%B="",%=2 D ^PRCFYN
15 . Q:%<0 S:%=1 %=3
16 . Q
17 I %=2 S X=$S($D(PRCFD("LOGIN")):10,1:0) D STATUS,NA G VEX
18 I %=3 D G VEX
19 . S DR=25 D ^DIE I X D
20 . . S DR="24//TODAY;23" D ^DIE,PRCFCHK^PRCFDCI,^PRCFDSUS
21 . . Q
22 . S X=3 D STATUS
23 . Q
24 G:$D(PRCFD("LOGIN"))&'$D(PRCFD("RECERT")) VEX
25 I '$P(^PRCF(421.5,PRCF("CIDA"),0),"^",27) G PAYMENT
26 S %A="Do you wish to forward this invoice for signature at this time",%B="",%=1 D ^PRCFYN
27 I %'=1 S X=0,PRCF("%")=% D STATUS S X=" <No further action taken.>*" D MSG^PRCFQ S %=PRCF("%") K PRCF("%") S:%<0 PRCFD("^")="" G VEX
28 S DIE="^PRCF(421.5,",DA=PRCF("CIDA"),DR="[PRCF CI BORROWER]" D ^DIE
29 I $D(Y) S X=0 D STATUS,NA S PRCFD("^")="" G VEX
30 S X="Please forward actual invoice to service for signature.*"
31 D MSG^PRCFQ S X=5 D STATUS
32VEX Q
33 ;
34PAYMENT S %A="Do you wish to process this item for payment now",%B="",%=1
35 D ^PRCFYN I %'=1 S X=10 S:%<0 PRCFD("^")="" D STATUS,NA G PAYX
36 D DIE^PRCFDCI
37PAYX Q
38STATUS N X1,X2,DA,DIE,DR S X2=X
39 S X1=$S($D(^PRCF(421.5,PRCF("CIDA"),2))#2:$P(^(2),"^"),1:"")
40 I X1="" D ST S X="Status is set to '"_Y_"'.*" D MSG^PRCFQ G STATUSX
41 I X=X1 D ST S X="Status of '"_Y_"' has not been changed.*" D MSG^PRCFQ Q
42 S X=X1 D ST S $P(X1,"^",2)=Y,X=X2 D ST S $P(X2,"^",2)=Y
43 S X="Status has been changed from '"_$P(X1,"^",2)_"'*" D MSG^PRCFQ
44 S X=" to '"_$P(X2,"^",2)_"'.*" D MSG^PRCFQ
45 I $G(PRCNOPAT)=1 K PRCNOPAT W ?3,"This invoice needs a valid purchase order number.",!!
46STATUSX S DA=PRCF("CIDA"),DR="50////^S X=+X2",DIE=421.5 D ^DIE
47 Q
48ST N DD,F S DD=421.5,F=50 D ^PRCFU1 Q
49NA S X=" <No action taken.>*" D MSG^PRCFQ Q
50OUT ;EXIT LINE
51 D OUT^PRCFDE Q
52EDIT ;EDIT EXISTING, INCOMPLETE INVOICE
53 S PRCF("X")="AS" D ^PRCFSITE Q:'%
54 S PRCFD("PAY")="",PRCFDX("ED")="",DIC=421.5,DIC(0)="AEMNZ"
55 S DIC("S")="I $S('$D(^(2)):1,+^(2)>3:0,1:1),$D(^(1)),$P(^(1),""^"",2)=PRC(""SITE"")"
56 D ^DIC K DIC I Y<0 K PRCFDX("ED") D OUT Q
57 S PRCF("CIDA")=+Y D PAT^PRCFDE I $D(PRCFD("^")) D OUT Q
58 S %A="Do you wish to edit another incomplete invoice",%B="",%=2
59 D ^PRCFYN G EDIT:%=1 D OUT
60 Q
61 ;
62 ;
63PO ;INPUT TRANSFORM FOR FIELD 4.5 FILE 421.5
64 ;I '$D(PRC("SITE")) S PRCFX=X,PRCF("X")="AS" D ^PRCFSITE S X=PRCFX K PRCFX Q:'%
65 I X["." S X=$P(X,".")
66 N DIC,%A,%B S DIC=442,DIC(0)="EM" D ^DIC K DIC
67 I $D(DTOUT)!($D(DUOUT)) K DTOUT,DUOUT,X Q
68 I Y>0 S ZY=Y,X=$P($G(^PRC(442,+Y,7)),U,2) I X<10!(X>43) G:X=45 CANC D QUES,^PRCFYN S Y=ZY K ZY I %'=1 K X Q
69 I $G(PRCF("CIDA"))="" S PRCF("CIDA")=$G(DA)
70 I Y>0 S X=$P(Y,"^",2),$P(^PRCF(421.5,PRCF("CIDA"),0),"^",7)=+Y,^PRCF(421.5,"E",+Y,PRCF("CIDA"))="" Q
71 I Y<0,X="" K X Q
72 S X=$S(X["-":PRC("SITE")_"-"_$P(X,"-",2),1:PRC("SITE")_"-"_X)
73 S %A=$S(X]"":"PAT Reference Number "_X_" is not in Purchase Order File.",1:"No PAT number selected"),%A(0)="*!",%A(1)="OK to Continue",%B="",%=2 D ^PRCFYN I %'=1 K X Q
74 I %=1 S PRCNOPAT=1
75 N PZ
76 S PZ=$P(^PRCF(421.5,PRCF("CIDA"),0),"^",7),$P(^(0),"^",7)=""
77 I PZ]"" K ^PRCF(421.5,"E",PZ,PRCF("CIDA")) Q
78 Q
79QUES S X=+$G(^PRC(442,+Y,7))
80 S X=$S(X="":"UNKNOWN",'$D(^PRCD(442.3,X,0)):"UNKNOWN",1:$P(^(0),"^"))
81 S %A="Current Status on this PAT number is '"_X_"'. OK to Continue"
82 S %A(0)="*",%B="",%=2
83 Q
84CANC W !,$C(7),"Purchase Order status is: CANCELED ORDER. Cannot proceed." S Y=ZY,%=-1 K ZY,X Q
Note: See TracBrowser for help on using the repository browser.