VistA-FOIAVistA/r/VOLUNTARY_TIMEKEEPING-ABSV/ABSVTPR2.m

36 lines
1.9 KiB
Mathematica

ABSVTPR2 ;VAMC ALTOONA/CTB - PRINT OCC HRS - SELECTED ORGS ;5/22/97 11:16 AM
V ;;4.0;VOLUNTARY TIMEKEEPING;**7**;JULY 6, 1994
OUT K %DT,%,%X,B,ABSVX("CREATE"),ABSVX("BDATE"),ABSVX("EDATE"),BDATE,COMB,DA,DA1,DDH,DIC,DIE,DIJ,DIK,DP,DQ,DR,DUOUT,EDATE,MONTH,NN,NAME,ORG,SER,VOL,TC,TC1,TC2,TC3,VOLDA,X,X1,XZ,Y,ZI
Q
SELORG ;PRINT SELECTED ORGANIZATIONS
D ^ABSVSITE Q:'%
S X="Using this option you may select up to 10 organization to print out per session.*" D MSG^ABSVQ W !
S XZ=1,DIC=503334,DIC(0)="AEMNQZ",DIC("A")="Select Organization #1: "
F ZI=1:1 Q:XZ>10 D ^DIC Q:+Y<0 W:'$D(^ABS(503336,"D",+Y)) !,"THERE ARE NO ENTRIES IN THE TIME CARD FILE FOR THIS ORGANIZATION",*7 I $D(^(+Y)) S ABSVX("LIST",+Y)=$P(Y(0),"^",2),XZ=XZ+1,DIC("A")="Select Organization #"_XZ_": "
K DIC I $D(ABSVX("LIST"))'>9 S X="No Organizations Selected.*" D MSG^ABSVQ G OUT
S BPROMPT="Select Beginning Month/Year: ",EPROMPT="Select Ending Month: ",MONTH=""
W ! D RANGE^ABSVTPR1 K MONTH
G:Y<0 OUT
S ABSVX("EDATE")=EDATE,ABSVX("BDATE")=$E(BDATE,1,5)_"00"
S ZTRTN="SO1^ABSVTPR2",ZTDESC="VOLUNTARY SELECTED ORGANIZATION LISTING - OCCASIONAL HOURS",ZTSAVE("ABSV*")="",ZTSAVE("EDATE")="",ZTSAVE("BDATE")="" D ^ABSVQ D OUT Q
SO1 ;DQ SELECTED ORG LISTING
K ^TMP("ABSVSELORG",$J)
I '$D(ZTQUEUED) D WAIT^ABSVYN
S DA=0
F S DA=$O(ABSVX("LIST",DA)) Q:'DA D
. S N=0
. F S N=$O(^ABS(503336,"D",DA,N)) Q:'N D
. . S X=^ABS(503336,N,0)
. . I $P(X,"^",3)=ABSV("SITE"),$P(X,"^",8)'<BDATE,$P(X,"^",8)'>EDATE S ^TMP("ABSVSELORG",$J,N)=""
. . Q
. Q
K ABSVX("LIST") I '$D(^TMP("ABSVSELORG",$J)) S X="No Time Cards Found.*" D:'$D(ZTQUEUED) MSG^ABSVQ D:$D(ZTQUEUED) KILL^%ZTLOAD G OUT
S IOP=ABIOP
S L=0,DIC="^ABS(503336,"
S FR=",",TO=","
S BY="#@+3.5;S2",FLDS="[ABSV OCC HRS ORG SUMMARY]",BY(0)="^TMP(""ABSVSELORG"","_$J_",",L(0)=1
D EN1^DIP,DIKILL^ABSVQ
;K ^TMP("ABSVSELORG",$J)
I $D(ZTQUEUED) D KILL^%ZTLOAD Q
QUIT