|
|
@ -518,10 +518,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
|
|
|
|
|
|
|
|
//红冲发票提交QAD
|
|
|
|
if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum)) |
|
|
|
{ |
|
|
|
await SubmitToQadHongChongAsync(invoiceGrp.ParentInvbillNum,_detail).ConfigureAwait(false); |
|
|
|
} |
|
|
|
|
|
|
|
await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false); |
|
|
|
foreach (var itm in tedsaInvs1) |
|
|
|
{ |
|
|
@ -587,18 +584,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
LINE = (i + 1).ToString() |
|
|
|
}); |
|
|
|
} |
|
|
|
tedSaInvs.FirstOrDefault().InvoiceTaxAmount += invoiceGrp.TaxDiff; |
|
|
|
//红冲发票提交QAD
|
|
|
|
if (!string.IsNullOrEmpty(invoiceGrp.ParentInvbillNum)) |
|
|
|
{ |
|
|
|
await SubmitToQadHongChongAsync(invoiceGrp.ParentInvbillNum).ConfigureAwait(false); |
|
|
|
} |
|
|
|
var invbefore = invoiceGrp.RealAmt + invoiceGrp.TaxDiff;//
|
|
|
|
var invafter = tedSaInvs.Sum(p => p.InvoiceTaxAmount); |
|
|
|
var invdiff = invbefore - invafter; |
|
|
|
|
|
|
|
tedSaInvs.FirstOrDefault().InvoiceTaxAmount += invdiff; |
|
|
|
|
|
|
|
|
|
|
|
//await _exChangeCenterDbContext.Set<TEA_TASK_SUB>().AddAsync(teaTaskSub).ConfigureAwait(false);
|
|
|
|
//await _exChangeCenterDbContext.Set<TED_SAS_INVOICE>().AddRangeAsync(tedSaInvs).ConfigureAwait(false);
|
|
|
|
//invoiceGrp.State = SettleBillState.已提交QAD;
|
|
|
|
////构建发票同步Qad状态表数据
|
|
|
|
//await BindInvoiceSyncQadAsync(teaTaskSub, invoiceGrp.RealnvBillNum, invoiceGrp.InvbillNum, invoiceGrp.ClientCode).ConfigureAwait(false);
|
|
|
|
await _exChangeCenterDbContext.BulkInsertAsync(new List<TEA_TASK_SUB>() { teaTaskSub }).ConfigureAwait(false); |
|
|
|
foreach (var itm in tedSaInvs) |
|
|
|
{ |
|
|
|
itm.InvoiceQuatity = -itm.InvoiceQuatity; |
|
|
|
itm.InvoiceNetAmount = -itm.InvoiceNetAmount; |
|
|
|
itm.InvoiceTaxAmount = -itm.InvoiceTaxAmount; |
|
|
|
} |
|
|
|
await _exChangeCenterDbContext.BulkInsertAsync(tedSaInvs).ConfigureAwait(false); |
|
|
|
invoiceGrp.State = SettleBillState.已提交QAD; |
|
|
|
await _repository.DbContext.BulkUpdateAsync(new List<INVOICE_GRP>() { invoiceGrp }); |
|
|
|