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

ACRFSS12.m

Go to the documentation of this file.
ACRFSS12 ;IHS/OIRM/DSD/THL,AEF - DISPALY AND EDIT SERVICES/SUPPLIES PROCURED; [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;;NOV 05, 2001
 ;;CONTINUAITON OF ACRFSS1,25T
DISPLAY ;EP;TO DISPLAY SUPPLIES/SERVICES FOR A REQUEST
 Q:$D(ACROUT)
 D PHEAD:'$D(ACRORIGF)
 S ACRDOCVN=$P(ACRDOCPO,U,5)
 I $D(ACRPRT)!$D(ACRREV),ACRREFX'=103,ACRREFX'=349,ACRREFX'=326,$G(ACRAPVT)'=31!($G(ACRAPVT)=6) D
 .S D0=ACRDOCDA
 .D ^ACRFJS
 D PHEAD:'$D(ACRORIGF)
 D HEAD^ACRFSSD1:'$D(ACRORIGF)
 K ACRSS
 S ACRXREF=$S(ACRREFX=103!(ACRREFX=349)!(ACRREFX=326)!($P(^ACRDOC(ACRDOCDA,0),U,4)=35&($P($G(^ACROBL(ACRDOCDA,"APV")),U)="A")):"J",'$D(ACRPO)&'$D(ACRPPO):"C",1:"J")
 S (ACRSSDA,ACRSSTOT,ACRSJ)=0
 F  S ACRSSDA=$O(^ACRSS(ACRXREF,ACRDOCDA,ACRSSDA)) Q:'ACRSSDA  D
 .S ACRSSTOT=ACRSSTOT+$P($G(^ACRSS(ACRSSDA,"DT")),U,4)
 .S ACRSJ=ACRSJ+1
 .N X
 .S X=^ACRSS(ACRSSDA,0)
 .S ACRSSX(+$P(X,U,2),ACRSJ)=ACRSSDA_U_^ACRSS(ACRSSDA,0)
 .I '$D(ACRSCHK),'$D(ACRREV),'$D(ACRPRT),$D(^ACRAPVS("AB",ACRDOCDA)) D SCHK
 .D SCHK1:$D(ACRSCHK)
 N X,Y,I,J
 S (X,I,J)=0
 F  S X=$O(ACRSSX(X)) Q:'X  D
 .S Y=0
 .F  S Y=$O(ACRSSX(X,Y)) Q:'Y  D
 ..S J=J+1
 ..S:X'=ACRDOCDA ACRFROMX=1
 ..I J'=+^ACRSS(+ACRSSX(X,Y),0) D
 ...S DA=+ACRSSX(X,Y)
 ...S DIE="^ACRSS("
 ...S DR=".01///^S X=J"
 ...S $P(ACRSSX(X,Y),U,2)=J
 ...N X,Y
 ...D DIE^ACRFDIC
 ..S ACRSS(+$P(ACRSSX(X,Y),U,2))=ACRSSX(X,Y)
 K ACRQUIT,ACRSSX
 N ACRX
 S (ACRX,ACRSSDA,ACRJ)=0
 F  S ACRX=$O(ACRSS(ACRX)) Q:'ACRX!$D(ACRQUIT)!$D(ACROUT)  D
 .I $G(ACRFROMX) D
 ..Q:$P(ACRSS(ACRX),U,3)=$G(ACRFROMX)
 ..S ACRFROMX=$P(ACRSS(ACRX),U,3)
 ..W !?3,$S('$D(ACRORIGF):"|",1:" ")
 ..D W^ACRFSSD
 ..W !?3,$S('$D(ACRORIGF):"|",1:" "),"(From Request NO: ",$P(^ACRDOC(ACRFROMX,0),U),")"
 ..D W^ACRFSSD
 ..W !?3,$S('$D(ACRORIGF):"|",1:" ")
 ..D W^ACRFSSD
 .S ACRSSDA=+ACRSS(ACRX)
 .D ^ACRFSSD
 D ASC
 K ACRQUIT,ACRFROMX
 I ACRJ=0 D
 .W !?5,"NO ITEMS ON FILE FOR THIS PROCUREMENT"
 .I $D(^ACRSS("C",ACRDOCDA)),'$D(^ACRSS("J",ACRDOCDA)) D
 ..S ACRSSDA=$O(^ACRSS("C",ACRDOCDA,0))
 ..I ACRSSDA,+$G(^ACRSS(ACRSSDA,"PO")) D
 ...W !?5,"ITEMS TRANSFERRED TO PO: "
 ...W $P(^ACRDOC(+^ACRSS(ACRSSDA,"PO"),0),U,2),"  (",$P(^ACRDOC(+^ACRSS(ACRSSDA,"PO"),0),U),")"
 I ACRJ>0 D
 .I ACRREFX=116,'$P(^ACRDOC(ACRDOCDA,0),U,19),$L($P(^ACRSYS(1,"DT"),U,19,20))>3 D EXCEED
 .S:ACRSSTOT'["." ACRSSTOT=ACRSSTOT_".00"
 .I $E(DT,4,5)<10,($E(DT,1,3)+1700)<$P($G(^ACRLOCB(+$P(ACRDOC0,U,6),"DT")),U) D  I 1
 ..S ACRAPVTX="SUBJECT TO AVAILABILITY OF FUNDS"
 .E  I $E($P(ACRDOC0,U,3),5,7)>600,'$D(ACRPRT),'$D(ACRINV),$E(IOST,1,2)="P-" D
 ..W !,"THIS IS TO CERTIFY THAT THIS OBLIGATION IS WITHIN THE 30% FOURTH QUARTER"
 ..W !,"SPENDING LIMITATION AND THE 12% LIMITATION FOR THE MONTH."
 .I '$D(ACRORIGF) D
 ..W $$DASH^ACRFMENU
 ..W !?47,"TOTAL   |"
 ..W:'$D(ACRPQT) ?57,$J($FN(ACRSSTOT-$G(ACRQD),"P",2),10)
 ..W ?67,"|"
 .S ACGRDA=$P(ACRDOC0,U,16)
 .I ACGRDA,$D(^ACGS(ACGRDA,0)),$D(^("DT1")),(ACRSSTOT-$G(ACRQD))'=$P(^("DT1"),U,5) D
 ..S DR="26////"_(ACRSSTOT-$G(ACRQD))
 ..S DIE="^ACGS("
 ..S DA=ACGRDA
 ..D DIE^ACRFDIC
 ..K ACGRDA
 D QUAN
 I $E(IOST,1,2)="C-",($D(ACRPRT)!$D(ACRREV)),$G(ACRAPVT)'=31&($G(ACRAPVT)'=6) D
 .D PAUSE^ACRFWARN
 .W @IOF
 Q
SCHK K ACRSCHK
 N X
 S X=0
 F  S X=$O(^ACRAPVS("AB",ACRDOCDA,X)) Q:'X!$D(ACRSCHK)  I $D(^ACRAPVS(X,0)),$E($G(^ACRAPVS(X,"DT")))="A",$P(^ACRDOC(ACRDOCDA,0),U,13)=$P(^ACRAPVS(X,0),U,6) S ACRSCHK=""
 Q
SCHK1 K ^TMP("ACRSS",$J,ACRSSDA)
 S %X="^ACRSS("_ACRSSDA_","
 S %Y="^TMP(""ACRSS"","_$J_","_ACRSSDA_","
 D %XY^%RCR
 Q
PHEAD ;EP;TO PRINT HEADER ON ADDITIONAL DOCUMENT PAGES
 Q:$D(ACROUT)
 S:'$D(ACRPHEAD) ACRPHEAD=$S('$D(ACRPQT):13,$G(ACRDC)=1:16,1:5)
 I $E(IOST,1,2)="P-",IOSL-ACRPHEAD<$Y D
 .I $G(ACRZIS(2))]"" S IOP=ACRZIS(2) D ^%ZIS G:POP>0 PHEAD U IO
 .N DXS,DIP,DC,DN
 .S D0=ACRDOCDA
 .S ACRREFDA=$P(ACRDOC0,U,13)
 .S ACRREF=$P(^AUTTDOCR(ACRREFDA,0),U)
 .S:'$D(ACRREFX) ACRREFX=ACRREF
 .W @IOF
 .I $D(ACRPQT) D ^ACRPQH I 1
 .I '$D(ACRPQT) D
 ..D ^ACRPRQH:ACRREFX=116!(ACRREFX=101)
 ..D ^ACRPTOH:ACRREFX=130
 ..D ^ACRPSH:ACRREFX=103
 ..I ACRREFX=349!(ACRREFX=326),$D(ACRORIGF),+$G(ACRPSC) D
 ...N X
 ...S X="HEAD^ACRF"_+ACRPSC_2
 ...D @X
 K ACRPHEAD
 Q
QUAN ;EP;TO PRINT QUANTITY DISCOUNT
 I $P(ACRDOCPO,U,19),$P(ACRDOCPO,U,20)]"" D
 .S ACRQDP=$P(ACRDOCPO,U,19)
 .S ACRQD=$P(ACRDOCPO,U,20)
 .S ACRQDT=$S(ACRSSTOT<ACRQDP:0,1:ACRQDP/100*ACRSSTOT)
 .I ACRQDT'=$P($G(^ACRDOC(ACRDOCDA,13)),U,8) D
 ..S DA=ACRDOCDA
 ..S DIE="^ACRDOC("
 ..S DR="103921////"_ACRQDT
 ..D DIE^ACRFDIC
 .W !,"QUANTITY DISCOUNT: ",$P(ACRQDP,U),"% if TOTAL > ",$FN(ACRQD,"P",2)
 .W !?39,"DISCOUNT AMOUNT"
 .W ?57,$J($FN(ACRQDT,"P",2),10)
 .W !?40,"ADJUSTED TOTAL"
 .W ?57,$J($FN(ACRSSTOT-ACRQDT,"P",2),10)
 .K ACRQUIT,ACRQD,ACRQDP,ACRQDT
 Q
