入库金额数量处理

This commit is contained in:
sez 2025-11-24 10:44:01 +08:00
parent 40767e80dc
commit 7206ba5cea
4 changed files with 36 additions and 37 deletions

View File

@ -93,8 +93,8 @@ public class OtherInApplyPushOtherInConvertPlugin extends AbstractConvertPlugIn
String batch = jsonMap.get("batch") != null ? jsonMap.get("batch").toString() : null; // 批次
String toZone = jsonMap.get("toZone") != null ? jsonMap.get("toZone").toString() : null; // 库区
DynamicObject bd_warehouse=null;
if(toZone!=null){
DynamicObject bd_warehouse = null;
if (toZone != null) {
String wareNumber = wareTypeMap.get(toZone);
bd_warehouse = BusinessDataServiceHelper.loadSingle("bd_warehouse", new QFilter[]{new QFilter("number", QCP.equals, wareNumber)});
}
@ -108,12 +108,12 @@ public class OtherInApplyPushOtherInConvertPlugin extends AbstractConvertPlugIn
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, producer)});
BigDecimal qty = entry.getBigDecimal("qty");//原数量
BigDecimal price = entry.getBigDecimal("price");//不含税单价
BigDecimal amount = price.multiply(quantity).divide(qty);//金额
BigDecimal amount = entry.getBigDecimal("amount");//金额
amount = amount.multiply(quantity).divide(qty);//金额
// 处理第一次逻辑
if (i == 0) {
entry.set("amount",amount);
entry.set("amount", amount);
// 第一次直接赋值
entry.set("qty", quantity);
@ -122,7 +122,7 @@ public class OtherInApplyPushOtherInConvertPlugin extends AbstractConvertPlugIn
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);
@ -138,14 +138,14 @@ public class OtherInApplyPushOtherInConvertPlugin extends AbstractConvertPlugIn
for (IDataEntityProperty property : properties) {
newEntry.set(property.getName(), entry.get(property.getName()));
}
newEntry.set("amount",amount);
newEntry.set("amount", amount);
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);

View File

@ -93,8 +93,8 @@ public class OtherOutApplyPushOtherOutConvertPlugin extends AbstractConvertPlugI
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)});
}
@ -108,15 +108,15 @@ public class OtherOutApplyPushOtherOutConvertPlugin extends AbstractConvertPlugI
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, producer)});
BigDecimal qty = entry.getBigDecimal("qty");//原数量
BigDecimal price = entry.getBigDecimal("price");//单价
BigDecimal amount = price.multiply(quantity).divide(qty);//金额
BigDecimal amount = entry.getBigDecimal("amount");//金额
amount = amount.multiply(quantity).divide(qty);//金额
// 处理第一次逻辑
if (i == 0) {
entry.set("amount",amount);
entry.set("remainreturnqty",quantity);//未退库数量
entry.set("remainreturnbaseqty",quantity);//未退库基本数量
entry.set("amount", amount);
entry.set("remainreturnqty", quantity);//未退库数量
entry.set("remainreturnbaseqty", quantity);//未退库基本数量
// 第一次直接赋值
entry.set("qty", quantity);
@ -125,7 +125,7 @@ public class OtherOutApplyPushOtherOutConvertPlugin extends AbstractConvertPlugI
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);
@ -142,9 +142,9 @@ public class OtherOutApplyPushOtherOutConvertPlugin extends AbstractConvertPlugI
newEntry.set(property.getName(), entry.get(property.getName()));
}
newEntry.set("amount",amount);
newEntry.set("remainreturnqty",quantity);//未退库数量
newEntry.set("remainreturnbaseqty",quantity);//未退库基本数量
newEntry.set("amount", amount);
newEntry.set("remainreturnqty", quantity);//未退库数量
newEntry.set("remainreturnbaseqty", quantity);//未退库基本数量
newEntry.set("qty", quantity);
newEntry.set("baseqty", quantity);
@ -152,7 +152,7 @@ public class OtherOutApplyPushOtherOutConvertPlugin extends AbstractConvertPlugI
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);

View File

