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

ACRFPSS.m

Go to the documentation of this file.
ACRFPSS ;IHS/OIRM/DSD/THL,AEF - SUMMARIZED FINANCIAL DATA FOR SERVICES AND SUPPLIES;  [ 05/09/2005  10:25 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**3,16,17**;NOV 05, 2001
 ;;SUMMARIZE DOCUMENT FINANCE DATA
EN Q:$D(ACROUT)
 I $D(ACRDOCDA),$D(^ACRDOC(ACRDOCDA,0)),$P(^(0),U,18)>0 Q
 K ACROBJ,ACRCAN
 D EN1
EXIT D:'$D(ACRPSUM) PAUSE^ACRFWARN
 Q
EN1 ;EP;
 N ACRY,ACR,ACRI,ACRX,ACRCAN,ACR1,ACR2,ACR3,ACRTOT,ACRSSRQD,ACRRX,ACRPHONE
 I ACRREFX=116,'$P(^ACRDOC(ACRDOCDA,0),U,19),$L($P(^ACRSYS(1,"DT"),U,19,20))>2000 D EXCEED^ACRFSS12
 S ACRXREF=$S(ACRREFX=103!(ACRREFX=349)!(ACRREFX=326)!(ACRREFX=499)!($P(^ACRDOC(ACRDOCDA,0),U,4)=35&($P($G(^ACROBL(ACRDOCDA,"APV")),U)="A")):"J",1:"C")
 S (ACRX,D0)=ACRDOCDA
 S (ACRTOT,ACRY)=0
 F  S ACRY=$O(^ACRSS(ACRXREF,ACRX,ACRY)) Q:'ACRY!$D(ACRSSRQD)  D EN11
 I $D(ACRSSRQD) D  Q
 .W !!,"REQUIRED FINANCIAL DATA MISSING.  FINANCIAL SUMMARY CANNOT BE COMPLETED."
 I $D(ACROBJ) D
 .D PRINT
 .D QUAN^ACRFSS12
 Q
EN11 S ACR=^ACRSS(ACRY,0)
 S ACRLBDA=$P(ACR,U,6)
 S ACR1=$P(ACR,U,4)
 S ACR2=$P(ACR,U,5)
 S ACR=$P(ACR,U)
 S ACR3=$P($G(^ACRSS(ACRY,"DT")),U,4)
 S ACRDESC=$P($G(^ACRSS(ACRY,"NMS")),U,5)
 I ACR1=""!(ACR2="") S ACRSSRQD="" Q
 I $D(ACRREFX),ACRREFX=499,$D(ACRRRNO) D  I $D(ACRQUIT) K ACRQUIT Q
 .S ACRQUIT=""
 .S ACRRX=0
 .F  S ACRRX=$O(^ACRRR("AC",ACRDOCDA,ACRRRNO,ACRRX)) Q:'ACRRX  D
 ..S ACRRRDA=0
 ..F  S ACRRRDA=$O(^ACRRR("AC",ACRDOCDA,ACRRRNO,ACRRX,ACRRRDA)) Q:'ACRRRDA  D
 ...I $D(^ACRRR(ACRRRDA,0)),$D(^ACRRR(ACRRRDA,"DT")),$D(^ACRRR(ACRRRDA,0)),ACRY=+^(0) D
 ....S ACR3=$P(^ACRRR(ACRRRDA,"DT"),U,2)*$P($G(^ACRSS(+^ACRRR(ACRRRDA,0),"DT")),U,3)
 ....K ACRQUIT
 ....S DA=ACRRRDA
 ....S DIE="^ACRRR("
 ....S DR=".14////1"
 ....D DIE^ACRFDIC
SETS D SETACT
 I ACRREFX=130!(ACRREFX=600) K ACRALTOT D ALTOT^ACRFSSA1
 S:'$D(ACROBJ(ACRACT,ACR2,ACR1)) ACROBJ(ACRACT,ACR2,ACR1)=0,ACROBJ(ACRACT,ACR2,ACR1,"I")=""
 I "^130^600^"[(U_ACRREFX_U),ACRDESC["Travel-DHHS",$P(^ACRDOC(ACRDOCDA,"TOAU"),U,5)'=1 D ALADJST
 S ACROBJ(ACRACT,ACR2,ACR1)=ACROBJ(ACRACT,ACR2,ACR1)+ACR3
 I "^130^600^"[(U_ACRREFX_U),ACRDESC["Other Exp-DHHS",$P($G(^ACRDOC(ACRDOCDA,"TRNG4")),U,16) S ACROBJ(ACRACT,ACR2,ACR1)=$P(^("TRNG4"),U,16)-$G(ACRALTOT)
 ;IF MAX DOLLARS INDICATED FOR CONTINUING EDUCATION
 ;ENSURE THAT MAX NOT EXCEEDED IN OBLIGATION OR PAYMENT
 S ACROBJ(ACRACT,ACR2,ACR1,"I")=ACROBJ(ACRACT,ACR2,ACR1,"I")_$S(ACROBJ(ACRACT,ACR2,ACR1,"I")]"":",",1:"")_ACR
 S:'$D(ACRCAN(ACRACT,ACR2)) ACRCAN(ACRACT,ACR2)=0
 S ACRCAN(ACRACT,ACR2)=ACRCAN(ACRACT,ACR2)+ACR3
 S ACRTOT=ACRTOT+ACR3
 Q
PRINT ;EP;
 I '$D(ACRORIGF) S ACRPHEAD=5 D PHEAD^ACRFSS12
 S:'$D(ACRREFX) ACRREFX=ACRREF
 W !
 D B1
 W:'$D(ACRORIGF) "---------------------",$S(ACRREF'=148:"---------------------------",1:"  SECTION C - FISCAL DATA  "),"------------------------------"
 D B1
 D H1
 S ACRACT=""
 F  S ACRACT=$O(ACROBJ(ACRACT)) Q:ACRACT=""  D
 .D ACT
 .S (ACRCAN,ACROBJ)=0
 .F  S ACRCAN=$O(ACROBJ(ACRACT,ACRCAN)) Q:'ACRCAN  D P1
 S ACRI=$G(ACRI)                       ;ACR*2.1*17.02 IM16906
 I ACRREFX=499,ACRI>1 D
 .W !?20,"--------------"
 .W !?10,"TOTAL:",?19,$J($FN(ACRTOT,"P,",2),14)
 S ACRSSTOT=ACRTOT
 Q
P1 S ACR1=ACRCAN(ACRACT,ACRCAN)
 W !
 D B
 W:+$G(ACRPSC)'=26&($G(ACRPSC)'=33) ?5
 W:+$G(ACRPSC)=26!(+$G(ACRPSC)=33) ?41
 W $P(^AUTTCAN(ACRCAN,0),U),"  "
 S ACRSSADA=$P(^AUTTCAN(ACRCAN,0),U,6)
 D P2
 Q
P2 S ACRI=0
 F  S ACROBJ=$O(ACROBJ(ACRACT,ACRCAN,ACROBJ)) Q:'ACROBJ  D P3
 I '$D(ACRORIGF),$E($G(IOST),1,2)="P-",$Y>(IOSL-4) S ACRPHEAD=5 D PHEAD^ACRFSS12
 Q
P3 S ACR2=ACROBJ(ACRACT,ACRCAN,ACROBJ),ACRI=ACRI+1
 I ACRI>1 W ! D B
 I $D(ACRORIGF),+$G(ACRPSC)=1449 W ?49
 W:+$G(ACRPSC)=26!(+$G(ACRPSC)=33) ?60
 W:+$G(ACRPSC)=347 ?14
 W:+$G(ACRPSC)'=26 ?14
 W:+$G(ACRPSC)=26 ?41
 W $P(^AUTTOBJC(ACROBJ,0),U)
 W:'$D(ACRORIGF) $J($FN(ACR2,"P,",2),14)
 I $D(ACROBJ(ACRACT,ACRCAN,ACROBJ,"A"))#2 W !?4,"(REF CODE ",$P($G(^AUTTDOCR(+$P($G(^ACRSYS(+$G(ACRADA),"DT")),U,35),0)),U),?18,$J($FN(ACROBJ(ACRACT,ACRCAN,ACROBJ,"A"),"P,",2),14),")"
 I $D(ACRORIGF) D
 .W:ACRI=1 $J($FN(ACR1,"P,",2),10)
 .W ?28,$J($FN(ACR2,"P,",2),10)
 I +$G(ACRPSC)=347,$G(ACR11)]"",$Y=22 D 11^ACRF3472
 ;W:"^103^349^326^130^600^148^"'[(U_ACRREFX_U) ?48,$P(ACROBJ(ACRACT,ACRCAN,ACROBJ,"I"),",",1,5)  ;ACR*2.1*16.03 IM13679
 W:"^103^349^326^130^600^148^"'[(U_ACRREFX_U) ?48,$P(ACROBJ(ACRACT,ACRCAN,ACROBJ,"I"),",",1,6)  ;ACR*2.1*16.03 IM13679
 I (ACRREFX=103!(ACRREFX=349)!(ACRREFX=326))&'$D(ACR3542)!("^130^600^"[(U_ACRREFX_U)) D
 .I $D(ACRTOB),'$D(ACRORIGF),ACRI=1 W ?39,"|    ",ACRTOB
 .I ACRI>1,'$D(ACRORIGF) W ?39,"|"
 .K ACRCONC
 .I $D(^ACRAL("E",ACRDOCDA)) D
 ..N ACRALDA
 ..S ACRALDA=0
 ..F  S ACRALDA=$O(^ACRAL("E",ACRDOCDA,ACRALDA)) Q:'ACRALDA!$D(ACRCONC)  I +$P($G(^ACRAL(ACRALDA,"DT")),U,11) S ACRCONC=$P(^("DT"),U,11)
 .W:$D(ACRCONC) ?45,"NON-CONTRACT CODE: ",ACRCONC
 .K ACRCONC
 W ?79
 D B
 ;F ACRCNT=6:5 Q:$P(ACROBJ(ACRACT,ACRCAN,ACROBJ,"I"),",",ACRCNT)=""  D    ;ACR*2.1*16.03 IM13679
 F ACRCNT=7:6 Q:$P(ACROBJ(ACRACT,ACRCAN,ACROBJ,"I"),",",ACRCNT)=""  D     ;ACR*2.1*16.03 IM13679
 .I "^130^103^349^326^600^148^"'[(U_ACRREFX_U) D
 ..W !,"|"
 ..W ?48,$P(ACROBJ(ACRACT,ACRCAN,ACROBJ,"I"),",",ACRCNT,ACRCNT+5)
 ..W ?79,"|"
 Q
H1 ;I ACRREFX=130 D ALTOT^ACRFSSA1
 D
 .I ACRREFX'=148,'$D(ACRORIGF) D
 ..D PPO:ACRREFX=103!(ACRREFX=349)!(ACRREFX=326)
 ..W !
 ..D B
 ..W:ACRREFX=103&'$D(ACR3542) "9."
 ..W:ACRREFX'=148 " ACCOUNTING AND APPROPRIATION DATA"
 ..W:ACRREFX=103&'$D(ACR3542) ?39,"|10. REQUISITIONING OFFICE",$S(ACRPHONE]"":" ("_ACRPHONE_")",1:"")
 ..W ?79
 ..D B
 ..W !
 ..D B
 ..W "---------------------------------------"
 ..W:ACRREFX=103&$D(ACRROFF)&'$D(ACR3542) ?39,"|    ",ACRROFF
 ..W ?79
 ..D B
 .S ACRLBDA=$P(ACRDOC0,U,6)
H11 Q
PPO ;DATA FOR PRINTING PURCHASE ORDER
 S ACRROFF=$P($G(^ACRDOC(ACRDOCDA,"PO")),U,7)
 S ACRTOB=$P($G(^ACRDOC(ACRDOCDA,"PO")),U,5)
 S ACRPHONE=$P(^ACRDOC(ACRDOCDA,"REQ"),U,8)
 I ACRROFF,$D(^AUTTPRG(ACRROFF,0)) S ACRROFF=$P(^(0),U)
 I ACRTOB,$D(^AUTTVNDR(ACRTOB,11)) S ACRTOB=$P(^(11),U,26)
 I ACRTOB,$D(^AUTTTOB(ACRTOB,0)) S ACRTOB=$P(^(0),U,2)
 Q
B Q:$D(ACRORIGF)
 W $S(ACRREFX'=103&(ACRREFX'=349)&(ACRREFX'=326):"|",1:"")
 Q
B1 Q:$D(ACRORIGF)
 W $S(ACRREFX'=103&(ACRREFX'=349)&(ACRREFX'=326):"|",1:"-")
 Q
ALADJST ;ADJUST FINACIAL SUMMARY TO EXCLUDE AIRLINE EXPENSE AND TO CREATE
 ;SEPARATE DHR FOR AIRLINE EXPENSE WHEN INDICATED
 N ACRREFA
 I $G(ACRADA),ACRREFX=130!(ACRREFX=600),$P(^ACRSYS(ACRADA,"DT"),U,33) D  Q:$G(ACRREFA)=""
 .I $P(^ACRSYS(ACRADA,"DT"),U,35) S ACRREFA=$P($G(^AUTTDOCR(+$P(^("DT"),U,35),0)),U) K:ACRREFA=ACRREFX ACRREFA
 I '$D(ACRCANCL),$G(ACRADA),ACRREFX=600,$P(^ACRSYS(ACRADA,"DT"),U,34) Q   ;IF THIS IS A TO CANCELLATION, CREATE SEPARATE AIRLINE DHR EVEN IF AIRFARE ON PMT DHR IS SET TO YES
 S ACR3=ACR3-$G(ACRALTOT)
 I $G(ACRALTOT),$G(ACRREFA)]"" S ACROBJ(ACRACT,ACR2,ACR1,"A")=ACRALTOT
 Q
ACT ;WRITE ACCOUNTING INFO
 W !
 D B
 ;W:+$G(ACRPSC)'=26&($G(ACRPSC)'=33) ?2              ;ACR*2.1*3.40
 ;W:+$G(ACRPSC)=26!(+$G(ACRPSC)=33) ?41              ;ACR*2.1*3.40
 W:+$G(ACRPSC)'=26&($G(ACRPSC)'=33) ?0               ;ACR*2.1*3.40
 W:+$G(ACRPSC)=26!(+$G(ACRPSC)=33) ?38               ;ACR*2.1*3.40
 W ACRACT
 W:ACRREFX=103&'$D(ACR3542)&'$D(ACRORIGF) ?39,"|11. BUSINESS CLASSIFICATION" ;ACR*2.1*3.40
 I ACRREFX=130,$G(ACRALTOT) W ?45,"(AIRLINE EXPENSE: ",$FN(ACRALTOT,"P,",2),")"
 W ?79
 D B
 Q
