Index: ORGALUX.mac.rou =================================================================== diff -u -r919 -r1134 --- ORGALUX.mac.rou (.../ORGALUX.mac.rou) (revision 919) +++ ORGALUX.mac.rou (.../ORGALUX.mac.rou) (revision 1134) @@ -2,10 +2,7 @@ ORGALUX ;Verwerking Orgalux [ 12/27/2003 12:40 PM ] ; ISORGAL(PRNr) ; Is het een orgalux product - New Key - Set Key=$O(^KPR(PRNr,"I")) - Quit:$E(Key)'="I" 0 - Quit $P(^KPR(PRNr,Key),"\",1)["OL" + Quit $$ISORGAL^PRODUKT2(PRNr) IsIntivo(PRNr) Quit $P($G(^KPR(PRNr,0)),"\")?1(1"OL.I",1"OL.TI",1"OL.FW").E @@ -142,6 +139,65 @@ ; ; Stockupdate van een moeder met stock overkinderen STOCKUPDMoeder(MPRNr) + New R,ScanTyp,MFysSt,KFysSt,Reserv,Faktor,KPRNr,QtyOld,QtyNew,Sleutel + ; Fysstock toekennen aan de moeders vertrekkend van de min. stock van de kinderen + Quit:$$$ProductGet(MPRNr,$$$LinkType)'="S" ; Stock over kinderen + + ;Quit:'$$ISORGAL^PRODUKT2(MPRNr) + Set R=^KPR(MPRNr,0),ScanTyp=$P(R,D,24) + ;Quit:ScanTyp="" + Kill MFysSt + Set KPRNr="" + /* [PRA 2011-05-05] Niet nodig wegens geen update van de reservaties op de kinderen. + . Set Reserv=+$P(^KPR(MPRNr,2),D,9) ; Reservatie van de moeder + */ + + ;Fysische stock bepalen dmv fysische stock van de kindproducten. + Set MoederProduct = ##class(DOM.PM.Bouwstenen.Product).%OpenId(MPRNr) + Set KindIterator = ##class(TECH.ListIterator).%New(MoederProduct.Bouwstenen) + While(KindIterator.HasNext()) + { + Set KindBouwsteen = KindIterator.Next() + + #define BouwsteenTypeKind "K" + Quit:$$$BouwsteenTypeKind'=KindBouwsteen.Type + Set KPRNr = KindBouwsteen.KindProduct.ProductNr + #define OpslagzoneManueel 9 + Quit:$$OPSLZONE^PRODUKT2()=$$$OpslagzoneManueel + + Set Faktor=KindBouwsteen.Aantal + Set KFysSt=$$GETSTOCK^PRODUKT4(KPRNr,"F")/$S('Faktor:1,1:Faktor)\1 + Set MFysSt=$G(MFysSt,KFysSt) + Set:KFysSt