Browse Source

报废重开时备件价格处理

master
学 赵 1 year ago
parent
commit
36397d3c4c
  1. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs
  2. 2
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs
  3. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs
  4. 74
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs
  5. 1
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs

4
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs

@ -529,7 +529,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
&& inv.State != SettleBillState. && inv.State != SettleBillState.
) )
{ {
throw new UserFriendlyException($"发票只有在财务已审核、客户已收票、已扣减、已提交QAD状态下可以报废!", "400"); throw new UserFriendlyException($"发票只有在财务已审核、红冲状态下可以报废!", "400");
} }
var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false);
@ -695,7 +695,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
&& inv.State != SettleBillState. && inv.State != SettleBillState.
) )
{ {
throw new UserFriendlyException($"发票只有在财务已审核、客户已收票、已扣减、已提交QAD状态下可以报废!", "400"); throw new UserFriendlyException($"发票只有在财务已审核、红冲状态下可以报废!", "400");
} }

2
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs

@ -492,7 +492,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
&& inv.State != SettleBillState. && inv.State != SettleBillState.
) )
{ {
throw new UserFriendlyException($"发票只有在财务已审核、客户已收票、已扣减、已提交QAD状态下可以报废!", "400"); throw new UserFriendlyException($"发票只有在财务已审核、红冲状态下可以报废!", "400");
} }

3
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs

