Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ACRFTR1

ACRFTR1.m

Go to the documentation of this file.
ACRFTR1 ;IHS/OIRM/DSD/THL,AEF - TRAINING REPORTS;  [ 11/22/2006   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19,22**;NOV 05, 2001
 ;;UTILITY TO SELECT AND PRINT VARIOUS TRAINING SUMMARY REPORTS
 W @IOF
H1 I $D(ACRSMRY) D
 .W !?3,"REPORT TYPE: "
 .N X
 .S X=ACRTYPE
 .W $S(X=1:"PURPOSE OF TRAINING",X=2:"TYPE OF TRAINING",X=3:"SOURCE OF TRAINING",X=4:"SPECIAL INTEREST CODE",X=5:"SKILL CODE",X=6:"PROFESIONAL CATEGORY",X=7:"ALL TRAINING",1:"UNSPECIFIED")
 W !!,"SUMMARY FOR...: ",ACRFOR
 S ACRDC=$S($D(ACRDC):ACRDC+1,1:1)
 W ?60,"PAGE: ",ACRDC
 W !,"REPORT DATE...: "
 S Y=DT
 X ^DD("DD")
 W Y
 W !,"BEGINNING DATE: "
 S Y=ACRBEGIN
 X ^DD("DD")
 W Y
 W !,"ENDING DATE...: "
 S Y=ACREND
 X ^DD("DD")
 W Y
 W !,"--------------------------------------------------------------------------------"
 W !,"AUTHORIZA-"
 W ?11,"EMPLOYEE"
 W !,"TION NO."
 W ?11,"COURSE TITLE"
 W ?28,"SERIES/GRD"
 W ?41,"TUITION"
 W ?49,"BOOKS"
 W ?57,"TRAVEL"
 W ?65,"M & IE"
 W ?73,"OTHER"
 W !,"---------- ----------------------------- ------- ------- ------- ------- -------"
 Q
PL ;PRINT LINE SUMMARY OF EACH DOCUMENT
 W !,$E(ACRTGNO,1,10)
 W ?11,ACRTRNEE
 W ?32,ACRGRD
 W !?11,ACRTITLE
 W ?40,$J($P(ACR4,"."),8)
 W ?48,$J($P(ACR5,"."),8)
 W ?56,$J($P(ACR1,"."),8)
 W ?64,$J($P(ACR2,"."),8)
 W ?72,$J($P(ACR3,"."),8)
 W !?11,"HOURS: ",$J(ACRDUTHR,4),$J(ACRNDHR,5)
 W:+ACRDATES ?$X+1,ACRDATES
 W ?48,$J($P(ACR4+ACR5,"."),8)
 W ?72,$J($P(ACR1+ACR2+ACR3,"."),8)
 W $$DASH^ACRFMENU
 Q
START ;EP;TO PRINT TRAINING SUMMARY
 I ACRTYPE=8 D ALL Q
S1 K ^TMP("ACRTRNG",$J)
 D H
 S ACRDOCDA=0
 ;F  S ACRDOCDA=$O(^ACRDOC(ACRXREF,ACRDFN,ACRDOCDA)) Q:'ACRDOCDA!$D(ACRQUIT)!$D(ACROUT)  I $E($G(^ACROBL(ACRDOCDA,"APV")))'="D",$P(^ACRDOC(ACRDOCDA,0),U,13)=53 S ACRDOC0=^(0) D  ;ACR*2.1*22.05 IM22816
 F  S ACRDOCDA=$O(^ACRDOC(ACRXREF,ACRDFN,ACRDOCDA)) Q:'ACRDOCDA!$D(ACRQUIT)!$D(ACROUT)  D   ;ACR*2.1*22.05 IM22816
 .Q:$E($G(^ACROBL(ACRDOCDA,"APV")))'="A"          ;ACR*2.1*22.05 IM22816
 .Q:$P(^ACRDOC(ACRDOCDA,0),U,13)'=53              ;ACR*2.1*22.05 IM22816
 .S ACRDOC0=^ACRDOC(ACRDOCDA,0)                   ;ACR*2.1*22.05 IM22816
 .I $G(ACRPOZ),$P(ACRDOC0,U,8)'=ACRPOZ  Q
 .I $G(ACRLOC),$P($G(^ACRLOCB(+$P(ACRDOC0,U,6),"DT")),U,11)'=ACRLOC Q
 .I $G(ACRAREA),$P($G(^ACRPO(+$P(ACRDOC0,U,8),0)),U,19)'=ACRAREA Q
 .I $G(ACRCAN),$P($G(^ACRDOC(ACRDOCDA,"REQ")),U,10)'=ACRCAN Q
 .S ACRTRNG=$G(^ACRDOC(ACRDOCDA,"TRNG"))
 .S ACRTRNG3=$G(^ACRDOC(ACRDOCDA,"TRNG3"))
 .S ACRTRNG4=$G(^ACRDOC(ACRDOCDA,"TRNG4"))
 . I $G(ACRSG)]"" D  Q:ACRSG'=ACRSGX
 . . S ACRSGX=$P(ACRTRNG3,U,11,12)
 . . Q:$P(ACRSGX,U)'=""&($P(ACRSGX,U,2)'="")
 . . Q:$P(ACRTRNG,U,2)=""
 . . S ACRSGX=$P($G(^ACRAU($P(ACRTRNG,U,2),1)),U,8)_U_$P($G(^ACRAU($P(ACRTRNG,U,2),1)),U,4)
 . K ACRSGX
 . I $G(ACRTT),$P(ACRTRNG3,U,7)'=ACRTT Q
 .I ACRBEGIN,ACRBEGIN>$P(ACRTRNG,U,11)!(ACREND<$P(ACRTRNG,U,12)) Q
 .I $D(ACRNVAL),$P($G(^ACROBL(ACRDOCDA,"APV")),U)="A",$D(^ACRTVAL("B",ACRDOCDA)) Q
 .D TYPET
 .S ^TMP("ACRTRNG",$J,ACRTYPET,$P(^ACRDOC(ACRDOCDA,0),U))=ACRDOCDA
 Q:'$D(^TMP("ACRTRNG",$J))
