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

ACRFSS3.m

Go to the documentation of this file.
ACRFSS3 ;IHS/OIRM/DSD/THL,AEF - EDIT TRAVEL OR TRAINING EXPENSES; [ 02/02/2005  10:23 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**16**;NOV 05, 2001
 ;;CONTINUATION OF ACRFSS
 ;;EDIT TRAVEL OR TRAINING EXPENSES
TO F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)
EXIT K ACRX,ACRQUIT,ACRPF,ACRI,ACRALTOT,ACRSS
 Q
EN1 S ACRTXDA=$P(ACRDOC0,U,4)
 I ACRREF=600!(ACRREF=130) D ^ACRFSS4 I $D(ACRREV) S ACRQUIT="" Q
 Q:$D(ACROUT)
 I $D(ACRNEWOB),$D(^ACRSS("E",ACRDOCDA)),ACRREF=130!(ACRREF=600) D UP
 W !!,$S(ACRREF=130:"TRAVEL ORDER",ACRREF=600:"TRAVEL VOUCHER",1:"TRAINING REQUEST")," BEING PROCESSED."
 W !
 F ACRI=1:1:$S(ACRREF=130!(ACRREF=600):4,1:2) D ADD
 I $D(ACRQUIT) Q
 F  D EN2 Q:$D(ACRQUIT)!$D(ACROUT)
 Q
EN2 ;EP
 D DISPLAY
 D EDIT
 S ACRQUIT=""
 Q
DISPLAY I $E(IOST,1,2)="C-",'$D(ACRPRT) D
 .W @IOF
 .W !?10,@ACRON,$S(ACRREF=130!(ACRREF=600):"TRAVEL",1:"TRAINING")," EXPENSES"
 .W @ACROF," FOR DOCUMENT: ",@ACRON,ACRDOC,@ACROF
 .D OBJ
 W !!,"ITEM"
 W ?6,"TYPE OF"
 W:'$D(ACRPRT) ?22,"OBJ"
 W ?42,"ESTIMATED"
 W !," NO."
 W ?6,"EXPENSE"
 I '$D(ACRPRT) D
 .W ?22,"CODE"
 .W ?28,"CAN NO."
 W ?42,"EXPENSE"
 W !,"----"
 W ?6,"--------------"
 I '$D(ACRPRT) D
 .W ?22,"----"
 .W ?28,"-------"
 W ?42,"----------"
 S ACRSSDA="",(ACRSSTOT,ACRJ)=0
 I ACRREF=130!(ACRREF=600) F ACRI=1:1:4 D
 .S ACRSSDA=$O(^ACRSS("E",ACRDOCDA,ACRI,0))
 .Q:'ACRSSDA
 .S ACRJ=ACRJ+1
 .D DISP1
 I ACRREF=148 F ACRI=1,2 D
 .S ACRSSDA=$O(^ACRSS("E",ACRDOCDA,ACRI,ACRSSDA))
 .Q:'ACRSSDA
 .S ACRJ=ACRJ+1
 .D DISP1
 W !?42,"----------"
 W !?34,"TOTAL"
 W ?42,$J($FN(ACRSSTOT,"P",2),11)
 I $D(ACRPRT),$E(IOST,1,2)["C-" D PAUSE^ACRFWARN W @IOF
 Q
DISP1 S ACRSS=ACRSSDA_"^"_^ACRSS(ACRSSDA,0),ACRSS1=$P($G(^ACRSS(ACRSSDA,"DT")),U,4),ACRITEM=$P(ACRSS,U,2),ACRSSITM=$P($G(^ACRSS(ACRSSDA,"NMS")),U,5),ACRSS(ACRJ)=ACRSS,ACROBJDA=$P(ACRSS,U,5),ACRSSCAN=$P(ACRSS,U,6)
 S ACRCAN=$P($G(^AUTTCAN(+ACRSSCAN,0)),U),ACROBJ=$P($G(^AUTTOBJC(+ACROBJDA,0)),U)
 S:ACRSS1'["." ACRSS1=ACRSS1_".00"
 S:$L($P(ACRSS1,".",2))=1 ACRSS1=ACRSS1_"0"
 S ACRSSTOT=ACRSSTOT+ACRSS1
 S:ACRITEM'=ACRJ&(ACRITEM'=999) $P(^ACRSS(ACRSSDA,0),U)=ACRJ
 W !,$J(ACRJ,3)
 W ?6,ACRSSITM
 I '$D(ACRPRT) D
 .W ?22,$S(ACROBJ]"":ACROBJ,1:"****")
 .W ?28,ACRCAN
 W ?42,$J(ACRSS1,10)
 Q
