Browse Source

修改可结算单生成发票,价格判断逻辑,备件作废重开,可结算单发票更新逻辑

master
学 赵 1 year ago
parent
commit
ad659b2a8d
  1. 32
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs
  2. 272
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  3. 59
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs
  4. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs
  5. 64
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

32
code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs

@ -256,23 +256,27 @@ namespace Win.Sfs.SettleAccount.Bases
new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" });
} }
var errorEntitylist = new List<PUB_ADJ_DETAIL>(); var errorEntitylist = new List<PUB_ADJ_DETAIL>();
if (inv.BusinessType == EnumBusinessType.BeiJian)
{
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site,true).ConfigureAwait(false);
}
if (inv.BusinessType == EnumBusinessType.YinDuJian) switch (inv.BusinessType )
{
foreach (var itm in entityList)
{
itm.BusinessType = EnumBusinessType.YinDuJian;
}
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site, true).ConfigureAwait(false);
}
else
{ {
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false); case EnumBusinessType.BeiJian:
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site, true).ConfigureAwait(false);
break;
case EnumBusinessType.YinDuJian:
foreach (var itm in entityList)
{
itm.BusinessType = EnumBusinessType.YinDuJian;
}
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site, true).ConfigureAwait(false);
break;
default:
errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false);
break;
} }
if (errorEntitylist.Count > 0) if (errorEntitylist.Count > 0)
{ {
foreach (var itm in errorEntitylist) foreach (var itm in errorEntitylist)

272
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs

@ -143,27 +143,52 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
List<PriceList> priceList = new List<PriceList>(); List<PriceList> priceList = new List<PriceList>();
if (inv.BusinessType == EnumBusinessType.BeiJian) switch (inv.BusinessType)
{ {
var priceListbj = _pricebjRepository.ToList();//价格单 case EnumBusinessType.BeiJian:
foreach (var itm in priceListbj) 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, ClientCode = "1049", ContractNo = itm.ContractNo }); {
} priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian) break;
{ case EnumBusinessType.YinDuJian:
var priceListYindu = _priceYinDuRepository.ToList();//价格单 var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu) foreach (var itm in priceListYindu)
{ {
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
} }
}
else break;
{ default:
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单 priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
break;
} }
//if (inv.BusinessType == EnumBusinessType.BeiJian)
//{
// 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, ClientCode = "1049", ContractNo = itm.ContractNo });
// }
//}
//if (inv.BusinessType == EnumBusinessType.YinDuJian)
//{
// var priceListYindu = _priceYinDuRepository.ToList();//价格单
// foreach (var itm in priceListYindu)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
// }
//}
//else
//{
// priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
//}
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false);
if (errorList.Count > 0) if (errorList.Count > 0)
{ {
@ -312,26 +337,30 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
List<PriceList> priceList = new List<PriceList>(); List<PriceList> priceList = new List<PriceList>();
if (inv.BusinessType == EnumBusinessType.BeiJian)
{ switch (inv.BusinessType)
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, ClientCode = "1049", ContractNo = itm.ContractNo });
}
}
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
}
else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单 case EnumBusinessType.BeiJian:
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, ClientCode = "1049", ContractNo = itm.ContractNo });
}
break;
case EnumBusinessType.YinDuJian:
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
break;
default:
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
break;
} }
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false);
if (errorList.Count > 0) if (errorList.Count > 0)
{ {
@ -451,18 +480,44 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
List<PriceList> priceList = new List<PriceList>(); List<PriceList> priceList = new List<PriceList>();
if (inv.BusinessType == EnumBusinessType.BeiJian)
{ switch (inv.BusinessType)
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, ClientCode = "1049", ContractNo = itm.ContractNo });
}
}
else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单 case EnumBusinessType.BeiJian:
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, ClientCode = "1049", ContractNo = itm.ContractNo });
}
break;
case EnumBusinessType.YinDuJian:
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
break;
default:
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
break;
} }
//if (inv.BusinessType == EnumBusinessType.BeiJian)
//{
// 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, ClientCode = "1049", ContractNo = itm.ContractNo });
// }
//}
//else
//{
// priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
//}
var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false);
if (errorList.Count > 0) if (errorList.Count > 0)
{ {
@ -629,35 +684,52 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
List<PriceList> priceList = new List<PriceList>(); List<PriceList> priceList = new List<PriceList>();
if (inv.BusinessType == EnumBusinessType.BeiJian) switch (inv.BusinessType)
{ {
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单 case EnumBusinessType.BeiJian:
foreach (var itm in priceListbj) 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, ClientCode = "1049", ContractNo = itm.ContractNo }); {
} priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
if (inv.BusinessType == EnumBusinessType.YinDuJian) break;
{ case EnumBusinessType.YinDuJian:
var priceListYindu = _priceYinDuRepository.ToList();//价格单 var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu) foreach (var itm in priceListYindu)
{ {
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
} }
break;
default:
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
break;
} }
else //if (inv.BusinessType == EnumBusinessType.BeiJian)
{ //{
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 // var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
} // foreach (var itm in priceListbj)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
// }
//}
//if (inv.BusinessType == EnumBusinessType.YinDuJian)
//{
// var priceListYindu = _priceYinDuRepository.ToList();//价格单
// foreach (var itm in priceListYindu)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
// }
//}
//else
//{
// priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
//}
var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys); var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s var q = from d in dto1s
join p in priceList on d.LU equals p.LU join p in priceList on d.LU equals p.LU
@ -846,26 +918,50 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
List<PriceList> priceList = new List<PriceList>(); List<PriceList> priceList = new List<PriceList>();
if (inv.BusinessType == EnumBusinessType.BeiJian) switch (inv.BusinessType)
{
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
}
}
if (inv.BusinessType == EnumBusinessType.YinDuJian)
{ {
var priceListYindu = _priceYinDuRepository.ToList();//价格单 case EnumBusinessType.BeiJian:
foreach (var itm in priceListYindu) 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, ClientCode = "1041", ContractNo = itm.ContractNo }); {
} priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
else break;
{ case EnumBusinessType.YinDuJian:
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
break;
default:
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == inv.Site).ToList();//价格单
break;
} }
//if (inv.BusinessType == EnumBusinessType.BeiJian)
//{
// var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
// foreach (var itm in priceListbj)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
// }
//}
//if (inv.BusinessType == EnumBusinessType.YinDuJian)
//{
// var priceListYindu = _priceYinDuRepository.ToList();//价格单
// foreach (var itm in priceListYindu)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
// }
//}
//else
//{
// priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
//}
var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys); var dto1s = ObjectMapper.Map<List<PUB_CAN_SA_DETAIL>, List<PUB_CAN_SA_DETAIL_DTO>>(entitys);
var q = from d in dto1s var q = from d in dto1s
join p in priceList on d.LU equals p.LU join p in priceList on d.LU equals p.LU