DTL S (ACRTOTD,ACRTOTND,ACRT4,ACRT5,ACRT6,ACRT1,ACRT2,ACRT3)=0
 S ACRTYPET=""
 F  S ACRTYPET=$O(^TMP("ACRTRNG",$J,ACRTYPET)) Q:ACRTYPET=""!$D(ACRQUIT)  D
 .S ACRDOC=""
 .F  S ACRDOC=$O(^TMP("ACRTRNG",$J,ACRTYPET,ACRDOC)) Q:ACRDOC=""!$D(ACRQUIT)  D
 ..S ACRDOCDA=+$G(^TMP("ACRTRNG",$J,ACRTYPET,ACRDOC))
 ..Q:'ACRDOCDA
 ..S ACRTRNG=$G(^ACRDOC(ACRDOCDA,"TRNG"))
 ..S ACRTRNG3=$G(^ACRDOC(ACRDOCDA,"TRNG3"))
 ..S ACRTRNG4=$G(^ACRDOC(ACRDOCDA,"TRNG4"))
 ..D DOCS
 I $D(ACRSMRY) D  I $D(ACRDTAIL) D PAUSE^ACRFWARN,H G DTL
 .S ACRTYPET=""
 .F  S ACRTYPET=$O(^TMP("ACRTRNG",$J,ACRTYPET)) Q:ACRTYPET=""!$D(ACRQUIT)  D STAIL
 .D TAIL
 .K ACRSMRY
 D TAIL
 D EXIT^ACRFTR:'$D(ACRXT)
 D PAUSE^ACRFWARN
 W:$E($G(IOST),1,2)="P-" @IOF
 Q
H I $E(IOST,1,2)="C-" D HEAD I 1
 E  D H1
 Q
GATHER ;GATHER DATA ON EACH TRAVEL DOCUMENT
 D EN2^ACRFCLM
 N I
 F I=1:1:6 S @("ACR"_I)=$TR(@("ACR"_I)," ","")
 D TYPET
 S ACRDUZ=$P(ACRTRNG,U,2)
 S ACRDUTHR=$P(ACRTRNG,U,9)
 S ACRNDHR=$P(ACRTRNG,U,10)
 S ACRTOTD=ACRTOTD+ACRDUTHR
 S ACRTOTD(ACRTYPET)=$G(ACRTOTD(ACRTYPET))+ACRDUTHR
 S ACRTOTND=ACRTOTND+ACRNDHR
 S ACRTOTND(ACRTYPET)=$G(ACRTOTND(ACRTYPET))+ACRNDHR
 S ACRT1=ACRT1+ACR1
 S ACRT2=ACRT2+ACR2
 S ACRT3=ACRT3+ACR3
 S ACRT4=ACRT4+ACR4
 S ACRT5=ACRT5+ACR5
 S ACRT6=ACRT6+ACR6
 S ACRT1(ACRTYPET)=$G(ACRT1(ACRTYPET))+ACR1
 S ACRT2(ACRTYPET)=$G(ACRT2(ACRTYPET))+ACR2
 S ACRT3(ACRTYPET)=$G(ACRT3(ACRTYPET))+ACR3
 S ACRT4(ACRTYPET)=$G(ACRT4(ACRTYPET))+ACR4
 S ACRT5(ACRTYPET)=$G(ACRT5(ACRTYPET))+ACR5
 S ACRT6(ACRTYPET)=$G(ACRT6(ACRTYPET))+ACR6
 Q:$D(ACRSMRY)
 S ACRFROM=$P(ACRTRNG,U,11)
 S ACRTO=$P(ACRTRNG,U,12)
 S ACRTITLE=$E($P(ACRTRNG,U,18),1,29)
 S ACRTGNO=$P(^ACRDOC(ACRDOCDA,0),U)
 ;S ACRTRNEE=$E($P($G(^VA(200,+ACRDUZ,0)),U),1,20)  ;ACR*2.1*19.02 IM16848
 S ACRTRNEE=$E($$NAME2^ACRFUTL1(+ACRDUZ),1,20)  ;ACR*2.1*19.02 IM16848
 S ACRGRD=$G(^ACRAU(+ACRDUZ,1))
 S ACRGRD=$P(ACRGRD,U,3)_$P(ACRGRD,U,8)_"-"_$P(ACRGRD,U,4)
 S ACRDATES=$E(ACRFROM,4,5)_"/"_$E(ACRFROM,6,7)_"-"_$E(ACRTO,4,5)_"/"_$E(ACRTO,6,7)_"/"_$E(ACRTO,2,3)
 Q
