fix:配件价格库获取标准价条件增加
This commit is contained in:
parent
4e767b6990
commit
038eae94f0
@ -84,17 +84,17 @@ public class ClientUtils {
|
||||
if (spmodel != null) {
|
||||
products = spmodel.getLong("yem_products.id");
|
||||
}
|
||||
String yemBdProductsid = "";
|
||||
if (yemBdProducts!=null){
|
||||
String yemBdProductsid = "";
|
||||
if (yemBdProducts != null) {
|
||||
yemBdProductsid = yemBdProducts.getString("number");
|
||||
}
|
||||
if ("P".equals(businesssort)){
|
||||
if ("CC".equals(yemBdProducts.getString("number"))){//叉车
|
||||
yemBdProductsid= "CCPJ";
|
||||
}else if ("ZZJ".equals(yemBdProducts.getString("number"))){//装载机
|
||||
yemBdProductsid= "ZZJPJ";
|
||||
if ("P".equals(businesssort)) {
|
||||
if ("CC".equals(yemBdProducts.getString("number"))) {//叉车
|
||||
yemBdProductsid = "CCPJ";
|
||||
} else if ("ZZJ".equals(yemBdProducts.getString("number"))) {//装载机
|
||||
yemBdProductsid = "ZZJPJ";
|
||||
} else if ("TLJ".equals(yemBdProducts.getString("number"))) {//拖拉机
|
||||
yemBdProductsid= "TLJPJ";
|
||||
yemBdProductsid = "TLJPJ";
|
||||
}
|
||||
}
|
||||
//客户需求单整机 -整机分录行
|
||||
@ -103,7 +103,7 @@ public class ClientUtils {
|
||||
list.add(new QFilter("yem_bd_products.id", QCP.equals, products));
|
||||
list.add(new QFilter("billstatus", QCP.equals, "C"));
|
||||
list.add(new QFilter("yem_billtype.number", QCP.equals, "yem_pricelibrary_ZJ"));
|
||||
list.add(new QFilter("yem_cancelstatus",QCP.equals,"0"));
|
||||
list.add(new QFilter("yem_cancelstatus", QCP.equals, "0"));
|
||||
// list.add(new QFilter("yem_productclass.number",QCP.equals,yemBdProductsid));
|
||||
//读取价格库数据
|
||||
DynamicObject yem_pricelibrary = null;
|
||||
@ -337,7 +337,8 @@ public class ClientUtils {
|
||||
list.add(new QFilter("billstatus", QCP.equals, "C"));
|
||||
list.add(new QFilter("yem_billtype.number", QCP.equals, "yem_pricelibrary_PJ"));
|
||||
list.add(new QFilter("yem_accessory.yem_material.id", QCP.equals, materialId));
|
||||
list.add(new QFilter("yem_productclass.number",QCP.equals,yemBdProducts));
|
||||
list.add(new QFilter("yem_productclass.number", QCP.equals, yemBdProducts));
|
||||
list.add(new QFilter("yem_cancelstatus", QCP.equals, "0"));
|
||||
//DynamicObject yem_material = BusinessDataServiceHelper.loadSingle("yem_pricelibrary","yem_accessory.yem_material,yem_accessory.yem_standsalesprice", list.toArray(new QFilter[0]));
|
||||
DynamicObject[] yem_material = BusinessDataServiceHelper.load("yem_pricelibrary", "billno,yem_accessory.yem_material,yem_accessory.yem_standsalesprice,auditdate", list.toArray(new QFilter[0]));
|
||||
DynamicObject nowMaterial = null;
|
||||
@ -374,19 +375,25 @@ public class ClientUtils {
|
||||
if (yem_accessory != null && yem_accessory.size() > 0) {
|
||||
for (DynamicObject dm : yem_accessory) {
|
||||
long yem_materials = dm.getLong("yem_material.id");//价格库物料内码
|
||||
String yemBillstatusfield = dm.getString("yem_billstatusfield");
|
||||
|
||||
if (materialId == yem_materials) {
|
||||
pjDatas.add(dm);
|
||||
if (dm != null) {
|
||||
models.setValue("yem_fobprice", dm.getBigDecimal("yem_standsalesprice"), rowInfo);
|
||||
String yembilltype = models.getDataEntityType().getName();
|
||||
if ("yem_es_salesorder".equals(yembilltype) || "yem_es_xsalesorder".equals(yembilltype)) {
|
||||
models.setValue("yem_exwrmbprice", dm.getBigDecimal("yem_standsalesprice"), rowInfo);
|
||||
}
|
||||
if (yem_exrate.compareTo(BigDecimal.ZERO) != 0) {
|
||||
DynamicObjectCollection coll = getTypeColl(models);
|
||||
if (!isFCAPriceItem(coll, rowInfo)) {
|
||||
models.setValue("yem_safobprice", roundUpNew(dm.getBigDecimal("yem_standsalesprice").divide(yem_exrate, RoundingMode.HALF_UP)), rowInfo);
|
||||
if ("B".equals(yemBillstatusfield)) {
|
||||
if ("yem_es_salesorder".equals(yembilltype) || "yem_es_xsalesorder".equals(yembilltype)) {
|
||||
models.setValue("yem_exwrmbprice", dm.getBigDecimal("yem_standsalesprice"), rowInfo);
|
||||
}
|
||||
if (yem_exrate.compareTo(BigDecimal.ZERO) != 0) {
|
||||
DynamicObjectCollection coll = getTypeColl(models);
|
||||
if (!isFCAPriceItem(coll, rowInfo)) {
|
||||
models.setValue("yem_safobprice", roundUpNew(dm.getBigDecimal("yem_standsalesprice").divide(yem_exrate, RoundingMode.HALF_UP)), rowInfo);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
info.append("明细信息 第" + (rowInfo + 1) + "行未获取到标准价,请及时询价!\r\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -520,7 +527,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 实际整车单价
|
||||
*
|
||||
* <p>
|
||||
* 实际整车单价 = 实际整车金额 / 数量
|
||||
*/
|
||||
public static void countRealCatPrice(IDataModel model, int rowNow) {
|
||||
@ -543,7 +550,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 实际整车金额
|
||||
*
|
||||
* <p>
|
||||
* 实际整车金额 = 销售金额价格条款 - 资源配件金额
|
||||
*/
|
||||
|
||||
@ -1201,7 +1208,7 @@ public class ClientUtils {
|
||||
* @param[2] row
|
||||
* return
|
||||
* @time 2023/8/10 19:55
|
||||
*
|
||||
* <p>
|
||||
* 销售单价(价格条款)= 销售FOB金额 /数量
|
||||
*/
|
||||
|
||||
@ -1234,17 +1241,15 @@ public class ClientUtils {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 销售金额(价格条款)结算币别
|
||||
*
|
||||
* <p>
|
||||
* 1、如果分录没有总费用、没有折扣金额,就是按照 数量*销售EXW单价
|
||||
* 2、如果分录有总费用或者折扣金额,则销售金额(价格条款) = (折扣后销售金额 +总费用 )+ 资源配件单价 *数量
|
||||
* 销售单价(价格条款)= 销售金额(价格条款) /数量
|
||||
*
|
||||
*/
|
||||
public static void addSaAmountTk(IDataModel model, int rowNow) {
|
||||
boolean ifgift = (boolean) model.getValue("yem_ifgift", rowNow);
|
||||
@ -1294,6 +1299,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 整机计算 销售单价(价格条款)=折扣后销售单价+单车总费用+资源配件单价
|
||||
*
|
||||
* @param model
|
||||
* @param row
|
||||
*/
|
||||
@ -1308,6 +1314,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 整机 销售金额(价格条款)=销售单价(价格条款)*数量
|
||||
*
|
||||
* @param model
|
||||
* @param row
|
||||
*/
|
||||
@ -1320,6 +1327,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 整机 实际整车单价=折扣后销售单价+单车总费用
|
||||
*
|
||||
* @param model
|
||||
* @param row
|
||||
*/
|
||||
@ -1333,6 +1341,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 整机 实际整车金额=实际整车单价*数量
|
||||
*
|
||||
* @param model
|
||||
* @param row
|
||||
*/
|
||||
@ -1346,6 +1355,7 @@ public class ClientUtils {
|
||||
/**
|
||||
* 计算保险费
|
||||
* 保险费=(FOB单价+海运费)*保险加成率*运保费率/100
|
||||
*
|
||||
* @param rowIdx
|
||||
* @param model
|
||||
*/
|
||||
@ -1408,8 +1418,9 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* // 银行利息费=(当前行销售FOB单价+海运费+保险费)*收款计划中的是否信保为是的收汇百分比%/100*利息率/100,利息率手填
|
||||
*
|
||||
* <p>
|
||||
* 银行利息费=(当前行销售FOB单价+海运费+保险费)*收款计划中的是否信保为是的收汇百分比%/100*利息率/100/360*利息天数
|
||||
*
|
||||
* @param rowIdx
|
||||
* @param model
|
||||
*/
|
||||
@ -1852,7 +1863,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 计算销售FCA标配青岛单价
|
||||
*
|
||||
* <p>
|
||||
* 销售FCA标配青岛单价 = 标配FOB(青岛)价 / 汇率,向上取整,保留整数,业务存在手动调整
|
||||
*
|
||||
* @param model
|
||||
@ -1870,7 +1881,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 销售FCA标配青岛金额
|
||||
*
|
||||
* <p>
|
||||
* 销售FCA标配青岛金额=销售FCA标配青岛单价*数量
|
||||
*
|
||||
* @param model
|
||||
@ -1885,7 +1896,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 计算销售FOB单价
|
||||
*
|
||||
* <p>
|
||||
* 销售FOB单价=商品明细对应多功能配置中 单台加价金额(结算币别)合计值 + 销售FCA标配青岛单价+FOB与FCA费用差额
|
||||
*/
|
||||
public static void calculateSalesFOBUnitPrice(IDataModel model, int idx) {
|
||||
@ -1932,8 +1943,8 @@ public class ClientUtils {
|
||||
* 查询物流价格核算表
|
||||
*
|
||||
* @param transportStyle 运输方式
|
||||
* @param port 港口
|
||||
* @param billingMethod 计费方式
|
||||
* @param port 港口
|
||||
* @param billingMethod 计费方式
|
||||
* @return
|
||||
*/
|
||||
public static BigDecimal queryLogisticsCosts(long transportStyle, long port, long billingMethod) {
|
||||
@ -2004,7 +2015,8 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 根据重量物流价格核算表.明细信息.重量核算价格 查询价格
|
||||
* @param entry 重量核算价格
|
||||
*
|
||||
* @param entry 重量核算价格
|
||||
* @param weight 重量
|
||||
* @return 单价
|
||||
*/
|
||||
@ -2029,7 +2041,7 @@ public class ClientUtils {
|
||||
* ②港杂费=单价*数量
|
||||
*
|
||||
* @param model 外销合同
|
||||
* @param idx 明细行
|
||||
* @param idx 明细行
|
||||
*/
|
||||
public static void calculatePortAmt(IDataModel model, int idx) {
|
||||
BigDecimal qty = (BigDecimal) model.getValue("yem_qty", idx);
|
||||
@ -2056,7 +2068,7 @@ public class ClientUtils {
|
||||
* ①内陆运输=费用信息.区间单价*吨数
|
||||
*
|
||||
* @param model 外销合同
|
||||
* @param idx 明细行
|
||||
* @param idx 明细行
|
||||
*/
|
||||
public static void calcInlandTransportationAmt(IDataModel model, int idx) {
|
||||
BigDecimal tonsqty = (BigDecimal) model.getValue("yem_tonsqty", idx);
|
||||
@ -2075,8 +2087,9 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 选择基础机型、携带基础机型中产品机型的吨数
|
||||
*
|
||||
* @param model 外销合同
|
||||
* @param idx 明细行
|
||||
* @param idx 明细行
|
||||
*/
|
||||
public static void bringProductModelTons(IDataModel model, int idx) {
|
||||
DynamicObject productmodel = (DynamicObject) model.getValue("yem_productmodel", idx);
|
||||
@ -2094,6 +2107,7 @@ public class ClientUtils {
|
||||
|
||||
/**
|
||||
* 查询费用项目对应的计费方式
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static Long queryBillingMethod(DynamicObject dataEntity, String expenseItemNo) {
|
||||
|
Loading…
Reference in New Issue
Block a user