source: FOIAVistA/tag/r/PAID-PRS/PRSDCOMP.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 4.2 KB
Line 
1PRSDCOMP ;HISC/FPT,GWB-COMPUTED FIELDS FOR 450 & 459 ;12/09/2002
2 ;;4.0;PAID;**78**;Sep 21, 1995
3EN1 ;calculate computed fields
4 S ZERO=$G(^PRST(459,PPIEN,"P",IEN,0))
5 S ONE=$G(^PRST(459,PPIEN,"P",IEN,1))
6 S TWO=$G(^PRST(459,PPIEN,"P",IEN,2))
7 S THREE=$G(^PRST(459,PPIEN,"P",IEN,3))
8 S FOUR=$G(^PRST(459,PPIEN,"P",IEN,4))
9 S FIVE=$G(^PRST(459,PPIEN,"P",IEN,5))
10 S SIX=$G(^PRST(459,PPIEN,"P",IEN,6))
11 S SUBACCT=$P(ZERO,U,9),PAYPLAN=$P(ZERO,U,3)
12 S MEDICARE=$P(ONE,U,6),VAFICA=$P(ONE,U,10),VALICOST=$P(ONE,U,15),VAHBCOST=$P(ONE,U,18),VARETIRE=$P(ONE,U,21)
13 S TSP=$P(TWO,U,13)+$P(TWO,U,14)+$P(TWO,U,15)+$P(TWO,U,16)+$P(TWO,U,17)+$P(TWO,U,18)
14 S SEVPAY=$P(THREE,U,2)
15 S ALUSED=$P(FOUR,U,1),SLUSED=$P(FOUR,U,2)
16 S GROSSPAY=$P(FIVE,U,1),ANNUITY=$P(FIVE,U,4),BASEPAY=$P(FIVE,U,5),HOLPAY=$P(FIVE,U,8),ONCALL=$P(FIVE,U,13),OTPAY=$P(FIVE,U,14),SATPAY=$P(FIVE,U,17),STANDPAY=$P(FIVE,U,18),SUNPAY=$P(FIVE,U,19)
17 S LIVING=$P(FIVE,U,22),AWARDS=$P(FIVE,U,24),SESAWARD=$P(FIVE,U,25),LUMPSUM=$P(FIVE,U,26),MOVING=$P(FIVE,U,28),UNIFORM=$P(FIVE,U,29)
18 S MDDDPAY=$P(SIX,U,3)
19 ;gross pay plus benefits
20 S COMPUTED=GROSSPAY+UNIFORM+MEDICARE+VALICOST+VAHBCOST+VAFICA+VARETIRE+TSP+ANNUITY D DECIMAL
21 S $P(^PRST(459,PPIEN,"P",IEN,8),U,1)=COMPUTED,$P(^PRSPC(IEN,"PAY"),U,10)=COMPUTED
22 ;annual leave used
23 S COMPUTED=$S(SUBACCT=81!(SUBACCT=71)!(PAYPLAN="Y"):ALUSED*8,1:ALUSED) D DECIMAL
24 S $P(^PRST(459,PPIEN,"P",IEN,4),U,7)=COMPUTED,$P(^PRSPC(IEN,"ANNUAL"),U,14)=COMPUTED
25 ;sick leave used
26 S COMPUTED=$S(SUBACCT=81!(SUBACCT=71)!(PAYPLAN="Y"):SLUSED*8,1:SLUSED) D DECIMAL
27 S $P(^PRST(459,PPIEN,"P",IEN,4),U,8)=COMPUTED,$P(^PRSPC(IEN,"SICK"),U,8)=COMPUTED
28 I $D(^PRSPC(IEN,"BOND1")),$P(^PRSPC(IEN,"BOND1"),U,11)="Y" K ^PRSPC(IEN,"BOND1")
29 I $D(^PRSPC(IEN,"BOND2")),$P(^PRSPC(IEN,"BOND2"),U,10)="Y" K ^PRSPC(IEN,"BOND2")
30 I $D(^PRSPC(IEN,"BOND3")),$P(^PRSPC(IEN,"BOND3"),U,10)="Y" K ^PRSPC(IEN,"BOND3")
31 I $D(^PRSPC(IEN,"BOND4")),$P(^PRSPC(IEN,"BOND4"),U,10)="Y" K ^PRSPC(IEN,"BOND4")
32KILL1 K ALUSED,ANNUITY,AWARDS,BASEPAY,COMPUTED,FOUR,FIVE,GROSSPAY,HOLPAY,LIVING,LUMPSUM,MDDDPAY,MEDICARE,MOVING,ONCALL,ONE,OTPAY
33 K PAYPLAN,SATPAY,SESAWARD,SEVPAY,SIX,SLUSED,STANDPAY,SUBACCT,SUNPAY,THREE,TSP,TWO,UNIFORM,VAFICA,VAHBCOST,VALICOST,VARETIRE,ZERO
34 Q
35DECIMAL ;check decimal digits
36 S:COMPUTED'["." COMPUTED=COMPUTED_"."
37 S:$L($P(COMPUTED,".",1))=0 COMPUTED="0"_COMPUTED
38 S:$L($P(COMPUTED,".",2))=0 COMPUTED=COMPUTED_"00"
39 S:$L($P(COMPUTED,".",2))=1 COMPUTED=COMPUTED_"0"
40 Q
41FTE ;FTE computation
42 S FTEE=DATA,DB=$P(^PRSPC(IEN,0),U,10),NH8B=$P(^PRSPC(IEN,0),U,16) D
43 .I DB=1,FTEE=0 S $P(^PRSPC(IEN,"MISC4"),U,11)=1 Q
44 .I DB=1,FTEE>0 S $P(^PRSPC(IEN,"MISC4"),U,11)="."_FTEE Q
45 .I DB=2,NH8B=1 S $P(^PRSPC(IEN,"MISC4"),U,11)=0 Q
46 .I DB=2 S FTEE=$FN(NH8B/80,"",2),$P(^PRSPC(IEN,"MISC4"),U,11)=+FTEE Q
47 .I DB=3,FTEE=0 S $P(^PRSPC(IEN,"MISC4"),U,11)=0 Q
48 .I DB=3,FTEE>0 S $P(^PRSPC(IEN,"MISC4"),U,11)="."_FTEE
49 S NODE=""
50 K DB,FTEE,NH8B Q
51BONDS ;Savings Bond Balance computation
52 I $D(^PRSPC(IEN,"BOND1")) S $P(^PRSPC(IEN,"BOND1"),U,9)="" I $P(RCD,":",8)="" D
53 .S SBBAL=$P(^PRSPC(IEN,"BOND1"),U,5)
54 .S SBEPP=$P(^PRSPC(IEN,"BOND1"),U,10)
55 .S SBDEM=$P(^PRSPC(IEN,"BOND1"),U,11)
56 .S SBDEM=$S(SBDEM=4:50,SBDEM=8:100,SBDEM="B":250,SBDEM="D":500,SBDEM="F":2500,1:0)
57 .I SBEPP+SBBAL=SBDEM S $P(^PRSPC(IEN,"BOND1"),U,5)=""
58 I $D(^PRSPC(IEN,"BOND2")) S $P(^PRSPC(IEN,"BOND2"),U,8)="" I $P(RCD,":",9)="" D
59 .S SBBAL=$P(^PRSPC(IEN,"BOND2"),U,4)
60 .S SBEPP=$P(^PRSPC(IEN,"BOND2"),U,9)
61 .S SBDEM=$P(^PRSPC(IEN,"BOND2"),U,10)
62 .S SBDEM=$S(SBDEM=4:50,SBDEM=8:100,SBDEM="B":250,SBDEM="D":500,SBDEM="F":2500,1:0)
63 .I SBEPP+SBBAL=SBDEM S $P(^PRSPC(IEN,"BOND2"),U,4)=""
64 I $D(^PRSPC(IEN,"BOND3")) S $P(^PRSPC(IEN,"BOND3"),U,8)="" I $P(RCD,":",9)="" D
65 .S SBBAL=$P(^PRSPC(IEN,"BOND3"),U,4)
66 .S SBEPP=$P(^PRSPC(IEN,"BOND3"),U,9)
67 .S SBDEM=$P(^PRSPC(IEN,"BOND3"),U,10)
68 .S SBDEM=$S(SBDEM=4:50,SBDEM=8:100,SBDEM="B":250,SBDEM="D":500,SBDEM="F":2500,1:0)
69 .I SBEPP+SBBAL=SBDEM S $P(^PRSPC(IEN,"BOND3"),U,4)=""
70 I $D(^PRSPC(IEN,"BOND4")) S $P(^PRSPC(IEN,"BOND4"),U,8)="" I $P(RCD,":",9)="" D
71 .S SBBAL=$P(^PRSPC(IEN,"BOND4"),U,4)
72 .S SBEPP=$P(^PRSPC(IEN,"BOND4"),U,9)
73 .S SBDEM=$P(^PRSPC(IEN,"BOND4"),U,10)
74 .S SBDEM=$S(SBDEM=4:50,SBDEM=8:100,SBDEM="B":250,SBDEM="D":500,SBDEM="F":2500,1:0)
75 .I SBEPP+SBBAL=SBDEM S $P(^PRSPC(IEN,"BOND4"),U,4)=""
76 K SBBAL,SBEPP,SBDEM Q
Note: See TracBrowser for help on using the repository browser.