diff --git a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs index efc9600..103ef95 100644 --- a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs +++ b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs @@ -1562,7 +1562,7 @@ WHERE AND a.WarehouseCode= (SELECT TOP 1 WHCode FROM ICSDeliveryNotice WHERE DNCode='{DNCode}' And Sequence='{Sequence}' ) AND a.InvCode= '{INVCode}' AND a.Quantity>0 - ORDER BY Quantity) + ORDER BY InDate DESC) PRINT(@locationCodeCurrent) IF @locationCodeCurrent is NULL BEGIN set @locationCodeCurrent=(SELECT @@ -1722,7 +1722,7 @@ WHERE AND a.WarehouseCode= '{whCode}' AND a.InvCode= '{invCode}' AND a.Quantity>0 - ORDER BY Quantity) + ORDER BY InDate DESC) PRINT(@locationCodeCurrent) IF @locationCodeCurrent is NULL BEGIN set @locationCodeCurrent=(SELECT @@ -2107,7 +2107,7 @@ WHERE AND a.WarehouseCode= '{whCode}' AND a.InvCode= '{invCode}' AND a.Quantity>0 - ORDER BY Quantity) + ORDER BY InDate DESC) PRINT(@locationCodeCurrent) IF @locationCodeCurrent is NULL BEGIN set @locationCodeCurrent=(SELECT @@ -2271,7 +2271,7 @@ WHERE AND a.WarehouseCode= (SELECT TOP 1 WHCode FROM ICSManufactureReceive WHERE RCVCode='{RCVCode}' And Sequence='{Sequence}' ) AND a.InvCode= (SELECT TOP 1 INVCode FROM ICSManufactureReceive WHERE RCVCode='{RCVCode}' And Sequence='{Sequence}') AND a.Quantity>0 - ORDER BY Quantity) + ORDER BY InDate DESC) PRINT(@locationCodeCurrent) IF @locationCodeCurrent is NULL BEGIN set @locationCodeCurrent=(SELECT