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