ADD I $D(^ACRSS("E",ACRDOCDA,ACRI)) D ADD1:ACRREF'=148 Q
 S X=ACRI
 S DIC(0)="L"
 S DIC="^ACRSS("
 I ACRREF=130!(ACRREF=600) S Y(0)=$S(X=1:"Travel-DHHS",X=2:"Per Diem-DHHS",X=3:"Other Exp-DHHS",X=4:"Travel-OTHER",X=5:"Per Diem-OTHER",1:"Other Exp-OTHER")
 E  S Y(0)=$S(X=1:"Tuition & Fees",1:"Books & Other")
 I ACRREF=130!(ACRREF=600),X=4 S Y(0)="Travel Mgt Fee"
 S ACRCANDA=$O(^AUTTCAN("B",ACRFDNCA,0))
 S DIC("DR")=".02////"_$G(ACRDOCDA)_";.03////"_$G(ACRDOCDA)_";.05////"_$G(ACRCANDA)_";.06////"_$G(ACRLBDA)_";5////"_$G(Y(0))
 I ACRI<5,ACRREF=130!(ACRREF=600) S DIC("DR")=DIC("DR")_";13////"_$S(ACRI=1:+$G(ACRALTOT),ACRI=2:$G(ACRPD)+$G(ACRLDG),ACRI=3:$G(ACROTHT)+$G(ACRRC)+$G(ACR4P),ACRI=4&($D(^ACRAL("E",ACRDOCDA))):$P($G(^ACRSYS(1,400)),U),1:0)
 E  S DIC("DR")=DIC("DR")_";13////0"
 I $G(Y(0))="Travel Mgt Fee" D
 . S DIC("DR")=DIC("DR")_";.04////"_$S($P($G(^ACRSYS(1,400)),U,2)]"":$P($G(^ACRSYS(1,400)),U,2),$G(ACROBJ)]"":ACROBJ,+$O(^AUTTOBJC("B",2121_" ",0)):$O(^AUTTOBJC("B",2121_" ",0)),1:"")
 D FILE^ACRFDIC
 S ACRSSDA=+Y
 Q
ADD1 S DA=$O(^ACRSS("E",ACRDOCDA,ACRI,0))
 S DIE="^ACRSS("
 Q:'DA
 ;I ACRREF=130!(ACRREF=600),$P($G(^ACRSS(DA,"DT")),U,4)=$S(ACRI=1:$G(ACRALTOT),ACRI=2:$G(ACRPD)+$G(ACRLDG),ACRI=3:$G(ACROTHT)+$G(ACRRC)+$G(ACR4P),1:0) Q  ;ACR*2.1*16.09 IM13605
 S ACRALTOT=$G(ACRALTOT)                          ;ACR*2.1*16.09 IM13605
 S ACRPD=$G(ACRPD)                                ;ACR*2.1*16.09 IM13605
 S ACRLDG=$G(ACRLDG)                              ;ACR*2.1*16.09 IM13605
 S ACROTHT=$G(ACROTHT)                            ;ACR*2.1*16.09 IM13605
 S ACRRC=$G(ACRRC)                                ;ACR*2.1*16.09 IM13605
 S ACR4P=$G(ACR4P)                                ;ACR*2.1*16.09 IM13605
 I ACRREF=130!(ACRREF=600),$P($G(^ACRSS(DA,"DT")),U,4)=$S(ACRI=1:+ACRALTOT,ACRI=2:ACRPD+ACRLDG,ACRI=3:ACROTHT+ACRRC+ACR4P,1:0) Q  ;ACR*2.1*16.09 IM13605
 I ACRREF=130!(ACRREF=600) Q:ACRI=4&(+$$TMFEE^ACRFSS42(ACRDOCDA))
 I ACRI<5,ACRREF=130!(ACRREF=600) S DR="13////"_$S(ACRI=1:+ACRALTOT,ACRI=2:ACRPD+ACRLDG,ACRI=3:ACROTHT+ACRRC+ACR4P,ACRI=4&($D(^ACRAL("E",ACRDOCDA))):$P($G(^ACRSYS(1,400)),U),1:0)
 E  S DR="13////0"
 I ACRI=4,ACRREF=130!(ACRREF=600) S DR=DR_";4////"_$S($P($G(^ACRSYS(1,400)),U,2):$P($G(^ACRSYS(1,400)),U,2),1:$O(^AUTTOBJC("B",2121_" ",0)))
 Q:ACRREF=148
 D DIE^ACRFDIC
 Q