DOCS ;GATHER AND PRINT INFO ON EACH TRAINING DOCUMENT
 D GATHER
 Q:$D(ACRSMRY)
 D PL
 D GROUP:$D(^ACRTPAR("B",ACRDOCDA))
 I $Y+5>IOSL D
 .D PAUSE^ACRFWARN
 .D HEAD
 Q
TAIL ;
 W !?18,"---- ----"
 W ?41,"------- ------- ------- ------- -------"
 W !?5,"TOTAL HOURS: ",$J(ACRTOTD,4),$J(ACRTOTND,5)
 W ?32,"DOLLARS:"
 W ?40,$J($P(ACRT4,"."),8)
 W ?48,$J($P(ACRT5,"."),8)
 W ?56,$J($P(ACRT1,"."),8)
 W ?64,$J($P(ACRT2,"."),8)
 W ?72,$J($P(ACRT3,"."),8)
 W !?30,"SUB-TOTAL:"
 W ?48,$J($P(ACRT4+ACRT5,"."),8)
 W ?72,$J($P(ACRT1+ACRT2+ACRT3,"."),8)
 W !?28,"TOTAL COSTS:"
 W ?72,$J($P(ACRT1+ACRT2+ACRT3+ACRT4+ACRT5,"."),8)
 Q
STAIL ;
 W !?5,$$TYPE(ACRTYPET,ACRTYPE("G"))
 W !?11,"HOURS: ",$J(+$G(ACRTOTD(ACRTYPET)),4),$J(+$G(ACRTOTND(ACRTYPET)),5)
 W ?32,"DOLLARS:"
 W ?40,$J($P($G(ACRT4(ACRTYPET)),"."),8)
 W ?48,$J($P($G(ACRT5(ACRTYPET)),"."),8)
 W ?56,$J($P($G(ACRT1(ACRTYPET)),"."),8)
 W ?64,$J($P($G(ACRT2(ACRTYPET)),"."),8)
 W ?72,$J($P($G(ACRT3(ACRTYPET)),"."),8)
 W !?21,"CATEGORY SUB-TOTAL:"
 W ?48,$J($P($G(ACRT4(ACRTYPET))+$G(ACRT5(ACRTYPET)),"."),8)
 W ?72,$J($P($G(ACRT1(ACRTYPET)),".")+$P($G(ACRT2(ACRTYPET)),".")+$P($G(ACRT3(ACRTYPET)),"."),8)
 W !?19,"CATEGORY TOTAL COSTS:"
 W ?72,$J($P($G(ACRT4(ACRTYPET))+$G(ACRT5(ACRTYPET))+$G(ACRT1(ACRTYPET))+$G(ACRT2(ACRTYPET))+$G(ACRT3(ACRTYPET)),"."),8)
 I $Y+5>IOSL D
 .D PAUSE^ACRFWARN
 .D HEAD
 Q
GROUP ;INCLUDE GROUP TRAINING PARTICIPANTS IN TRAINING REPORT
 Q
TYPE(X,Y) ;DETERMINE NAME TO PRINT
 I X=999 S X=$S(ACRTYPE=7:"ALL",1:"OTHER")_" TRAINING" Q X
 S X=$G(@(Y_X_",0)"))
 S X=$P(X,U,2)
 Q X
ALL ;PRINT ALL SUMMARY REPORTS
 N ACRXT
 F ACRXT=1:1:7 D:'$D(ACRQUIT)&'$D(ACROUT)
 .S ACRSMRY=""
 .S ACRTYPE=ACRXT
 .Q:ACRTYPE=7
 .S ACRTYPE("G")=$$TTYPE^ACRFTR(ACRTYPE)
 .D S1
 Q
TYPET S ACRTYPET=$S(ACRTYPE=7:999,ACRTYPE=6:$P(ACRTRNG4,U,14),ACRTYPE=5:$P(ACRTRNG,U,22),ACRTYPE=6:$P(ACRTRNG4,U,14),1:$P(ACRTRNG3,U,$S(ACRTYPE=1:6,ACRTYPE=2:7,ACRTYPE=3:8,ACRTYPE=4:9,1:999)))
 S:ACRTYPET="" ACRTYPET=999
 Q