wip:获取标准价:FOB与FCA费用差额标配FOB(青岛)价

This commit is contained in:
zzs01@yunemao.com 2024-09-09 17:15:34 +08:00
parent 7f3dcb4e65
commit 5a2d7edaa0

View File

@ -192,19 +192,25 @@ public class ClientUtils {
* 获取标准价中 计算fob价(整机分录行) * 获取标准价中 计算fob价(整机分录行)
*/ */
public static void fobPriceAdd(DynamicObjectCollection dy, BigDecimal yem_exrate, int rowInfo, DynamicObject dynamicObject, IDataModel models) { public static void fobPriceAdd(DynamicObjectCollection dy, BigDecimal yem_exrate, int rowInfo, DynamicObject dynamicObject, IDataModel models) {
//计算多功能配置页签 标准销售价价计算总额
DynamicObject currEntry = dy.get(rowInfo);
//fob单价计算 //fob单价计算
DynamicObject dataEntity = models.getDataEntity(true); DynamicObject dataEntity = models.getDataEntity(true);
String yembilltype = dataEntity.getString("yem_billtype.number"); String yembilltype = dataEntity.getString("yem_billtype.number");
BigDecimal pricefob = BigDecimal.ZERO; BigDecimal pricefob = BigDecimal.ZERO;
if (!isFCAPriceItem(currEntry)) {
if ("yem_im_inclientdeman_zj".equals(yembilltype) || "yem_es_salesorder_nmzj".equals(yembilltype) || "yem_es_xsalesorder_nmzj".equals(yembilltype)) { if ("yem_im_inclientdeman_zj".equals(yembilltype) || "yem_es_salesorder_nmzj".equals(yembilltype) || "yem_es_xsalesorder_nmzj".equals(yembilltype)) {
pricefob = dynamicObject.getBigDecimal("yem_foreigntradeprice"); pricefob = dynamicObject.getBigDecimal("yem_foreigntradeprice");
} }
if ("yem_im_clientdeman_zj".equals(yembilltype) || "yem_es_salesorder_ZJ".equals(yembilltype) || "yem_es_xsalesorder_zj".equals(yembilltype)) { if ("yem_im_clientdeman_zj".equals(yembilltype) || "yem_es_salesorder_ZJ".equals(yembilltype) || "yem_es_xsalesorder_zj".equals(yembilltype)) {
pricefob = dynamicObject.getBigDecimal("yem_pricefob"); pricefob = dynamicObject.getBigDecimal("yem_pricefob");
} }
} else {
pricefob = dynamicObject.getBigDecimal("yem_fcafactoryprice");//FCA工厂价
}
BigDecimal fobsubfcaamt = dynamicObject.getBigDecimal("yem_fobsubfcaamt");//FOB与FCA费用差额
models.setValue("yem_fobsubfcaamt", fobsubfcaamt, rowInfo);//FOB与FCA费用差额
//计算多功能配置页签 标准销售价价计算总额
DynamicObject currEntry = dy.get(rowInfo);
if (currEntry != null) { if (currEntry != null) {
BigDecimal fobPrice = BigDecimal.ZERO; BigDecimal fobPrice = BigDecimal.ZERO;
DynamicObjectCollection dc = currEntry.getDynamicObjectCollection("yem_multiconfig"); DynamicObjectCollection dc = currEntry.getDynamicObjectCollection("yem_multiconfig");
@ -1756,6 +1762,22 @@ public class ClientUtils {
} }
} }
} }
public static boolean isFCAPriceItem(DynamicObjectCollection collection, int idx, String propKey) {
DynamicObject d = collection.get(idx);
DynamicObject priceItem = d.getDynamicObject(propKey);
if (YEM.isNotEmpty(priceItem)) {
String name = priceItem.getString("name");
return "FCA".equals(name);
}
return false;
}
public static boolean isFCAPriceItem(DynamicObject d) {
DynamicObjectCollection collection = new DynamicObjectCollection();
collection.add(d);
return isFCAPriceItem(collection, 0, "yem_priceitemsp");
}
} }