EXCEED ;EP;PRINT EXCEED ESTIMATE MESSAGE
 N ACRPER,ACRMAX
 S ACRPER=$P(^ACRSYS(1,"DT"),U,19)
 S ACRMAX=$P(^ACRSYS(1,"DT"),U,20)
 W !?3,"|"
 D W^ACRFSSD
 W !?3,"|The purchasing department is hereby authorized to exceed the"
 D W^ACRFSSD
 W !?3,"|estimate shown hereon by"
 W:ACRPER " ",ACRPER," percent "
 I ACRPER,ACRMAX W "but "
 I ACRMAX D
 .W "not more than $",$FN(ACRMAX,"P",2)
 .D W^ACRFSSD
 .W !?3,"|"
 W "without additional funding."
 D W^ACRFSSD
 Q
ASC ;EP;ADD ASC SURCHARGE
 Q
 Q:$P(^ACRDOC(ACRDOCDA,0),U,4)=35!($P(^(0),U,12))
 Q:$D(ACRREV)
 N X,Y,Z,ACRSURC,ACRQUIT
 Q:'$P($G(^ACRSYS(+$G(ACRADA),"DT1")),U,7)  S ACRSURC=$P(^("DT1"),U,7)
 S (X,Z)=0
 F  S X=$O(^ACRSS("C",ACRDOCDA,X)) Q:'X  D
 .S Y=$G(^ACRSS(X,"DESC"))
 .S Z=Z+$P(^ACRSS(X,"DT"),U,4)
 .I +^ACRSS(X,0)=999!(Y["ASC SURCHARGE") S ACRQUIT=X_U_$P(^ACRSS(X,"DT"),U,4)
 I $G(ACRQUIT) D  Q
 .S DA=+ACRQUIT
 .S DIE="^ACRSS("
 .S DR=(Z-$G(ACRQD)-$P(ACRQUIT,U,2))*(ACRSURC/100)
 .S DR="12////"_DR
 .D DIE^ACRFDIC
 S X=999
 S DIC="^ACRSS("
 S DIC(0)="L"
 S DIC("DR")=".02////"_ACRDOCDA_";.03////"_ACRDOCDA_";.04///"_ACROBJ_";.05////"_ACRCANDA_";.06////"_ACRLBDA_";.07////"_ACRDOCDA_";.2////"_ACRDOCDA_";5////SURCHARGE;10////1;11///EACH"
 S DIC("DR")=DIC("DR")_";12////"_(Z-$G(ACRQD)-$P($G(ACRQUIT),U,2))*(ACRSURC/100)_";100////ASC SURCHARGE"
 D FILE^ACRFDIC
 K ACRSURC
 Q