diff --git a/lc123/cloud/app/plugin/operate/cas/PurOrderUnReversePayBillPlugin.java b/lc123/cloud/app/plugin/operate/cas/PurOrderUnReversePayBillPlugin.java index dc15593..10f0286 100644 --- a/lc123/cloud/app/plugin/operate/cas/PurOrderUnReversePayBillPlugin.java +++ b/lc123/cloud/app/plugin/operate/cas/PurOrderUnReversePayBillPlugin.java @@ -68,7 +68,7 @@ public class PurOrderUnReversePayBillPlugin extends AbstractOperationServicePlug paybill.set("unsettleamount", unsettleamount);//未结算金额 paybill.set("unsettleamountbase", unsettleamountbase);//未结算金额(本位币) paybill.set("entry", entries); - SaveServiceHelper.save(new DynamicObject[]{paybill});// } + SaveServiceHelper.save(new DynamicObject[]{paybill});// } } } diff --git a/lc123/cloud/app/plugin/operate/im/SaleOutBillConvertPlugin.java b/lc123/cloud/app/plugin/operate/im/SaleOutBillConvertPlugin.java index 9f4acfe..96c375c 100644 --- a/lc123/cloud/app/plugin/operate/im/SaleOutBillConvertPlugin.java +++ b/lc123/cloud/app/plugin/operate/im/SaleOutBillConvertPlugin.java @@ -97,8 +97,8 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P } String batch = jsonMap.get("batch") != null ? jsonMap.get("batch").toString() : null; // 批次 String fromZone = jsonMap.get("fromZone") != null ? jsonMap.get("fromZone").toString() : null; // 库区 - DynamicObject bd_warehouse=null; - if(fromZone!=null){ + DynamicObject bd_warehouse = null; + if (fromZone != null) { String wareNumber = wareTypeMap.get(fromZone); bd_warehouse = BusinessDataServiceHelper.loadSingle("bd_warehouse", new QFilter[]{new QFilter("number", QCP.equals, wareNumber)}); } @@ -113,13 +113,14 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P // 处理第一次逻辑 if (i == 0) { // 第一次直接赋值 + BigDecimal qty = entry.getBigDecimal("qty");//原数量 entry.set("qty", quantity); entry.set("baseqty", quantity); entry.set("tqq9_goods", tqq9_goodspackage); entry.set("producedate", manufactureDate); entry.set("expirydate", expirationDate); entry.set("lotnumber", batch); - if(bd_warehouse!=null){ + if (bd_warehouse != null) { entry.set("warehouse", bd_warehouse); } entry.set("tqq9_wmsdetailid", wmsDetailId); @@ -128,6 +129,18 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P entry.set("tqq9_scs", tqq9_proxyandfactory); DynamicObjectCollection billentry_lk = entry.getDynamicObjectCollection("billentry_lk"); billentry_lk.clear(); + BigDecimal amount = entry.getBigDecimal("amount");//金额 + BigDecimal taxamount = entry.getBigDecimal("taxamount");//税额 + BigDecimal amountandtax = entry.getBigDecimal("amountandtax");//税额 + amount=amount.multiply(quantity).divide(qty); + taxamount=taxamount.multiply(quantity).divide(qty); + amountandtax=amountandtax.multiply(quantity).divide(qty); + entry.set("amount", amount); + entry.set("curamount", amount); + entry.set("taxamount", taxamount); + entry.set("curtaxamount", taxamount); + entry.set("amountandtax", amountandtax); + entry.set("curamountandtax", amountandtax); } else { DataEntityPropertyCollection properties = entry.getDataEntityType().getProperties(); // 后续循环复制entry并赋值 @@ -135,13 +148,14 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P for (IDataEntityProperty property : properties) { newEntry.set(property.getName(), entry.get(property.getName())); } + BigDecimal qty = entry.getBigDecimal("qty");//原数量 newEntry.set("qty", quantity); newEntry.set("baseqty", quantity); newEntry.set("tqq9_goods", tqq9_goodspackage); newEntry.set("producedate", manufactureDate); newEntry.set("expirydate", expirationDate); newEntry.set("lotnumber", batch); - if(bd_warehouse!=null){ + if (bd_warehouse != null) { newEntry.set("warehouse", bd_warehouse); } newEntry.set("tqq9_wmsdetailid", wmsDetailId); @@ -150,6 +164,18 @@ public class SaleOutBillConvertPlugin extends AbstractConvertPlugIn implements P newEntry.set("tqq9_scs", tqq9_proxyandfactory); DynamicObjectCollection billentry_lk = newEntry.getDynamicObjectCollection("billentry_lk"); billentry_lk.clear(); + BigDecimal amount = entry.getBigDecimal("amount");//金额 + BigDecimal taxamount = entry.getBigDecimal("taxamount");//税额 + BigDecimal amountandtax = entry.getBigDecimal("amountandtax");//税额 + amount=amount.multiply(quantity).divide(qty); + taxamount=taxamount.multiply(quantity).divide(qty); + amountandtax=amountandtax.multiply(quantity).divide(qty); + entry.set("amount", amount); + entry.set("curamount", amount); + entry.set("taxamount", taxamount); + entry.set("curtaxamount", taxamount); + entry.set("amountandtax", amountandtax); + entry.set("curamountandtax", amountandtax); // 处理完新entry后的逻辑(比如加入集合或其他操作) iterator.add(newEntry); }