Index: EWTOE.mac.rou =================================================================== diff -u -r3941 -r4548 --- EWTOE.mac.rou (.../EWTOE.mac.rou) (revision 3941) +++ EWTOE.mac.rou (.../EWTOE.mac.rou) (revision 4548) @@ -513,7 +513,7 @@ .....If ORDNr,OLNr Set KLNr=$P(^KO1(ORDNr,"F"),D),R=^KOD(KLNr,"F",ORDNr,OLNr),OLUNr=$P(R,D,15) .....Do RCPPAL^EWPAL(PRNr,$G(C("PALETID")),ORDNr,OLUNr,Aantal) .....Do TOELINE(,TOENr,TLUNr,,Aantal,BOAantal,"",1,.WMS) - .....Do MARKTBXFINISHED(TOENr,TLUNr,Aantal,BOAantal) + .....Do MARKTBXFINISHED(TOENr,TLUNr,Aantal,BOAantal,PRNr) .....Do CHKDEL^FLOWTOE(TOENr) .....If $G(KLNr),ORDNr,LEVNr=$$$LevHalux,'$D(^KTO1(TOENr)) Do ......If $$GetPickDatum^EWORDS6(ORDNr)'<$H Quit:$$IsVoorVandaagOfMorgen^EWORDS6(ORDNr)'=1 @@ -531,14 +531,21 @@ Else Do ERROR^EWLOG($T(UPTOEL)) Quit -MARKTBXFINISHED(TOENr,TLUNr,Aantal,BOAantal) - New rset +MARKTBXFINISHED(TOENr,TLUNr,Aantal,BOAantal,PRNr) + New rset,BatchID Set rset = ##class(%ResultSet).%New("DOM.PM.Maatwerk.TBX.HaluxWerkoverzichtHelper:qGeefQueueIDs") Do rset.Execute(TOENr,TLUNr) While (rset.Next(.sc)){ Set QueueItem = ##class(DS.PPS.TBX.Queue).%OpenId(rset.Data("ID")) Do QueueItem.ZetFinished() - Set LadeGerecepteerdEventData = ##class(TECH.Events.LadeGerecepteerdEventData).%New(QueueItem.TOENr,QueueItem.TLUNr,QueueItem.Product.ProductNr,QueueItem.BatchID,QueueItem.Sequence) + } + Set BatchID = "" + &SQL(SELECT BatchID Into :BatchID FROM PPS.TBX_Queue + WHERE TOENr = :TOENr + GROUP BY TOENr) + For i=1:1:Aantal + { + Set LadeGerecepteerdEventData = ##class(TECH.Events.LadeGerecepteerdEventData).%New(TOENr,TLUNr,PRNr,BatchID,"-1") Set LadeGerecepteerdEvent = ##class(TECH.Events.LadeGerecepteerdEvent).%New(LadeGerecepteerdEventData) Do ##class(TECH.PubSub.OrchestrationContext).GetEventRaiser().RaiseEventAsync(LadeGerecepteerdEvent) } @@ -664,4 +671,4 @@ UPRODNOK ;"Produkt "_$P(^KPR(PRNr,0),D)_" komt niet overeen met toelevering "_TOENr_";"_TLUNr_" "_$P(^KPR(TPRNr,0),D) UPAANTNOK ;"Aantal in toelevering te weinig "_TOENr_";"_TLUNr_" "_TAantal_" - "_Aantal UPTRAP ;"TRAP "_TOENr_";"_TLUNr_";"_Error - ; \ No newline at end of file + ;