Index: APPS/MAG/InventarisService.cls.xml =================================================================== diff -u -r3486 -r3961 --- APPS/MAG/InventarisService.cls.xml (.../InventarisService.cls.xml) (revision 3486) +++ APPS/MAG/InventarisService.cls.xml (.../InventarisService.cls.xml) (revision 3961) @@ -1,9 +1,9 @@ - + + 1 %RegisteredObject -0 BronPalletID:%String,DoelPalletID:%String,ProductID:%String,AantalBijTeLaden:%Integer @@ -622,7 +622,7 @@ Set ResultSet = ##class(%ResultSet).%New() Do ResultSet.Prepare("SELECT sum(AantalGevraagd) As Aantal, Product As ProductID, MIN(TECH.DateTime_HorologToTimeStamp(Lijn->Hoofding->DueOutTime)) As VroegsteDueOut" _" FROM Flow_OrderWMS.Sub" - _" WHERE StatusWMS = ""W"" AND TECH.DateTime_HorologToTimeStamp(Lijn->Hoofding->DueOutTime) < ?" + _" WHERE StatusWMS = 'W' AND TECH.DateTime_HorologToTimeStamp(Lijn->Hoofding->DueOutTime) < ?" _" GROUP BY Product" _" ORDER BY VroegsteDueOut ASC") Set Status = ResultSet.Execute(TimeStamp) @@ -635,7 +635,7 @@ Set BijladenProductInfo.AantalTePicken = ResultSet.Data("Aantal") Do TePickenProducten.Insert(BijladenProductInfo) } - Do ResultSet.%Close() + Do ResultSet.Close() Set ResultSet = "" Quit TePickenProducten @@ -651,35 +651,39 @@ 0){ + Set IN = "" + Set ProductIDIt = ##class(TECH.ListIterator).%New(ProductIDs) + While ProductIDIt.HasNext(){ + Set IN = IN_ProductIDIt.Next() + If ProductIDIt.HasNext(){ + Set IN = IN_", " + } } + Set ResultSet = ##class(%ResultSet).%New() + Set Statement = "SELECT I.Product As ProductID, SUM(CAST(qty_pcs AS INT)) as Aantal" + _" FROM EWMS.Inventory I" + _" JOIN EWMS.Locations L ON I.loc_m = L.loc_m and I.loc_id = L.loc_id" + _" LEFT JOIN EWMS.TransLoc T ON T.loc_m = L.loc_m AND T.loc_g = L.loc_g AND T.loc_x = L.loc_x AND T.loc_y = L.loc_y" + _" GROUP BY I.Product,T.Loc_ispickbaar, I.loc_m" + _" HAVING T.loc_ispickbaar = ? AND I.loc_m < 5 AND I.Product IN ("_IN_")" + Do ResultSet.Prepare(Statement) + Set Status = ResultSet.Execute(IsPickbaar) + If $$$ISERR(Status) Do ##class(TECH.ExceptionHandler).Throw(##class(TECH.Exceptions.StatusException).%New(##class(TECH.enu.ExceptionCode).GeneralError(),"Kon de aantal pickbare producten niet ophalen.",Status)) + While ResultSet.Next() + { + Set ProductID = $ZSTRIP(ResultSet.Data("ProductID"),"<>W") + Set Aantal = ResultSet.Data("Aantal") + Do arAantalPickbaar.SetAt(Aantal, ProductID) + } + Do ResultSet.Close() + Set ResultSet = "" } - Set ResultSet = ##class(%ResultSet).%New() - Set Statement = "SELECT I.Product As ProductID, SUM(CAST(qty_pcs AS INT)) as Aantal" - _" FROM EWMS.Inventory I" - _" JOIN EWMS.Locations L ON I.loc_m = L.loc_m and I.loc_id = L.loc_id" - _" LEFT JOIN EWMS.TransLoc T ON T.loc_m = L.loc_m AND T.loc_g = L.loc_g AND T.loc_x = L.loc_x AND T.loc_y = L.loc_y" - _" GROUP BY I.Product,T.Loc_ispickbaar, I.loc_m" - _" HAVING T.loc_ispickbaar = ? AND I.loc_m < 5 AND I.Product IN ("_IN_")" - Do ResultSet.Prepare(Statement) - Set Status = ResultSet.Execute(IsPickbaar) - If $$$ISERR(Status) Do ##class(TECH.ExceptionHandler).Throw(##class(TECH.Exceptions.StatusException).%New(##class(TECH.enu.ExceptionCode).GeneralError(),"Kon de aantal pickbare producten niet ophalen.",Status)) - While ResultSet.Next() - { - Set ProductID = $ZSTRIP(ResultSet.Data("ProductID"),"<>W") - Set Aantal = ResultSet.Data("Aantal") - Do arAantalPickbaar.SetAt(Aantal, ProductID) - } - Do ResultSet.%Close() - Set ResultSet = "" Quit arAantalPickbaar ]]> + +