diff --git a/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java b/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java index 5ee0548..a31a86b 100644 --- a/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java +++ b/arap/src/public/nc/api/arap/resource/GatheringbillRestResource.java @@ -99,8 +99,16 @@ public class GatheringbillRestResource extends ArapBaseRestResource { // 税码 String ctaxcode = ""; BaseDAO dao = new BaseDAO(); - // 销售订单号 + // 销售订单号 从表体拿 String csaleorderid = ""; + List> itemMaps = (List) billMap.get("items"); + List itemvos = new ArrayList(); + if (itemMaps != null && itemMaps.size() > 0) { + for (Map item : itemMaps) { + GatheringBillItemVO itemvo = (GatheringBillItemVO) fromJsonToVO(item, GatheringBillItemVO.class); + csaleorderid = itemvo.getDef37(); + } + } try { HYPubBO hybo = new HYPubBO(); headvo.setIsinit(new UFBoolean(false)); @@ -113,10 +121,10 @@ public class GatheringbillRestResource extends ArapBaseRestResource { // 往来对象0-客户 2-部门 3-业务员 默认客户 headvo.setObjtype(0); // 销售订单号 - csaleorderid = headvo.getDef3(); if (StringUtils.isEmpty(csaleorderid)) { throw new BusinessException("销售订单不能为空"); - // return ResultMessageUtil.exceptionToJSON("销售订单不能为空", APIErrCodeEnum.BUSINESSEXCCODE.getCode()); + // return ResultMessageUtil.exceptionToJSON("销售订单不能为空", + // APIErrCodeEnum.BUSINESSEXCCODE.getCode()); } // 客户 Object customerid = hybo.findColValue("so_saleorder", "ccustomerid", @@ -181,8 +189,6 @@ public class GatheringbillRestResource extends ArapBaseRestResource { return ResultMessageUtil.exceptionToJSON(e); } - List> itemMaps = (List) billMap.get("items"); - List itemvos = new ArrayList(); if (itemMaps != null && itemMaps.size() > 0) { for (Map item : itemMaps) { GatheringBillItemVO itemvo = (GatheringBillItemVO) fromJsonToVO(item, GatheringBillItemVO.class); @@ -229,7 +235,7 @@ public class GatheringbillRestResource extends ArapBaseRestResource { // UFDouble notax_cr = money_cr.sub(local_tax_cr); itemvo.setNotax_cr(notax_cr); - //zhangxinah增加组织本币无税金额(贷方) + // zhangxinah增加组织本币无税金额(贷方) itemvo.setLocal_notax_cr(notax_cr); // itemvo.setRate(UFDouble.ZERO_DBL);