59
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs

@ -79,26 +79,49 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
} }
var entitys = await _pubMng.GetDetalListAsync(billnum).ConfigureAwait(false); var entitys = await _pubMng.GetDetalListAsync(billnum).ConfigureAwait(false);
List<PriceList> priceList = new List<PriceList>(); List<PriceList> priceList = new List<PriceList>();
if (main.BusinessType == EnumBusinessType.BeiJian)
{ switch (main.BusinessType)
var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049", ContractNo=itm.ContractNo});
}
}
if (main.BusinessType == EnumBusinessType.YinDuJian)
{
var priceListbj = _priceYinDuRepository.Where(p => p.IsCancel == false).ToList(); //价格单
foreach (var itm in priceListbj)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
}
else
{ {
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 case EnumBusinessType.BeiJian:
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, ClientCode = "1049", ContractNo = itm.ContractNo });
}
break;
case EnumBusinessType.YinDuJian:
var priceListYindu = _priceYinDuRepository.ToList();//价格单
foreach (var itm in priceListYindu)
{
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
}
break;
default:
priceList = _priceRepository.Where(p => p.IsCancel == false && p.ClientCode == main.Site).ToList();//价格单
break;
} }
//if (main.BusinessType == EnumBusinessType.BeiJian)
//{
// var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
// foreach (var itm in priceListbj)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price ,ClientCode="1049", ContractNo=itm.ContractNo});
// }
//}
//if (main.BusinessType == EnumBusinessType.YinDuJian)
//{
// var priceListbj = _priceYinDuRepository.Where(p => p.IsCancel == false).ToList(); //价格单
// foreach (var itm in priceListbj)
// {
// priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1041", ContractNo = itm.ContractNo });
// }
//}
//else
//{
// priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
//}
var errorList = await CheckInvoiceGenerationRules(entitys, main.Site, priceList, main.BusinessType).ConfigureAwait(false);//校验生成规则 var errorList = await CheckInvoiceGenerationRules(entitys, main.Site, priceList, main.BusinessType).ConfigureAwait(false);//校验生成规则
if (errorList.Count > 0) if (errorList.Count > 0)
{ {

2
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

@ -2204,7 +2204,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
foreach (var detail in adjdetails) foreach (var detail in adjdetails)
{ {
detail.InvBillNum = key; detail.InvBillNum = key;
adjdetails.Add(detail); adjlist.Add(detail);
} }
} }
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID })

