|
|
@ -324,10 +324,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
/// </summary>
|
|
|
|
/// <param name="input"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
public virtual async Task<List<INVOICE_WAIT_DETAIL_DTO>> ReissueInvoiceList(List<PUB_ADJ_DETAIL_DTO> p_list) |
|
|
|
public virtual async Task<List<INVOICE_REPEAT_DTO>> ReissueInvoiceList(List<PUB_ADJ_DETAIL_DTO> p_list) |
|
|
|
{ |
|
|
|
List<INVOICE_WAIT_DETAIL_DTO> ls = new List<INVOICE_WAIT_DETAIL_DTO>(); |
|
|
|
|
|
|
|
var invBill = new INVOICE_REPEAT_DTO(); |
|
|
|
var adjlist=ObjectMapper.Map<List<PUB_ADJ_DETAIL_DTO>, List<PUB_ADJ_DETAIL>>(p_list); |
|
|
|
if (adjlist == null && adjlist.Count==0) |
|
|
|
{ |
|
|
@ -428,13 +428,38 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
{ |
|
|
|
if (invbillnum.Substring(0, 3) == "INV")//一次开票重开
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); |
|
|
|
ls= ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); |
|
|
|
|
|
|
|
var ls = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); |
|
|
|
|
|
|
|
var tax = inv.Tax; |
|
|
|
var amt = entities.Sum(p => p.Amt); |
|
|
|
var taxamt =amt+ Math.Round(amt * tax, 2); |
|
|
|
var billnum = string.Empty; |
|
|
|
invBill.Amt = amt; |
|
|
|
invBill.TaxAmt = taxamt; |
|
|
|
invBill.Tax = tax; |
|
|
|
invBill.BusinessType=inv.BusinessType; |
|
|
|
invBill.DETIAL = ls; |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
else//二次开票
|
|
|
|
{ |
|
|
|
var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); |
|
|
|
ls=ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); |
|
|
|
var ls = ObjectMapper.Map<List<INVOICE_WAIT_DETAIL>, List<INVOICE_WAIT_DETAIL_DTO>>(entities); |
|
|
|
|
|
|
|
var tax = inv.Tax; |
|
|
|
var amt = entities.Sum(p => p.Amt); |
|
|
|
var taxamt = amt + Math.Round(amt * tax, 2); |
|
|
|
var billnum = string.Empty; |
|
|
|
invBill.Amt = amt; |
|
|
|
invBill.TaxAmt = taxamt; |
|
|
|
invBill.Tax = tax; |
|
|
|
invBill.BusinessType = inv.BusinessType; |
|
|
|
invBill.DETIAL = ls; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -447,7 +472,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ |
|
|
|
//{
|
|
|
|
// throw new UserFriendlyException($"不存发票号:{p_invbillnum}对应的结算分组号");
|
|
|
|
//}
|
|
|
|
return ls; |
|
|
|
return invBill; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|