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

ACGSEDIT.m

Go to the documentation of this file.
ACGSEDIT ;IHS/OIRM/DSD/THL - EDIT CONTRACT/CONTRACT ACTION; [ 03/27/2000   2:22 PM ]
 ;;2.0t1;CONTRACT INFORMATION SYSTEM;;FEB 16, 2000
 ;;ROUTINE WHICH IS CALLED TO EDIT CONTRACT/CONTRACT ACTION
EN K ACGNEW
 F  D EDIT Q:$D(ACGQUIT)!$D(ACGOUT)
EXIT K ACG,ACGN,ACGJ,ACGI,ACGQUIT,ACGTOT,ACGFLDS,ACGFLDSS,ACGCNO,ACGRDA,ACGOUT,ACGXX
 Q
EDIT D VND^ACGSTAR1:'$D(ACGOUT)
 Q:$D(ACGQUIT)!$D(ACGOUT)!'$D(ACG5DA)
 F  D EDIT1 Q:$D(ACGQUIT)
 K ACGQUIT
 Q
EDIT1 ;EP;TO SELECT CONTRACT OR MODIFICATION TO EDIT
 Q:'$D(ACGCNO)
 W !!?13,"CONTRACT/",!,"NO.",?5,"TYPE",?11,"MODIFICATION",?30,"AMOUNT",!,"---",?5,"----",?11,"--------------",?27,"------------  --------------------------------------"
 S (ACG,ACGJ,ACGTOT)=0
 F  S ACG=$O(^ACGS("C",ACGCNO,ACG)) Q:'ACG  I $D(^ACGS(ACG,0)),$D(^("DT")) S ACGDT=^("DT") D
 .S ACGJ=ACGJ+1,ACGXX($P(ACGDT,U,2),ACGJ)=ACG
 S ACG="",ACGI=0
 F  S ACG=$O(ACGXX(ACG)) Q:ACG=""  D
 .S ACGJ=0
 .F  S ACGJ=$O(ACGXX(ACG,ACGJ)) Q:'ACGJ  S ACGI=ACGI+1,ACG(ACGI-1)=ACGXX(ACG,ACGJ)
 K ACGXX
 S ACGI=""
 F  S ACGI=$O(ACG(ACGI)) Q:ACGI=""  D
 .S ACGJ=ACGI
 .S ACG=+ACG(ACGI)
 .Q:'ACG
 .S ACGN=+^ACGS(ACG,0)
 .I ACGN'=ACGJ,"^6^15^17^"'[(U_+^ACGS(ACG,"DT")_U) D COUNT
 .D WEC
 .I ACGJ>1,ACGJ#20=0 D HOLD^ACGSMENU
 I ACGJ<0 W !!,"NO CONTRACT ACTIONS ON FILE FOR THIS CONTRACT" S ACGQUIT="" D HOLD^ACGSMENU Q
 W !?27,"------------",!?18,"TOTAL:",?27,$J($FN(ACGTOT,"P",0),12),!
 I $D(ACGNEW) K ACGNEW Q
 I ACGJ=0 S Y=0 D E1 S ACGQUIT="" Q
 S DIR(0)="NO^0:"_ACGJ,DIR("A")="Which one"
 D DIR^ACGSDIC
 Q:$D(ACGQUIT)!(Y<0)
E1 Q:'$D(ACG(Y))
 S ACGRDA=ACG(Y),(ACGFLDS,ACGFLDSS)=$P(^ACGTPA($P(^ACGS(ACGRDA,"DT"),U),0),U)
 I '$D(ACGFY),'ACGFY S ACGFY=91
 I $P(^ACGS(ACGRDA,0),U,4)'="" W *7,*7,!!,"THIS RECORD HAS ALREADY BEEN EXPORTED AND CANNOT BE EDITED" Q
 I $D(ACGDELET) D  Q
 .I $P(^ACGS(ACGRDA,0),U,3)=ACGRDA W *7,*7,!!,"ORIGINAL CONTRACT ACTION CANNOT BE DELETED." Q
 .S ACG=ACGRDA D WEC S DIR(0)="YO",DIR("A")="Sure you want to delete this modification",DIR("B")="NO" W ! D DIR^ACGSDIC Q:$D(ACGQUIT)!(+Y'=1)  S DA=ACGRDA,DIK="^ACGS(" D ^DIK
 D ^ACGSCS
 Q
COUNT S ACG2=$P(^ACGS(ACG,"DT"),U,2),DIE="^ACGS(",DA=ACG,DR=".01////"_ACGJ S:$E(ACG2,$L(ACGJ),$L(ACG2))'=ACGJ ACG2=$E(ACG2,1,$L(ACG2)-$L(ACGJ))_ACGJ,DR=DR_";2////"_ACG2_";1099////"_DT D DIE^ACGSDIC
 Q
WEC Q:'$D(^ACGS(ACG,"DT"))!'$D(^("DT1"))
 S ACGDT=^ACGS(ACG,"DT"),ACGDT1=^("DT1")
 W !,ACGJ,?6,$P(^ACGTPA(+ACGDT,0),U),?11,$S("^15^17^"'[(U_+ACGDT_U):$P(^ACGS(ACG,"DT"),U,2),1:$P(^ACGS(ACG,"SP"),U)),?27,$J($FN($P(ACGDT1,U,5),"P",0),12),?41,$S("^15^17^"'[(U_+ACGDT_U):$E($P(ACGDT1,U),1,38),1:"SMALL PURCHASE")
 S ACGTOT=ACGTOT+$P(^ACGS(ACG,"DT1"),U,5)
 ;PATCH XX
 Q