SETACT ;EP;TO SET ACCOUNTING DATA
 S ACRDPT=$P(^ACRLOCB(ACRLBDA,0),U,5)
 S ACRDT=^ACRLOCB(ACRLBDA,"DT")
 N ACRPJNUM
 S ACRPJNUM=$P($G(^ACRLOCB(ACRLBDA,3)),U)
 S ACRFY=$P(ACRDT,U)
 S ACRAPPDA=$P(ACRDT,U,4)
 S ACRALWDA=$P(ACRDT,U,5)
 S ACRSSADA=$P(ACRDT,U,8)
 S (ACRCAN,ACRCANDA)=$P(ACRDT,U,9)
 S ACRLCOD=$P(ACRDT,U,11)
 S ACRCCTDA=$P(ACRDT,U,15)
 S ACRDPT=$P(^AUTTPRG(ACRDPT,0),U,6)
 K ACRCCT
 I ACRCCTDA,$D(^AUTTCCT(ACRCCTDA,0)) S ACRCCT=$P(^(0),U)
 I '$D(ACRCCT),ACRCANDA,$D(^AUTTCAN(ACRCANDA,0)) S ACRCCT=$E($P(^(0),U),6,7)
 S ACRAPP=$P(^AUTTPRO(ACRAPPDA,0),U)
 S ACRALW=$P(^AUTTALLW(ACRALWDA,0),U)
 S ACRSSA=$P(^AUTTSSA(ACRSSADA,0),U,3)
 S ACRLCOD=$E($P(^AUTTLCOD(ACRLCOD,0),U),2,3)_"."_$P($G(^AUTTLCOD(ACRLCOD,"DT")),U,2)
 S ACRACT=ACRAPP_" "_ACRFY_"-"_ACRALW_"."_ACRSSA_"."_($S(ACRPJNUM]"":ACRPJNUM,1:(ACRDPT_ACRCCT)))_"."_ACRLCOD ;ACR*2.1*3.40
 Q