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

ACRFSS41.m

Go to the documentation of this file.
ACRFSS41 ;IHS/OIRM/DSD/THL,AEF - CONTINUATION OF ACRFSS4; [ 02/02/2005  10:22 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,16**;NOV 05, 2001
 ;;CONTINUATION OF ACRFSS4
ADD ;EP;
 I '$O(^ACRDOC(ACRDOCDA,9,0))#2 D  Q
 .W *7,*7
 .W !!,"No AUTHORIZED DESTINATIONS have been entered."
 .D PAUSE^ACRFWARN
 F  D ADD1 Q:$D(ACRQUIT)!$D(ACROUT)
 Q
ADD1 S (ACRJ,ACRDAYS)=+$G(ACRDAYS)
 I ACRJ>0 D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S DIR(0)="NO^1:"_ACRJ
 .S DIR("A")="Day "_(ACRJ+1)_" information is the same as day #"
 .W !
 .D DIR^ACRFDIC
 .I X="" K ACRQUIT Q
 .Q:$D(ACRQUIT)!$D(ACROUT)
 .I +Y S ACRDUP=+Y D DAYS
 D ADD11
 I $D(ACRQUIT) K ACRQUIT Q
 I $D(ACRTVCH) S ACRCHANG=""
 S DA=ACRDA
 S DIE="^ACRTV("
 S DR="[ACR TRAVEL DAY-2]"
 S DIE("NO^")=""
 D DDS^ACRFDIC
 I $D(ACRSCREN) K ACRSCREN D DIE^ACRFDIC
 S ^TMP("ACRTV",$J,ACRJ)=ACRDA_U_^ACRTV(ACRDA,0)
 I ACRJ=1 D DUP Q:$D(ACRQUIT)
 D SCHK
 W !
 S DIR(0)="YO"
 S DIR("A")="Add another day"
 S DIR("B")="NO"
 D DIR^ACRFDIC
 I Y'=1 S ACRQUIT=""
 Q
SCHK N ACRJ
 D APCHK^ACRFSCHK
 D APPROVE^ACRFSCHK
 Q
ADD11 ;FILE NEW DAY
 S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";7.5////"_$P(^ACRDOC(ACRDOCDA,"TOSA"),U,10)_";32////"_$P(^("TOSA"),U,10)
 I ACRJ=0,$D(^ACRDOC(ACRDOCDA,"TO")),$P(^("TO"),U,9) D
 .N ACRDUZ
 .S ACRDUZ=$P(^ACRDOC(ACRDOCDA,"TO"),U,9)
 .I $D(^ACRAU(ACRDUZ,0)),$D(^(1)) S DIC("DR")=DIC("DR")_";7////"_$P(^(1),U,2)
 I ACRJ<1 S ACRNEW=$P(^ACRDOC(ACRDOCDA,"TO"),U,14)
 D DDATE:ACRJ>0
 D FYCHECK
 Q:$D(ACRQUIT)
 S ACRJ=ACRJ+1
 S X=ACRJ
 S DIC="^ACRTV("
 S DIC(0)="L"
 S DIC("DR")=DIC("DR")_";.04////"_$S(ACRNEW<$P(^ACRDOC(ACRDOCDA,"TO"),U,14)!(ACRNEW>$P(^("TO"),U,15)):2,1:1)
 S DIC("DR")=DIC("DR")_";1////"_ACRNEW
 I $D(ACRDUP),ACRJ>1 D
 .S ACRTVDAX=0
 .F  S ACRTVDAX=$O(^ACRTV("D",ACRDOCDA,ACRTVDAX)) Q:'ACRTVDAX  I $D(^ACRTV(ACRTVDAX,0)),+^(0)=ACRDUP,$D(^("DT")) S ACRTVDT=^("DT") Q
 S ACRTVDAX=+$O(^ACRDOC(ACRDOCDA,9,0))
 I ACRTVDAX,$D(^ACRDOC(ACRDOCDA,9,ACRTVDAX,0)) S ACRTVDAX=+^(0)
 I ACRTVDAX,$D(^ACRPD(ACRTVDAX,0)) S DIC("DR")=DIC("DR")_";4////"_ACRTVDAX K ACRTVDAX
 I $D(ACRDUP),$D(ACRTVDT) D
 .S DIC("DR")=DIC("DR")_";4////"_$P(ACRTVDT,U,4)_";11////"_$P(ACRTVDT,U,11)
 .I $P(ACRTVDT,U,4),$D(^ACRPD($P(ACRTVDT,U,4),0)) S DIC("DR")=DIC("DR")_";17////On duty "_$P(^(0),U)
 .I ACRJ=$S($D(ACRDAYS):ACRDAYS,1:ACRJ) S DIC("DR")=DIC("DR")_";3////"_(ACRNEW_".1800")_";7////"_$P(ACRTVDT,U,7)
 .I ACRJ<$S($D(ACRDAYS):ACRDAYS,1:ACRJ) S DIC("DR")=DIC("DR")_";9////"_$P(ACRTVDT,U,9)
 I $G(ACRREF)=600 S DIC("DR")=DIC("DR")_";.05////1"
 D FILE^ACRFDIC
 S ACRDA=+Y
 S ACRDT=$G(^ACRTV(+Y,"DT"))
 S ^TMP("ACRTV",$J,ACRJ)=ACRDA_"^"_^ACRTV(ACRDA,0)
 K ACRDUP
 ;I $P(ACRDT,U,5)=""!($P(ACRDT,U,6)="") D        ; ACR*2.1*16.10 IM12185
 ;.S DA=ACRDA                                    ; ACR*2.1*16.10 IM12185
 ;.S DIE="^ACRTV("                               ; ACR*2.1*16.10 IM12185 
 ;.S DR="5////"_$P(^ACRSYS(1,"DT"),U,22)_$S(+ACRDT<$P(^ACRDOC(ACRDOCDA,"TO"),U,15):";6////"_$P(^ACRSYS(1,"DT"),U,21),1:"")    ; ACR*2.1*16.10 IM12185
 ;.D DIE^ACRFDIC                                 ; ACR*2.1*16.10 IM12185
 I $P(ACRDT,U,5)="" D   ; only check per diem rate   ; ACR*2.1*16.10 IM12185
 .S DA=ACRDA                                     ; ACR*2.1*16.10 IM12185
 .S DIE="^ACRTV("                                ; ACR*2.1*16.10 IM12185
 .S DR="5////"_$P(^ACRSYS(1,"DT"),U,22)          ; ACR*2.1*16.10 IM12185
 .D DIE^ACRFDIC                                  ; ACR*2.1*16.10 IM12185
 ;
 I $P(ACRDT,U,6)="",(+ACRDT<$P(^ACRDOC(ACRDOCDA,"TO"),U,15)) D  ;only check lodging rate   ; ACR*2.1*16.10 IM12185
 .S DA=ACRDA                                     ; ACR*2.1*16.10 IM12185
 .S DIE="^ACRTV("                                ; ACR*2.1*16.10 IM12185
 .S DR="6////"_$P(^ACRSYS(1,"DT"),U,21)          ; ACR*2.1*16.10 IM12185
 .D DIE^ACRFDIC                                  ; ACR*2.1*16.10 IM12185
 Q
DDATE S ACRD=0
 F  S ACRD=$O(^TMP("ACRTV",$J,ACRD)) Q:'ACRD  S ACRDA=+^TMP("ACRTV",$J,ACRD)
 I $D(^ACRTV(+$G(ACRDA),"DT")) S X1=$P(^("DT"),U)
 E  S X1=$P(^ACRDOC(ACRDOCDA,"TO"),U,14)
 S X2=1
 D C^%DTC
 S ACRNEW=X
 Q
EDIT ;EP;
 ;S ACRJ=ACRDAYS                               ;ACR*2.1*3.20
 S ACRJ=+$G(ACRDAYS)                           ;ACR*2.1*3.20
 K ACRQUIT
 S DIR(0)="LO^1:"_ACRJ
 S DIR("A")="Which DAY(s)"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 N ACRZ,ACRI
 S ACRZ=Y
 F ACRI=1:1 S ACRYY=$P(ACRZ,",",ACRI) Q:ACRYY=""  D:$D(^TMP("ACRTV",$J,ACRYY))&'$D(ACRQUIT) EDIT1
 Q
EDIT1 I ACRI>1 D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S DIR(0)="YO"
 .S DIR("A")="Continue Travel day edit"
 .S DIR("B")="YES"
 .W !
 .N ACRY
 .D DIR^ACRFDIC
 .I +Y'=1 S ACRQUIT=""
 F  D E Q:$D(ACRQUIT)
 K ACRQUIT,ACRCOUNT
 Q
E S (ACRTVDA,ACRDA,DA)=$P(^TMP("ACRTV",$J,ACRYY),U)
 S ACRCOUNT=$G(ACRCOUNT)+1
 I $D(ACRTVCH) D CHK1
 S DA=ACRDA
 S DIE="^ACRTV("
 S DR="[ACR TRAVEL DAY-2]"
 S DIE("NO^")=""
 D DDS^ACRFDIC
 I '$D(ACRSCREN) S ACRQUIT=""
 I $D(ACRSCREN) K ACRSCREN D ^ACRFETD
 I $D(ACRTVCH) D CHK2
 K ACRTVCH
 Q
DELETE ;EP;DELETE TRAVEL DAYS
 S ACRJ=$G(ACRDAYS)
 S DIR(0)="LO^1:"_ACRJ
 S DIR("A")="Which DAY(s)"
 W !
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!(+Y<1)
 S ACRDEL=Y
 S DIR(0)="YO"
 S DIR("A")="Sure you want to delete travel day(s) "_$E(Y,1,$L(Y)-1)_" "
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:Y'=1
 F ACRI=1:1 S ACRYY=$P(ACRDEL,",",ACRI) Q:ACRYY=""  D:$D(^TMP("ACRTV",$J,ACRYY)) DTV1
 K ACRDEL
 D SCHK
 Q
DTV1 S DA=+^TMP("ACRTV",$J,ACRYY)
 S DIK="^ACRTV("
 D DIK^ACRFDIC
 S ACRDAYS=ACRDAYS-1
 I $D(ACRTVCH) S ACRCHANG=""
 K ^TMP("ACRTV",$J,ACRYY)
 Q
DISP W @IOF
 W !?19,@ACRON,"DAILY TRAVEL INFORMATION",@ACROF
 N DXS,DIP,DC,DN
 S D0=DA
 D ^ACRPTD
 Q
VOUCHER ;EP;VOUCHER AUDIT
 S DIR(0)="YO"
 S DIR("A")="Edit the Travel Voucher"
 S DIR("B")="NO"
 W !
 D DIR^ACRFDIC
 Q:ACRY'=1
 S ACRDOCDA=ACRDOCDA
 F  D DISPLAY^ACRFSS42,EDIT Q:$D(ACRQUIT)!$D(ACROUT)
 Q
CHK1 ;SET VARIABLES FOR POST-EDIT COMPARISON
 S ^TMP("ACRTV",$J,"CHK",ACRTVDA)=^ACRTV(ACRTVDA,0)_"&&&&"_^ACRTV(ACRTVDA,"DT")
 Q
CHK2 ;COMPARE TRAVEL DAY INFO AFTER EDIT
 Q:'ACRTVDA
 Q:'$D(^ACRTV(ACRTVDA,0))
 S X=^ACRTV(ACRTVDA,0)_"&&&&"_^ACRTV(ACRTVDA,"DT")
 I ^TMP("ACRTV",$J,"CHK",ACRTVDA)'=X S ACRCHANG=""
 Q
LODGE ;EP;DISPLAY LODGING AND PER DIEM RATES FOR CITIES TO WHICH THE
 ;TRAVELER IS TRAVELING
 D LODGE^ACRFSS43
 Q
DELAUTO ;EP;DELETE RENTAL CAR EXPENSES IF RENTAL CAR IS DENIED
 D DELAUTO^ACRFSS43
 Q
DUP ;DUPLICATE DATA FOR ALL DAYS
 D DAYS
 Q:$G(ACRDAYS)<1
 S DIR(0)="YO"
 S DIR("A")="Duplicate information from Day 1 to Day(s) 2 - "_ACRDAYS
 S DIR("B")="YES"
 W !
 D DIR^ACRFDIC
 I $G(Y)'=1 K ACRQUIT Q
 F ACRJJ=1:1:ACRDAYS-1 S ACRJ=ACRJJ,ACRDUP=1 D ADD11 Q:$D(ACRQUIT)
 K ACRDUP
 S ACRQUIT=""
 Q
DAYS S X1=$P(^ACRDOC(ACRDOCDA,"TO"),U,15)
 S X2=$P(^ACRDOC(ACRDOCDA,"TO"),U,14)
 D ^%DTC
 S ACRDAYS=$S(X<1:0,X+1<100:X+1,1:100)
 Q
FYCHECK ;EP;CHECK TO SEE IF TRAVEL DAY IS IN SAME FY AS THE BUDGET ACCOUNT
 ;PREVENT ADDING DAY FOR NEXT FY FOR SINGLE YEAR ACCOUNT
 Q:$G(ACRAPP)'?7N
 N ACRFY,X,X1
 S ACRFY=$P(^ACRLOCB($S($G(ACRLBDA):ACRLBDA,1:$P(ACRDOC0,U,6)),"DT"),U)
 S X=ACRNEW\10000+1700,X1=ACRNEW\100#100
 I X>ACRFY!(X=ACRFY&(X1>9)) D FYMESS
 I X<(ACRFY-1)!(X<ACRFY&(X1<10)) D FYMESS
 Q
FYMESS ;
 N X
 D SCREEN^ACRFAU
 W:$D(ACRSCREN) @IOF
 W *7,*7
 W @ACRON
 W !!,"You cannot create a travel day which is in a Fiscal Year other"
 W !,"than Fiscal Year ",ACRFY,", using this account.  Select an account"
 W !,"from an appropriate Fiscal Year for additional travel days."
 W @ACROF
 I '$D(ACRDUP) D PAUSE^ACRFWARN I 1
 E  H 5
 K X,ACRSCREN
 S DIR(0)="DO^::E"
 S DIR("A")="Date of Travel"
 W !
 D DIR^ACRFDIC
 I +Y<1 S ACRQUIT="" Q
 S ACRNEW=Y
 D FYCHECK
 Q