|
@ -89,9 +89,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); |
|
|
var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); |
|
|
var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); |
|
|
var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (settle == null) |
|
|
if (settle == null) |
|
|
{ |
|
|
{ |
|
|
throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!", "400"); |
|
|
throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!", "400"); |
|
@ -269,7 +266,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
isReturn: itm.Qty > 0 ? false : true, |
|
|
isReturn: itm.Qty > 0 ? false : true, |
|
|
settleDate: itm.SettleDate, |
|
|
settleDate: itm.SettleDate, |
|
|
groupNum: itm.GroupNum, |
|
|
groupNum: itm.GroupNum, |
|
|
invGroupNum: itm.InvGroupNum, |
|
|
invGroupNum: inv.InvGroupNum, |
|
|
contactid: itm.Extend1,//生产号
|
|
|
contactid: itm.Extend1,//生产号
|
|
|
invbillnum: string.Empty, |
|
|
invbillnum: string.Empty, |
|
|
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode |
|
|
partcode: relist.FirstOrDefault(p => p.SettleMaterialCode == itm.LU).ErpMaterialCode |
|
@ -388,7 +385,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
//var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
|
|
|
//var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
|
|
|
if (adjlist != null && adjlist.Count > 0) |
|
|
if (adjlist != null && adjlist.Count > 0) |
|
|
{ |
|
|
{ |
|
|
var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); |
|
|
var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); |
|
|
|
|
|
|
|
|
var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); |
|
|
var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); |
|
|
var errorList=await CheckAdJRules(adjlist, relist.ToList(),inv.BusinessType); |
|
|
var errorList=await CheckAdJRules(adjlist, relist.ToList(),inv.BusinessType); |
|
@ -526,7 +523,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
|
|
|
var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细
|
|
|
if (adjlist != null && adjlist.Count > 0) |
|
|
if (adjlist != null && adjlist.Count > 0) |
|
|
{ |
|
|
{ |
|
|
var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType); |
|
|
var relationList = _relationRepository.Where(p => p.BusinessType == inv.BusinessType).ToList(); |
|
|
var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); |
|
|
var relist = relationList.GroupBy(p => new { p.SettleMaterialCode, p.ErpMaterialCode }).Select(p => p.FirstOrDefault()); |
|
|
var errorList = await CheckAdJRules(adjlist, relist.ToList(), inv.BusinessType); |
|
|
var errorList = await CheckAdJRules(adjlist, relist.ToList(), inv.BusinessType); |
|
|
if (errorList.Count > 0) |
|
|
if (errorList.Count > 0) |
|
|