1 | ABSVOTSD ;VAMC ALTOONA/CTB_CLH - DELETE OCCASIONAL TIME SHEET ENTRIES ;6/6/94 3:27 PM
|
---|
2 | V ;;4.0;VOLUNTARY TIMEKEEPING;;JULY 6, 1994
|
---|
3 | D ^ABSVSITE Q:'%
|
---|
4 | D NOW^ABSVQ S XDATE=X I +$E(X,4,5)=1 S XDATE=$E(X,1,3)-1_1200
|
---|
5 | E S MO=0_($E(X,4,5)-1),MO=$E(MO,$L(MO)-1,$L(MO)) S XDATE=$E(X,1,3)_MO_"00"
|
---|
6 | S ABSVXA="This option will delete ALL entries in the Occasional Time Sheet File for the",ABSVXA(1)="month specified. Do you wish to continue",ABSVXB="",%=1 D ^ABSVYN I %'=1 S X=" NO ACTION TAKEN" D MSG^ABSVQ G OUT
|
---|
7 | W ! S %DT("A")="Select Month/Year to be deleted: ",%DT="AE" D ^%DT I Y<0 S X=" No month selected" D MSG^ABSVQ G OUT
|
---|
8 | S Y=$E(Y,1,5)_"00" I Y'<XDATE W !,"You may not delete entries for: Last month, the current month or",!,"any future months using this option.",*7 G OUT
|
---|
9 | S MONTH=Y D D^ABSVQ S FULLMON=Y I '$D(^ABS(503336,"AD",MONTH)) S X=" No entries in file for "_FULLMON_".*" W ! D MSG^ABSVQ G OUT
|
---|
10 | S ABSVXA="Are you sure you want to delete all entries for "_Y_" for Station "_ABSV("SITE"),ABSVXB="",%=2 D ^ABSVYN I %'=1 S MSG=" Option terminated*" D MSG^ABSVQ G OUT
|
---|
11 | S ZTRTN="DQ^ABSVOTSD",ZTDESC="DELETE VOLUNTARY TIME SHEET ENTRIES FOR "_FULLMON,ZTSAVE("MONTH")="",ZTSAVE("FULLMON")="",ZTSAVE("ABSV*")="" D ^ABSVQ
|
---|
12 | OUT K %DT,COUNT,DA,FULLMON,MO,MONTH,POP,X,XDATE,Y,ABSVXX Q
|
---|
13 | ;
|
---|
14 | DQ ;ENTRY POINT FROM TASK MANAGER FOR DAILY RECORD DELETION
|
---|
15 | D NOW^ABSVQ W "Beginning Deletion on ",ABSVXX
|
---|
16 | S COUNT=0,DA=0 F I=1:1 S DA=$O(^ABS(503336,"AD",MONTH,DA)) Q:'DA Q:$P(^ABS(503336,DA,0),"^",9)<3 I $D(^(0)),$P(^(0),"^",16)=MONTH,$P(^(0),"^",3)=ABSV("SITE") D DEL S COUNT=COUNT+1 W "."
|
---|
17 | W !!,"FINISHED DELETION PASS FOR ",FULLMON,", FOR STATION ",ABSV("SITE"),". ",!,COUNT," ENTRIES DELETED." D NOW^ABSVQ W !,"Deletion completed on ",ABSVXX
|
---|
18 | I $D(ZTQUEUED) D KILL^%ZTLOAD
|
---|
19 | D OUT
|
---|
20 | QUIT
|
---|
21 | ;
|
---|
22 | DEL ;DELETE SINGLE ENTRY IN FILE 503336
|
---|
23 | K A,X S A=^ABS(503336,DA,0) I $D(ABSV("SITE"))'[0,$P(A,"^",3)'=ABSV("SITE") Q
|
---|
24 | S X=$P(A,"^",1) I X]"" K ^ABS(503336,"B",$E(X,1,30),DA)
|
---|
25 | S X=$P(A,"^",4) I X]"" K ^ABS(503336,"D",$E(X,1,30),DA)
|
---|
26 | S X=$P(A,"^",8) I X]"" K ^ABS(503336,"AC",$E(X,1,30),DA)
|
---|
27 | S X=$P(A,"^",9) I X]"" K ^ABS(503336,"AF",$E(X,1,30),DA)
|
---|
28 | S X=$P(A,"^",14) I X]"" K ^ABS(503336,"C",$E(X,1,30),DA)
|
---|
29 | S X=$P(A,"^",16) I X]"" K ^ABS(503336,"AD",$E(X,1,30),DA)
|
---|
30 | K A,X,^ABS(503336,DA,0),^(2)
|
---|
31 | L +^ABS(503336,0):15 Q:'$T
|
---|
32 | S $P(^(0),"^",4)=$P(^ABS(503336,0),"^",4)-1
|
---|
33 | L -^ABS(503336,0)
|
---|
34 | QUIT
|
---|