source: FOIAVistA/trunk/r/IFCAP-PRC-PRX--PRCA--PRCN/PRC0G.m@ 1119

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

initial load of FOIAVistA 6/30/08 version

File size: 2.7 KB
Line 
1PRC0G ;WISC/PLT-IFCAP UTILITY ; 02/19/96 3:37 PM
2V ;;5.1;IFCAP;;Oct 20, 2000
3 ;Per VHA Directive 10-93-142, this routine should not be modified.
4 QUIT ;invalid entry
5 ;
6 ;prca data ^1=station #, ^2=fcp code,
7 ; ^3=year (yyyy) or (yy optional for fiscal year only),
8 ; ^4=F if fiscal year, else bbfy year
9QTRDT(PRCA) ;ef - ^1=first qtr date, ^2=last qtr date, ^3=oldest open qtr date for this bbfy & ebfy
10 ; ^4=true if revolving fund, ^5=todays qtr date
11 N PRCRI,PRCB,PRCC
12 N A,B,C,D,E,X,Y
13 S (A,B,C,D,E)=""
14 I $P(PRCA,"^",4)="F" S $P(PRCA,"^",3)=$$BBFY^PRCSUT($P(PRCA,"^",1),$P(PRCA,"^",3),$P(PRCA,"^",2),1)
15 S PRCB=$$ACC^PRC0C(+PRCA,$P(PRCA,"^",2)_"^"_$E($P(PRCA,"^",3),1,2)_"^"_$P(PRCA,"^",3))
16 I $P(PRCB,"^",5)]"" S D=$O(^PRCD(420.3,"B",$P(PRCB,"^",5),"")) I D S D=$P($G(^PRCD(420.3,D,0)),"^",8)="Y" S:D $P(PRCB,"^",7)=2099
17 I $P(PRCB,"^",6) S A=$P($$QTRDATE^PRC0D($P(PRCB,"^",6),1),"^",7),B=$P($$QTRDATE^PRC0D($P(PRCB,"^",7),4),"^",7)
18 S C=$P($G(^PRC(420,+PRCA,0)),"^",9)
19 S C=$S(C<A:A,B<C:B,1:C)
20 S E=$$DATE^PRC0C(+$H,"H"),E=$P($$QTRDATE^PRC0D(+E,$P(E,"^",2)),"^",7)
21 QUIT A_"^"_B_"^"_C_"^"_D_"^"_E
22 ;
23 ;prca data ^1=ri of file 410, ^2=quarter beginning date (FM DATE)
24E410(PRCA) ;edit running balance quarter date field 449
25 N X
26 D EDIT^PRC0B(.X,"410;^PRCS(410,;"_$P(PRCA,"^"),"449////"_$P(PRCA,"^",2),"LS")
27 QUIT
28 ;
29 ;prca data ^1=ri of file 410, ^2=status code E, A, O, or C.
30ERS410(PRCA) ;edit running balance status field 450, and rb quarter date field 449 if nil
31 N A,B,C,D,X,Y
32 S A=$G(^PRCS(410,+PRCA,0)) QUIT:A=""
33 S B=""
34 I $P(A,"^",11)="" D
35 . S B=$G(^PRCS(410,+PRCA,3)),B=$P(B,"^",11)
36 . S B=$S(B="":$P(A,"-",2)_"^F",1:+$$DATE^PRC0C(B,"I"))
37 . S C=$$QTRDT($P(A,"-",1)_"^"_$P(A,"-",4)_"^"_B)
38 . S D=$$QTRDATE^PRC0D($P(A,"-",2),$P(A,"-",3)),D=$P(D,"^",7)
39 . S B=$S(D<$P(C,"^",3):$P(C,"^",3),$P(C,"^",2)<D:$P(C,"^",2),1:D)
40 . S B="449////"_B_";"
41 . QUIT
42 I $P(PRCA,"^",2)]"" S B=B_"450////"_$P(PRCA,"^",2)
43 I B]"" D EDIT^PRC0B(.X,"410;^PRCS(410,;"_$P(PRCA,"^"),B,"LS")
44 QUIT
45 ;
46 ;prca data ^1=station #, ^2=running balance quarter date (fileman date)
47 ;prcb = obligation, p.o. or amendment date (fileman date)
48OBDT(PRCA,PRCB) ;ef value = true if rb qtr date and obl/p.o./amend are compatible
49 N A,B,C
50 S A=$$DATE^PRC0C(PRCB,"I"),A=$P($$QTRDATE^PRC0D(+A,$P(A,"^",2)),"^",7)
51 S B=$P($G(^PRC(420,+PRCA,0)),"^",9)
52 S C=$S($P(PRCA,"^",2)'>B:B,1:$P(PRCA,"^",2))
53 QUIT A=C
54 ;
55 ;A data ^1=station #, ^2=fiscal year, ^3=quarter year, ^4=fcp code
56 ; ^5=BBFY
57RBDT(A) ;ef=runing balance (quarter) date
58 N B,C,D
59 S C=$$QTRDT($P(A,"^",1)_"^"_$P(A,"^",4)_"^"_$S($P(A,"^",5):$P(A,"^",5),1:$P(A,"^",2)_"^F"))
60 S D=$$QTRDATE^PRC0D($P(A,"^",2),$P(A,"^",3)),D=$P(D,"^",7)
61 S B=$S(D<$P(C,"^",3):$P(C,"^",3),$P(C,"^",2)<D:$P(C,"^",2),1:D)
62 QUIT B
Note: See TracBrowser for help on using the repository browser.