Index: APPS/Halux/common/impl/BatchImpl.cls.xml =================================================================== diff -u -r994 -r1012 --- APPS/Halux/common/impl/BatchImpl.cls.xml (.../BatchImpl.cls.xml) (revision 994) +++ APPS/Halux/common/impl/BatchImpl.cls.xml (.../BatchImpl.cls.xml) (revision 1012) @@ -1,10 +1,10 @@ - + persistent 1 %Persistent,APPS.Halux.common.Batch -62189,54458.271185 +62199,50912.144639 0 @@ -22,12 +22,18 @@ 1 - + %Integer array 1 + +%Integer +list +1 + + %Boolean 1 @@ -36,10 +42,6 @@ 1 - -;1000;5023;1213;3814;1390;1387;1966;4073;1949;4451;6780;3044;2523;4533;6261;11620;3670;3814; - - Lijn:APPS.Halux.common.enu.ProductieLijn="" 1 @@ -78,8 +80,8 @@ Set Iterator = ##class(TECH.ListIterator).%New(..Toeleveringen) While (Iterator.HasNext()) { - Do Iterator.Next() - Set Toelevering = ToeleveringAPI.GeefToelevering(Iterator.Key()) + Set ToeleveringNummer = Iterator.Next() + Set Toelevering = ToeleveringAPI.GeefToelevering(ToeleveringNummer) If ($IsObject(Toelevering)) { Do Toeleveringen.Insert(Toelevering) @@ -117,16 +119,17 @@ { Set Aantal = Aantal + Lijn.GeefAantal() // De productiegroep van het laatste product wint, dit bij gebrek aan betere opties... - Set ProductieGroep = ..BepaalProductieGroep(Toelevering, Product) + Set ProductieGroep = ##class(APPS.Halux.common.ProductieService).%New().GeefProductieGroep(Toelevering, Product) } } Set Errors = ##class(%ListOfDataTypes).%New() If (Aantal = 0) { Do Errors.Insert("De toelevering bevat geen tandemboxen") } If ((Aantal > 0) && '..IsGeldigeProductieGroep(ProductieGroep)) { Do Errors.Insert("De productiegroep van de toelevering is verschillend van de productiegroep van de batch") } - If (..IsAanwezigInAndereBatch(Toelevering)) { Do Errors.Insert("De toelevering zit reeds in een andere batch") } - If (..Toeleveringen.IsDefined(Toelevering.GeefToeNr())) { Do Errors.Insert("De toelevering zit reeds in deze batch") } + Set BijhorendeBatch = ##class(APPS.Halux.common.BatchService).%New().GeefBijhorendeBatch(Toelevering) + If ($IsObject(BijhorendeBatch)) { Do Errors.Insert("Deze toelevering zit reeds in batch "_BijhorendeBatch.GeefBatchID()) } + If (..ToeleveringenIndex.IsDefined(Toelevering.GeefToeNr())) { Do Errors.Insert("De toelevering zit reeds in deze batch") } If ((ProductieGroep = ##class(APPS.Halux.common.enu.ProductieGroep).Kast()) && ('..IsGeldigAfleverAdres(Toelevering))) { Do Errors.Insert("Het afleveradres van deze toelevering is anders dan de vorige") } If (Errors.Count() > 0) @@ -138,7 +141,8 @@ Do ##class(TECH.ExceptionHandler).Throw(##class(APPS.Halux.common.impl.ToeleveringException).%New(MaakBatchError)) } - Do ..Toeleveringen.SetAt(1,Toelevering.GeefToeNr()) + Do ..ToeleveringenIndex.SetAt(1,Toelevering.GeefToeNr()) + Do ..Toeleveringen.Insert(Toelevering.GeefToeNr()) Set ..ProductieGroep = ProductieGroep ]]> @@ -147,7 +151,21 @@ Toelevering:DOM.LEV.Toelevering %Boolean ..Toeleveringen.Count())) + { + If (..Toeleveringen.GetAt(i) = Toelevering.GeefToeNr()) + { + Do ..Toeleveringen.RemoveAt(i) + Set Gevonden = 1 + } + Set i = i + 1 + } + } If (..Toeleveringen.Count() = 0) { Do ..CleanUp() @@ -158,6 +176,7 @@ @@ -177,21 +196,16 @@ %Boolean - -Toelevering:DOM.LEV.Toelevering -1 + %Boolean - - -Toelevering:DOM.LEV.Toelevering,TBXLade:DOM.PM.TBXProduct.TBXLade + +1 +oid:%ObjectIdentity 1 -APPS.Halux.common.enu.ProductieGroep +%Status - -%Boolean - +1 +BatchID:%Integer + - -%Library.CacheStorage -^APPS.Halux.common7FB.BatchImplD -BatchImplDefaultData -^APPS.Halux.common7FB.BatchImplD -^APPS.Halux.common7FB.BatchImplI -^APPS.Halux.common7FB.BatchImplS - - -%%CLASSNAME - - -AanmaakTijdstip - - -Lijn - - -ProductieGroep - - - -Toeleveringen -subnode -"Toeleveringen" - - + + Do ..RaiseBatchRemovedEvent({ID}) +DELETE +1 + + - +