64
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs

@ -901,21 +901,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
var ls = itm.Value;//结算分组号列表 var ls = itm.Value;//结算分组号列表
//反向查找结算数据 //反向查找结算数据
var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList(); var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList();
foreach (var detail in invdetails) //foreach (var detail in invdetails)
{ //{
detail.InvbillNum = key; // detail.InvbillNum = key;
salist.Add(detail); // salist.Add(detail);
} //}
if (!string.IsNullOrEmpty(p_parentInvBillNum)) //if (!string.IsNullOrEmpty(p_parentInvBillNum))
{ //{
//反向查找调整数据 // //反向查找调整数据
var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList(); // var adjdetails = p_adjlist.Where(p => ls.Contains(p.GroupNum)).ToList();
foreach (var detail in adjdetails) // foreach (var detail in adjdetails)
{ // {
detail.InvBillNum = key; // detail.InvBillNum = key;
} // }
} //}
var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID, p.LU }) var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID, p.LU })
.Select(itm => new .Select(itm => new
@ -959,24 +959,24 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
decimal txtAmt = detailDtos.Sum(k => k.Amt) + Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税后金额 decimal txtAmt = detailDtos.Sum(k => k.Amt) + Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税后金额
decimal readAmt = Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税额 decimal readAmt = Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税额
var mapList = new List<INVOICE_MAP_GROUP>(); var mapList = new List<INVOICE_MAP_GROUP>();
foreach (var groupnum in ls) //foreach (var groupnum in ls)
{ //{
mapList.Add(new INVOICE_MAP_GROUP( // mapList.Add(new INVOICE_MAP_GROUP(
guid: GuidGenerator.Create(), // guid: GuidGenerator.Create(),
version: p_version, // version: p_version,
invbillNum: key, // invbillNum: key,
invGroupNum: p_InvGroupNum, // invGroupNum: p_InvGroupNum,
settleGroupNum: groupnum, // settleGroupNum: groupnum,
amt: 0, // amt: 0,
extend1: string.Empty, // extend1: string.Empty,
extend2: string.Empty // extend2: string.Empty
) // )
); // );
} //}
if (mapList.Count > 0) //if (mapList.Count > 0)
{ //{
groupList.AddRange(mapList); // groupList.AddRange(mapList);
} //}
List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>(); List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>();
foreach (var detail in query.ToList()) foreach (var detail in query.ToList())
{ {

Loading…
Cancel
Save