|
|
@ -60,9 +60,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var errorlist = await CheckRepeat(p_list).ConfigureAwait(false); |
|
|
|
if (errorlist.Count > 0) |
|
|
|
{ |
|
|
|
|
|
|
|
return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); |
|
|
|
|
|
|
|
} |
|
|
|
var first = p_list.FirstOrDefault(); |
|
|
|
var invbillnum = first.InvBillNum; |
|
|
@ -78,9 +76,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var version = int.Parse(DateTime.Now.ToString("yyyymm")); |
|
|
|
//var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
|
|
|
|
var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); |
|
|
|
|
|
|
|
var settle = await _pubMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); |
|
|
|
|
|
|
|
if (settle == null) |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); |
|
|
@ -133,12 +129,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var priceListbj = _pricebjRepository.ToList();//价格单
|
|
|
|
foreach (var itm in priceListbj) |
|
|
|
{ |
|
|
|
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price }); |
|
|
|
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price,ClientCode="1049" }); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
priceList = _priceRepository.ToList();//价格单
|
|
|
|
priceList = _priceRepository.Where(p=>p.IsCancel==false && p.ClientCode==inv.Site).ToList();//价格单
|
|
|
|
} |
|
|
|
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); |
|
|
|
if (errorList.Count > 0) |
|
|
@ -209,9 +205,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var version = int.Parse(DateTime.Now.ToString("yyyymm")); |
|
|
|
//var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组
|
|
|
|
var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); |
|
|
|
|
|
|
|
var settle = await _pubMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (settle == null) |
|
|
|
{ |
|
|
|
throw new BusinessException("8989", $"选择发票:{p_invbillnum}对应的可结算单不在请检查!"); |
|
|
@ -610,13 +607,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
{ |
|
|
|
throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); |
|
|
|
} |
|
|
|
var invlist = invBilllist.OrderBy(p => p.PartCode).ToList(); |
|
|
|
var invlist = invBilllist.OrderBy(p => p.LU).ToList(); |
|
|
|
//}
|
|
|
|
//else
|
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号");
|
|
|
|
//}
|
|
|
|
return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); |
|
|
|
return new JsonResult(new { Code = 200, Message = "生成成功", Data = invlist }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|