Index: cwCW.mac.rou =================================================================== diff -u -r1488 -r1568 --- cwCW.mac.rou (.../cwCW.mac.rou) (revision 1488) +++ cwCW.mac.rou (.../cwCW.mac.rou) (revision 1568) @@ -1,44 +1,113 @@ cwCW ; Routines speciaal Chris Willems Quit -kfap - set v=3000,t=$o(^KFAP("F","")),r="" - for set v=$o(^KFAP("F",v)) q:v="" do - . s:r="" r=v - . i v>(t+10) s $p(r,D,2)=t - . s t=v - . i $p(r,D),$p(r,D,2) w !,$j($p(r,D),6),?10,$j($p(r,D,2),6) s r="" - quit - ; - ; -bs - New MPRNr,MCount - Set MPRNr="",MCount=0 - For Set MPRNr=$O(^PRBS("BS",MPRNr)) Quit:MPRNr="" Do - . Set MCount=MCount+1 - . If '(MCount#1000) Write !,$J(MCount,6)," producten verwerkt" - . Do bso(MPRNr) +ConvertR10temR18 + ;Write !,"ConvertR10temR18^cwCW activeren a.u.b.",! Quit + Read "Concersie doorvoeren?",!,"Go[] = Go",!,Go + Quit:Go'="Go" + New KlKey,KLNr,Count + Do ##class(vhDeploy.Deploy20110630x1344).ExecCode() + Set (KlKey,Count)=0 + For Set KlKey=$O(^KKL(KlKey)) Quit:KlKey="" Do + . Set KLNr=$P(^KKL(KlKey,0),D) + . Do ConvertOneR10temR18(KLNr,.Count) + Write !!,"Aantal= ",Count Quit - ; -bso(MPRNr) - Set SamengesteldProduct = ##class(DOM.DomeinContext).Instance().GeefProductAPI().GeefSamengesteldProduct(MPRNr) - Set KindBouwsteenIterator = SamengesteldProduct.GeefKindBouwsteenIterator() - While (KindBouwsteenIterator.HasNext()) - { - Set KindBouwsteen = KindBouwsteenIterator.Next() - If (KindBouwsteen.GeefID() [ "PROD") - { - Set Rec = ^PRBS("BS",MPRNr,KindBouwsteen.GeefID()) - Do SamengesteldProduct.VerwijderBouwsteen(KindBouwsteen) - set KindBouwsteenNieuw = SamengesteldProduct.VoegToeKindBouwsteen(KindBouwsteen.GeefProduct(),KindBouwsteen.GeefAantal()) - Do SamengesteldProduct.Save() - Set ^PRBS("BS",MPRNr,KindBouwsteenNieuw.GeefID()) = Rec - } - } +ConvertOneR10temR18(KLNr,Count) + New Rec,KlNaam,OldRegio,NewRegio,PostCode + Set Rec=^KKL(^KK1(KLNr),0) + Set OldRegio=$P(Rec,D,20) + If OldRegio>9,OldRegio<19 Do + . Set KlNaam=$P(Rec,D,2),PostCode=$P(Rec,D,6) + . Quit:PostCode'?4N + . Set NewRegio=$$ConvertR10temR18NewRegio(PostCode) + . Quit:OldRegio=NewRegio + . Quit:'NewRegio + . Do MODFIELD^KLANT(KLNr,120,NewRegio) + . Write !,$J(KLNr,5),?10,KlNaam,?40,OldRegio,?50,PostCode,?60,NewRegio + . Set Count=Count+1 Quit - ; +ConvertR10temR18NewRegio(PostCode) + New NewRegio + If PostCode'?4N Set NewRegio="??" + + Else If $E(PostCode,1,3)=850 Set NewRegio=14 + Else If $E(PostCode,1,3)=851 Set NewRegio=14 + Else If $E(PostCode,1,3)=852 Set NewRegio=14 + Else If $E(PostCode,1,3)=853 Set NewRegio=14 + Else If $E(PostCode,1,3)=854 Set NewRegio=14 + Else If $E(PostCode,1,3)=856 Set NewRegio=14 + + Else If $E(PostCode,1,3)=855 Set NewRegio=18 + Else If $E(PostCode,1,3)=857 Set NewRegio=18 + Else If $E(PostCode,1,3)=858 Set NewRegio=18 + Else If $E(PostCode,1,3)=859 Set NewRegio=18 + + Else If $E(PostCode,1,2)=15 Set NewRegio=10 + Else If $E(PostCode,1,2)=16 Set NewRegio=10 + Else If $E(PostCode,1,2)=17 Set NewRegio=10 + Else If $E(PostCode,1,2)=18 Set NewRegio=10 + Else If $E(PostCode,1,2)=19 Set NewRegio=10 + Else If $E(PostCode,1,2)=28 Set NewRegio=10 + Else If $E(PostCode,1,2)=30 Set NewRegio=10 + Else If $E(PostCode,1,2)=31 Set NewRegio=10 + Else If $E(PostCode,1,2)=32 Set NewRegio=10 + Else If $E(PostCode,1,2)=33 Set NewRegio=10 + Else If $E(PostCode,1,2)=34 Set NewRegio=10 + + Else If $E(PostCode,1,2)=91 Set NewRegio=11 + Else If $E(PostCode,1,2)=92 Set NewRegio=11 + Else If $E(PostCode,1,2)=93 Set NewRegio=11 + Else If $E(PostCode,1,2)=94 Set NewRegio=11 + + Else If $E(PostCode,1,2)=20 Set NewRegio=12 + Else If $E(PostCode,1,2)=21 Set NewRegio=12 + Else If $E(PostCode,1,2)=22 Set NewRegio=12 + Else If $E(PostCode,1,2)=26 Set NewRegio=12 + Else If $E(PostCode,1,2)=29 Set NewRegio=12 + Else If $E(PostCode,1,2)=23 Set NewRegio=12 + Else If $E(PostCode,1,2)=24 Set NewRegio=12 + Else If $E(PostCode,1,2)=25 Set NewRegio=12 + + Else If $E(PostCode,1,2)=86 Set NewRegio=14 + Else If $E(PostCode,1,2)=89 Set NewRegio=14 + Else If $E(PostCode,1,2)=88 Set NewRegio=14 + + Else If $E(PostCode,1,2)=35 Set NewRegio=15 + Else If $E(PostCode,1,2)=36 Set NewRegio=15 + Else If $E(PostCode,1,2)=37 Set NewRegio=15 + Else If $E(PostCode,1,2)=38 Set NewRegio=15 + Else If $E(PostCode,1,2)=39 Set NewRegio=15 + + Else If $E(PostCode,1,2)=10 Set NewRegio=16 + Else If $E(PostCode,1,2)=14 Set NewRegio=16 + Else If $E(PostCode,1,2)=13 Set NewRegio=16 + Else If $E(PostCode,1,2)=11 Set NewRegio=16 + Else If $E(PostCode,1,2)=12 Set NewRegio=16 + + Else If $E(PostCode,1,2)=90 Set NewRegio=17 + Else If $E(PostCode,1,2)=95 Set NewRegio=17 + Else If $E(PostCode,1,2)=96 Set NewRegio=17 + Else If $E(PostCode,1,2)=97 Set NewRegio=17 + Else If $E(PostCode,1,2)=98 Set NewRegio=17 + Else If $E(PostCode,1,2)=99 Set NewRegio=17 + + Else If $E(PostCode,1,2)=83 Set NewRegio=18 + Else If $E(PostCode,1,2)=82 Set NewRegio=18 + Else If $E(PostCode,1,2)=80 Set NewRegio=18 + Else If $E(PostCode,1,2)=87 Set NewRegio=18 + Else If $E(PostCode,1,2)=84 Set NewRegio=18 + + Else If $E(PostCode,1,1)=4 Set NewRegio=16 + Else If $E(PostCode,1,1)=5 Set NewRegio=16 + Else If $E(PostCode,1,1)=6 Set NewRegio=16 + Else If $E(PostCode,1,1)=7 Set NewRegio=16 + + Else Set NewRegio="??" + Quit NewRegio + ConvertKlantActiviteit New R,KlKey Set KlKey=0 @@ -136,5 +205,4 @@ Write !,KLNr,?10,KlNaam,?40,OldRegio,?50,NewRegio Do:$L(KlNaam) MODFIELD^KLANT(KLNr,120,NewRegio) Read:KlNaam'=Naam R - Quit - \ No newline at end of file + Quit \ No newline at end of file