| 1 | PRCST22 ; ;10/27/00
|
---|
| 2 | D DE G BEGIN
|
---|
| 3 | DE S DIE="^PRCS(410,D0,""IT"",",DIC=DIE,DP=410.02,DL=2,DIEL=1,DU="" K DG,DE,DB Q:$O(^PRCS(410,D0,"IT",DA,""))=""
|
---|
| 4 | I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,1) S:%]"" DE(2)=% S %=$P(%Z,U,2) S:%]"" DE(11)=%,DE(18)=% S %=$P(%Z,U,3) S:%]"" DE(19)=% S %=$P(%Z,U,4) S:%]"" DE(9)=%,DE(15)=% S %=$P(%Z,U,5) S:%]"" DE(5)=% S %=$P(%Z,U,6) S:%]"" DE(20)=%
|
---|
| 5 | I S %=$P(%Z,U,7) S:%]"" DE(21)=%
|
---|
| 6 | K %Z Q
|
---|
| 7 | ;
|
---|
| 8 | W W !?DL+DL-2,DLB_": "
|
---|
| 9 | Q
|
---|
| 10 | O D W W Y W:$X>45 !?9
|
---|
| 11 | I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
|
---|
| 12 | W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
|
---|
| 13 | TR R X:DTIME E S (DTOUT,X)=U W $C(7)
|
---|
| 14 | Q
|
---|
| 15 | A K DQ(DQ) S DQ=DQ+1
|
---|
| 16 | B G @DQ
|
---|
| 17 | RE G PR:$D(DE(DQ)) D W,TR
|
---|
| 18 | N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
|
---|
| 19 | RD G QS:X?."?" I X["^" D D G ^DIE17
|
---|
| 20 | I X="@" D D G Z^DIE2
|
---|
| 21 | I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
|
---|
| 22 | T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
|
---|
| 23 | K DDER G X
|
---|
| 24 | P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
|
---|
| 25 | G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
|
---|
| 26 | I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
|
---|
| 27 | V D @("X"_DQ) K YS
|
---|
| 28 | Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
|
---|
| 29 | X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
|
---|
| 30 | S X="?BAD"
|
---|
| 31 | QS S DZ=X D D,QQ^DIEQ G B
|
---|
| 32 | D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
|
---|
| 33 | Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
|
---|
| 34 | PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
|
---|
| 35 | R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
|
---|
| 36 | I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
|
---|
| 37 | X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
|
---|
| 38 | RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
|
---|
| 39 | I I DV'["I",DV'["#" G RD
|
---|
| 40 | D E^DIE0 G RD:$D(X),PR
|
---|
| 41 | Q
|
---|
| 42 | SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
|
---|
| 43 | I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
|
---|
| 44 | D ^DIR I 'DDER S %=Y(0),X=Y
|
---|
| 45 | Q
|
---|
| 46 | SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
|
---|
| 47 | I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
|
---|
| 48 | E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
|
---|
| 49 | Q
|
---|
| 50 | NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
|
---|
| 51 | KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
|
---|
| 52 | BEGIN S DNM="PRCST22",DQ=1
|
---|
| 53 | 1 S DQ=2 ;@1
|
---|
| 54 | 2 S DW="0;1",DV="MRNJ3,0",DU="",DLB="LINE ITEM NUMBER",DIFLD=.01
|
---|
| 55 | S DE(DW)="C2^PRCST22"
|
---|
| 56 | S Y="1"
|
---|
| 57 | G Y
|
---|
| 58 | C2 G C2S:$D(DE(2))[0 K DB
|
---|
| 59 | S X=DE(2),DIC=DIE
|
---|
| 60 | K ^PRCS(410,DA(1),"IT","B",$E(X,1,30),DA)
|
---|
| 61 | S X=DE(2),DIC=DIE
|
---|
| 62 | K ^PRCS(410,DA(1),"IT","AB",$E(X,1,30),DA)
|
---|
| 63 | C2S S X="" Q:DG(DQ)=X K DB
|
---|
| 64 | S X=DG(DQ),DIC=DIE
|
---|
| 65 | S ^PRCS(410,DA(1),"IT","B",$E(X,1,30),DA)=""
|
---|
| 66 | S X=DG(DQ),DIC=DIE
|
---|
| 67 | S ^PRCS(410,DA(1),"IT","AB",$E(X,1,30),DA)=""
|
---|
| 68 | Q
|
---|
| 69 | X2 K:+X'=X!(X>999)!(X<1)!(X?.E1"."1N.N) X
|
---|
| 70 | Q
|
---|
| 71 | ;
|
---|
| 72 | 3 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 73 | X3 I $D(^PRCS(410,DA(1),3)),$P(^(3),"^",4),$D(^(2)),$P(^(2),"^",1)'="" S PRCSV=$P(^(3),"^",4)
|
---|
| 74 | Q
|
---|
| 75 | 4 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 76 | X4 I '$D(PRCSV) S Y=1
|
---|
| 77 | Q
|
---|
| 78 | 5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="0;5",DV="FX",DU="",DLB="ITEM MASTER FILE NO.",DIFLD=5
|
---|
| 79 | S DE(DW)="C5^PRCST22"
|
---|
| 80 | G RE
|
---|
| 81 | C5 G C5S:$D(DE(5))[0 K DB
|
---|
| 82 | S X=DE(5),DIC=DIE
|
---|
| 83 | K ^PRCS(410,DA(1),"IT","AG",$E(X,1,30),DA)
|
---|
| 84 | C5S S X="" Q:DG(DQ)=X K DB
|
---|
| 85 | S X=DG(DQ),DIC=DIE
|
---|
| 86 | S ^PRCS(410,DA(1),"IT","AG",$E(X,1,30),DA)=""
|
---|
| 87 | Q
|
---|
| 88 | X5 K:X[""""!($A(X)=45) X I $D(X) D ITEM^PRCSES1
|
---|
| 89 | I $D(X),X'?.ANP K X
|
---|
| 90 | Q
|
---|
| 91 | ;
|
---|
| 92 | 6 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 93 | X6 K PRCSSUB I X="" S Y=1
|
---|
| 94 | Q
|
---|
| 95 | 7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 96 | X7 S PRCSSUB=$S($D(^PRCD(420.1,+$S($D(^PRCS(410,DA(1),3)):$P(^(3),U,3),1:""),1,+$S($D(^PRC(441,+$S($D(^PRCS(410,DA(1),"IT",DA,0)):$P(^(0),U,5),1:""),0)):$P(^(0),U,10),1:""),0)):$P(^(0),U),1:"")
|
---|
| 97 | Q
|
---|
| 98 | 8 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 99 | X8 S X=$P($G(^PRCS(410,DA(1),3)),U,3) I X]"" S X=$$GETBOCNT^PRCSECP(PRC("SITE"),+PRC("CP"),+X) I (+X=1) S $P(^PRCS(410,DA(1),"IT",DA,0),U,4)=$P(X,U,2),Y="@44" W !,"BOC: ",$P(X,U,2)
|
---|
| 100 | Q
|
---|
| 101 | 9 D:$D(DG)>9 F^DIE17,DE S DQ=9,DW="0;4",DV="RFX",DU="",DLB="BOC",DIFLD=4
|
---|
| 102 | S DE(DW)="C9^PRCST22"
|
---|
| 103 | G RE
|
---|
| 104 | C9 G C9S:$D(DE(9))[0 K DB
|
---|
| 105 | S X=DE(9),DIC=DIE
|
---|
| 106 | K ^PRCS(410,"AD",$E(X,1,30),DA(1))
|
---|
| 107 | C9S S X="" Q:DG(DQ)=X K DB
|
---|
| 108 | S X=DG(DQ),DIC=DIE
|
---|
| 109 | S ^PRCS(410,"AD",$E(X,1,30),DA(1))=""
|
---|
| 110 | Q
|
---|
| 111 | X9 K:X[""""!($A(X)=45) X I $D(X) D SUB^PRCSES
|
---|
| 112 | I $D(X),X'?.ANP K X
|
---|
| 113 | Q
|
---|
| 114 | ;
|
---|
| 115 | 10 S DQ=11 ;@44
|
---|
| 116 | 11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="0;2",DV="RNJ9,2",DU="",DLB="QUANTITY",DIFLD=2
|
---|
| 117 | S DE(DW)="C11^PRCST22"
|
---|
| 118 | G RE
|
---|
| 119 | C11 G C11S:$D(DE(11))[0 K DB
|
---|
| 120 | S X=DE(11),DIC=DIE
|
---|
| 121 | X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N&(E'=DA) E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
|
---|
| 122 | C11S S X="" Q:DG(DQ)=X K DB
|
---|
| 123 | S X=DG(DQ),DIC=DIE
|
---|
| 124 | X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
|
---|
| 125 | Q
|
---|
| 126 | X11 K:+X'=X!(X>999999)!(X<.01)!(X?.E1"."3N.N) X
|
---|
| 127 | Q
|
---|
| 128 | ;
|
---|
| 129 | 12 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 130 | X12 S Y="@4"
|
---|
| 131 | Q
|
---|
| 132 | 13 D:$D(DG)>9 F^DIE17,DE S DQ=13,D=0 K DE(1) ;1
|
---|
| 133 | S Y="DESCRIPTION^W^^0;1^Q",DG="1",DC="^410.03" D DIEN^DIWE K DE(1) G A
|
---|
| 134 | ;
|
---|
| 135 | 14 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 136 | X14 S X=$P($G(^PRCS(410,DA(1),3)),U,3) I X]"" S X=$$GETBOCNT^PRCSECP(PRC("SITE"),+PRC("CP"),+X) I (+X=1) S $P(^PRCS(410,DA(1),"IT",DA,0),U,4)=$P(X,U,2),Y="@444" W !,"BOC: ",$P(X,U,2)
|
---|
| 137 | Q
|
---|
| 138 | 15 S DW="0;4",DV="RFX",DU="",DLB="BOC",DIFLD=4
|
---|
| 139 | S DE(DW)="C15^PRCST22"
|
---|
| 140 | G RE
|
---|
| 141 | C15 G C15S:$D(DE(15))[0 K DB
|
---|
| 142 | S X=DE(15),DIC=DIE
|
---|
| 143 | K ^PRCS(410,"AD",$E(X,1,30),DA(1))
|
---|
| 144 | C15S S X="" Q:DG(DQ)=X K DB
|
---|
| 145 | S X=DG(DQ),DIC=DIE
|
---|
| 146 | S ^PRCS(410,"AD",$E(X,1,30),DA(1))=""
|
---|
| 147 | Q
|
---|
| 148 | X15 K:X[""""!($A(X)=45) X I $D(X) D SUB^PRCSES
|
---|
| 149 | I $D(X),X'?.ANP K X
|
---|
| 150 | Q
|
---|
| 151 | ;
|
---|
| 152 | 16 S DQ=17 ;@444
|
---|
| 153 | 17 S DQ=18 ;@2
|
---|
| 154 | 18 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="0;2",DV="RNJ9,2",DU="",DLB="QUANTITY",DIFLD=2
|
---|
| 155 | S DE(DW)="C18^PRCST22"
|
---|
| 156 | G RE
|
---|
| 157 | C18 G C18S:$D(DE(18))[0 K DB
|
---|
| 158 | S X=DE(18),DIC=DIE
|
---|
| 159 | X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N&(E'=DA) E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
|
---|
| 160 | C18S S X="" Q:DG(DQ)=X K DB
|
---|
| 161 | S X=DG(DQ),DIC=DIE
|
---|
| 162 | X "S E=0,E(1)="""" S:'$D(^PRCS(410,DA(1),4)) ^(4)="""" F E(0)=1:1 S E=$O(^PRCS(410,DA(1),""IT"",E)) S:E?1N.N E(1)=E(1)+($P(^(E,0),U,2)*$P(^(0),U,7)) I E'?1N.N X ^DD(410.02,2,1,1,1.4) K E Q"
|
---|
| 163 | Q
|
---|
| 164 | X18 K:+X'=X!(X>999999)!(X<.01)!(X?.E1"."3N.N) X
|
---|
| 165 | Q
|
---|
| 166 | ;
|
---|
| 167 | 19 D:$D(DG)>9 F^DIE17,DE S DQ=19,DW="0;3",DV="RP420.5'",DU="",DLB="UNIT OF PURCHASE",DIFLD=3
|
---|
| 168 | S DU="PRCD(420.5,"
|
---|
| 169 | G RE
|
---|
| 170 | X19 Q
|
---|
| 171 | 20 S DW="0;6",DV="FX",DU="",DLB="STOCK NUMBER",DIFLD=6
|
---|
| 172 | G RE
|
---|
| 173 | X20 K:$L(X)>24!($L(X)<1)!(X'?.ANP) X
|
---|
| 174 | I $D(X),X'?.ANP K X
|
---|
| 175 | Q
|
---|
| 176 | ;
|
---|
| 177 | 21 S DW="0;7",DV="RNJ10,2X",DU="",DLB="EST. ITEM (UNIT) COST",DIFLD=7
|
---|
| 178 | S DE(DW)="C21^PRCST22"
|
---|
| 179 | G RE
|
---|
| 180 | C21 G C21S:$D(DE(21))[0 K DB
|
---|
| 181 | D ^PRCST23
|
---|
| 182 | C21S S X="" Q:DG(DQ)=X K DB
|
---|
| 183 | D ^PRCST24
|
---|
| 184 | Q
|
---|
| 185 | X21 S:X["$" X=$P(X,"$",2) Q:X?1"N/C" K:+X'=X&(X'?.N1"."2N)!(X>9999999)!(X<0) X I $D(X) S:X=0 X="N/C"
|
---|
| 186 | Q
|
---|
| 187 | ;
|
---|
| 188 | 22 S DQ=23 ;@4
|
---|
| 189 | 23 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 190 | X23 K PRCSV
|
---|
| 191 | Q
|
---|
| 192 | 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 193 | X24 D 2^PRCSCK
|
---|
| 194 | Q
|
---|
| 195 | 25 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 196 | X25 I $D(PRCSERR),PRCSERR S Y="@1"
|
---|
| 197 | Q
|
---|
| 198 | 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
|
---|
| 199 | X26 D QRB^PRCSCK
|
---|
| 200 | Q
|
---|
| 201 | 27 D:$D(DG)>9 F^DIE17 G ^PRCST25
|
---|