|
|
|
@ -78,6 +78,7 @@ public class BillInfoInspurUtils { |
|
|
|
|
// 开始处理含税金额、不含税金额、税额
|
|
|
|
|
for (int i = 0; i < detailList.size(); i++) { |
|
|
|
|
BillDetail detail = detailList.get(i); |
|
|
|
|
|
|
|
|
|
if (detail.getTaxamt() == null) { |
|
|
|
|
String errorMsg = StringUtils.format("发票第{}条明细,含税金额为空,无法开票", i); |
|
|
|
|
throw new JianshuiBillInfoCalucateException(errorMsg, companyservice, JSONObject.toJSONString(billInfo)); |
|
|
|
@ -92,6 +93,8 @@ public class BillInfoInspurUtils { |
|
|
|
|
String errorMsg = StringUtils.format("发票第{}条明细,税额为空,无法开票", i); |
|
|
|
|
throw new JianshuiBillInfoCalucateException(errorMsg, companyservice, JSONObject.toJSONString(billInfo)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detailList.get(i).setIndex((long) (i + 1)); |
|
|
|
|
|
|
|
|
|
/** 浪潮特殊处理,防止误差 */ |
|
|
|
@ -106,11 +109,11 @@ public class BillInfoInspurUtils { |
|
|
|
|
|
|
|
|
|
// 0 不含税 1 含税
|
|
|
|
|
if(hsbz == 1 || hsbz == 0){ |
|
|
|
|
if(taxAmDetail.compareTo(zero) > 0){ |
|
|
|
|
if(taxAmDetail.compareTo(zero) != 0 ){ |
|
|
|
|
detail.setHsbz(0); |
|
|
|
|
taxfreeamt = taxfreeamt.add(NumberUtil.sub(taxAmDetail,taxDetail)); |
|
|
|
|
taxamt = taxamt.add(taxAmDetail); |
|
|
|
|
}else if(taxFreeAmtDetail.compareTo(zero) > 0 ){ |
|
|
|
|
}else if(taxFreeAmtDetail.compareTo(zero) != 0 ){ |
|
|
|
|
detail.setHsbz(0); |
|
|
|
|
taxfreeamt = taxfreeamt.add(taxFreeAmtDetail); |
|
|
|
|
taxamt = taxamt.add(NumberUtil.add(taxFreeAmtDetail,taxDetail) ); |
|
|
|
|