| | |
| | | |
| | | decimal orderDetailNeedQuantity = item.ReqQuantity - detailAssignQuantity; |
| | | |
| | | decimal useStockLength = autoAssignStocks[0].StockLength - autoAssignStocks[0].StockOutLength; |
| | | decimal useStockLength = autoAssignStocks[0].StockLength; |
| | | if (orderDetailNeedQuantity > useStockLength) |
| | | { |
| | | |
| | |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | item.AssignTotalUsage += useStockLength; |
| | | autoAssignStocks.Remove(autoAssignStocks[0]); |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | Dt_OutStockLockInfo outStockLockInfo = _outStockLockInfoService.GetOutStockLockInfo(item, autoAssignStocks[0], orderDetailNeedQuantity); |
| | | outStockLockInfos.Add(outStockLockInfo); |
| | | item.AssignTotalUsage = orderQuantity; |
| | | autoAssignStocks[0].StockOutLength += orderDetailNeedQuantity; |
| | | if (autoAssignStocks[0].StockOutLength == autoAssignStocks[0].StockLength) |
| | | { |
| | | autoAssignStocks.Remove(autoAssignStocks[0]); |
| | | } |
| | | autoAssignStocks.Remove(autoAssignStocks[0]); |
| | | assignStop = false; |
| | | } |
| | | } |