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

ACRFSS.m

Go to the documentation of this file.
ACRFSS ;IHS/OIRM/DSD/THL,AEF - DISPLAY AND EDIT SERVICES/SUPPLIES;  [ 01/31/2007  9:55 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**5,22**;NOV 05, 2001
 ;;ROUTINE TO DISPLAY AND EDIT SERVICES/SUPPLIES AND TRAVEL ORDER AND
 ;;TRAINING REQUEST INFORMATION
EN N ACRI
 K ACRQUIT,DR,ACRSSDR
 S:'$D(ACRTXDA) ACRTXDA=$P(ACRDOC0,U,4)
 I ACRREF=130!(ACRREF=148)!(ACRREF=600) D  Q
 .D ^ACRFSS3
 .D EXIT
 I ACRREF=999 D  Q
 .D ^ACRFSS6
 .D EXIT
 F  D EN1 Q:$D(ACRQUIT)!$D(ACROUT)!$D(ACRREV)!$D(ACROUT)
 I $D(ACRPO),'$D(ACROUT) D
 .N ACRX
 .S ACRX=0
 .F  S ACRX=$O(ACRSS(ACRX)) Q:'ACRX  D
 ..S ACRSSDA=$P(ACRSS(ACRX),U)
 ..I $P(^ACRSS(ACRSSDA,0),U,12)]"" K ACRSS(ACRX)
 .S (ACRK,ACRX)=0
 .F  S ACRX=$O(ACRSS(ACRX)) Q:'ACRX  S ACRK=ACRK+1
 .I ACRK>1 D  Q:Y'=1
 ..S DIR(0)="YO"
 ..S DIR("A")="Add these ITEMS to the STANDARD ITEM FILE"
 ..S DIR("B")="NO"
 ..W !
 ..D DIR^ACRFDIC
 .N ACRX
 .S ACRX=0
 .F  S ACRX=$O(ACRSS(ACRX)) Q:'ACRX  D
 ..S ACRSSDA=+ACRSS(ACRX)
 ..Q:$P(^ACRSS(ACRSSDA,0),U,12)]""
 ..S DIR(0)="YO"
 ..S DIR("A")="Add ITEM NO. "_ACRX_" to the STANDARD ITEM FILE"
 ..S DIR("B")="NO"
 ..W !
 ..D DIR^ACRFDIC
 ..Q:Y'=1
 ..D ADD^ACRFSTOK
 ..S DA=ACRSSDA
 ..S DIE="^ACRSS("
 ..S DR=".12////"_ACRITMDA
 ..D DIE^ACRFDIC
EXIT I $D(ACRSSTOT),$P(ACROBL0,U)'=ACRSSTOT D
 .W !
 .D WAIT^DICD:$E($G(IOST),1,2)="C-"
 .D EX
 D EXIT^ACRFSSA
 Q
