tt
This commit is contained in:
@@ -275,7 +275,7 @@ namespace WMS.Web.Repositories
|
|||||||
Qty = s.detail.AccruedQty,
|
Qty = s.detail.AccruedQty,
|
||||||
DeliveredQty = s.detail.DeliveredQty,
|
DeliveredQty = s.detail.DeliveredQty,
|
||||||
ReceiveQty = s.detail.ReceiveQty,
|
ReceiveQty = s.detail.ReceiveQty,
|
||||||
//可入库数量=应入库数量-收货数量-已交数量+该明细的入库数量之和;
|
//采购:可入库数量=应入库数量-收货数量-已交数量+该明细的入库数量之和;
|
||||||
AvailableQty = s.detail.AccruedQty - s.detail.ReceiveQty- s.detail.DeliveredQty,
|
AvailableQty = s.detail.AccruedQty - s.detail.ReceiveQty- s.detail.DeliveredQty,
|
||||||
Remark = s.detail.Remark,
|
Remark = s.detail.Remark,
|
||||||
ErpDetailId=s.detail.ErpDetailId
|
ErpDetailId=s.detail.ErpDetailId
|
||||||
@@ -352,29 +352,12 @@ namespace WMS.Web.Repositories
|
|||||||
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.MaterialId),
|
Specifications = _erpBasicDataExtendService.GetMaterialSpecifications(materials, s.MaterialId),
|
||||||
Qty = s.AccruedQty,
|
Qty = s.AccruedQty,
|
||||||
DeliveredQty = s.DeliveredQty,
|
DeliveredQty = s.DeliveredQty,
|
||||||
//可入库数量=应入库数量-收货数量-已交数量+该明细的入库数量之和;
|
//非采购:可入库数量=应入库数量-收货数量;
|
||||||
AvailableQty = s.AccruedQty - s.ReceiveQty- s.DeliveredQty,
|
AvailableQty = s.AccruedQty - s.ReceiveQty,
|
||||||
Remark = s.Remark,
|
Remark = s.Remark,
|
||||||
ErpDetailId=s.ErpDetailId
|
ErpDetailId=s.ErpDetailId
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
//找到入库单:通过erp明细ID
|
|
||||||
var erpDetIds = task_details.GroupBy(x => x.ErpDetailId).Select(x => x.Key).ToList();
|
|
||||||
var instockDets = await _context.InStockDetails.Where(x => erpDetIds.Contains(x.ErpDetailId)).ToListAsync();
|
|
||||||
if (instockDets != null && instockDets.Count != 0)
|
|
||||||
{
|
|
||||||
task_details.ForEach(x =>
|
|
||||||
{
|
|
||||||
var current_instock_dets = instockDets.Where(t => t.ErpDetailId == x.ErpDetailId).ToList();
|
|
||||||
if (current_instock_dets != null && current_instock_dets.Count != 0 && x.ErpDetailId == current_instock_dets.FirstOrDefault().ErpDetailId)
|
|
||||||
{
|
|
||||||
//+该明细的入库数量之和;在这里处理
|
|
||||||
var instock_qty = current_instock_dets.Sum(x => x.Qty);
|
|
||||||
x.AvailableQty = x.AvailableQty + instock_qty;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//找箱
|
//找箱
|
||||||
var task_box = await _context.InstockTaskBox.Where(x => ids.Contains(x.TaskId))
|
var task_box = await _context.InstockTaskBox.Where(x => ids.Contains(x.TaskId))
|
||||||
.Select(s => new SourceBillNoNoPurchaseBoxQueryResponse()
|
.Select(s => new SourceBillNoNoPurchaseBoxQueryResponse()
|
||||||
|
|||||||
Reference in New Issue
Block a user