source: WorldVistAEHR/trunk/r/PAID-PRS/PRS8UP.m@ 623

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

initial load of WorldVistAEHR

File size: 5.3 KB
Line 
1PRS8UP ;HISC/MRL,JAH/WIRMFO-DECOMPOSITION, UPDATE TOTALS ;12/15/97
2 ;;4.0;PAID;**6,21,30,45**;Sep 21, 1995
3 ;
4 ;This routine is used to collect information related to
5 ;weekly activity which is unrelated to actual time, including
6 ;VCS Sales, Environmental Differential, Hazard Pay,
7 ;Lump Sum Data, etc.
8 ;
9 ;Called by Routines: PRS8ST
10 ;
11 ; -- VCS Sales (VC, VS)/Fee Basis (FE)
12 ;
13 ; If there is data (X) on the VCS sales node. (Both VCS sales and
14 ; Fee Basis data is stored on this node). Then we need to check to
15 ; see if the employee's pay plan is F=Fee Basis or U=VCS Sales.
16 ;
17 ;
18 ; If we're dealing w/ previous pay period where an employee
19 ; has changed pay plans, we need to check their pay plan for the
20 ; pay period we are dealing with.
21 N PAYPDTMP,PPLOLD
22 S PAYPDTMP=$G(^PRST(458,+PY,0)) ;pay period we're working with.
23 S PPLOLD=$$OLDPP^PRS8UT(PAYPDTMP,+DFN) ;pay plan from PAYPDTMP.
24 S PPL=$P($G(^PRSPC(+DFN,0)),"^",21) ;pay plan in master record.
25 ;
26 ;if we find an old pay plan and it's different than the master record
27 ;use the old pay plan to determine VCS or FEE.
28 I PPLOLD'=0,(PPL'=PPLOLD) S PPL=PPLOLD
29 ;
30 S X=$G(^PRST(458,+PY,"E",+DFN,2)),(T,T(1),T(2))=0
31 I PPL'="F",X'="" F I=1:1:14 S V=+$P(X,"^",I),W=$S(I<8:1,1:2),T(W)=T(W)+V
32 I PPL'="F" F I=1,2 I $D(T(I)) D
33 .S X1=$P(T(I),".",2)
34 .S X1=X1_$E("00",0,2-$L(X1)) ;2 numbers for cents (X1)
35 .S X=+$P(T(I),".",1)
36 .S X=X_X1 I '+X Q ;no value/don't report
37 .S $P(WK(I),"^",37)=X
38 S X=$G(^PRST(458,+PY,"E",+DFN,2))
39 I PPL="F",X'="" F I=1:1:14 S V=+$P(X,"^",I),T=T+V
40 I PPL="F",$D(T) D
41 .S X1=$P(T,".",2)
42 .S X1=X1_$E("00",0,2-$L(X1))
43 .S X=+$P(T,".",1)
44 .S X=X_X1 I '+X Q ;if no value, don't save
45 .S $P(WK(3),"^",17)=X
46 K I,PPL,T,V,W,X,X1
47 ;
48 ; -- Environmental Differential (EA, EC)
49 ; -- Hazardous Duty Pay (EB, ED)
50 ;
51 S X=$G(^PRST(458,+PY,"E",+DFN,4))
52 F I=1,3,5,7,9,11 S Y=+$P(X,"^",I) D
53 .I I=1!(I=7) S T=0,W=1+(I=7)
54 .S Y=$G(^PRST(457.6,+Y,0)) Q:Y=""
55 .S Y=+$P(Y,"^",3) Q:'Y
56 .S Y=$E("00",0,2-$L(Y))_Y ;percentage
57 .S Y(1)=+$P(X,"^",I+1) Q:'Y(1)
58 .S Y(1)=$E("000",0,3-$L(Y(1)))_Y(1) ;hours
59 .S T=T+1
60 .I T<3 S $P(WK(W),"^",36+(T*2))=Y,$P(WK(W),"^",37+(T*2))=Y(1)
61 .K Y
62 K I,T,W,X,Y
63 ;
64 ; -- Lump Sum Data (LY, LH, LD, DT)
65 ;
66 S (X,Y)=$G(^PRST(458,+PY,"E",+DFN,3)),(C,T(1),T(2),T(3))=""
67 I X'="" F I=2,3,4 S T(I-1)=+$P(X,"^",I) I +T(I-1) S C=1
68 I C F I=1,2,3 I +T(I) D
69 .S X1="."_$P(T(I),".",2)\.25 ;turn % into quarter hours
70 .S X=+$P(T(I),".",1)
71 .S X=X_+X1 I '+X Q
72 .S $P(WK(3),"^",4+I)=X
73 S X=$P(Y,"^",5)
74 I X?7N S X=$E(X,4,7)_$E(X,2,3),$P(WK(3),"^",8)=X
75 K I,C,T,X ;clean up/save new T&L as Y (if there)
76 ;
77 ; -- T&L Change (TL)
78 ;
79 S X=$P(Y,"^") I $L(X)=3 S $P(WK(3),"^",4)=X
80 K X
81 ;
82 ; -- Optional Withholding Tax (TO)
83 ;
84 I $P(Y,"^",7)="Y" S $P(WK(3),"^",9)=1
85 ;
86 ; -- Foreigh Cola (LA)
87 ;
88 I $P(Y,"^",8)="Y" S $P(WK(3),"^",10)=2
89 ;
90 ; -- Payment Records (RR)
91 ;
92 I $P(Y,"^",6)="Y" S $P(WK(3),"^",15)=1
93 ;
94 ; -- Days Worked (DW)
95 ;
96 I DWK,TYP["I" S $P(WK(3),"^",2)=+DWK
97 ;
98 ; -- Calendar Year Adjustment (CA)
99 ;
100 ; I $D(WPCY) S X=WPCYA S X=(X\4)_"0",$P(WK(3),"^",12)=X K WPCY,WPCYA
101 I $D(WPCY) D
102 . S X=WPCYA S:$E(ENT,1,2)["H" X=(X\4) I +X S X=X_"0",$P(WK(3),"^",12)=X
103 . K WPCY,WPCYA
104 E S X=+CAMISC I TYP["I",+X S X=X_"0",$P(WK(3),"^",12)=X
105 ;
106 ; -- Days Worked [SF 2806] (CY)
107 ;
108 I CYA2806'=0 S X=+CYA2806 I (TYP["I"!(TYP["P")),TYP'["B",+X S:"56U"'[$P(C0,"^",21) X=(X\4)_(X#4),$P(WK(3),"^",14)=X
109 E S X=+CAMISC I TYP["I",+X S:"56U"'[$P(C0,"^",21) X=X_"0",$P(WK(3),"^",14)=X
110 ;
111 ; -- Fire Fighter Normal Hours (FF)
112 ; Sum PT from week 1 with PH from week 2 and copy into FF
113 ;
114 S $P(WK(3),"^",16)=""
115 I "Ff"[TYP,(("RC"[PMP)!(NH=448)!(NH>320&(NH(1)'=NH(2)))) D
116 . F I=1,2 D
117 .. S X=+$P(WK(I),"^",32)
118 .. I +X S $P(WK(3),"^",16)=$P(WK(3),"^",16)+X
119 ;
120 S X=$P(WK(3),"^",16)
121 I X S $P(WK(3),"^",16)=(X\4)_(X#4) ;quarter hours
122 K I,X,Y
123 ;
124 ; -- reduce OC by OT where applicable
125 F I=1,2 I $P(WK(I),"^",35),+$G(CBCK(I)) D
126 .S $P(WK(I),"^",35)=$P(WK(I),"^",35)-CBCK(I)
127 ;
128 ; -- Military Leave (ML)
129 ;I $G(MILV) S P=11 D DAYS
130 ;
131 ; -- Work Comp [Count COP days] (PC)
132 I $G(WCMP) S P=13 D DAYS
133 ;
134END ; --- all done here
135 Q
136 ;
137DAYS ; --- count total number of days for ML and PC
138 K NODE S NODE=$P("ML^^CP","^",P-10),(NODE(1),NODE(2))=""
139 F D=1:1:14 D
140 .S NODE(1)=NODE(1)_+$G(^TMP($J,"PRS8",D,NODE))
141 .S NODE(2)=NODE(2)_+$G(^TMP($J,"PRS8",D,"OFF"))
142 .I $E(NODE(1),D) D SET ;save day in WK(3)
143 S NODE(1)=$E("0*",1+$G(^TMP($J,"PRS8",0,NODE)))_NODE(1)_$E("0*",1+$G(^TMP($J,"PRS8",15,NODE))) ; assume ML/CP has been counted for past/future ppd
144 S NODE(2)=+$G(^TMP($J,"PRS8",0,"OFF"))_NODE(2)_+$G(^TMP($J,"PRS8",15,"OFF")) ; set off days for past/future ppd
145 S F=1 ;F=Forward check needed
146 F I=2:1:15 S X=$E(NODE(1),I),X1=$E(NODE(2),I) D
147 .I 'X1 S F=$S(X="*":I,1:-1) ;go forward into next week
148 .S (C,Q)=0 I X1,X'="*",$E(NODE(1),I-1)="*" F J=F+1:1:15 Q:Q D ; X'="*"" ==> X=1 for NODE="ML" if there is a problem with the counting of ML when the orders specify days off are not to be counted.
149 ..S X=$E(NODE(1),J),X1=$E(NODE(2),J)
150 ..I 'X1,X=0 S Q=1 Q ;worked
151 ..I X="*" S Q=1,C=J-2 Q ;military leave
152 ..I J=15,$E(NODE(1),J+1)="*" S Q=1,C=14 Q ; if last day in ppd, and there is ML/CP on the first day of next ppd, then count this ML/CP
153 .I C F J=I-1:1:C S D=J D SET ;save off days in pp
154 Q
155 ;
156SET ; --- set WK(3) Node for ML
157 S $P(WK(3),"^",+P)=$P(WK(3),"^",+P)+1
158 S NODE(1)=$E(NODE(1),0,D-1)_"*"_$E(NODE(1),D+1,99)
159 Q
Note: See TracBrowser for help on using the repository browser.