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

ACRFPO1.m

Go to the documentation of this file.
ACRFPO1 ;IHS/OIRM/DSD/THL,AEF - PURCHASE ORDER PROCESSING;  [ 1/31/2007   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGT SYSTEM;**19,22**;NOV 05, 2001
 ;;CONTINUATION OF ACRFPO
ASSIGN ;EP;
 K ACRAPDA
 Q:$D(ACRQUIT)!$D(ACROUT)!(+Y<1)
 S ACRREFX=116
 S ACRREQST=""
 D ACCEPT
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 W !
 S DIR(0)="YO"
 S DIR("A")="Print the Requisition now"
 S DIR("B")="NO"
 D DIR^ACRFDIC
 Q:$D(ACROUT)
 K ACRQUIT
 I Y=1 D PR^ACRFEA42
 K ACRREQST
 Q:$D(ACROUT)
 S DIR(0)="YO"
 S DIR("A")="Is this procurement within our purchasing authority"
 S DIR("B")="YES"
 W !
 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 I ACRY'=1 D  Q
 .S DA=ACRDOCDA
 .S DIE="^ACRDOC("
 .S DR=".08T;.4T"
 .D DIE^ACRFDIC
 .S ACRPS=$P(^ACRDOC(ACRDOCDA,"PA"),U,3)
 .;S ACRPS=$P($P($P(^VA(200,ACRPS,0),U),",",2)," ")_" "_$P($P(^(0),U),",")  ;ACR*2.1*19.02 IM16848
 .S ACRPS=$$NAME3^ACRFUTL1(ACRPS)  ;ACR*2.1*19.02 IM16848
 .W !!,"Document ",ACRDOC," transferred to ",ACRPS
 .W !,"for assignment and processing."
 .W !
 .D PAUSE^ACRFWARN
 S DIR(0)="SO^1:Purchase Order;2:Award/Contract (SF 26);3:Solicitation, Offer and Award (SF 33);4:Solicitation/Contract/Order for Commercial Items (SF 1449);5:Tribal Contract"
 S DIR("A")="Type of procurement action"
 S DIR("?")="Indicate the type of procurement action to be taken."
 W !
 I 0 D DIR^ACRFDIC
 I $D(ACRQUIT)!$D(ACROUT) K ACRQUIT Q
 S DA=ACRDOCDA
 S DIE="^ACRDOC("
 S DR=".24///"_$S(ACRY=1:"@",1:(ACRY-1))_";.13///"_$S(ACRY=1:"103",ACRY=5:"326",1:"349")
 S DR=".24///@;.13///103"
 D DIE^ACRFDIC
 W !!,"Assign ",ACRDOC," to:"
 S ACRPA=+$G(^ACRDOC(ACRDOCDA,"PA"))
 S DA=ACRDOCDA
 S DIE="^ACRDOC("
 S DR=".2T;103960T;20T"
 D DIE^ACRFDIC
 I +$G(^ACRDOC(ACRDOCDA,"PA")),+^("PA")'=ACRPA D
 .D NOW^%DTC
 .S X=%
 .S DIC(0)="L"
 .S DIC="^ACRDOC("_ACRDOCDA_",11,"
 .S DA(1)=ACRDOCDA
 .S DIC("DR")=".02////"_ACRPA_";.03////"_DUZ
 .S:'$D(@(DIC_"0)")) ^ACRDOC(ACRDOCDA,11,0)="^9002196.0111D"
 .D FILE^ACRFDIC
 Q
ACCEPT ;EP;
 S DIR(0)="SO^1:Accept Requisition;2:Send Message to Requestor;3:Return Requisition for Resubmission"
 S DIR("B")="Accept Requisition"
 W !
 D DIR^ACRFDIC
 I ACRY=2 D
 .S ACRAPDAS=""
 .D XMY^ACRFXMY
 .S (ACRY,Y)=2
 I ACRY=3 D  Q
 .D REACT^ACRFEA4
 .I ACRY=1 D
 ..S ACRAPDAS="R"
 ..D XMY^ACRFXMY
 ..W !,ACRDOC," resubmitted for change/clarification."
 ..D PAUSE^ACRFWARN
 ..S ACRQUIT="",Y=-1
 ..I $P(^ACRDOC(ACRDOCDA,0),U,4)=35,$P(^(0),U,7),$P(^(0),U,7)'=35 D
 ...S DA=ACRDOCDA
 ...S DIE="^ACRDOC("
 ...S DR=".04////"_$P(^ACRDOC(ACRDOCDA,0),U,7)
 ...D DIE^ACRFDIC
 Q
PRINT ;EP;TO PRINT PURCHASE ORDER
 F  D P1 Q:$D(ACRQUIT)!$D(ACROUT)
 K ACRQUIT,ACRPPO
 Q
P1 I '$D(ACRREQST) D
 .S DIC("S")="S ACRAPV=$G(^ACROBL(+Y,""APV"")),ACRREFZ=$P(^ACRDOC(+Y,0),U,13),ACRREFZ=$P($G(^AUTTDOCR(+ACRREFZ,0)),U)"
 .S DIC("S")=DIC("S")_" I ""^103^210^349^326^""[(U_ACRREFZ_U)!(ACRREFZ=116&($P(^ACRDOC(+Y,0),U,4)=35)!($P(^(0),U,12))),$E(ACRAPV)=""A"""
 D LOOKUP^ACRFPO3
 K ACRREFZ,ACRAPV
 Q:$D(ACRQUIT)!$D(ACROUT)
 D PSC:$D(ACRPPO)
 Q:$D(ACRQUIT)!$D(ACROUT)
 D PRINT^ACRFSHIP:ACRREFX'=349
 I '$D(ACRRR)#2,'$P(ACRDOC0,U,19) D  Q:$D(ACROUT)
 .D ^ACRFSSPO
 .;Q:ACRPOTOT<2500.999                 ;ACR*2.1*22.06 IM23064
 .Q:ACRPOTOT<3000.999                  ;ACR*2.1*22.06 IM23064
 .N X
 .S X=$P($G(^ACRDOC(ACRDOCDA,13)),U,5,6)
 .Q:$L(X)=1
 .S DIR(0)="YO"
 .S DIR("A")="Include Cost Comparison"
 .S DIR("B")="NO"
 .W !
 .D DIR^ACRFDIC
 .S:Y=1 ACRCOST=""
 .Q:$D(ACROUT)
P11 ;EP;FOR RECEIVING REPORT PRINT
 N ACRPAGE                             ;ACR*2.1*22.01 IM22636
 I $D(ACRRR)#2!($D(ACRIV)#2) D  Q:$D(ACRQUIT)!$D(ACROUT)!'$G(ACRRRNO)
 .D RRNO^ACRFRRPT
 .Q:$D(ACRQUIT)!$D(ACROUT)!'$D(ACRRRNO)
 .Q:'ACRRRNO
 .S (ACRREF,ACRREFX)=499
 I $D(ACRFEDS) D
 .S (ACRREF,ACRREFX)=210
 .S:$P($G(^ACRDOC(ACRDOCDA,3)),U,17)=1 ACR3542=""
 D TSKVAR^ACRFPRNT
 S ACRRTN="^ACRFQ"
 D ^ACRFZIS
 K ACRQUIT,ACR3542,ACRPSC,ACRORIGF,ACRADJST
 Q
EDIT ;EP;
 S ACRENTRY=$T(@ACRENTRY^ACRFCTL1)
 S ACRPO=""
 K ACRPOA
 D SET^ACRFEA
 D ^ACRFEA4
 K ACRPRCS
 Q
AMEND ;EP;
 S DIC("S")="S ACRREF=$P(^ACRDOC(+Y,0),U,13),ACRREF=$P(^AUTTDOCR(ACRREF,0),U) I ""^116^103^349^326^210^148^""[(U_ACRREF_U),$D(^ACROBL(+Y,""APV"")),$P(^(""APV""),U,8)=""A"""
 D LOOKUP^ACRFPO3
 Q:$D(ACRQUIT)!$D(ACROUT)
 D NOW^%DTC
 S X=DUZ
 S DA(1)=ACRDOCDA
 S DIC="^ACRDOC("_DA(1)_",7,"
 S DIC(0)="L"
 S DIC("DR")=".02///"_%
 S:'$D(^ACRDOC(DA(1),7,0)) ^ACRDOC(DA(1),7,0)="^9002196.07"
 D FILE^ACRFDIC
 N ACRENTRY,ACRPO
 S ACRENTRY="PO",ACRPO=""
 D ^ACRFEA41:'$D(ACRCANCL)
 I $D(ACRCANCL) S ACRMCODE=4 D EN2^ACRFDEL
 Q
FEDSTRIP ;EP;TO PRINT FEDSTRIP ORDER
 S ACRFEDS=""
 D PRINT
 Q
ACRCANCL ;EP;TO SELECT APPROVED PURCHASE ORDER FOR CANCELLATION
 K ACRREQST
 N ACRPO,ACRENTRY,ACRCANCL
 S ACRENTRY="PO"
 S ACRCANCL=""
 S ACRPO=""
 D AMEND
 K ACRPRT
 Q
SPENT ;EP;TO ADJUST OBLIGATION WITH THE ACTUAL EXPENDITURE
 F  D S1 Q:$D(ACRQUIT)
 K ACRQUIT
 Q
S1 D LOOKUP^ACRFPO3
 Q:$D(ACRQUIT)
 S DA=ACRDOCDA
 S DIE="^ACRDOC("
 S DR="103200.1T;103200.2T"
 D DIE^ACRFDIC
 S DA=ACRDOCDA
 S DIE="^ACROBL("
 S DR="2FINAL PAYMENT AMOUNT"
 D DIE^ACRFDIC
 Q
MOD ;EP;PURCHASE AGENT OPTIONS
 W @IOF
 W !?20,"Purchasing Agent Options"
 K ACRPOA
 S ACRPO=""
 S DIR(0)="SO^1:Process Signed Requisition;2:Create Modification;3:Edit Pending Modification;4:Quit"
 D DIR^ACRFDIC
 I $D(ACROUT)!$D(ACRQUIT)!(123'[$G(Y)) S ACRQUIT="" Q
 I Y=1 D EN^ACRFPO S Y=1
 I Y=2 D M1 S Y=2
 I Y=3 D M2 S Y=3
 K ACRQUIT,ACRPPO,ACRPRT
 Q
M1 ;
 N ACRPO,ACRENTRY
 S ACRENTRY="OBLAMT"
 S ACRENTRY=$T(@ACRENTRY^ACRFCTL1)
 S ACRZY=""
 D SET^ACRFEA
 D A1^ACRFNEWD
 D A1^ACRFEA1:'$D(ACRQUIT)&$G(ACRAMEND)
 Q
M2 ;
 S DIC="^ACRDOC("
 S DIC(0)="AEMQZ"
 S DIC("A")="Edit Which Modification: "
 S D="B^C^G^J"
 S DIC("S")="S ACRXX=^ACRDOC(+Y,0),ACRAPV=$G(^ACROBL(+Y,""APV"")),ACRREF=$P(ACRXX,U,13),ACRREF=$P(^AUTTDOCR(ACRREF,0),U) I ""^116^204^210^""[(U_ACRREF_U),$P(ACRXX,U,15),$P(ACRAPV,U)="""""
 W !
 D MIX^ACRFDIC
 S:+Y<1 ACRQUIT=""
 Q:$D(ACRQUIT)!$D(ACROUT)
 S ACRDOCDA=+Y
 D SETDOC^ACRFEA1
 D ^ACRFEA41
 Q
PSC ;EP;DETERMINE WHICH PO TO PRINT
 K ACRPSC,ACRORIGF
 S Y=$P(^ACRDOC(ACRDOCDA,0),U,24)+1
 I +Y<1 K ACRPSC S ACRQUIT="" Q
 I +Y=1 S ACRPSC="347^50"
 I +Y=2 S ACRPSC="26^32"
 I +Y=3 S ACRPSC="33^33"
 I +Y=4 S ACRPSC="1449^32"
 I +Y=5 S ACRPSC="326^50" Q
 I Y'=1 D PSC1 Q
 ;PRINT ON BLANK PAPER OR PRE-PRINTED FORM
 S DIR(0)="SO^1:Print on blank paper;2:Print on Pre-printed form"
 S DIR("A")="Which print format"
 S DIR("B")=1
 W !
 D DIR^ACRFDIC
 Q:+Y'=2
PSC1 S ACRORIGF=""
 S DIR(0)="NO^0:2"
 S DIR("A")="Adjust TOP OF PAGE by (number of lines)"
 S DIR("B")=0
 W !
 D DIR^ACRFDIC
 I "012"'[Y S ACRQUIT="" Q
 S ACRADJST=Y
 Q