source: WorldVistAEHR/trunk/r/PAID-PRS/PRSROSOR.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: 2.0 KB
Line 
1PRSROSOR ;HISC/JH-SORT FOR OT/CT & EXPENDITURE REPORTS ;11/18/98
2 ;;4.0;PAID;**2,26,46**;Sep 21, 1995
3OTCT ;Over Time & Comp Time Sort
4 S X=$E($P($G(^PRST(458,DA(3),"E",D0,5)),"^"),22,24) D:$P(TLE(1),"^")=X
5 . S TLUNIT=$P($G(^PRSPC(D0,0)),U,7),SSN=$P($G(^(0)),U,9) I SSN'="" S SSN=$E(SSN,1,3)_"-"_$E(SSN,4,5)_"-"_$E(SSN,6,9)
6 . S COMP=$P($G(^PRST(459,DA(1),"P",D0,4)),"^",3),COMPU=$P($G(^PRST(459,DA(1),"P",D0,4)),"^",4),OTH=$P($G(^PRST(459,DA(1),"P",D0,5)),"^",15)
7 . S SAL=$P($G(^PRST(459,DA(1),"P",D0,5)),"^"),OTP=$P($G(^(5)),"^",14),DA(4)=$P(DA(2),"-",2)
8 . Q:'(COMP!(OTH)) S ^TMP($J,"OT/CP",DA(2),DATE,$P(TLE(1),"^"),NAM,D0)=SSN_"^"_SAL_"^"_COMP_"^"_COMPU_"^"_OTH_"^"_OTP,CNT=CNT+1 W:'$D(ZTSK)&($E(IOST)'="P")&($R(30)) "."
9 . Q
10 Q
11EXP ;Expenditure Sort
12 S (TL,GOV,STOT,TOT)=0,U="^",TLE=$P(TLE(1),U)
13 S DA(3)=$O(^PRST(458,"B",DA(1),0)) Q:DA(3)'>0 D
14 . S D0=0 F S D0=$O(^PRST(458,DA(3),"E",D0)) Q:D0'>0 S X=$E($P($G(^PRST(458,DA(3),"E",D0,5)),U),22,24) D:TLE=X
15 ..;
16 ..; skip employee if there is no expenditure data for them
17 .. Q:'($G(^PRST(459,DA,"P",D0,5))!$G(^(8)))
18 ..;
19 .. S NAM=$P($G(^PRSPC(D0,0)),U),TOT(1)=$P($G(^PRST(459,DA,"P",D0,5)),U,5),TOT(2)=$P($G(^(5)),U,10),TOT(3)=$P($G(^(5)),U,8),TOT(4)=$P($G(^(5)),U,14)
20 .. S TOT(5)=$P($G(^PRST(459,DA,"P",D0,5)),U,19),TOT(6)=$P($G(^(5)),U,13),TOT(7)=$P($G(^(5)),U,24)+$P($G(^(5)),U,25)+$P($G(^(5)),U,31),TOT(8)=$P($G(^(5)),U,4),TOT(9)=$P($G(^(5)),U,17)
21 .. F I=1:1:9 S TOTAL(I)=TOTAL(I)+TOT(I),$P(STOT,U,I)=$P(STOT,U,I)+TOT(I)
22 .. S TOT=$P($G(^PRST(459,DA,"P",D0,5)),U)
23 .. S GOV(1)=$P($G(^PRST(459,DA,"P",D0,8)),U),GOV=GOV(1)-TOT
24 .. S TOTAL=TOTAL+TOT,TGOV=TGOV+GOV,$P(STOT,U,10)=$P(STOT,U,10)+TOT,$P(STOT,U,11)=$P(STOT,U,11)+GOV,$P(STOT,U,12)=$P(STOT,U,12)+(TOT+GOV)
25 .. S ^TMP($J,"EXP",+$P(DA(1),"-",2),TLE,NAM,D0)=TOT(1)_U_TOT(2)_U_TOT(3)_U_TOT(4)_U_TOT(5)_U_TOT(6)_U_TOT(7)_U_TOT(8)_U_TOT(9)_U_TOT_U_GOV_U_(TOT+GOV)
26 .. S CNT=CNT+1,(GOV,TOT)=0
27 .. I '(CNT#30),$E(IOST,1,2)="C-",'$D(ZTQUEUED) W "."
28 .. Q
29 . S ^TMP($J,"EXP1",+$P(DA(1),"-",2),TLE)=STOT,STOT=0
30 . Q
31 Q
Note: See TracBrowser for help on using the repository browser.