@ -313,9 +313,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
errors.Add(new ERR_EXP_DTO() { Message = $"选择发票有没有金税发票号发票,不能审核!" }); errors.Add(new ERR_EXP_DTO() { Message = $"选择发票有没有金税发票号发票,不能审核!" });
} }
var ls = invs.Where(p => p.State != SettleBillState.).Distinct(); var ls = invs.Where(p => p.State != SettleBillState.).Distinct();
if (ls.Any()) if (ls.Any())
{ {

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

@ -143,7 +143,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var priceListbj = _pricebjRepository.ToList();//价格单 var priceListbj = _pricebjRepository.ToList();//价格单
foreach (var itm in priceListbj) foreach (var itm in priceListbj)
{ {
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049" }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price, ClientCode = "1049", ContractNo = itm.ContractNo });
} }
} }
else else
@ -161,6 +161,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {
Id = d.Id,
SettleBillNum = d.SettleBillNum, SettleBillNum = d.SettleBillNum,
Site = d.Site, Site = d.Site,
Version = d.Version, Version = d.Version,
@ -169,15 +170,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleDate = d.SettleDate, SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum, InvGroupNum = d.InvGroupNum,
LU = d.LU, LU = d.LU,
// MaterialDesc = d.MaterialDesc,
PN = d.PN, PN = d.PN,
Qty = d.Qty, Qty = d.Qty,
GroupNum = d.GroupNum, GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n", ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode = d.PartCode PartCode = d.PartCode,//客户零件号
LineCode = d.IndexNum
}; };
var dtos = q.ToList(); var dtos = q.ToList();
@ -302,7 +303,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var priceListbj = _pricebjRepository.ToList();//价格单 var priceListbj = _pricebjRepository.ToList();//价格单
foreach (var itm in priceListbj) foreach (var itm in priceListbj)
{ {
priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price,ClientCode="1049" }); priceList.Add(new PriceList() { LU = itm.LU, BeginTime = itm.BeginDate, EndTime = itm.EndDate, Price = itm.Price,ClientCode="1049", ContractNo = itm.ContractNo });
} }
} }
else else
@ -320,6 +321,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {
Id = d.Id,
SettleBillNum = d.SettleBillNum, SettleBillNum = d.SettleBillNum,
Site = d.Site, Site = d.Site,
Version = d.Version, Version = d.Version,
@ -328,15 +330,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleDate = d.SettleDate, SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum, InvGroupNum = d.InvGroupNum,
LU = d.LU, LU = d.LU,
// MaterialDesc = d.MaterialDesc,
PN = d.PN, PN = d.PN,
Qty = d.Qty, Qty = d.Qty,
GroupNum = d.GroupNum, GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n", ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode = d.PartCode PartCode = d.PartCode,//客户零件号
LineCode = d.IndexNum
}; };
var dtos = q.ToList(); var dtos = q.ToList();
@ -426,7 +428,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList();
//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();//不能结算
var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 List<PriceList> priceList = new List<PriceList>();
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)
{ {
@ -438,6 +452,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site
select new TEMP_CAN_SA_DETAIL select new TEMP_CAN_SA_DETAIL
{ {
Id = d.Id,
SettleBillNum = d.SettleBillNum, SettleBillNum = d.SettleBillNum,
Site = d.Site, Site = d.Site,
Version = d.Version, Version = d.Version,
@ -446,15 +461,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleDate = d.SettleDate, SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum, InvGroupNum = d.InvGroupNum,
LU = d.LU, LU = d.LU,
// MaterialDesc = d.MaterialDesc,
PN = d.PN, PN = d.PN,
Qty = d.Qty, Qty = d.Qty,
GroupNum = d.GroupNum, GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "n", ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode= d.PartCode PartCode = d.PartCode,//客户零件号
LineCode = d.IndexNum
}; };
var dtos = q.ToList(); var dtos = q.ToList();
@ -531,7 +546,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
&& inv.State != SettleBillState. && inv.State != SettleBillState.
) )
{ {
throw new UserFriendlyException($"发票只有在财务已审核、客户已收票、已扣减、已提交QAD状态下可以报废!", "400"); throw new UserFriendlyException($"发票只有在财务已审核、红冲状态下可以报废!", "400");
} }
@ -612,15 +627,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleDate = d.SettleDate, SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum, InvGroupNum = d.InvGroupNum,
LU = d.LU, LU = d.LU,
MaterialDesc = d.MaterialDesc,
PN = d.PN, PN = d.PN,
Qty = d.Qty, Qty = d.Qty,
GroupNum = d.GroupNum, GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "N", ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode = d.PartCode PartCode = d.PartCode,//客户零件号
LineCode = d.IndexNum
}; };
var dtos = q.ToList(); var dtos = q.ToList();
@ -732,7 +747,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
&& inv.State != SettleBillState. && inv.State != SettleBillState.
) )
{ {
throw new UserFriendlyException($"发票只有在财务已审核、客户已收票、已扣减、已提交QAD状态下可以报废!", "400"); throw new UserFriendlyException($"发票只有在财务已审核、红冲状态下可以报废!", "400");
} }
@ -792,12 +807,19 @@ 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();
var priceList = _priceRepository.ToList();//价格单 List<PriceList> priceList = new List<PriceList>();
//var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); if (inv.BusinessType == EnumBusinessType.BeiJian)
//if (errorList.Count() > 0) {
//{ var priceListbj = _pricebjRepository.Where(p => p.IsCancel == false).ToList(); //价格单
// return await ExportErrorReportAsync(errorList); 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).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
@ -813,15 +835,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
SettleDate = d.SettleDate, SettleDate = d.SettleDate,
InvGroupNum = d.InvGroupNum, InvGroupNum = d.InvGroupNum,
LU = d.LU, LU = d.LU,
MaterialDesc = d.MaterialDesc,
PN = d.PN, PN = d.PN,
Qty = d.Qty, Qty = d.Qty,
GroupNum = d.GroupNum, GroupNum = d.GroupNum,
Amt = Math.Round(d.Qty * p.Price, 2), Amt = Math.Round(d.Qty * p.Price, 2),
ContractDocID = "N", ContractDocID = (d.BusinessType != EnumBusinessType.BeiJian) ? string.Empty : p.ContractNo,
BeginDate = p.BeginTime, BeginDate = p.BeginTime,
EndDate = p.EndTime, EndDate = p.EndTime,
PartCode = d.PartCode PartCode = d.PartCode,//客户零件号
LineCode = d.IndexNum
}; };
var dtos = q.ToList(); var dtos = q.ToList();

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

@ -2309,7 +2309,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers
entity.SetProperty("PartGroup", detail.PartGroup); entity.SetProperty("PartGroup", detail.PartGroup);
entity.SetProperty("PN", detail.PN); entity.SetProperty("PN", detail.PN);
entity.SetProperty("SettleDate", detail.SettleDate); entity.SetProperty("SettleDate", detail.SettleDate);
_entityDetailList.Add(entity); _entityDetailList.Add(entity);
} }
if (_entityDetailList.Count > 0) if (_entityDetailList.Count > 0)

Loading…
Cancel
Save