wip(version1011):整机价格

This commit is contained in:
zzs 2024-10-12 16:50:26 +08:00 committed by ljw
parent 0f861016cd
commit 6a25bf15fa

View File

@ -1674,22 +1674,22 @@ public class ClientUtils {
if (!ifGift) { if (!ifGift) {
BigDecimal saFobAmount = (BigDecimal) model.getValue("yem_safobamount", row); BigDecimal saFobAmount = (BigDecimal) model.getValue("yem_safobamount", row);
BigDecimal disAmt = (BigDecimal) model.getValue("yem_disamt", row); BigDecimal disAmt = (BigDecimal) model.getValue("yem_disamt", row);
if (isFCAPriceItem(model, row)) { // if (isFCAPriceItem(model, row)) {
// 折扣后销售金额 = 商品明细对应多功能配置中 单台加价金额结算币别合计值 + 销售FCA标配青岛单价- 折扣金额 // 折扣后销售金额 = 商品明细对应多功能配置中 单台加价金额结算币别合计值 + 销售FCA标配青岛单价- 折扣金额
DynamicObjectCollection c = dataEntity.getDynamicObjectCollection("yem_es_materialinfo"); // DynamicObjectCollection c = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
//
DynamicObject d = c.get(row); // DynamicObject d = c.get(row);
DynamicObjectCollection subC = d.getDynamicObjectCollection("yem_multiconfig"); // DynamicObjectCollection subC = d.getDynamicObjectCollection("yem_multiconfig");
BigDecimal sumAmt = BigDecimal.ZERO; // BigDecimal sumAmt = BigDecimal.ZERO;
for (DynamicObject sub : subC) { // for (DynamicObject sub : subC) {
BigDecimal decimal = sub.getBigDecimal("yem_unitsetamount"); // BigDecimal decimal = sub.getBigDecimal("yem_unitsetamount");
sumAmt = sumAmt.add(decimal); // sumAmt = sumAmt.add(decimal);
} // }
BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", row); // BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", row);
model.setValue("yem_afterfrontdisamt", sumAmt.add(sastandardfcaprice).subtract(disAmt)); // model.setValue("yem_afterfrontdisamt", sumAmt.add(sastandardfcaprice).subtract(disAmt));
} else { // } else {
// }
model.setValue("yem_afterfrontdisamt", saFobAmount.subtract(disAmt), row); model.setValue("yem_afterfrontdisamt", saFobAmount.subtract(disAmt), row);
}
} else { } else {
model.setValue("yem_afterfrontdisamt", null, row); model.setValue("yem_afterfrontdisamt", null, row);
} }
@ -1852,13 +1852,13 @@ public class ClientUtils {
} }
public static boolean isFCAPriceItem(DynamicObjectCollection collection, int idx) { public static boolean isFCAPriceItem(DynamicObjectCollection collection, int idx) {
String propKey = "yem_priceitemsp"; String propKey = "yem_shippingmethod";
DynamicObject d = collection.get(idx); DynamicObject d = collection.get(idx);
if (d.containsProperty(propKey)) { if (d.containsProperty(propKey)) {
DynamicObject priceItem = d.getDynamicObject(propKey); DynamicObject shippingmethod = d.getDynamicObject(propKey);
if (YEM.isNotEmpty(priceItem)) { if (YEM.isNotEmpty(shippingmethod)) {
String name = priceItem.getString("name"); String name = shippingmethod.getString("yem_typeofoffer");//报价类型[A:FOB,B:FCA]
return "FCA".equals(name); return "B".equals(name);
} }
} }
return false; return false;
@ -1871,10 +1871,10 @@ public class ClientUtils {
} }
public static boolean isFCAPriceItem(IDataModel model, int idx) { public static boolean isFCAPriceItem(IDataModel model, int idx) {
DynamicObject priceitemsp = (DynamicObject) model.getValue("yem_priceitemsp", idx); DynamicObject shippingmethod = (DynamicObject) model.getValue("yem_shippingmethod", idx);
if (YEM.isNotEmpty(priceitemsp)) { if (YEM.isNotEmpty(shippingmethod)) {
String name = priceitemsp.getString("name"); String name = shippingmethod.getString("name");
return "FCA".equals(name); return "B".equals(name);
} }
return false; return false;
} }
@ -1905,12 +1905,12 @@ public class ClientUtils {
* @param model * @param model
* @param idx * @param idx
*/ */
public static void calculateSalesFCAStandardQingdaoUnitAmount(IDataModel model, int idx) { // public static void calculateSalesFCAStandardQingdaoUnitAmount(IDataModel model, int idx) {
BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", idx); // BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", idx);
BigDecimal qty = (BigDecimal) model.getValue("yem_qty", idx); // BigDecimal qty = (BigDecimal) model.getValue("yem_qty", idx);
BigDecimal calc = sastandardfcaprice.multiply(qty); // BigDecimal calc = sastandardfcaprice.multiply(qty);
model.setValue("yem_sastandardfcaamt", calc, idx); // model.setValue("yem_sastandardfcaamt", calc, idx);
} // }
/** /**
* 计算销售FOB单价 * 计算销售FOB单价
@ -1934,9 +1934,9 @@ public class ClientUtils {
sumAmt = sumAmt.add(decimal); sumAmt = sumAmt.add(decimal);
} }
BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", idx);//销售FCA标配青岛单价 // BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", idx);//销售FCA标配青岛单价
BigDecimal fobsubfcaamt = (BigDecimal) model.getValue("yem_fobsubfcaamt", idx);//FOB与FCA费用差额 BigDecimal fobsubfcaamt = (BigDecimal) model.getValue("yem_fobsubfcaamt", idx);//FOB与FCA费用差额
BigDecimal calc = sumAmt.add(sastandardfcaprice).add(fobsubfcaamt); BigDecimal calc = sumAmt.add(fobsubfcaamt);
model.setValue("yem_safobprice", calc, idx); model.setValue("yem_safobprice", calc, idx);
} else { } else {
int rowCount = model.getEntryRowCount("yem_es_materialinfo"); int rowCount = model.getEntryRowCount("yem_es_materialinfo");
@ -1949,9 +1949,9 @@ public class ClientUtils {
sumAmt = sumAmt.add(decimal); sumAmt = sumAmt.add(decimal);
} }
BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", i);//销售FCA标配青岛单价 // BigDecimal sastandardfcaprice = (BigDecimal) model.getValue("yem_sastandardfcaprice", i);//销售FCA标配青岛单价
BigDecimal fobsubfcaamt = (BigDecimal) model.getValue("yem_fobsubfcaamt", i);//FOB与FCA费用差额 BigDecimal fobsubfcaamt = (BigDecimal) model.getValue("yem_fobsubfcaamt", i);//FOB与FCA费用差额
BigDecimal calc = sumAmt.add(sastandardfcaprice).add(fobsubfcaamt); BigDecimal calc = sumAmt.add(fobsubfcaamt);
model.setValue("yem_safobprice", calc, i); model.setValue("yem_safobprice", calc, i);
} }
} }
@ -2062,6 +2062,7 @@ public class ClientUtils {
* @param idx 明细行 * @param idx 明细行
*/ */
public static void calculatePortAmt(IDataModel model, int idx) { public static void calculatePortAmt(IDataModel model, int idx) {
if (isFCAPriceItem(model, idx)) {
BigDecimal qty = (BigDecimal) model.getValue("yem_qty", idx); BigDecimal qty = (BigDecimal) model.getValue("yem_qty", idx);
BigDecimal calc = BigDecimal.ZERO; BigDecimal calc = BigDecimal.ZERO;
Map<String, Object> logistics = queryLogistics(model, idx, "FYXM0023.6"); Map<String, Object> logistics = queryLogistics(model, idx, "FYXM0023.6");
@ -2079,6 +2080,7 @@ public class ClientUtils {
} }
model.setValue("yem_portamt", calc, idx); model.setValue("yem_portamt", calc, idx);
} }
}
/** /**
* 计算内陆运费 * 计算内陆运费
@ -2089,6 +2091,7 @@ public class ClientUtils {
* @param idx 明细行 * @param idx 明细行
*/ */
public static void calcInlandTransportationAmt(IDataModel model, int idx) { public static void calcInlandTransportationAmt(IDataModel model, int idx) {
if (isFCAPriceItem(model, idx)) {
BigDecimal tonsqty = (BigDecimal) model.getValue("yem_tonsqty", idx); BigDecimal tonsqty = (BigDecimal) model.getValue("yem_tonsqty", idx);
BigDecimal price = BigDecimal.ZERO; BigDecimal price = BigDecimal.ZERO;
Map<String, Object> logistics = queryLogistics(model, idx, "FYXM0023.11");//内陆运费 Map<String, Object> logistics = queryLogistics(model, idx, "FYXM0023.11");//内陆运费
@ -2102,6 +2105,7 @@ public class ClientUtils {
BigDecimal calc = price.multiply(tonsqty); BigDecimal calc = price.multiply(tonsqty);
model.setValue("yem_inlandfreight", calc, idx); model.setValue("yem_inlandfreight", calc, idx);
} }
}
/** /**
* 选择基础机型携带基础机型中产品机型的吨数 * 选择基础机型携带基础机型中产品机型的吨数