修复除法未指定精度问题
This commit is contained in:
parent
a5089a619b
commit
28017f49e7
|
@ -23,6 +23,7 @@ import nccloud.open.api.auto.token.cur.utils.APICurUtils;
|
|||
import okhttp3.*;
|
||||
import shkd.utils.DobeDWUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -143,6 +144,7 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
|
|||
if(contextUrl != null && contextUrl.startsWith("http://isctest")){
|
||||
return;
|
||||
}
|
||||
|
||||
DynamicObject[] dos = e.getDataEntities();
|
||||
DynamicObject prinfo = null;
|
||||
boolean isBipSuccess = false;
|
||||
|
@ -331,9 +333,12 @@ public class YongyouBIPOperation extends AbstractOperationServicePlugIn implemen
|
|||
items.put("notax_de","-"+bcsqje.toString());
|
||||
}
|
||||
}else{
|
||||
items.put("taxrate",invoicetax.divide(bcsqje.subtract(invoicetax)).multiply(BigDecimal.valueOf(100)));//税率=税额/不含税 * 100
|
||||
//不含税金额
|
||||
BigDecimal notaxv = bcsqje.subtract(invoicetax);
|
||||
//除法时,指定精度和舍入模式
|
||||
items.put("taxrate",invoicetax.divide(notaxv,10,RoundingMode.HALF_UP).multiply(BigDecimal.valueOf(100)).toString());//税率=税额/不含税 * 100
|
||||
items.put("local_tax_de",invoicetax.toString());//税额
|
||||
items.put("notax_de",bcsqje.subtract(invoicetax).toString());//贷方无税金额,除税金额
|
||||
items.put("notax_de",notaxv.toString());//贷方无税金额,除税金额
|
||||
if("unaudit".equals(eventName)){
|
||||
//如果此时是反审核,则需要将金额置为负数
|
||||
items.put("local_tax_de","-"+items.getString("local_tax_de"));
|
||||
|
|
Loading…
Reference in New Issue