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

ACRFTV2.m

Go to the documentation of this file.
ACRFTV2 ;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
SS ;EP;TO PRINT TRAVEL REPORT
 K ^TMP("ACRTV",$J)
 D EN1
EXIT D EXIT^ACRFTV
 Q
EN1 I $D(ACRBOTH) D  Q
 .K ACRDTAIL
 .D SS0
 .S ACRDTAIL=""
 .S (ACRREQ,ACROBL,ACRSPT)=0
 .D SS0
 .K ^TMP("ACRTV",$J)
SS0 Q:$D(ACRQUIT)!$D(ACROUT)
 U IO
 S (ACRREQT,ACROBLT,ACRSPTT)=0
 I ACRTVT="D" D T Q
 I ACRTVT="AE"!(ACRTVT="NCC") D T1 Q
 I ACRTVT="TDEPT"!(ACRTVT="PO") D PDEPT^ACRFTV1 Q
 I ACRTVT="RC"!(ACRTVT="LOC") D TDAY^ACRFTV3 I 1
 E  D:ACRTVT'="C" SS4^ACRFTV3
SS1 ;EP;
 N ACRFY
 D DISPLAY^ACRFTV1
 I '$D(ACRDTAIL) D
 .D H1^ACRFTV1
 .D SS3^ACRFTV1
 S ACROBJ=$S($G(ACRDTL1):"",1:"ALL")
 S ACR=""
 F  S ACR=$O(^TMP("ACRTV",$J,ACR)) Q:ACR=""!$D(ACRQUIT)!$D(ACROUT)  D
 .I $D(ACRDTAIL) D SS2^ACRFTV1
 .Q:$D(ACRQUIT)!$D(ACROUT)
 .S ACR0=^TMP("ACRTV",$J,ACR)
 .F ACRI=1:1:4 S @("ACR"_ACRI)=$P(ACR0,U,ACRI)
 .I $G(ACRDTL1) D  Q:$D(ACRQUIT)!$D(ACROUT)
 ..D ALL
 ..W ?50,$J($FN(ACR1,"P,",2),15)
 ..W ?64,$J($FN(ACR2,"P,",2),15)
 ..W:ION<81 !?65
 ..W:ION>80 ?80
 ..W $J($FN(ACR4,"P,",2),15)
 ..I $D(ACRDTAIL) D  Q:$D(ACRQUIT)!$D(ACROUT)
 ...D PAUSE^ACRFWARN:$D(ACRDTAIL)
 ...W:$E(IOST,1,2)="C-" @IOF
 .S ACRREQ=ACRREQ+ACR1
 .S ACROBL=ACROBL+ACR2
 .S ACRSPT=ACRSPT+ACR4
 .I $D(ACRREQT) D
 ..S ACRREQT=ACRREQT+ACR1
 ..S ACROBLT=ACROBLT+ACR2
 ..S ACRSPTT=ACRSPTT+ACR4
 .I $Y>(IOSL-5) D
 ..D PAUSE^ACRFWARN
 ..Q:$D(ACRQUIT)!$D(ACROUT)
 ..W @IOF
 ..D H1^ACRFTV1:$D(ACRDTAIL)
 Q:$D(ACRQUIT)!$D(ACROUT)
 D ALL
 W ?50,$J($FN(ACRREQ,"P,",2),15)
 W ?64,$J($FN(ACROBL,"P,",2),15)
 W:ION<81 !?65
 W:ION>80 ?80
 W $J($FN(ACRSPT,"P,",2),15)
 I $D(ACRSIGT) D SIGT^ACRFTV I 1
 E  D PAUSE^ACRFWARN:$D(ACRDTAIL)
 Q
ALL ;
 I '$D(ACRDTAIL) W:ACR="" $$DASH^ACRFMENU
 E  W $$DASH^ACRFMENU
 I ACR]"",ACR'="ALL",ACROBJ'="ALL",ACROBJ'=ACR D
 .S ACROBJ=ACR
 .W !?10,"TOTALS FOR OBJECT CODE: ",ACR
 E  D
 .I $L(ACR)=4 W !?10,"TOTALS FOR OBJECT CODE: ",ACR
 .E  W !?10,"TOTAL:"
 Q
T ;TO PRINT TRAVEL REPORT FOR SELECTED TRAVELERS
 F ACRJ=2:1 S ACRTVDA=$P(ACRTRAV,U,ACRJ) Q:ACRTVDA=""  D T1
 I $L(ACRTRAV,U)>3 D
 .W $$DASH^ACRFMENU
 .W !?10,"TOTAL FOR SELECTED TRAVELERS:"
 .W ?50,$J($FN(ACRREQT,"P,",2),15)
 .W ?64,$J($FN(ACROBLT,"P,",2),15)
 .W:ION<81 !?65
 .W:ION>80 ?80
 .W $J($FN(ACRSPTT,"P,",2),15)
 .I $D(ACRSIGT) D SIGT^ACRFTV
 .I $E(IOST,1,2)="C-" D PAUSE^ACRFWARN
 W @IOF
 Q
T1 K ^TMP("ACRTV",$J)
 S (ACRREQ,ACROBL,ACRSPT)=0
 I ACRTVT="D" D
 .S ACRZDA=0
 .F  S ACRZDA=$O(^ACRDOC("N",ACRTVDA,ACRZDA)) Q:'ACRZDA  D
 ..Q:'$D(^ACRDOC(ACRZDA,"TO"))
 ..S ACRTO=^ACRDOC(ACRZDA,"TO")
 ..S ACRFR=$P(ACRTO,U,14)
 ..S ACRTO=$P(ACRTO,U,15)
 ..I ACRFR>(ACRBEGIN-1),ACRTO<(ACREND+1) D
 ...S ACRTVT="D"
 ...D SS4^ACRFTV3
 I ACRTVT="AE"!(ACRTVT="NCC") D
 .S ACRBEG=ACRBEGIN
 .F  S ACRBEG=$O(^ACRDOC("DD",ACRBEG)) Q:'ACRBEG!(ACRBEG>ACREND)  D
 ..S ACRZDA=0
 ..F  S ACRZDA=$O(^ACRDOC("DD",ACRBEG,ACRZDA)) Q:'ACRZDA!(ACRBEG>ACREND)  D
 ...I ACRTVT="AE",$P($G(^ACRDOC(ACRZDA,"TOTV")),U,4)="A" D  Q
 ....S ACRTVT="D"
 ....D SS4^ACRFTV3
 ....S ACRTVT="AE"
 ...I ACRTVT="NCC" D
 ....S ACRALDA=0
 ....F  S ACRALDA=$O(^ACRAL("E",ACRZDA,ACRALDA)) Q:'ACRALDA!$D(ACRQUIT)  I $P($G(^ACRAL(ACRALDA,"DT")),U,11)]"",$P(^("DT"),U,11)'="00" D
 .....S ACRTVT="D"
 .....D SS4^ACRFTV3
 .....S ACRTVT="NCC",ACRQUIT=""
 ....K ACRQUIT
 D SS1
 I $D(ACRSIGT) D SIGT^ACRFTV I 1
 E  D PAUSE^ACRFWARN:'$D(ACRDTAIL)
 W:$D(ACRDTAIL) @IOF
 Q