1.金额字段处理

This commit is contained in:
龚豆豆 2025-11-20 14:52:35 +08:00
parent 3bf1405120
commit aaf89f5fc7
2 changed files with 31 additions and 5 deletions

View File

@ -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});//
}
}
}

View File

@ -113,6 +113,7 @@ 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);
@ -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,6 +148,7 @@ 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);
@ -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);
}