|
@ -27,6 +27,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
|
|
|
|
|
private readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _nothbpoRepository; |
|
|
private readonly INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> _nothbpoRepository; |
|
|
|
|
|
|
|
|
|
|
|
private readonly INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> _notpubRepository; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _notRepository; |
|
|
private readonly INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> _notRepository; |
|
|
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository; |
|
|
private readonly INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> _adjRepository; |
|
|
protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository; |
|
|
protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository; |
|
@ -50,7 +53,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> notRepository, |
|
|
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> notRepository, |
|
|
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, |
|
|
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, |
|
|
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository, |
|
|
INormalEfCoreRepository<CodeSetting, Guid> codesetRepository, |
|
|
INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> nothbpoRepository |
|
|
INormalEfCoreRepository<HBPO_NOT_SA_DETAIL, Guid> nothbpoRepository, |
|
|
|
|
|
INormalEfCoreRepository<PUB_NOT_SA_DETAIL, Guid> notpubRepository |
|
|
) |
|
|
) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
@ -68,6 +72,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
_pdpubRepository = pdpubRepository; |
|
|
_pdpubRepository = pdpubRepository; |
|
|
_codesetRepository = codesetRepository; |
|
|
_codesetRepository = codesetRepository; |
|
|
_nothbpoRepository = nothbpoRepository; |
|
|
_nothbpoRepository = nothbpoRepository; |
|
|
|
|
|
_notpubRepository = notpubRepository; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public INV_MNG() |
|
|
public INV_MNG() |
|
@ -1614,29 +1619,65 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
|
|
|
|
|
if (p_first == true) |
|
|
if (p_first == true) |
|
|
{ |
|
|
{ |
|
|
var mng = await _hbpoMng.GetMainAsync(p_InvGroupNum); |
|
|
|
|
|
var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == mng.SettleBillNum);//一次开票时查找不可结数据,追加需求
|
|
|
var settleBillnum = string.Empty; |
|
|
if (notsettle != null && notsettle.Count() > 0) |
|
|
|
|
|
|
|
|
if (businessType == EnumBusinessType.ZhiGongJianHBPO) |
|
|
{ |
|
|
{ |
|
|
var innotls = new List<INVOICE_NOT_SETTLE>(); |
|
|
var mng = await _pubMng.GetMainAsync(p_InvGroupNum); |
|
|
foreach (var nitm in notsettle) |
|
|
settleBillnum=mng.SettleBillNum; |
|
|
|
|
|
var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == settleBillnum);//一次开票时查找不可结数据,追加需求
|
|
|
|
|
|
if (notsettle != null && notsettle.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
innotls.Add(new INVOICE_NOT_SETTLE( |
|
|
var innotls = new List<INVOICE_NOT_SETTLE>(); |
|
|
guid: GuidGenerator.Create(), |
|
|
foreach (var nitm in notsettle) |
|
|
version: p_version, |
|
|
{ |
|
|
invGroupNum: p_InvGroupNum, |
|
|
innotls.Add(new INVOICE_NOT_SETTLE( |
|
|
settleGroupNum: nitm.GroupNum, |
|
|
guid: GuidGenerator.Create(), |
|
|
lU: nitm.LU, |
|
|
version: p_version, |
|
|
lU1: nitm.LU, |
|
|
invGroupNum: p_InvGroupNum, |
|
|
extend1: nitm.PN, |
|
|
settleGroupNum: nitm.GroupNum, |
|
|
extend2: string.Empty, |
|
|
lU: nitm.LU, |
|
|
qty: nitm.Qty, |
|
|
lU1: nitm.LU, |
|
|
p_invbillnum: string.Empty |
|
|
extend1: nitm.PN, |
|
|
)); |
|
|
extend2: string.Empty, |
|
|
|
|
|
qty: nitm.Qty, |
|
|
|
|
|
p_invbillnum: string.Empty |
|
|
|
|
|
)); |
|
|
|
|
|
} |
|
|
|
|
|
if (innotls.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
notDetialList.AddRange(innotls); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
if (innotls.Count > 0) |
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
var mng = await _hbpoMng.GetMainAsync(p_InvGroupNum); |
|
|
|
|
|
settleBillnum = mng.SettleBillNum; |
|
|
|
|
|
var notsettle = _notpubRepository.Where(p => p.SettleBillNum == settleBillnum);//一次开票时查找不可结数据,追加需求
|
|
|
|
|
|
if (notsettle != null && notsettle.Count() > 0) |
|
|
{ |
|
|
{ |
|
|
notDetialList.AddRange(innotls); |
|
|
var innotls = new List<INVOICE_NOT_SETTLE>(); |
|
|
|
|
|
foreach (var nitm in notsettle) |
|
|
|
|
|
{ |
|
|
|
|
|
innotls.Add(new INVOICE_NOT_SETTLE( |
|
|
|
|
|
guid: GuidGenerator.Create(), |
|
|
|
|
|
version: p_version, |
|
|
|
|
|
invGroupNum: p_InvGroupNum, |
|
|
|
|
|
settleGroupNum: nitm.GroupNum, |
|
|
|
|
|
lU: nitm.LU, |
|
|
|
|
|
lU1: nitm.LU, |
|
|
|
|
|
extend1: nitm.PN, |
|
|
|
|
|
extend2: string.Empty, |
|
|
|
|
|
qty: nitm.Qty, |
|
|
|
|
|
p_invbillnum: string.Empty |
|
|
|
|
|
)); |
|
|
|
|
|
} |
|
|
|
|
|
if (innotls.Count > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
notDetialList.AddRange(innotls); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -2012,7 +2053,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
invlist = await JITInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票
|
|
|
invlist = await JITInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票
|
|
|
break; |
|
|
break; |
|
|
case EnumBusinessType.ZhiGongJianHBPO: |
|
|
case EnumBusinessType.ZhiGongJianHBPO: |
|
|
invlist = await JITInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票
|
|
|
invlist = await FirstInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false);//重开可以变多张发票
|
|
|
break; |
|
|
break; |
|
|
case EnumBusinessType.BeiJian: |
|
|
case EnumBusinessType.BeiJian: |
|
|
invlist = await BJInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false); |
|
|
invlist = await BJInvoice(p_list, p_adjlist, dtos, new List<TEMP_NOT_SA_DETAIL>(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false); |
|
|