EN1 I $D(ACRPO),'$D(^ACRSS("C",ACRDOCDA)),'$D(^ACRSS("J",ACRDOCDA)) D  Q
 .W !!,"NO ITEMS ORDERED ON THIS REQUEST."
 .H 2
 .S ACRQUIT=""
 I $D(^ACRSS("C",ACRDOCDA))!$D(^ACRSS("J",ACRDOCDA)) D
 .N ACRSJ
 .D DISPLAY^ACRFSS12
 .D SELECT
 I '$D(ACRREV),'$D(ACRPO),'$D(^ACRSS("C",ACRDOCDA)) D  Q:$D(ACRQUIT)!$D(ACROUT)
 .S ACRJ=0
 .S ACRDOCVN=$P(ACRDOCPO,U,5)
 .W @IOF
 .W !?20,"ADD ITEMS TO THIS REQUEST"
 .W !!
 .D ORDER^ACRFSS11
 I '$D(ACRREV),'$D(ACRPO) D
 .Q:"^103^349^326^210^"[(U_$G(ACRREFX)_U)
 .Q:$P(^ACRDOC(ACRDOCDA,0),U,4)=35&($E($G(^ACROBL(ACRDOCDA,"APV")))="A")
 .Q:$G(ACRAPVT)=31!($G(ACRAPVT)=6)
 .D ^ACRFSCHK
 Q
SELECT D ^ACRFSSPO
 D CHECK^ACRFWARN
 Q:$D(ACROUT)
 I $$REQTP^ACRFSSU(ACRDOCDA)["CREDIT CARD" D     ;ACR*2.1*5.17
 .;I ACRSSTOT>2500 D CHECKCC^ACRFWARN(ACRSSTOT)   ;ACR*2.1*5.17 ;ACR*2.1*22.06 IM23064
 .I ACRSSTOT>3000 D CHECKCC^ACRFWARN(ACRSSTOT)  ;ACR*2.1*22.06 IM23064
 Q:$D(ACROUT)                                    ;ACR*2.1*5.17
 I $D(ACRREV),$E(IOST,1,2)="C-" Q
 I $D(ACRPO),ACRJ<1 S ACRQUIT="" H 2 Q
SELECT1 I '$D(ACRPO) D
 .S DIR(0)="SO^1:Edit an item;2:Add a new item;3:Delete an item;4:View item ADDITIONAL DESCRIPTION;5:Item Entry Completed"
 .S:$G(ACRPOT)>2500 DIR(0)=DIR(0)_";6:Add Cost Comparison Data"
 .I $P(^ACRDOC(ACRDOCDA,0),U,19),$P(^ACRDOC(ACRDOCDA,"PO"),U,5)=$P($G(^ACRSYS(1,"DT1")),U,12),$P($G(^ACRDOC(ACRDOCDA,"REQ2")),U,13)]"",$D(^ACRSUP("B",$P(^("REQ2"),U,13))) D
 ..I $G(ACRPOT)>2500 S DIR(0)=DIR(0)_";7:"
 ..E  S DIR(0)=DIR(0)_";6:"
 ..S DIR(0)=DIR(0)_$S('$P($G(^ACRDOC(ACRDOCDA,"REQ2")),U,14):"Import Supply Contract Data",1:"Edit Unit of Issue/Object Code")
 ..S ACRSUPC=$P($G(^ACRDOC(ACRDOCDA,"REQ2")),U,14) ;CONTROL UPDATE OF SUPPLY CONTRACT DATA FOR SELECTED DOCUMENT
 I $D(ACRPO) D
 .S DIR(0)="SO^1:Edit an item;2:Add NEW or Standard item;3:Delete an item;4:View item ADDITIONAL DESCRIPTION;5:Item Edit Completed;6:Transfer an item"
 .S:$G(ACRPOT)>2500 DIR(0)=DIR(0)_";7:Add Cost Comparison Data"
 I $G(ACRAPVT)=31!($G(ACRAPVT)=6) D
 .S DIR(0)="SO^1:Edit an item;5:Item Entry Completed"
 S DIR(0)=DIR(0)_";OUT:Discontinue Processing "_$S('$D(ACRPO):"Request",1:"PO")
 S DIR("A")="    Option"
 S DIR("B")=5
 D DIR^ACRFDIC
 Q:$D(ACRQUIT)!$D(ACROUT)
 I Y=1 D EDIT^ACRFSS1 Q
 I Y=2 D ORDER^ACRFSS11 K ACRQUIT Q
 I Y=3 D DELETE^ACRFSS2 K ACRQUIT Q
 I Y=4 D VIEW^ACRFSS2 K ACRQUIT Q
 I Y=6,$D(ACRPO) D TRANS^ACRFSS2 Q
 I Y=6,'$D(ACRPO),'$D(ACRSUPC) D EDIT^ACRFSS2 Q
 I Y=7,'$D(ACRSUPC) D EDIT^ACRFSS2 Q
 I Y=6!(Y=7),$D(ACRSUPC) D PVENDOR Q
 I Y=5 S ACRQUIT="" Q
 I Y="OUT",'$D(ACRPO),'$D(ACRPOA) S ACROUT=""
 Q
OBL ;EP;TO TRIGGER THE REQUEST APPROVED AND/OR REQUEST AUTHORIZED FIELD(S)
 ;IN THE FMS SUPPLIES/SERVICES FILE TO UPDATE THE REQUESTED AND
 ;OBLIGATED AMOUNTS
 S ACRDA=0
 F  S ACRDA=$O(^ACRSS("J",ACRDOCDA,ACRDA)) Q:'ACRDA  D
 .S DA=ACRDA
 .S DIE="^ACRSS("
 .S DR="905////A"
 .I "^103^349^326^210^600^148^"[(U_ACRREF_U) S DR=DR_";911///A"
 .I ACRREF=204,$P(^ACRDOC(ACRDOCDA,0),U,4)=30 S DR=DR_";911///A"
 .I ACRREF=116,$P(^ACRDOC(ACRDOCDA,0),U,4)=35 S DR=DR_";911///A"
 .I $P(^ACRDOC(ACRDOCDA,0),U,19),$D(^ACRDOC($P(^(0),U,19),0)),$P(^(0),U,20) S DR=DR_";911///A"
 .D DIE^ACRFDIC
 .D TRANS
 Q
EX Q:'$P(^ACRSYS(1,"DT"),U,99)
 S DA=ACRDOCDA
 S DIE="^ACROBL("
 S DR=".01///"_(ACRSSTOT-$G(ACRQD))
 S:$D(ACRVENDA) DR=DR_";100////"_ACRVENDA
 D DIE^ACRFDIC
 S DA=$O(^ACRTRX("AC",ACRDOCDA,"O",0))
 S DIE="^ACRTRX("
 S DR="10////"_(ACRSSTOT-$G(ACRQD))
 D DIE^ACRFDIC
 Q
DISPLAY ;EP;
 D DISPLAY^ACRFSS12
 Q
TRANS ;EP;TO SET THE DOCUMENT FILE MULTIPLE FOR ITEMS TRANSFERRED TO
 ;ANOTHER DOCUMENT
 Q:$D(^ACRSS("C",ACRDOCDA,ACRDA))
 Q:$P(^ACRSS(ACRDA,0),U,2)=ACRDOCDA
 S DA(1)=$P(^ACRSS(ACRDA,0),U,2)
 Q:$D(^ACRDOC(DA(1),31,"B",ACRDOCDA))
 S X=ACRDOCDA
 S DIC="^ACRDOC("_DA(1)_",31,"
 S DIC(0)="L"
 S:'$D(^ACRDOC(DA(1),31,0)) ^ACRDOC(DA(1),31,0)="^9002196.031P"
 D FILE^ACRFDIC
 Q
PVENDOR ;PRIME VENDOR OPTIONS
 ;IF PRIME VENDOR DATA HAS NOT BEEN IMPORTED FOR THIS DOCUMENT, IMPORT
 I '$G(ACRSUPC) D  Q
 .K ACRSUPC
 .S ACR1=$P($G(^ACRDOC(ACRDOCDA,"REQ2")),U,13)
 .I ACR1="" K ACRSUPC Q
 .S DIR(0)="YO"
 .S DIR("A")="Update Items from Contractor Data"
 .W !
 .D DIR^ACRFDIC
 .Q:$G(Y)'=1
 .D DOC^ACRFPVEN
 ;IF PRIME VENDOR DATA HAS BEEN IMPORTED ALLOW EDIT OF UNIT OF ISSUE
 ;AND OBJECT CODE
 N ACRSSDA
 S ACRSSDA=0
 F  S ACRSSDA=$O(^ACRSS("J",ACRDOCDA,ACRSSDA)) Q:'ACRSSDA!$D(ACRQUIT)  D
 .S DA=ACRSSDA
 .S DIE="^ACRSS("
 .S DR=".04T;11T"
 .W !
 .D DIE^ACRFDIC
 .K ACRQUIT
 .S DIR(0)="YO"
 .S DIR("A")="Edit next item......"
 .S DIR("B")="YES"
 .D DIR^ACRFDIC
 .I $G(Y)'=1 S ACRQUIT="" Q
 Q