EDIT ;     
 I $G(ACRREF)=148,$P($G(^ACROBL(ACRDOCDA,"APV")),U)="A" Q   ;PREVENT EDITING EXPENSES ON APPROVED TRAINING REQUEST
 S DIR(0)="LOA^1:"_$S(ACRREF=130!(ACRREF=600):4,1:2)
 S DIR("A")="Item NO(s). ==> "
 I ACRREF=600 S DIR("B")=4
 W !
 K ACRQUIT
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)!'+Y
 I ACRREF=600 Q:+Y'=4
 F ACRI=1:1 S X=$P(ACRY,",",ACRI) Q:'X  D:+$G(ACRSS(X)) E1
 Q
E1 W !!?22,"Item No. ",X
 S (DA,ACRSSDA)=+ACRSS(X)
 S DIE="^ACRSS("
 S DR="S DIE(""NO^"")="""";.05T//"_$S($L($G(ACRFDNCA))=7:ACRFDNCA,$L($G(ACRCAN))=7:ACRCAN,1:"")_";.04T"_$S(ACRREF'=148:"",X=1:";13TUITION & FEES......",X=2:";13BOOKS & OTHER.......",1:"")
 I $P($G(^ACRSS(ACRSSDA,"NMS")),U,5)="Travel Mgt Fee" S DR=DR_";13T"
 D DIE^ACRFDIC
 Q
COURSE ;EP;TO EDIT TRAINING NEED
 N DXS,DIP,DC,DN
 S (D0,DA)=ACRDOCDA
 S DIE="^ACRDOC("
 S DR="[ACR TRAINING NEED]"
 D DDS^ACRFDIC
 Q:'$D(ACRSCREN)
 K ACRSCREN
 D ^ACR148A
 I $D(^ACRDOC(ACRDOCDA,"TRNGND1")) D  I Y'=1 S ACRQUIT="" Q
 .S DIR(0)="YO"
 .S DIR("A")="            Edit this data"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 D DIE^ACRFDIC
 Q
UP ;EP;TO UPDATE REQUEST AMOUNT
 Q:$P(^ACRDOC(ACRDOCDA,0),U,14)["CANCELLED"
 S ACRSSDA=0
 F ACRI=1:1:3 D:$D(^ACRSS("E",ACRDOCDA,ACRI))
 .S ACRSSDA=$O(^ACRSS("E",ACRDOCDA,ACRI,ACRSSDA))
 .S DA=ACRSSDA
 .S DIE="^ACRSS("
 .S DR="13////"_$S(ACRI=1:+$G(ACRALTOT),ACRI=2:ACRPD+ACRLDG,1:ACROTHT+ACRRC+ACR4P)
 .D DIE^ACRFDIC
 Q
OBJ ;
 Q:$P($G(^ACROBL(ACRDOCDA,"APV")),U)="A"   ;PREVENT EDITING OF OBJECT CLASS CODE ON APPROVED REQUEST
 I "^130^148^"[(U_ACRREF_U),$G(ACRDOCDA),$D(^ACRSS("C",ACRDOCDA)) S (ACRSSDA,DA)=$O(^ACRSS("C",ACRDOCDA,0)) I DA,$D(^ACRSS(DA,0)) S ACROBJ=$P(^(0),U,4) D
 .S DIE="^ACRSS(",DR="S DIE(""NO^"")="""";.04"_$S(ACRREF=130:"THIS TRAVEL ORDER",1:"THIS TRAINING REQUEST")_"//"_$S(ACRREF=130:"2121",1:"252W")
 .W !!,"OBJECT CODE FOR"
 .D DIE^ACRFDIC
 .Q:ACROBJ=$P(^ACRSS(ACRSSDA,0),U,4)
 .S ACROBJ=$P(^ACRSS(ACRSSDA,0),U,4)
 .F  S ACRSSDA=$O(^ACRSS("C",ACRDOCDA,ACRSSDA)) Q:'ACRSSDA  D
 ..Q:$P(^ACRSS(ACRSSDA,0),U,4)=ACROBJ
 ..S DA=ACRSSDA
 ..S DIE="^ACRSS("
 . . S DR=".04////"_$S($P($G(^ACRSS(ACRSSDA,"NMS")),U,5)="Travel Mgt Fee":$P($G(^ACRSYS(1,400)),U,2),1:ACROBJ)
 ..D DIE^ACRFDIC
 D PUT($G(ACROBJ),$G(ACRDOCDA))
 Q
PUT(ACROBJ,ACRDOCDA)         ;
 ;----- PUT OCC INTO OCC FIELD OF FMS DOCUMENT FILE
 ;
 ;      ACROBJ   = INTERNAL OBJECT CLASS CODE
 ;      ACRDOCDA = INTERNAL DOCUMENT NUMBER
 ;
 I $G(ACROBJ),$G(ACRDOCDA) D
 . S DIE="^ACRDOC("
 . S DA=ACRDOCDA
 . S DR="113060////"_ACROBJ
 . D ^DIE
 Q