@ -113,10 +113,10 @@ public class PurInConvertPlugin extends AbstractConvertPlugIn implements Plugin
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, producer)});
BigDecimal qty = entry.getBigDecimal("qty");//原数量
BigDecimal priceandtax = entry.getBigDecimal("priceandtax");//含税单价
BigDecimal price = entry.getBigDecimal("price");//不含税单价
BigDecimal amountandtax = priceandtax.multiply(quantity).divide(qty);//折扣后价税合计
BigDecimal amount = price.multiply(quantity).divide(qty);//金额
BigDecimal amountandtax = entry.getBigDecimal("amountandtax");//折扣后价税合计
BigDecimal amount = entry.getBigDecimal("amount");//金额
amountandtax = amountandtax.multiply(quantity).divide(qty);//折扣后价税合计
amount = amount.multiply(quantity).divide(qty);//金额
BigDecimal taxamount = amountandtax.subtract(amount);//税额
// 处理第一次逻辑
@ -125,9 +125,9 @@ public class PurInConvertPlugin extends AbstractConvertPlugIn implements Plugin
entry.set("taxamount", taxamount);//税额
entry.set("curtaxamount", taxamount);//税额(本位币)
entry.set("amountandtax", amountandtax);//折扣后价税合计
entry.set("curamountandtax",amountandtax);//价税合计(本位币)
entry.set("curamountandtax", amountandtax);//价税合计(本位币)
entry.set("amount", amount);//金额
entry.set("curamount",amount);//金额(本位币)
entry.set("curamount", amount);//金额(本位币)
entry.set("remainreturnqty", quantity);//未退库数量
entry.set("remainreturnbaseqty", quantity);//未退库基本数量
entry.set("remainjoinpriceqty", quantity); //剩余应付数量
@ -162,9 +162,9 @@ public class PurInConvertPlugin extends AbstractConvertPlugIn implements Plugin
newEntry.set("taxamount", taxamount);//税额
newEntry.set("curtaxamount", taxamount);//税额(本位币)
newEntry.set("amountandtax", amountandtax);//折扣后价税合计
newEntry.set("curamountandtax",amountandtax);//价税合计(本位币)
newEntry.set("curamountandtax", amountandtax);//价税合计(本位币)
newEntry.set("amount", amount);//金额
newEntry.set("curamount",amount);//金额(本位币)
newEntry.set("curamount", amount);//金额(本位币)
newEntry.set("remainreturnqty", quantity);//未退库数量
newEntry.set("remainreturnbaseqty", quantity);//未退库基本数量
newEntry.set("remainjoinpriceqty", quantity); //剩余应付数量

View File

@ -124,23 +124,22 @@ public class YdthPurInConvertPlugin extends AbstractConvertPlugIn implements Plu
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, producer)});
BigDecimal qty = entry.getBigDecimal("qty");//原数量
BigDecimal priceandtax = entry.getBigDecimal("priceandtax");//含税单价
BigDecimal price = entry.getBigDecimal("price");//不含税单价
BigDecimal amountandtax = priceandtax.multiply(quantity).divide(qty);//折扣后价税合计
BigDecimal amount = price.multiply(quantity).divide(qty);//金额
BigDecimal amountandtax = entry.getBigDecimal("amountandtax");//折扣后价税合计
BigDecimal amount = entry.getBigDecimal("amount");//金额
amountandtax = amountandtax.multiply(quantity).divide(qty);//折扣后价税合计
amount = amount.multiply(quantity).divide(qty);//金额
BigDecimal taxamount = amountandtax.subtract(amount);//税额
// 处理第一次逻辑
if (i == 0) {
entry.set("taxamount", taxamount);//税额
entry.set("curtaxamount", taxamount);//税额(本位币)
entry.set("amountandtax", amountandtax);//折扣后价税合计
entry.set("curamountandtax",amountandtax);//价税合计(本位币)
entry.set("curamountandtax", amountandtax);//价税合计(本位币)
entry.set("amount", amount);//金额
entry.set("curamount",amount);//金额(本位币)
entry.set("curamount", amount);//金额(本位币)
entry.set("remainreturnqty", quantity);//未退库数量
entry.set("remainreturnbaseqty", quantity);//未退库基本数量
entry.set("remainjoinpriceqty", quantity); //剩余应付数量
@ -175,9 +174,9 @@ public class YdthPurInConvertPlugin extends AbstractConvertPlugIn implements Plu
newEntry.set("taxamount", taxamount);//税额
newEntry.set("curtaxamount", taxamount);//税额(本位币)
newEntry.set("amountandtax", amountandtax);//折扣后价税合计
newEntry.set("curamountandtax",amountandtax);//价税合计(本位币)
newEntry.set("curamountandtax", amountandtax);//价税合计(本位币)
newEntry.set("amount", amount);//金额
newEntry.set("curamount",amount);//金额(本位币)
newEntry.set("curamount", amount);//金额(本位币)
newEntry.set("remainreturnqty", quantity);//未退库数量
newEntry.set("remainreturnbaseqty", quantity);//未退库基本数量
newEntry.set("remainjoinpriceqty", quantity); //剩余应付数量