persistent1%Persistent,APPS.Halux.common.Batch62199,50912.1446390APPS.Halux.common.enu.ProductieLijn1%TimeStamp1APPS.Halux.common.enu.ProductieGroep1%Integerarray1%Integerlist1%Boolean11 Set {*}=##class(APPS.Halux.common.impl.BatchImpl).%OpenId({ID}).IsActief()1Lijn:APPS.Halux.common.enu.ProductieLijn=""11%Status%TimeStamp%IntegerProductieLijn:APPS.Halux.common.enu.ProductieLijnTECH.IteratorAPPS.Halux.common.enu.ProductieGroepAPPS.Halux.common.enu.ProductieLijnToelevering:DOM.LEV.Toelevering 0) && '..IsGeldigeProductieGroep(ProductieGroep)) { Do Errors.Insert("De productiegroep van de toelevering is verschillend van de productiegroep van de 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)
{
Set MaakBatchError = ##class(APPS.Halux.common.impl.BatchError).%New()
Set MaakBatchError.ToeleveringNummer = Toelevering.GeefToeNr()
Set MaakBatchError.Boodschappen = Errors
Set MaakBatchErrorLijst = ##class(%ListOfObjects).%New()
Do ##class(TECH.ExceptionHandler).Throw(##class(APPS.Halux.common.impl.ToeleveringException).%New(MaakBatchError))
}
Do ..ToeleveringenIndex.SetAt(1,Toelevering.GeefToeNr())
Do ..Toeleveringen.Insert(Toelevering.GeefToeNr())
Set ..ProductieGroep = ProductieGroep
]]>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()
}
Quit Removed
]]>1Toelevering:DOM.LEV.Toelevering1%BooleanOrder:DOM.OV.Order1%StringProductieGroep:%String1%Boolean%Boolean1oid:%ObjectIdentity1%Status1BatchID:%Integer Do ..RaiseBatchRemovedEvent({ID})DELETE1