Index: APPS/VisiDot/impl/EndAfhandelaar.cls.xml =================================================================== diff -u -r2860 -r2936 --- APPS/VisiDot/impl/EndAfhandelaar.cls.xml (.../EndAfhandelaar.cls.xml) (revision 2860) +++ APPS/VisiDot/impl/EndAfhandelaar.cls.xml (.../EndAfhandelaar.cls.xml) (revision 2936) @@ -73,7 +73,9 @@ Do ##class(vhLib.Logger).%New("VisiDot").Warning("Recepteer Producten",Bericht) } - While QueueIterator.HasNext() + Set IsToeleveringReedsGerecepteerd = 0 + + While (QueueIterator.HasNext() && 'IsToeleveringReedsGerecepteerd) { /// QueueElement As DS.PPS.TBX.Queue Set QueueElement = QueueIterator.Next() @@ -87,17 +89,27 @@ Set ProductID = QueueHelper.GeefProductNr() Set BatchID = BatchID Set ToeleveringID = QueueElement.TOENr - Set Dossier = QueueElement.DOSNr - Set FrameID = ProductionHelper.GeefPalletIDVanVHossID(QueueHelper.GeefFrameID()) - Set ProdIsInKOM = "" - Set DomeinContext = ##class(TECH.Context.RuntimeContext).Instance() - Set GebruikerInitialen = DomeinContext.GeefGebruikerInitialen() - Set Status = ##class(BL.MB.UGLYPicking.Receptie).AddToBuffer(ReceptieGroepID,..bfrVolgNr,ProductID,Dossier,LocatieTransit,FrameID,GebruikerInitialen,.ProdIsInKOM,ToeleveringID) - If ($LG(Status,1) < 0) - { - Set FoutString = "##class(BL.MB.UGLYPicking.Receptie).AddToBuffer("_ReceptieGroepID_","_..bfrVolgNr_","_ProductID_","_Dossier_","_LocatieTransit_","_FrameID_","_GebruikerInitialen_","_ProdIsInKOM_")" - Do ##class(TECH.ExceptionHandler).Throw(##class(TECH.Exceptions.GeneralErrorException).%New("Fout bij uitvoeren van "_FoutString_$C(13,10)_"Fout: "_$LG(Status,2))) + /// Als toelevering nog niet gerecepteerd is : + Set Toelevering = ##class(DOM.DomeinContext).Instance().GeefToeleveringAPI().GeefToelevering(ToeleveringID) + If ('$IsObject(Toelevering)){ + Set IsToeleveringReedsGerecepteerd = 1 + Set Bericht = "De toelevering '"_ToeleveringID_"' is reeds gerecepteerd."_$C(13,10) + Set Bericht = Bericht_"Bij de recepetie via VisiDot met BatchID : '"_BatchID_"'"_$C(13,10) + Do ##class(vhLib.Logger).%New("VisiDot").ErrorMail("Toelevering "_ToeleveringID_" reeds gerecepteerd",Exception.ToString()) + }Else{ + Set Dossier = QueueElement.DOSNr + Set FrameID = ProductionHelper.GeefPalletIDVanVHossID(QueueHelper.GeefFrameID()) + Set ProdIsInKOM = "" + Set DomeinContext = ##class(TECH.Context.RuntimeContext).Instance() + Set GebruikerInitialen = DomeinContext.GeefGebruikerInitialen() + Set Status = ##class(BL.MB.UGLYPicking.Receptie).AddToBuffer(ReceptieGroepID,..bfrVolgNr,ProductID,Dossier,LocatieTransit,FrameID,GebruikerInitialen,.ProdIsInKOM,ToeleveringID) + + If ($LG(Status,1) < 0) + { + Set FoutString = "##class(BL.MB.UGLYPicking.Receptie).AddToBuffer("_ReceptieGroepID_","_..bfrVolgNr_","_ProductID_","_Dossier_","_LocatieTransit_","_FrameID_","_GebruikerInitialen_","_ProdIsInKOM_")" + Do ##class(TECH.ExceptionHandler).Throw(##class(TECH.Exceptions.GeneralErrorException).%New("Fout bij uitvoeren van "_FoutString_$C(13,10)_"Fout: "_$LG(Status,2))) + } } }