|
|
@ -27,6 +27,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
|
|
|
|
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<PUB_ADJ_DETAIL, Guid> _adjRepository; |
|
|
|
protected readonly INormalEfCoreRepository<CodeSetting, Guid> _codesetRepository; |
|
|
@ -50,7 +53,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
INormalEfCoreRepository<INVOICE_NOT_SETTLE, Guid> notRepository, |
|
|
|
INormalEfCoreRepository<PUB_ADJ_DETAIL, Guid> adjRepository, |
|
|
|
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; |
|
|
|
_codesetRepository = codesetRepository; |
|
|
|
_nothbpoRepository = nothbpoRepository; |
|
|
|
_notpubRepository = notpubRepository; |
|
|
|
} |
|
|
|
|
|
|
|
public INV_MNG() |
|
|
@ -1613,9 +1618,44 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
} |
|
|
|
|
|
|
|
if (p_first == true) |
|
|
|
{ |
|
|
|
|
|
|
|
var settleBillnum = string.Empty; |
|
|
|
|
|
|
|
if (businessType == EnumBusinessType.ZhiGongJianHBPO) |
|
|
|
{ |
|
|
|
var mng = await _pubMng.GetMainAsync(p_InvGroupNum); |
|
|
|
settleBillnum=mng.SettleBillNum; |
|
|
|
var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == settleBillnum);//一次开票时查找不可结数据,追加需求
|
|
|
|
if (notsettle != null && notsettle.Count() > 0) |
|
|
|
{ |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
var mng = await _hbpoMng.GetMainAsync(p_InvGroupNum); |
|
|
|
var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == mng.SettleBillNum);//一次开票时查找不可结数据,追加需求
|
|
|
|
settleBillnum = mng.SettleBillNum; |
|
|
|
var notsettle = _notpubRepository.Where(p => p.SettleBillNum == settleBillnum);//一次开票时查找不可结数据,追加需求
|
|
|
|
if (notsettle != null && notsettle.Count() > 0) |
|
|
|
{ |
|
|
|
var innotls = new List<INVOICE_NOT_SETTLE>(); |
|
|
@ -1640,6 +1680,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
//invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("INV");
|
|
|
|
} |
|
|
|
List<INVOICE_WAIT_DETAIL> _entityDetailList = new List<INVOICE_WAIT_DETAIL>(); |
|
|
@ -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);//重开可以变多张发票
|
|
|
|
break; |
|
|
|
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; |
|
|
|
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); |
|
|
|