From 28017f49e73036a8cb04ef6bcba059a444c8e615 Mon Sep 17 00:00:00 2001 From: yuxueliang0813 <407010292@qq.com> Date: Thu, 26 Dec 2024 10:44:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=99=A4=E6=B3=95=E6=9C=AA?= =?UTF-8?q?=E6=8C=87=E5=AE=9A=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shkd/repc/recon/opplugin/YongyouBIPOperation.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java index 0ff0223..595dbd8 100644 --- a/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java +++ b/main/java/shkd/repc/recon/opplugin/YongyouBIPOperation.java @@ -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"));