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

ACRFTO.m

Go to the documentation of this file.
ACRFTO ;IHS/OIRM/DSD/THL,AEF - TRAVEL ORDER PROCESSING;  [ 09/26/2005  11:20 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,19**;NOV 05, 2001
 ;;ROUTINE USED TO PROCESS TRAVEL ORDERS
EN K ACRQUIT,ACRUCHK,ACRTXDA
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRX,ACRDOC,ACRREF,ACRTXTYP,ACRDOC1,ACRMAX,ACRAPVT,ACRQUIT,ACRDA,ACRDOCDA,ACRENTRY,ACRGREF,ACRDOCDA,ACRREF1,ACRY,ACRAPDA,ACRLBDA,ACRNOW,ACRNUM,ACRORD,ACRREFDA,ACRSIG,ACRSIGG,ACRPRT,ACRCOMP,ACRURTV,ACRTPALL,ACRTPAR
 K ACRSIGP,ACRSIGZ,ACRSIGZZ,ACRFDNO(1),ACRPOA,ACRPO,ACRPPO,ACRPA,ACRXMY
 Q
EN1 ;EP;
 K ACRDOCDA,DIC
 D SELDOC
 I '$G(ACRDOCDA) S ACRQUIT="" Q
 Q:$D(ACRTPAR)
 I ACRREFX=130 D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S DIR(0)="YO"
 .S DIR("A")="Include Travel Expense Summary"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .I +Y'=1 S ACRDAILY=""
 I ACRREFX=148,(ACRID'["CANCELLED") D  Q:$D(ACRQUIT)!$D(ACROUT)   ;ACR*2.1*3.23
 .S DIR(0)="YO"
 .S DIR("A")="Include Training Evaluation"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .Q:$D(ACROUT)
 .I +Y=1 S ACRTVAL=""
 .I $D(^ACRTPAR("C",ACRDOCDA)) D  Q:$D(ACRQUIT)!$D(ACROUT)
 ..K ACRTPALL
 ..S DIR(0)="YO"
 ..S DIR("A")="Print PERSONNEL FILE Copy of the 350 for each Participant"
 ..S DIR("B")="NO"
 ..W !
 ..D DIR^ACRFDIC
 ..I +Y=1 S ACRTPALL=""
 I ACRREFX'=148 D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S DIR(0)="YO"
 .S DIR("A")="Include Travel Itinerary"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .Q:$D(ACRQUIT)!$D(ACROUT)
 .I +Y'=1 S ACRITINY=""
 I ACRREFX=600,$D(^ACROBL(ACRDOCDA,2)) D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S DIR(0)="YO"
 .S DIR("A")="Include Trip Report"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .I +Y=1 S ACRPTR=""
 I $D(ACRTPALL) D ^ACRFTPA1,EXIT Q
 D REQ^ACRFQ
 I $D(ACRPTR) D PTR ;ACR*2.1*3.22
 K ACRQUIT,ACRREQST,ACRDAILY,ACRITINY,ACRTVAL
 Q
TRAIN ;EP;TO SELECT THE TRAINING DOCUMENT AND COMPLETE THE TRAINING
 ;;EVALUATION
 K ACRQUIT
 F  D TR1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT
 Q
TR1 W @IOF
 W !?20,"SELECT THE TRAINING DOCUMENT"
 S DIC="^ACRDOC("
 S DIC(0)="AEMQZ"
 S DIC("A")="Select TRAINING DOCUMENT (350): "
 S DIC("S")="I $P($G(^ACRDOC(+Y,""TRNG"")),U,2)=DUZ"
 S DIC("S")=DIC("S")_" I $P($G(^ACROBL(+Y,""APV"")),U)=""A"""
 S D="B^G^R"
 W !!
 D MIX^ACRFDIC
 I +Y<1!$D(ACRQUIT)!$D(ACROUT) S ACRQUIT="" Q
 S ACRDOCDA=+Y
 S ACRCOMP=""
 S ACRREF=148
TR2 ;EP;TO COMPLETE TRAINING EVALUATION
 S DIR(0)="SO^1:Complete Training Evaluation;2:Cancel Training Order" ;ACR*2.1*3.16
 S DIR("A")="Which Action"
 W !
 D DIR^ACRFDIC
 Q:Y<1
 D SETDOC^ACRFEA1
 I Y=2 S ACRCANCL="" S ACRMCODE=4 D EN2^ACRFDEL Q
 S ACRUSER=$P($G(^ACRDOC(ACRDOCDA,"TRNG")),U,26) ;ACR*2.1*3.43
 I ACRUSER="" D   ;ACR*2.1*3.43
 .W !!,"Initiating Supervisor name is missing from the document, cannot proceed" ;ACR*2.1*3.43
 .W ! D PAUSE^ACRFWARN ;ACR*2.1*3.43
 .S ACRQUIT="" ;ACR;2.1*3.43
 Q:$D(ACRQUIT)   ;ACR*2.1*3.43
 S ACRDOC=$P(ACRDOC0,U),ACRREQST=""
 I '$D(^ACRTVAL("B",ACRDOCDA)) D
 .D NOW^%DTC
 .S ACRNOW=%
 .S DIC="^ACRTVAL("
 .S (X,DINUM)=ACRDOCDA
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_DUZ_";.03////"_ACRNOW
 .D FILE^ACRFDIC
 I '$P(^ACRTVAL(ACRDOCDA,0),U,3) D
 .D NOW^%DTC
 .S ACRNOW=%
 .S DA=ACRDOCDA
 .S DIE="^ACRTVAL("
 .S DR=".03////"_ACRNOW
 .D DIE^ACRFDIC
 D SCREEN^ACRFAU
 D TVDISP:'$D(ACRSCREN)
 Q:$D(ACRQUIT)
 I $P(^ACRTVAL(ACRDOCDA,0),U,4) D  Q
 .W !!,"This evaluation has already been completed and signed."
 .W !
 .D PAUSE^ACRFWARN
 S DA=ACRDOCDA
 S DIE="^ACRTVAL("
 S DR="[ACR TRAINING EVALUATION]"
 D DDS^ACRFDIC
 D:$D(ACRSCREN) DIE^ACRFDIC
 K ACRSCREN
 F ACRI=1:1:12 S:$P($G(^ACRTVAL(ACRDOCDA,"DT")),U,ACRI)="" ACRQUIT=""
 I $D(ACRQUIT) D  Q
 .W !!,"Training Evaluation cannot be signed until Items 1 through 12 are completed."
 .W !
 .D PAUSE^ACRFWARN
 D ^ACRFESIG
 ;WHEN TRAINING EVALUATION COMPLETE SEND FOR PAYMENT AUTHORIZATION
 Q:$D(ACRQUIT)
 I +$G(^ACRDOC(ACRDOCDA,"DT")),'$P(^ACRDOC(ACRDOCDA,"DT"),U,2) D ^ACRFRESP Q
 D NOW^%DTC
 S ACRNOW=%
 S DA=ACRDOCDA
 S DIE="^ACRTVAL("
 S DR=".04////"_ACRNOW
 D DIE^ACRFDIC
 K ^ACRAPVS("AORDR",ACRDOCDA)
 S ACRFINAL="Y"
 S ACRAPVT=9
 S ACRORDER=1
 S ACRLBDA=$P(^ACRDOC(ACRDOCDA,0),U,6)
 S ACRREFDA=53
 S ACRUSER=$P($G(^ACRDOC(ACRDOCDA,"TRNG")),U,26)
 S ACRDATE=ACRNOW
 D SETAPP^ACRFAPVS
 S ^ACRAPVS("ANXT",9,ACRUSER,+Y)=ACRDOCDA
 Q
TVDISP ;EP;TO DISPLAY A TRAINING EVALUATON
 N DXS,DIP
 S D0=ACRDOCDA
 D ^ACRPTE
 Q
TO ;EP;
 K ACRTVI
 S ACRREFX=130
 D EN
 Q
TR ;EP;
 K ACRTVI
 S ACRREFX=148
 D EN
 Q
TV ;EP;
 S ACRREFX=600
 D EN
 Q
TI ;EP;
 S ACRREFX=130,ACRTVI=""
 D EN
 K ACRTVI
 Q
YOURTV ;EP;
 S ACRREFX=600,ACRURTV=""
 D EN
 K ACRURTV
 Q
TESIGS ;EP;TO DISPLAY TRAINING EVALUATION SIGNATURES
 N X,ACRNOI,ACRSIG
 W !!,"SIGNATURES FOR TRAINING EVALUATION"
 W !,"----------------------------------"
 W !,"ATTENDEE.............: "
 S X=$G(^ACRTVAL(ACRDOCDA,0))
 I '$P(X,U,2) S $P(X,U,2)=$P($G(^ACRDOC(ACRDOCDA,"TRNG")),U,2)
 ;W:$P(X,U,2) $P($G(^VA(200,$P(X,U,2),0)),U)  ;ACR*2.1*19.02 IM16848
 W:$P(X,U,2) $$NAME2^ACRFUTL1($P(X,U,2))  ;ACR*2.1*19.02 IM16848
 S Y=$P(X,U,4)
 X:Y ^DD("DD")
 W ?49,$S($P(X,U,4):"COMPLETED ",1:"PENDING")
 W ?60,Y
 W !,"INITIATION SUPERVISOR: "
 N J,X,Y
 S (X,J)=0
 F  S X=$O(^ACRAPVS("AB",ACRDOCDA,X)) Q:'X  I $P($G(^ACRAPVS(X,0)),U,3)=9 S J=J+1 I J>1 S X=^ACRAPVS(X,"DT") Q
 I '$P(X,U,2) S $P(X,U,2)=$P($G(^ACRDOC(ACRDOCDA,"TRNG")),U,26)
 S ACRSIG=$P(X,U,6)
 S ACRNOI=$P(X,U,2)
 ;W $S(ACRSIG:$P($G(^VA(200,ACRSIG,0)),U),1:$P($G(^VA(200,ACRNOI,0)),U))  ;ACR*2.1*19.02 IM16848
 W $S(ACRSIG:$$NAME2^ACRFUTL1(ACRSIG),1:$$NAME2^ACRFUTL1(ACRNOI))  ;ACR*2.1*19.02 IM16848
 I '$P(X,U,4) W ?49,"PENDING" Q
 S Y=$P(X,U,4)
 X ^DD("DD")
 W ?49,$S($E(X)="A":"APPROVED",$E(X)="C":"CANCELLED",$E(X)="D":"DISAPPROVED",1:"PENDING")
 W ?60,Y
 I ACRSIG,ACRSIG'=ACRNOI D
 . ;W !?21,"(ACRING FOR: "_$P($G(^VA(200,ACRNOI,0)),U)_")"  ;ACR*2.1*19.02 IM16848
 . W !?21,"(ACRING FOR: "_$$NAME2^ACRFUTL1(ACRNOI)_")"  ;ACR*2.1*19.02 IM16848
 Q
TREPORT ;EP;TO EDIT TRIP REPORT
 W @IOF
 W !?20,"Enter your trip report below."
 W !!
 S DA=ACRDOCDA
 S DIE="^ACROBL("
 S DR=201
 D DIE^ACRFDIC
 Q
PTR ;EP;TO PRINT THE TRIP
 Q:'$D(ACRPTR)!'$D(^ACROBL(ACRDOCDA,2))
 N DXS,DIP
 S D0=ACRDOCDA
 D ^ACRPTR
 D PAUSE^ACRFWARN ;ACR*2.1*3.22
 K ACRPTR
 Q
ACS ;EP;TO SIGN AGREEMENT TO CONTINUE SERVICE
 I $P($G(^ACRDOC(ACRDOCDA,"TRNG")),U,2)'=DUZ S ACRDUZ=$P(^("TRNG"),U,2) D  Q
 .W !!,"The ",@ACRON,"Agreement to Continue in Service",@ACROF," must be signed by the attendee:"
 .N X
 .;S X=$P($G(^VA(200,+ACRDUZ,0)),U)  ;ACR*2.1*1.902 IM16848
 .S X=$$NAME2^ACRFUTL1(+ACRDUZ)  ;ACR*2.1*19.02 IM16848
 .W !?4,@ACRON,$P($P(X,",",2)," ")," ",$P(X,","),@ACROF
 .D PAUSE^ACRFWARN
 N X
 S X=$P(^ACRDOC(ACRDOCDA,"TRNG"),U,9)+$P(^("TRNG"),U,10)
 Q:X<80
 W !!,"You received ",X," hours of training."
 W !,"Your signature below acknowledges acceptance of"
 W !,"The Agreement to Continue in Service."
 W !!,"If you have any questions about this agreement and its"
 W !,"requirements, please contact your training officer before"
 W !,"you enter your electronic signature."
 D ^ACRFESIG
 Q:$D(ACRQUIT)
 I '$D(^ACRTVAL("B",ACRDOCDA)) D
 .S DIC="^ACRTVAL("
 .S (X,DINUM)=ACRDOCDA
 .S DIC(0)="L"
 .S DIC("DR")=".02////"_DUZ
 .D FILE^ACRFDIC
 D NOW^%DTC
 S ACRNOW=%
 S DA=ACRDOCDA
 S DIE="^ACRTVAL("
 S DR=".05////"_ACRNOW
 D DIE^ACRFDIC
 Q
ACSREQ(X) ;EP;TO DETERMINE IF AGREEMENT TO CONTINUE IN SERVICE IS REQUIRED
 ;AND IF SO WHETHER IT HAS BEEN SIGNED
 ;X = IEN OF THE TRAINING DOCUMENT
 S Y=0
 I $P($G(^ACRDOC(+X,"TRNG")),U,9)+$P($G(^("TRNG")),U,10)>79 S Y=1
 I $P($G(^ACRTVAL(+X,0)),U,5) S Y=2
 Q Y
SELDOC ;EP;TO SELECT TRAVEL DOCUMENT
 W @IOF
 W !?21,"Select ",$S(ACRREFX'=148:"TRAVEL "_$S(ACRREFX=130:"ORDER",1:"VOUCHER"),1:"TRAINING REPORT")
 S DIC="^ACRDOC("
 S DIC(0)="AEMQZ"
 S DIC("A")=$S(ACRREFX'=148:"Travel Order NO.: ",1:"Training Request NO.: "),ZTRTN="^ACRFQ"
 S D="B^G^Q^R"
 I '$D(DIC("S")) D
 .S DIC("S")=$S(ACRREFX=130:"S ACRREF=$P(^ACRDOC(+Y,0),U,13),ACRREF=$P(^AUTTDOCR(ACRREF,0),U) I ACRREF=130!(ACRREF=600)",ACRREFX=600:"I $P(^ACRDOC(+Y,0),U,13)=$O(^AUTTDOCR(""B"",600,0))",1:"I $P(^ACRDOC(+Y,0),U,13)=$O(^AUTTDOCR(""B"",148,0))")
 S:$D(ACRURTV) DIC("S")=DIC("S")_" I $P($G(^ACRDOC(+Y,""TO"")),U,9)=DUZ"
 S DIC("S")=DIC("S")_" I $$SCR^ACRFTO(+Y,DUZ)"
 W !!
 D MIX^ACRFDIC
 I +Y<1!$D(ACRQUIT)!$D(ACROUT) S ACRQUIT="" Q
 S ACRDOCDA=+Y
 S ACRCOMP=""
 S ACRREF=ACRREFX
 D SETDOC^ACRFEA1
 S ACRDOC=$P(ACRDOC0,U),ACRREQST=""
 Q
SCR(Y,DUZ)         ;EP ;EXTRINSIC FUNCTION
 ;----- SCREENS FOR ACCESS TO DEPARTMENT ACCOUNT OR DOCUMENT SIGNER
 ;      TO PREVENT UNAUTHORIZED PERSONS FROM VIEWING OR PRINTING
 ;      TRAVEL DOCUMENTS
 ;
 ;      INPUT:
 ;      Y   = DOCUMENT IEN
 ;      DUZ = USER IEN
 ;
 ;      OUTPUT:
 ;      RETURNS  1 IF DUZ DOES HAVE DEPT ACCOUNT ACCESS OR IS A SIGNER
 ;                 OR IS THE TRAVELER OR IS THE TRAVEL REQUESTED BY
 ;                 OR IS A HOLDER OF SECURITY KEY ACRFZ TRAVEL ORDERS
 ;               0 IF DUZ HAS NONE OF THE ABOVE
 ;
 I $D(^ACRLOCB($P(^ACRDOC(Y,0),U,6),"SC","B",DUZ)) Q 1
 I $D(^ACRAPVS("AC",Y,DUZ)) Q 1
 I $P($G(^ACRDOC(Y,"TO")),U,9)=DUZ Q 1
 I $P($G(^ACRDOC(Y,"TO")),U,18)=DUZ Q 1
 I $D(^XUSEC("ACRFZ TRAVEL ORDERS",DUZ)) Q 1
 Q 0
YOURTA ;EP -- YOUR TRAVEL ADVANCE
 ;
 ;      FOR FUTURE RELEASE
 Q
YOURTO ;EP -- YOUR TRAVEL ORDER
 ;
 ;      FOR FUTURE RELEASE
 Q