parent
70fefff998
commit
fecad339e3
@ -300,7 +300,7 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_safobamount", "yem_amount");//销售fob金额 汇总表头 fob金额
|
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_safobamount", "yem_amount");//销售fob金额 汇总表头 fob金额
|
||||||
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
||||||
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
||||||
ClientUtils.calculateDiscountRate(model, rowIndex);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, rowIndex);//计算折扣率
|
||||||
break;
|
break;
|
||||||
case "yem_onecarsum"://单车总费用
|
case "yem_onecarsum"://单车总费用
|
||||||
ClientUtils.countFrontDisPrice(model, rowIndex);//折扣前单价
|
ClientUtils.countFrontDisPrice(model, rowIndex);//折扣前单价
|
||||||
@ -322,7 +322,7 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
||||||
ClientUtils.countPoolAmt(view, model, "yem_es_materialinfo");//汇总折扣金额使用金额
|
ClientUtils.countPoolAmt(view, model, "yem_es_materialinfo");//汇总折扣金额使用金额
|
||||||
ClientUtils.addSaAmountTk(model, rowIndex);//销售金额(价格条款)结算币别
|
ClientUtils.addSaAmountTk(model, rowIndex);//销售金额(价格条款)结算币别
|
||||||
ClientUtils.calculateDiscountRate(model, rowIndex);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, rowIndex);//计算折扣率
|
||||||
break;
|
break;
|
||||||
case "yem_fundusetype"://资金使用类型
|
case "yem_fundusetype"://资金使用类型
|
||||||
model.setValue("yem_fundpoolamt", BigDecimal.ZERO);
|
model.setValue("yem_fundpoolamt", BigDecimal.ZERO);
|
||||||
@ -357,7 +357,7 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
case "yem_accamtusetype"://配件资金使用方式
|
case "yem_accamtusetype"://配件资金使用方式
|
||||||
ClientUtils.delValue(model, "yem_es_materialinfo");
|
ClientUtils.delValue(model, "yem_es_materialinfo");
|
||||||
// ClientUtils.countDisAmt(model,"yem_es_materialinfo",rowIndex);//计算折扣金额
|
// ClientUtils.countDisAmt(model,"yem_es_materialinfo",rowIndex);//计算折扣金额
|
||||||
ClientUtils.calculateDiscountRate(model, -1);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, -1);//计算折扣率
|
||||||
break;
|
break;
|
||||||
case "yem_fundpoolamt"://使用额度
|
case "yem_fundpoolamt"://使用额度
|
||||||
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
||||||
|
@ -331,7 +331,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
// ClientUtils.countSaPricePriceClause(model, rowIndex);//计算销售单价(价格条款)
|
// ClientUtils.countSaPricePriceClause(model, rowIndex);//计算销售单价(价格条款)
|
||||||
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
||||||
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
||||||
ClientUtils.calculateDiscountRate(model, rowIndex);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, rowIndex);//计算折扣率
|
||||||
break;
|
break;
|
||||||
case "yem_sastandardprice"://
|
case "yem_sastandardprice"://
|
||||||
ClientUtils.countFobAmtSaleRMB(model, rowIndex);//销售FOB标配青岛单价(本位币)
|
ClientUtils.countFobAmtSaleRMB(model, rowIndex);//销售FOB标配青岛单价(本位币)
|
||||||
@ -446,7 +446,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
break;
|
break;
|
||||||
case "yem_accamtusetype"://配件资金使用方式
|
case "yem_accamtusetype"://配件资金使用方式
|
||||||
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
||||||
ClientUtils.calculateDiscountRate(model, -1);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, -1);//计算折扣率
|
||||||
break;
|
break;
|
||||||
case "yem_fundpoolamt"://使用额度
|
case "yem_fundpoolamt"://使用额度
|
||||||
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
||||||
@ -464,7 +464,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
ClientUtils.countFrontDisAmt(model, rowIndex);//折扣前金额
|
ClientUtils.countFrontDisAmt(model, rowIndex);//折扣前金额
|
||||||
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
||||||
ClientUtils.addSaAmountTk(model, rowIndex);//销售金额(价格条款)结算币别
|
ClientUtils.addSaAmountTk(model, rowIndex);//销售金额(价格条款)结算币别
|
||||||
ClientUtils.calculateDiscountRate(model, rowIndex);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, rowIndex);//计算折扣率
|
||||||
break;
|
break;
|
||||||
case "yem_giveproactype":
|
case "yem_giveproactype":
|
||||||
summarizeModules(rowIndex);
|
summarizeModules(rowIndex);
|
||||||
|
@ -1590,7 +1590,7 @@ public class ClientUtils {
|
|||||||
}
|
}
|
||||||
ClientUtils.countAfterFrontAmt(model, i);//计算折扣后销售金额
|
ClientUtils.countAfterFrontAmt(model, i);//计算折扣后销售金额
|
||||||
}
|
}
|
||||||
ClientUtils.calculateDiscountRate(model, -1);
|
ClientUtils.calculateDiscountRate(view, model, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1758,15 +1758,15 @@ public class ClientUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void calculateDiscountRate(IDataModel model, int idx) {
|
public static void calculateDiscountRate(IFormView view, IDataModel model, int idx) {
|
||||||
String accamtusetype = (String) model.getValue("yem_accamtusetype");
|
String accamtusetype = (String) model.getValue("yem_accamtusetype");
|
||||||
if ("A".equals(accamtusetype)) {
|
if ("A".equals(accamtusetype)) {
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
doCalculateDiscountRate(model, idx);
|
doCalculateDiscountRate(view, model, idx);
|
||||||
} else {
|
} else {
|
||||||
int rowCount = model.getEntryRowCount("yem_es_materialinfo");
|
int rowCount = model.getEntryRowCount("yem_es_materialinfo");
|
||||||
for (int i = 0; i < rowCount; i++) {
|
for (int i = 0; i < rowCount; i++) {
|
||||||
doCalculateDiscountRate(model, i);
|
doCalculateDiscountRate(view, model, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1774,10 +1774,12 @@ public class ClientUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算折扣率
|
* 计算折扣率
|
||||||
|
*
|
||||||
|
* @param view
|
||||||
* @param model
|
* @param model
|
||||||
* @param idx
|
* @param idx
|
||||||
*/
|
*/
|
||||||
private static void doCalculateDiscountRate(IDataModel model, int idx) {
|
private static void doCalculateDiscountRate(IFormView view, IDataModel model, int idx) {
|
||||||
//yem_frontrateentry = ( yem_safobamount - yem_disamt ) / yem_safobamount * 100
|
//yem_frontrateentry = ( yem_safobamount - yem_disamt ) / yem_safobamount * 100
|
||||||
//折扣率% = ( 销售FOB金额 - 折扣金额 ) / 销售FOB金额 * 100
|
//折扣率% = ( 销售FOB金额 - 折扣金额 ) / 销售FOB金额 * 100
|
||||||
|
|
||||||
@ -1785,7 +1787,10 @@ public class ClientUtils {
|
|||||||
BigDecimal disamt = (BigDecimal) model.getValue("yem_disamt", idx);
|
BigDecimal disamt = (BigDecimal) model.getValue("yem_disamt", idx);
|
||||||
|
|
||||||
BigDecimal div = BigDecimalUtils.div(safobamount.subtract(disamt), safobamount, 12).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
BigDecimal div = BigDecimalUtils.div(safobamount.subtract(disamt), safobamount, 12).multiply(new BigDecimal("100")).setScale(2, RoundingMode.HALF_UP);
|
||||||
|
model.beginInit();
|
||||||
model.setValue("yem_frontrateentry", div, idx);
|
model.setValue("yem_frontrateentry", div, idx);
|
||||||
|
model.endInit();
|
||||||
|
view.updateView("yem_frontrateentry", idx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user