|
@ -115,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
/// <param name="p_State"></param>
|
|
|
/// <param name="p_State"></param>
|
|
|
/// <returns></returns>
|
|
|
/// <returns></returns>
|
|
|
/// <exception cref="BusinessException"></exception>
|
|
|
/// <exception cref="BusinessException"></exception>
|
|
|
[UnitOfWork(false)] |
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
public virtual async Task<bool> SetForwardState(List<string> p_invs, SettleBillState p_State) |
|
|
public virtual async Task<bool> SetForwardState(List<string> p_invs, SettleBillState p_State) |
|
|
{ |
|
|
{ |
|
|
List<string> errors = new List<string>(); |
|
|
List<string> errors = new List<string>(); |
|
@ -940,7 +940,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
/// <param name="p_version">版本号</param>
|
|
|
/// <param name="p_version">版本号</param>
|
|
|
/// <param name="p_InvGroupNum">发票分组</param>
|
|
|
/// <param name="p_InvGroupNum">发票分组</param>
|
|
|
/// <param name="p_parentInvBillNum">原发票号</param>
|
|
|
/// <param name="p_parentInvBillNum">原发票号</param>
|
|
|
[UnitOfWork(false)] |
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
public async Task<List<string>> SecInvoice<TDetail>(List<TDetail> p_list, List<PUB_ADJ_DETAIL> p_ajdlist, List<TEMP_CAN_SA_DETAIL> dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) |
|
|
public async Task<List<string>> SecInvoice<TDetail>(List<TDetail> p_list, List<PUB_ADJ_DETAIL> p_ajdlist, List<TEMP_CAN_SA_DETAIL> dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) |
|
|
where TDetail : SA_CAN_BASE |
|
|
where TDetail : SA_CAN_BASE |
|
|
{ |
|
|
{ |
|
@ -1180,7 +1180,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
return _invls; |
|
|
return _invls; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
[UnitOfWork(false)] |
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
public async Task<List<string>> FirstInvoice<TDetail>(List<TDetail> p_list, List<PUB_ADJ_DETAIL> p_adjlist, List<TEMP_CAN_SA_DETAIL> dtos, List<TEMP_NOT_SA_DETAIL> p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) |
|
|
public async Task<List<string>> FirstInvoice<TDetail>(List<TDetail> p_list, List<PUB_ADJ_DETAIL> p_adjlist, List<TEMP_CAN_SA_DETAIL> dtos, List<TEMP_NOT_SA_DETAIL> p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) |
|
|
where TDetail : SA_CAN_BASE |
|
|
where TDetail : SA_CAN_BASE |
|
|
{ |
|
|
{ |
|
@ -1403,7 +1403,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
); |
|
|
); |
|
|
string site = dtos.Where(p => !string.IsNullOrEmpty(p.Site)).FirstOrDefault().Site; |
|
|
string site = dtos.Where(p => !string.IsNullOrEmpty(p.Site)).FirstOrDefault().Site; |
|
|
string clientCode = string.Empty; |
|
|
string clientCode = string.Empty; |
|
|
|
|
|
|
|
|
switch (site) |
|
|
switch (site) |
|
|
{ |
|
|
{ |
|
|
case "1040": |
|
|
case "1040": |
|
@ -1434,7 +1433,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); |
|
|
|
|
|
|
|
|
if (adjlist.Count > 0) |
|
|
if (adjlist.Count > 0) |
|
|
{ |
|
|
{ |
|
|
await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); |
|
|
await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); |
|
@ -1673,7 +1671,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
{ |
|
|
{ |
|
|
detailList.AddRange(_entityDetailList); |
|
|
detailList.AddRange(_entityDetailList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (p_first == true) |
|
|
if (p_first == true) |
|
|
{ |
|
|
{ |
|
|
var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == p_InvGroupNum);//一次开票时查找不可结数据,追加需求
|
|
|
var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == p_InvGroupNum);//一次开票时查找不可结数据,追加需求
|
|
@ -1981,7 +1978,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
return _invls; |
|
|
return _invls; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
[UnitOfWork(false)] |
|
|
[UnitOfWork(IsDisabled = false)] |
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// 重开一次开票
|
|
|
/// 重开一次开票
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
@ -2035,9 +2032,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
case EnumBusinessType.YinDuJian: |
|
|
case EnumBusinessType.YinDuJian: |
|
|
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; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (invlist.Count == 0) |
|
|
if (invlist.Count == 0) |
|
|
{ |
|
|
{ |
|
|
return false; |
|
|
return false; |
|
@ -2206,10 +2201,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
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()) |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
var entity = new INVOICE_WAIT_DETAIL( |
|
|
var entity = new INVOICE_WAIT_DETAIL( |
|
|
guid: GuidGenerator.Create(), |
|
|
guid: GuidGenerator.Create(), |
|
|
version: p_version, |
|
|
version: p_version, |
|
@ -2225,14 +2218,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
beginDate: detail.BeginDate, |
|
|
beginDate: detail.BeginDate, |
|
|
endDate: detail.EndDate, |
|
|
endDate: detail.EndDate, |
|
|
partcode: detail.PartCode); |
|
|
partcode: detail.PartCode); |
|
|
entity.LineCode = detail.LineCode; |
|
|
entity.LineCode = detail.LineCode; |
|
|
entity.SetProperty("DeliveryNumber", detail.DeliveryIndexNumber);//交货号
|
|
|
entity.SetProperty("DeliveryNumber", detail.DeliveryNumber);//交货号
|
|
|
entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码
|
|
|
entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码
|
|
|
entity.SetProperty("VendorName", detail.VendorName);//供应商名称
|
|
|
entity.SetProperty("VendorName", detail.VendorName);//供应商名称
|
|
|
entity.SetProperty("PurchaseOrderNumber", "");//采购订单号
|
|
|
entity.SetProperty("PurchaseOrderNumber", "");//采购订单号
|
|
|
entity.SetProperty("DeliveryIndexNumber", "");//交付索引号
|
|
|
entity.SetProperty("DeliveryIndexNumber", detail.DeliveryIndexNumber);//交付索引号
|
|
|
entity.SetProperty("PartName", "");//零件名称
|
|
|
entity.SetProperty("PartName", detail.PartName);//零件名称
|
|
|
|
|
|
|
|
|
_entityDetailList.Add(entity); |
|
|
_entityDetailList.Add(entity); |
|
|
} |
|
|
} |
|
|
if (_entityDetailList.Count > 0) |
|
|
if (_entityDetailList.Count > 0) |
|
@ -2255,7 +2247,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers |
|
|
preTaxDiff: 0, |
|
|
preTaxDiff: 0, |
|
|
taxDiff: 0, |
|
|
taxDiff: 0, |
|
|
clientCode: string.Empty, |
|
|
clientCode: string.Empty, |
|
|
realAmt: 0 |
|
|
realAmt: readAmt |
|
|
); |
|
|
); |
|
|
invbill.CreationTime = DateTime.Now; |
|
|
invbill.CreationTime = DateTime.Now; |
|
|
invbill.ClientCode = "C001"; |
|
|
invbill.ClientCode = "C001"; |
|
|