source: WorldVistAEHR/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRCSEC2.m@ 1692

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1PRCSEC2 ;WISC/DJM-CONTINUATION OF PRCSEC ;4/30/93 3:08 PM
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4CAP(XX) ;FIND OUT NUMBER OF REQUESTS TO APPROVE FOR SUPPLY FUND, TOTAL AMOUNT OF OF REQUESTS, AND CHECK FOR SUFFICIENT $S TO PURCHASE. INFORM USER OF RESULTS.
5 N AA,AB,AC,X1
6 N AMT,CT,KS,S,VAR,X,XDA S (CT,AMT,XX)=0,S="-",KS=PRC("SITE")_S_+PRC("CP")_"-0",VAR=$P(KS,S,1,2),SPCP=$P(^PRC(420,PRC("SITE"),1,+PRC("CP"),0),U,12),SPCP=$S(SPCP=2:1,1:0) Q:'SPCP
7 F S KS=$O(^PRCS(410,"F",VAR_S_$P(KS,S,3))) Q:$P(VAR,S,1,2)'=$P(KS,S,1,2)!(KS="") S XDA=$O(^PRCS(410,"F",KS,0)) Q:XDA'>0 I $D(^PRCS(410,XDA,0)) D
8 .I $D(^PRCS(410,XDA,7)),$P(^(7),U,6)]"" Q
9 .I $S('$D(^PRCS(410,XDA,11)):1,'$P(^(11),U,3):1,1:0) Q
10 .S X=$P($P(^PRCS(410,XDA,0),U),S,4,5) I +$P(X,S)'=$P(KS,S,2)!($P(X,S,2)'=$P(KS,S,3)) Q
11 .S CT=CT+1,AB="PRCSRQ"_"("_CT_")",@AB=XDA I $D(^PRCS(410,XDA,4)) S AC=$S(+$P(^(4),U):$P(^(4),U),$P(^(0),U,2)="A"&($P(^(0),U,4)=1):$P(^(4),U,6),1:0),$P(@AB,U,2)=AC,AMT=AMT+AC
12 .Q
13 S AA=$P(^PRC(420,PRC("SITE"),0),U,6)
14 I AA'>0 W !!,"There are no funds available to approve requests at this time.",!,"Please try later." S XX=2 Q
15 W !!,"You have "_CT_" request"_$S(CT:"s",1:"")_" to be approved for SUPPLY FUND. Estimated $: "_$J(AMT,9,2)_"." S XX=$S(AA-AMT<0:1,1:0)
16 W !,"You "_$S(XX:"don't ",1:"")_"have sufficient funds to order "_$S(CT>1:"all ",1:"")_"the request"_$S(CT>1:"s.",1:"."),! Q:'XX
17 W !,?5,"The TOTAL dollar CAP available is $"_$J(AA,9,2)_".",!
18 W !,?5,"TRANSACTION",?30,"$ AMOUNT TO APPROVE" F X=1:1:CT S X1="PRCSRQ"_"("_X_")" W !,?5,$P(^PRCS(410,$P(@X1,U),0),U),?30,"$"_$J($P(@X1,U,2),9,2)
19 W ! Q
20OK ;THIS IS WHERE THE SUPPLY FUND CAP INFORMATION IS UPDATED. THE CONTROL POINT OFFICIAL HAS APPROVED THE TRANSACTION AND THERE ARE SUFFICIENT FUNDS TO PURCHASE THE ITEMS DESIRED.
21 Q:'SPCP N X S PRC("SITE")=$G(PRC("SITE")) D:PRC("SITE")="" STA^PRCSUT D:PRC("SITE")="" W2,W3 Q:PRC("SITE")="" S X=$G(^PRC(420,PRC("SITE"),0)) D:X="" W1,W3 Q:X="" S X=$P(X,U,5)+PRCST
22 S PRCST1="^"_X D ENTERCAP^PRCFWCAP(PRCST1) I $D(ERROR) D W1,W3 K ERROR
23 Q
24W1 W !!,"AN ERROR HAS OCCURRED." Q
25W2 W !!,"YOUR SITE IS UNDEFINED." Q
26W3 W " PLEASE CONTACT YOUR APPLICATIONS COORDINATOR",!,"TO RESOLVE THIS PROBLEM." Q
27PRCB ;The option PRCB CAP EDIT uses this entry point to enter or edit the SUPPLY FUND CAP.
28 W !!
29 N MESSAGE S MESSAGE=""
30 D ESIG^PRCUESIG(DUZ,.MESSAGE)
31 I (MESSAGE=0)!(MESSAGE=-3) W !!!,?15,"SIGNATURE CODE FAILURE" Q
32 I (MESSAGE=-1)!(MESSAGE=-2) Q
33 W !
34 N DA,DIE,DR,DATA I $G(PRC("SITE"))="" D STA^PRCSUT I PRC("SITE")="" D W2,W3 Q
35 S DA=PRC("SITE"),DIE="^PRC(420,",DR="4R" D ^DIE S DATA=$P(^PRC(420,PRC("SITE"),0),U,4) D ENTERCAP^PRCFWCAP(DATA) I $D(ERROR) D W1,W3 K ERROR Q
36 W !!!,?7,"The Supply Fund Cap for your Station is now: $",$FN(+$P($G(^PRC(420,+DA,0)),"^",3),",",2)
37 Q
Note: See TracBrowser for help on using the repository browser.