From ce99f9aeb1bbcdcda4719e518b8db0dc4ff079b4 Mon Sep 17 00:00:00 2001 From: "zhangxinah@yonyou.com" Date: Thu, 17 Apr 2025 18:39:31 +0800 Subject: [PATCH] =?UTF-8?q?2312=E6=94=B6=E6=AC=BE=E5=8D=95=E5=A4=96?= =?UTF-8?q?=E5=B8=81=E6=9C=AC=E5=B8=81=E8=AE=A1=E7=AE=97=E8=B0=83=E6=95=B4?= =?UTF-8?q?-=E5=BC=A0=E9=91=AB0417?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/GatheringbillRestResource.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java b/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java index 73dd35c..28fd1ff 100644 --- a/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java +++ b/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java @@ -138,7 +138,7 @@ public class GatheringbillRestResource extends ArapBaseRestResource { Object tr = dao.executeQuery( "select ntaxrate from so_saleorder_b where csaleorderid = '" + csaleorderid + "'", new ColumnProcessor()); - ntaxrate = new UFDouble(tr.toString()); + //ntaxrate = new UFDouble(tr.toString()); // 税码 Object ctaxcodeid = hybo.findColValue("so_saleorder_b", "ctaxcodeid", "csaleorderid = '" + csaleorderid + "' "); @@ -240,8 +240,12 @@ public class GatheringbillRestResource extends ArapBaseRestResource { itemvo.setNotax_cr(notax_cr); // zhangxinah增加组织本币无税金额(贷方) itemvo.setLocal_notax_cr(notax_cr); - // - itemvo.setRate(UFDouble.ZERO_DBL); + // 汇率为空时,默认为1 + if (headvo.getRate() == null) { + itemvo.setRate(UFDouble.ONE_DBL); + } else { + itemvo.setRate(headvo.getRate()); + } // itemvo.setTaxcodeid(ctaxcode); // @@ -249,7 +253,8 @@ public class GatheringbillRestResource extends ArapBaseRestResource { // 收支项目 itemvo.setPk_subjcode("201"); money = money.add(itemvo.getMoney_cr()); - itemvo.setLocal_money_cr(itemvo.getMoney_cr()); + itemvo.setLocal_money_cr( + itemvo.getMoney_cr().multiply(itemvo.getRate()).setScale(2, UFDouble.ROUND_HALF_UP)); Object def2 = itemvo.getDef2(); if (def2 != null) itemvo.setDef2(hybo.findColValue("bd_defdoc", "pk_defdoc", " code = '" + def2 + "' ") + ""); @@ -288,8 +293,8 @@ public class GatheringbillRestResource extends ArapBaseRestResource { headvo.setMoney(money); headvo.setGloballocal(money); - headvo.setRate(new UFDouble(1)); - headvo.setLocal_money(money); + // headvo.setRate(new UFDouble(1)); + headvo.setLocal_money(money.multiply(headvo.getRate()).setScale(2, UFDouble.ROUND_HALF_UP)); AggGatheringBillVO bill = new AggGatheringBillVO(); bill.setParentVO(headvo); bill.setChildrenVO((CircularlyAccessibleValueObject[]) itemvos.toArray(new GatheringBillItemVO[0]));