| | |
| | | } |
| | | List<Dt_StockInfo> autoAssignStocks = new List<Dt_StockInfo>(); |
| | | List<IStockInfoService.residueQuantity> newResidueQuantitys = new List<IStockInfoService.residueQuantity>(); |
| | | if (warehouse.Any(x => x.WarehouseCode.Contains("DW")) || warehouse.Any(x => x.WarehouseCode.Contains("YS"))) |
| | | { |
| | | |
| | | autoAssignStocks = _stockService.StockInfoService.DWANDYSGetOutboundStocks(stockInfos, dt_OutboundOrderDetails, out List<IStockInfoService.residueQuantity> residueQuantitys); |
| | | newResidueQuantitys.AddRange(residueQuantitys); |
| | | outStocks.AddRange(autoAssignStocks); |
| | | } |
| | | |
| | | foreach(var residueQuantity in newResidueQuantitys) |
| | | { |
| | | foreach (var item in dt_OutboundOrderDetails) |
| | |
| | | palletAssignQuantity = outStockLockInfos.Where(x => x.MaterielCode == item.MaterielCode && x.PalletCode == autoAssignStocks[j].PalletCode).Sum(x => x.AssignQuantity);//出库详情已分配数量 |
| | | } |
| | | decimal palletOutboundQuantity = 0; |
| | | if (warehouse.Any(x => x.WarehouseCode.Contains("DW")) || warehouse.Any(x => x.WarehouseCode.Contains("YS"))) |
| | | { |
| | | |
| | | palletOutboundQuantity = autoAssignStocks[j].Details.Where(x => x.BatchNo == item.BatchNo && x.MaterielCode == item.MaterielCode).Sum(x => x.OutboundQuantity); |
| | | |
| | | } |
| | | |
| | | if (palletAssignQuantity < palletOutboundQuantity)//如果出库详情已分配数量小于托盘已分配数量,则可以继续添加该托盘出库信息 |
| | | { |
| | | decimal orderDetailNeedQuantity = details[i].OrderQuantity - detailAssignQuantity; |