source: WorldVistAEHR/trunk/r/PAID-PRS/PRSAOTX.m@ 1147

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1PRSAOTX ; HISC/REL-OT/CT Approvals ;5/23/95 12:55
2 ;;4.0;PAID;**34,114**;Sep 21, 1995;Build 6
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 S (QT,NF)=0,PRSTLV=3 K ^TMP($J)
5 S TLE="" F S TLE=$O(^PRST(455.5,"B",TLE)) Q:TLE="" S TLH=0 F TLI=0:0 S TLI=$O(^PRST(455.5,"B",TLE,TLI)) Q:TLI<1 I $D(^PRST(455.5,TLI,"A",DUZ)) D TLC I QT G ES
6ES I '$D(^TMP($J)) W !!,$S('NF:"No Overtime or Comp/Credit actions to certify.",1:"No Overtime or Comp/Credit certification actions taken.") G EX
7 D ^PRSAES G:'ESOK EX D NOW^%DTC S NOW=%
8 F TLI=0:0 S TLI=$O(^TMP($J,TLI)) Q:TLI<1 S ACT=$G(^(TLI)) I ACT'="" F DA=0:0 S DA=$O(^TMP($J,TLI,DA)) Q:DA<1 S DFN=$G(^(DA)) D OT
9 G EX
10TLC ; Check T&L
11 S (ECST,NUM)=0 K R
12 S NN="" F S NN=$O(^PRSPC("ATL"_TLE,NN)) Q:NN="" F DFN=0:0 S DFN=$O(^PRSPC("ATL"_TLE,NN,DFN)) Q:DFN<1 I $D(^PRST(458.2,"AS",DFN)) D CHK I QT G T1
13 Q:'$D(^TMP($J,TLI)) I ECST W !!,"Estimated Cost of Overtime: $",$J(ECST,0,2)
14OK R !!,"Disposition (A=Approve, D=Disapprove, X=Dis. Line Item, RETURN to bypass): ",ACT:DTIME S:'$T!(ACT["^") QT=1 G:QT!(ACT="") T1 S ACT=$TR(ACT,"adx","ADX") I ACT'?1U!("ADX"'[ACT) W *7,!,"Enter A, D or X or Press RETURN to bypass" G OK
15 I ACT="X" D CAN S ACT="A"
16 S ^TMP($J,TLI)=ACT Q
17T1 K ^TMP($J,TLI) Q
18CHK ; Check for needed approvals
19 F DA=0:0 S DA=$O(^PRST(458.2,"AS",DFN,DA)) Q:DA<1 D LST Q:QT S ^TMP($J,TLI,DA)=DFN
20 Q
21OT ; Process action
22 S X=ESNAM,X1=DUZ,X2=DA D EN^XUSHSHP
23 S $P(^PRST(458.2,DA,0),"^",8)=$S($P(DFN,"^",2)="D":"D",1:ACT) K ^PRST(458.2,"AS",+DFN,DA)
24 S $P(^PRST(458.2,DA,0),"^",16,18)=DUZ_"^"_NOW_"^"_X Q
25LST ; Display Request
26 S Z=$G(^PRST(458.2,DA,0)) Q:Z="" D:'TLH HDR D:$Y>(IOSL-4) HDR Q:QT
27 S NUM=NUM+1,X=$P(Z,"^",3) D DTP^PRSAPPU S R(NUM)=DA
28 W !,$J(NUM,2)," ",Y," ",$P($G(^PRSPC(DFN,0)),"^",1),?42,$P(Z,"^",6)," Hrs. ",$S($P(Z,"^",5)="CT":"COMP TIME/CREDIT HRS",1:"OVERTIME")
29 I $P(Z,"^",5)="OT",$P(Z,"^",10) S ECST=ECST+$P(Z,"^",10)
30 S X=$P(Z,"^",9) I X'="" W " on T&L ",X
31 S Y=$P(Z,"^",7) W:Y'="" !?10,Y S NF=NF+1 Q
32HDR ; Display Header
33 I TLH R !!,"Press RETURN to Continue.",X:DTIME S:'$T!(X["^") QT=1 Q:QT
34 W:$E(IOST,1,2)="C-" @IOF W !?26,"VA TIME & ATTENDANCE SYSTEM",!?21,"OVERTIME & COMP TIME/CREDIT HRS APPROVAL"
35 S Z0=$G(^PRST(455.5,TLI,0)),Z1=$P(Z0,"^",5),Z1=$P($G(^DIC(49,+Z1,0)),"^",1) I $P(Z0,"^",6)'="" S Z1=Z1_", "_$P(Z0,"^",6)
36 S Z1=$P(Z0,"^",1)_" "_Z1 W !!?(80-$L(Z1)\2),Z1,! S TLH=1 Q
37CAN ; Process selective disapproval
38 R !,"Disapprove which Items: ",Y:DTIME I '$T!(Y["^") S K1=0 Q
39 F K=1:1 S K1=$P(Y,",",K) Q:K1="" S K2=$S(K1["-":$P(K1,"-",2),1:+K1),K1=+K1 D G:'K1 CAN F K3=K1:1:K2 S DA=$G(R(K3)) I DA S $P(^TMP($J,TLI,DA),"^",2)="D"
40 .I K1'<1,K1'>NUM,K1?1N.N Q
41 .I K2'<1,K2'>NUM,K2?1N.N Q
42 .W *7,!," Enter Numbers, or Range of Items (e.g., 1,3-5,7)"
43 .S K1=0 Q
44 Q
45EX F TLI=0:0 S TLI=$O(^TMP($J,TLI)) Q:TLI<1 S TLE=$P($G(^PRST(455.5,TLI,0)),"^",1) D APP^PRSASAL
46 G ^PRSAPPX
Note: See TracBrowser for help on using the repository browser.