|
|
@ -143,27 +143,52 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
//var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList();
|
|
|
|
//var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
|
|
|
|
List<PriceList> priceList = new List<PriceList>(); |
|
|
|
if (inv.BusinessType == EnumBusinessType.BeiJian) |
|
|
|
switch (inv.BusinessType) |
|
|
|
{ |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
if (inv.BusinessType == EnumBusinessType.YinDuJian) |
|
|
|
{ |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
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 });
|
|
|
|
// }
|
|
|
|
//}
|
|
|
|
//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); |
|
|
|
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 notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
|
|
|
|
List<PriceList> priceList = new List<PriceList>(); |
|
|
|
if (inv.BusinessType == EnumBusinessType.BeiJian) |
|
|
|
|
|
|
|
switch (inv.BusinessType) |
|
|
|
{ |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
if (inv.BusinessType == EnumBusinessType.YinDuJian) |
|
|
|
{ |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
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); |
|
|
|
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 notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算
|
|
|
|
List<PriceList> priceList = new List<PriceList>(); |
|
|
|
if (inv.BusinessType == EnumBusinessType.BeiJian) |
|
|
|
|
|
|
|
switch (inv.BusinessType) |
|
|
|
{ |
|
|
|
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 }); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
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); |
|
|
|
if (errorList.Count > 0) |
|
|
|
{ |
|
|
@ -629,35 +684,52 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
|
|
|
|
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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: |
|
|
|
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) |
|
|
|
{ |
|
|
|
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; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else |
|
|
|
{ |
|
|
|
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
|
|
|
|
} |
|
|
|
//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 q = from d in dto1s |
|
|
|
join p in priceList on d.LU equals p.LU |
|
|
@ -846,26 +918,50 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据
|
|
|
|
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); |
|
|
|
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: |
|
|
|
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) |
|
|
|
{ |
|
|
|
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; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//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 q = from d in dto1s |
|
|
|
join p in priceList on d.LU equals p.LU |
|
|
|