ACGSVEND ;IHS/OIRM/DSD/THL - ADD/EDIT VENDORS; [ 03/27/2000 2:22 PM ]
;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
;;ROUTINE TO ADD AND EDIT VENDOR DATA
EN ;EP;TO ADD OR EDIT CIS VENDOR
S AUTEDIT=""
D ADD^AUTTVLK
Q
EN4 ;EP;
Q:'$G(Y)
N ACGY
S (ACGDA,ACGD0)=+Y,ACGY=$P(Y,U,3),ACGVENAM=$P(^AUTTVNDR(+Y,0),U)
F D EN2 Q:$D(ACGQUIT)
K ACGQUIT
Q
EN2 G:ACGY=1 EN3
D VND
S DIR(0)="YO",DIR("A")="Edit VENDOR DATA",DIR("B")="NO"
W !
D DIR^ACGSDIC
I Y'=1 S ACGQUIT="" Q
EN3 S ACGY="",DIE="^AUTTVNDR(",DA=ACGDA,DR="[AUT VENDOR EDIT]"
W !!
S DY=18,DX=0,ACGDDIE="VND^ACGSVEND",ACGMESS=ACGVENAM
D DIE^ACGSDIC
I $D(ACGCWIN) X ACGCWIN
K ACGDDIE,ACGMESS,DX,DY
Q
VND ;EP;TO PRINT CIS VENDOR DATA
W:$D(IOF) @IOF
W ?9,@ACGON,"VENDOR",@ACGOF," DATA FOR: ",@ACGON,ACGVENAM,@ACGOF,!
K DXS,DIP,DC
S D0=ACGD0
D ^ACGPVND
K DXS,DIP,DC
Q
SP ;XEP;TO ADD OR EDIT A SMALL PURCHASE VENDOR
F D SP1 Q:$D(ACGQUIT)
SPEXIT K ACGVENAM,ACGDA,ACGD0
Q
SP1 K ACGY,X
D TITLE^ACGSMENU
W !!?28,"ADD OR EDIT SMALL PURCHASE VENDOR DATA"
S (DIC,DIE)="^AUTTVNDR(",DIC(0)="AELMQZ",DIC("A")="VENDOR..............: ",DIC("DR")="",DLAYGO=9999999.11
W !!!?21,"|" F ACGI=1:1:30 W "="
W "|"
D DIC^ACGSDIC
I U[$E(X)!(+Y<1) S ACGQUIT="" Q
SP4 ;EP;
Q:'$G(Y)
N ACGY
S (ACGDA,ACGD0)=+Y,ACGY=$P(Y,U,3),ACGVENAM=$P(^AUTTVNDR(+Y,0),U)
F D SP2 Q:$D(ACGQUIT)
K ACGQUIT
Q
SP2 G:ACGY=1 SP3
D SPD
S DIR(0)="YO",DIR("A")="Edit VENDOR DATA",DIR("B")="NO"
W !
D DIR^ACGSDIC
I Y'=1 S ACGQUIT="" Q
SP3 S ACGY="",DIE="^AUTTVNDR(",DA=ACGDA,DR="[AUT SMALL PURCHASE VENDOR]"
W !
D DIE^ACGSDIC
Q
TOB K ACGQUIT
S DIR(0)="SO^A1:Small Business Concern;A2:Large Business Concern;A3:Domestic Outside U.S./Foreign;A4:Other Entity",DIR("A")="TYPE OF BUSINESS...."
I $P(^AUTTVNDR(ACGDA,11),U,26)'="" S ACG1126=$P(^(11),U,26),DIR("B")=$S(ACG1126<4:"A1",ACG1126=4!(ACG1126=5):"A2",1:"A1")
E S DIR("B")="A1"
D DIR^ACGSDIC
I $D(ACGQUIT)!(X="") W !!,*7,"TYPE OF BUSINESS required" G TOB
S ACG1126=Y
TOV K ACGQUIT
S DIR(0)="SO^1:Small Disadvantages Business;2:Woman-Owned Small Business;3:Sheltered Workshop;4:UNICOR;5:Other",DIR("A")="TYPE OF VENDOR......"
I $P(^AUTTVNDR(ACGDA,11),U,15)'="",$P(^(11),U,15)=1 S DIR("B")=2
E I $P(^AUTTVNDR(ACGDA,11),U,26)'="" S ACG1115=$P(^(11),U,26),DIR("B")=$S(ACG1115=1:1,ACG1115=10:3,1:5)
E S DIR("B")=5
D DIR^ACGSDIC
I $D(ACGQUIT)!(X="") W !!,*7,"TYPE OF VENDOR required" G TOV
S ACG1115=Y
S DA=ACGDA,DIE="^AUTTVNDR(",DR="1115////"_$S(ACG1115=2:1,1:2)_";1126////"_$S(ACG1115=1:1,ACG1115=3!(ACG1115=4):10,ACG1126="A2"!(ACG1126="A4"):5,1:3)
D DIE^ACGSDIC
Q
SPD ;EP;TO PRINT SMALL PURCHASE VENDOR DATA
W:$D(IOF) @IOF
W ?9,@ACGON,"VENDOR",@ACGOF," DATA FOR: ",@ACGON,ACGVENAM,@ACGOF,!!
K DXS,DIP,DC
S D0=ACGD0
D ^ACGPSPD
K DXS,DIP,DC
Q
DIC D ^DIC K DIC,DA,DD,DR,DINUM Q
DIE L +@(DIE_DA_")"):4
I '$T W !!,"Entry being edited. Try Later." H 2 Q
D ^DIE
L -@(DIE_DA_")"):0
K DIE,DA,DR
Q
DIR D ^DIR S:$D(DIRUT) ACGQUIT="" K DIR,DIRUT,DUOUT,DTOUT Q
ACGSVEND ;IHS/OIRM/DSD/THL - ADD/EDIT VENDORS; [ 03/27/2000 2:22 PM ]
+1 ;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
+2 ;;ROUTINE TO ADD AND EDIT VENDOR DATA
EN ;EP;TO ADD OR EDIT CIS VENDOR
+1 SET AUTEDIT=""
+2 DO ADD^AUTTVLK
+3 QUIT
EN4 ;EP;
+1 IF '$GET(Y)
QUIT
+2 NEW ACGY
+3 SET (ACGDA,ACGD0)=+Y
SET ACGY=$PIECE(Y,U,3)
SET ACGVENAM=$PIECE(^AUTTVNDR(+Y,0),U)
+4 FOR
DO EN2
IF $DATA(ACGQUIT)
QUIT
+5 KILL ACGQUIT
+6 QUIT
EN2 IF ACGY=1
GOTO EN3
+1 DO VND
+2 SET DIR(0)="YO"
SET DIR("A")="Edit VENDOR DATA"
SET DIR("B")="NO"
+3 WRITE !
+4 DO DIR^ACGSDIC
+5 IF Y'=1
SET ACGQUIT=""
QUIT
EN3 SET ACGY=""
SET DIE="^AUTTVNDR("
SET DA=ACGDA
SET DR="[AUT VENDOR EDIT]"
+1 WRITE !!
+2 SET DY=18
SET DX=0
SET ACGDDIE="VND^ACGSVEND"
SET ACGMESS=ACGVENAM
+3 DO DIE^ACGSDIC
+4 IF $DATA(ACGCWIN)
XECUTE ACGCWIN
+5 KILL ACGDDIE,ACGMESS,DX,DY
+6 QUIT
VND ;EP;TO PRINT CIS VENDOR DATA
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE ?9,@ACGON,"VENDOR",@ACGOF," DATA FOR: ",@ACGON,ACGVENAM,@ACGOF,!
+3 KILL DXS,DIP,DC
+4 SET D0=ACGD0
+5 DO ^ACGPVND
+6 KILL DXS,DIP,DC
+7 QUIT
SP ;XEP;TO ADD OR EDIT A SMALL PURCHASE VENDOR
+1 FOR
DO SP1
IF $DATA(ACGQUIT)
QUIT
SPEXIT KILL ACGVENAM,ACGDA,ACGD0
+1 QUIT
SP1 KILL ACGY,X
+1 DO TITLE^ACGSMENU
+2 WRITE !!?28,"ADD OR EDIT SMALL PURCHASE VENDOR DATA"
+3 SET (DIC,DIE)="^AUTTVNDR("
SET DIC(0)="AELMQZ"
SET DIC("A")="VENDOR..............: "
SET DIC("DR")=""
SET DLAYGO=9999999.11
+4 WRITE !!!?21,"|"
FOR ACGI=1:1:30
WRITE "="
+5 WRITE "|"
+6 DO DIC^ACGSDIC
+7 IF U[$EXTRACT(X)!(+Y<1)
SET ACGQUIT=""
QUIT
SP4 ;EP;
+1 IF '$GET(Y)
QUIT
+2 NEW ACGY
+3 SET (ACGDA,ACGD0)=+Y
SET ACGY=$PIECE(Y,U,3)
SET ACGVENAM=$PIECE(^AUTTVNDR(+Y,0),U)
+4 FOR
DO SP2
IF $DATA(ACGQUIT)
QUIT
+5 KILL ACGQUIT
+6 QUIT
SP2 IF ACGY=1
GOTO SP3
+1 DO SPD
+2 SET DIR(0)="YO"
SET DIR("A")="Edit VENDOR DATA"
SET DIR("B")="NO"
+3 WRITE !
+4 DO DIR^ACGSDIC
+5 IF Y'=1
SET ACGQUIT=""
QUIT
SP3 SET ACGY=""
SET DIE="^AUTTVNDR("
SET DA=ACGDA
SET DR="[AUT SMALL PURCHASE VENDOR]"
+1 WRITE !
+2 DO DIE^ACGSDIC
+3 QUIT
TOB KILL ACGQUIT
+1 SET DIR(0)="SO^A1:Small Business Concern;A2:Large Business Concern;A3:Domestic Outside U.S./Foreign;A4:Other Entity"
SET DIR("A")="TYPE OF BUSINESS...."
+2 IF $PIECE(^AUTTVNDR(ACGDA,11),U,26)'=""
SET ACG1126=$PIECE(^(11),U,26)
SET DIR("B")=$SELECT(ACG1126<4:"A1",ACG1126=4!(ACG1126=5):"A2",1:"A1")
+3 IF '$TEST
SET DIR("B")="A1"
+4 DO DIR^ACGSDIC
+5 IF $DATA(ACGQUIT)!(X="")
WRITE !!,*7,"TYPE OF BUSINESS required"
GOTO TOB
+6 SET ACG1126=Y
TOV KILL ACGQUIT
+1 SET DIR(0)="SO^1:Small Disadvantages Business;2:Woman-Owned Small Business;3:Sheltered Workshop;4:UNICOR;5:Other"
SET DIR("A")="TYPE OF VENDOR......"
+2 IF $PIECE(^AUTTVNDR(ACGDA,11),U,15)'=""
IF $PIECE(^(11),U,15)=1
SET DIR("B")=2
+3 IF '$TEST
IF $PIECE(^AUTTVNDR(ACGDA,11),U,26)'=""
SET ACG1115=$PIECE(^(11),U,26)
SET DIR("B")=$SELECT(ACG1115=1:1,ACG1115=10:3,1:5)
+4 IF '$TEST
SET DIR("B")=5
+5 DO DIR^ACGSDIC
+6 IF $DATA(ACGQUIT)!(X="")
WRITE !!,*7,"TYPE OF VENDOR required"
GOTO TOV
+7 SET ACG1115=Y
+8 SET DA=ACGDA
SET DIE="^AUTTVNDR("
SET DR="1115////"_$SELECT(ACG1115=2:1,1:2)_";1126////"_$SELECT(ACG1115=1:1,ACG1115=3!(ACG1115=4):10,ACG1126="A2"!(ACG1126="A4"):5,1:3)
+9 DO DIE^ACGSDIC
+10 QUIT
SPD ;EP;TO PRINT SMALL PURCHASE VENDOR DATA
+1 IF $DATA(IOF)
WRITE @IOF
+2 WRITE ?9,@ACGON,"VENDOR",@ACGOF," DATA FOR: ",@ACGON,ACGVENAM,@ACGOF,!!
+3 KILL DXS,DIP,DC
+4 SET D0=ACGD0
+5 DO ^ACGPSPD
+6 KILL DXS,DIP,DC
+7 QUIT
DIC DO ^DIC
KILL DIC,DA,DD,DR,DINUM
QUIT
DIE LOCK +@(DIE_DA_")"):4
+1 IF '$TEST
WRITE !!,"Entry being edited. Try Later."
HANG 2
QUIT
+2 DO ^DIE
+3 LOCK -@(DIE_DA_")"):0
+4 KILL DIE,DA,DR
+5 QUIT
DIR DO ^DIR
IF $DATA(DIRUT)
SET ACGQUIT=""
KILL DIR,DIRUT,DUOUT,DTOUT
QUIT