fix:
1.单价四舍五入保留两位小数
This commit is contained in:
parent
3031c43db3
commit
2caaf2c850
@ -38,7 +38,7 @@ public class ClientUtils {
|
|||||||
String Entityname = dataEntity.getDataEntityType().getName();
|
String Entityname = dataEntity.getDataEntityType().getName();
|
||||||
BigDecimal yem_exrate = dataEntity.getBigDecimal("yem_exrate");
|
BigDecimal yem_exrate = dataEntity.getBigDecimal("yem_exrate");
|
||||||
DynamicObjectCollection detailedinfor = getTypeColl(models);
|
DynamicObjectCollection detailedinfor = getTypeColl(models);
|
||||||
DynamicObjectCollection materialInfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
// DynamicObjectCollection materialInfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
|
|
||||||
//提示
|
//提示
|
||||||
StringBuffer info = new StringBuffer();
|
StringBuffer info = new StringBuffer();
|
||||||
@ -46,7 +46,7 @@ public class ClientUtils {
|
|||||||
List<DynamicObject> pjDatas = new ArrayList<DynamicObject>();
|
List<DynamicObject> pjDatas = new ArrayList<DynamicObject>();
|
||||||
List<DynamicObject> selectDatas = new ArrayList<DynamicObject>();
|
List<DynamicObject> selectDatas = new ArrayList<DynamicObject>();
|
||||||
int rowInfo = 0;
|
int rowInfo = 0;
|
||||||
boolean flag = false;
|
// boolean flag = false;
|
||||||
for (DynamicObject temp : detailedinfor) {
|
for (DynamicObject temp : detailedinfor) {
|
||||||
if (Entityname.equals("yem_es_xsalesorder")) {
|
if (Entityname.equals("yem_es_xsalesorder")) {
|
||||||
String yem_linetype = temp.getString("yem_linetype");
|
String yem_linetype = temp.getString("yem_linetype");
|
||||||
@ -549,7 +549,8 @@ public class ClientUtils {
|
|||||||
// BigDecimal pricefieldacc = (BigDecimal) model.getValue("yem_pricefieldaccba", rowNow);
|
// BigDecimal pricefieldacc = (BigDecimal) model.getValue("yem_pricefieldaccba", rowNow);
|
||||||
BigDecimal truecaramt = (BigDecimal) model.getValue("yem_truecaramt", rowNow); // 实际整车金额
|
BigDecimal truecaramt = (BigDecimal) model.getValue("yem_truecaramt", rowNow); // 实际整车金额
|
||||||
BigDecimal qty = (BigDecimal) model.getValue("yem_qty", rowNow);
|
BigDecimal qty = (BigDecimal) model.getValue("yem_qty", rowNow);
|
||||||
model.setValue("yem_truecarprice", BigDecimalUtils.div(truecaramt, qty, 2), rowNow);
|
// model.setValue("yem_truecarprice", BigDecimalUtils.div(truecaramt, qty, 2), rowNow);
|
||||||
|
model.setValue("yem_truecarprice", truecaramt.divide(qty,2, RoundingMode.HALF_UP), rowNow);
|
||||||
} else {
|
} else {
|
||||||
model.setValue("yem_truecarprice", null, rowNow);
|
model.setValue("yem_truecarprice", null, rowNow);
|
||||||
}
|
}
|
||||||
@ -1234,7 +1235,7 @@ public class ClientUtils {
|
|||||||
BigDecimal priceFieldAccBa = (BigDecimal) model.getValue("yem_pricefieldaccba", row);//资源配置单价
|
BigDecimal priceFieldAccBa = (BigDecimal) model.getValue("yem_pricefieldaccba", row);//资源配置单价
|
||||||
BigDecimal oneCarSum = (BigDecimal) model.getValue("yem_onecarsum", row);//单车总费用
|
BigDecimal oneCarSum = (BigDecimal) model.getValue("yem_onecarsum", row);//单车总费用
|
||||||
BigDecimal saamtpriceclause = (BigDecimal) model.getValue("yem_saamtpriceclause", row);// 销售金额(价格条款)
|
BigDecimal saamtpriceclause = (BigDecimal) model.getValue("yem_saamtpriceclause", row);// 销售金额(价格条款)
|
||||||
model.setValue("yem_sapricepriceclause", BigDecimalUtils.div(saamtpriceclause, qty, 2), row);
|
model.setValue("yem_sapricepriceclause", saamtpriceclause.divide(qty,2, RoundingMode.HALF_UP), row);
|
||||||
|
|
||||||
// if (afterFrontDisPrice.compareTo(BigDecimal.ZERO) > 0) {
|
// if (afterFrontDisPrice.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
// // 销售单价(价格条款)= (销售金额(价格条款) / 数量)
|
// // 销售单价(价格条款)= (销售金额(价格条款) / 数量)
|
||||||
@ -1293,7 +1294,7 @@ public class ClientUtils {
|
|||||||
if (billtype == null) return;
|
if (billtype == null) return;
|
||||||
String type = billtype.getString("number");
|
String type = billtype.getString("number");
|
||||||
if (ArrayUtils.contains(roundArr, type)) {
|
if (ArrayUtils.contains(roundArr, type)) {
|
||||||
model.setValue("yem_saamtpriceclause", calculate.setScale(0, RoundingMode.UP), rowNow);
|
model.setValue("yem_saamtpriceclause", calculate.setScale(2, RoundingMode.UP), rowNow);
|
||||||
} else {
|
} else {
|
||||||
model.setValue("yem_saamtpriceclause", calculate, rowNow);
|
model.setValue("yem_saamtpriceclause", calculate, rowNow);
|
||||||
}
|
}
|
||||||
@ -1317,7 +1318,7 @@ public class ClientUtils {
|
|||||||
BigDecimal onecarsum = (BigDecimal) model.getValue("yem_onecarsum", row);//单车总费用
|
BigDecimal onecarsum = (BigDecimal) model.getValue("yem_onecarsum", row);//单车总费用
|
||||||
BigDecimal pricefieldaccba = (BigDecimal) model.getValue("yem_pricefieldaccba", row);//资源配件单价
|
BigDecimal pricefieldaccba = (BigDecimal) model.getValue("yem_pricefieldaccba", row);//资源配件单价
|
||||||
BigDecimal add = afterfrontdisprice.add(onecarsum).add(pricefieldaccba);
|
BigDecimal add = afterfrontdisprice.add(onecarsum).add(pricefieldaccba);
|
||||||
add = add.setScale(0, RoundingMode.UP);
|
add = add.setScale(2, RoundingMode.HALF_UP);
|
||||||
model.setValue("yem_sapricepriceclause", add, row);
|
model.setValue("yem_sapricepriceclause", add, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1344,7 +1345,7 @@ public class ClientUtils {
|
|||||||
BigDecimal afterfrontdisprice = (BigDecimal) model.getValue("yem_afterfrontdisprice", row);
|
BigDecimal afterfrontdisprice = (BigDecimal) model.getValue("yem_afterfrontdisprice", row);
|
||||||
BigDecimal onecarsum = (BigDecimal) model.getValue("yem_onecarsum", row);
|
BigDecimal onecarsum = (BigDecimal) model.getValue("yem_onecarsum", row);
|
||||||
BigDecimal add = afterfrontdisprice.add(onecarsum);
|
BigDecimal add = afterfrontdisprice.add(onecarsum);
|
||||||
add = add.setScale(0, RoundingMode.UP);
|
add = add.setScale(2, RoundingMode.HALF_UP);
|
||||||
model.setValue("yem_truecarprice", add, row);
|
model.setValue("yem_truecarprice", add, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1900,7 +1901,8 @@ public class ClientUtils {
|
|||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
BigDecimal standardprice = (BigDecimal) model.getValue("yem_standardprice", idx);//标配FOB(青岛)价
|
BigDecimal standardprice = (BigDecimal) model.getValue("yem_standardprice", idx);//标配FOB(青岛)价
|
||||||
BigDecimal exrate = (BigDecimal) model.getValue("yem_exrate");//汇率
|
BigDecimal exrate = (BigDecimal) model.getValue("yem_exrate");//汇率
|
||||||
BigDecimal calc = BigDecimalUtils.div(standardprice, exrate, 10);
|
// BigDecimal calc = BigDecimalUtils.div(standardprice, exrate, 10);
|
||||||
|
BigDecimal calc = standardprice.divide(exrate,10,RoundingMode.HALF_UP);
|
||||||
calc = calc.setScale(0, RoundingMode.UP);
|
calc = calc.setScale(0, RoundingMode.UP);
|
||||||
model.setValue("yem_sastandardfcaprice", calc, idx);
|
model.setValue("yem_sastandardfcaprice", calc, idx);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user