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

ACRFTV3.m

Go to the documentation of this file.
ACRFTV3 ;IHS/OIRM/DSD/THL,AEF - TRAVEL REPORT;  [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;ROUTINE TO PRINT TRAVEL REPORT
SS4 ;EP;
 S (ACR,ACR4,ACR9,ACR21)=0
 I ACRTVT'="D" S (ACRREQ,ACROBL,ACRSPT)=0
 F  S ACR=$O(^ACRSS(ACRTVT,ACRZDA,ACR)) Q:'ACR  D
 .Q:'$D(^ACRSS(ACR,0))!'$D(^ACRSS(ACR,"DT"))
 .S ACR0=^ACRSS(ACR,0)
 .S ACRDT=^ACRSS(ACR,"DT")
 .D SS5
 Q:ACRTVT="D"!(ACRTVT="TDEPT")!(ACRTVT="PO")!(ACRTVT="C")
 I '$D(ACRQUIT),$D(^TMP("ACRTV",$J)) D SS1^ACRFTV2
 I '$D(ACRQUIT),$E(IOST,1,2)="C-" D PAUSE^ACRFWARN
 W @IOF
 K ^TMP("ACRTV",$J)
 Q
SS5 S ACRDOCDA=$P(ACR0,U,2)
 Q:'ACRDOCDA
 Q:'$D(^ACRDOC(ACRDOCDA,"TO"))
 S ACRDOCTO=^ACRDOC(ACRDOCDA,"TO")
 I $D(ACRBEGIN),ACRBEGIN Q:$P(ACRDOCTO,U,14)<ACRBEGIN
 I $D(ACREND),ACREND,$P(ACRDOCTO,U,14)>ACREND Q
 I $D(ACRINVIT),$P($G(^AUTTLOC(+$P(ACRDOCTO,U,13),0)),U,4)=+$G(^ACRSYS(ACRADA,0)) Q
 K ACRDOCTO
 I ACRTVT["CAN",$P(ACR0,U,5)'=ACRZDA Q
 I ACRTVT["CAN",+^ACRLOCB($P(ACR0,U,6),"DT")'=ACRFY Q
 S ACROBJ=$P(ACR0,U,4)
 S ACROBJ=$P($G(^AUTTOBJC(+ACROBJ,0)),U)
 Q:$E(ACROBJ,1,2)'=21
 I '$G(ACRDTL1) S ACROBJ="ALL"
 S ACRCAN=$P(ACR0,U,5)
 S ACRCAN=$P($G(^AUTTCAN(+ACRCAN,0)),U)
 Q:ACRCAN=""
 I $D(ACRINCMP) D INCOMP I $D(ACRQUIT) K ACRQUIT Q
 S:'$D(^TMP("ACRTV",$J,ACROBJ)) ^TMP("ACRTV",$J,ACROBJ)=""
 F ACRI=4,9,21 S @("ACR"_ACRI)=$P(ACRDT,U,ACRI)
 N X
 S X=^TMP("ACRTV",$J,ACROBJ)
 S $P(X,U)=$P(X,U)+ACR4
 S $P(X,U,2)=$P(X,U,2)+ACR9
 S $P(X,U,3)=$P(X,U,3)+ACR21
 S $P(X,U,4)=$P(X,U,4)+ACR21
 S ^TMP("ACRTV",$J,ACROBJ)=X
 I $D(ACRDTAIL) D
 .S ACRDOC=$P(ACR0,U,3)
 .S ACRPD=$O(^ACRDOC(ACRDOC,9,"B",0))
 .S ACRTO=$G(^ACRDOC(ACRDOC,"TO"))
 .S ACRPURP=$E($P($G(^ACROBL(ACRDOC,"JST")),U),1,27)
 .S ACRREQ2=^ACRDOC(ACRDOC,"REQ2")
 .S ACRDOC=^ACRDOC(ACRDOC,0)
 .S ACRREF=$P(ACRDOC,U,13)
 .S ACRREF=$P(^AUTTDOCR(ACRREF,0),U)
 .S:$P(ACRDOC,U,14)["CANCEL" ACRPURP="*"_ACRPURP
 .I ACRPD,$D(^ACRPD(ACRPD,0)) S ACRPD=$P(^(0),U)
 .I "^103^349^326^210^"'[(U_ACRREF_U) D  I 1
 ..S ACRDOC0=$P(ACRDOC,U)
 ..S ACRDOC2=""
 .E  D
 ..S ACRDOC2=$P(ACRDOC,U)
 ..S ACRDOC0=$S($L($P(ACRDOC,U,2))>3:$E($P(ACRDOC,U,2),4,99),1:$P(ACRDOC,U))
 .I '$D(^TMP("ACRTV",$J,ACROBJ,ACRDOC0)) S X=$P(ACRTO,U,14)_U_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