fix:
1.新增外销合同提交晓燕 2.外销合同点击是否赠品值更新错误修改
This commit is contained in:
parent
e0b2828d54
commit
a02ae13270
@ -1981,6 +1981,23 @@ public class SalesOrderEdit extends AbstractBillPlugIn implements Plugin, Before
|
|||||||
if ("submit".equals(operateKey)) {
|
if ("submit".equals(operateKey)) {
|
||||||
setNewpPrice(dataEntity, view);
|
setNewpPrice(dataEntity, view);
|
||||||
checkGiftsGivenNumber(dataEntity, e);
|
checkGiftsGivenNumber(dataEntity, e);
|
||||||
|
DynamicObjectCollection collection = dataEntity.getDynamicObjectCollection("yem_es_salesorder_zp");
|
||||||
|
Map<Long,BigDecimal> map = new HashMap<>();
|
||||||
|
for (DynamicObject dynamicObject : collection) {
|
||||||
|
DynamicObject yemGiveproactype = dynamicObject.getDynamicObject("yem_giveproactype");
|
||||||
|
if (yemGiveproactype != null) {
|
||||||
|
long aLong = yemGiveproactype.getLong("id");
|
||||||
|
BigDecimal yemSingleamt = dynamicObject.getBigDecimal("yem_singleamt");
|
||||||
|
if (map.get(aLong)!=null){
|
||||||
|
if (map.get(aLong).compareTo(yemSingleamt)!=0){
|
||||||
|
ConfirmCallBackListener confirmCallBackListener = new ConfirmCallBackListener("checkGiftsGivenNumber", this);
|
||||||
|
this.getView().showConfirm("赠送配件分录同一机型存在多个单台配件金额,请检查后在进行提交!!!", MessageBoxOptions.OKCancel, confirmCallBackListener);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
map.put(aLong,yemSingleamt);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("save".equals(operateKey)) {
|
if ("save".equals(operateKey)) {
|
||||||
|
@ -619,10 +619,12 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
IDataModel model = this.getModel();
|
IDataModel model = this.getModel();
|
||||||
DynamicObject dynamicObject = model.getDataEntity(true);
|
DynamicObject dynamicObject = model.getDataEntity(true);
|
||||||
DynamicObject giveproactype = (DynamicObject) model.getValue("yem_giveproactype", rowIndex);
|
DynamicObject giveproactype = (DynamicObject) model.getValue("yem_giveproactype", rowIndex);
|
||||||
|
BigDecimal yemSingleamt = (BigDecimal) model.getValue("yem_singleamt", rowIndex);
|
||||||
if (giveproactype == null) return;
|
if (giveproactype == null) return;
|
||||||
DynamicObjectCollection materialinfo = dynamicObject.getDynamicObjectCollection("yem_es_materialinfo");
|
DynamicObjectCollection materialinfo = dynamicObject.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
BigDecimal qty = BigDecimal.ZERO;
|
BigDecimal qty = BigDecimal.ZERO;
|
||||||
for (DynamicObject object : materialinfo) {
|
for (DynamicObject object : materialinfo) {
|
||||||
|
BigDecimal yemSinglepartgiftmat = object.getBigDecimal("yem_singlepartgiftmat");
|
||||||
String businesssort = object.getString("yem_businesssort");
|
String businesssort = object.getString("yem_businesssort");
|
||||||
boolean ifgift = object.getBoolean("yem_ifgift");
|
boolean ifgift = object.getBoolean("yem_ifgift");
|
||||||
if ("Z".equals(businesssort) && !ifgift) {
|
if ("Z".equals(businesssort) && !ifgift) {
|
||||||
@ -630,7 +632,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
if (productmodel == null) continue;
|
if (productmodel == null) continue;
|
||||||
productmodel = BusinessDataServiceHelper.loadSingle(productmodel.getPkValue(), productmodel.getDynamicObjectType().getName());
|
productmodel = BusinessDataServiceHelper.loadSingle(productmodel.getPkValue(), productmodel.getDynamicObjectType().getName());
|
||||||
DynamicObject products = productmodel.getDynamicObject("yem_products");
|
DynamicObject products = productmodel.getDynamicObject("yem_products");
|
||||||
if (products != null && products.getLong("id") == giveproactype.getLong("id")) {
|
if (products != null && products.getLong("id") == giveproactype.getLong("id")&&yemSingleamt.compareTo(yemSinglepartgiftmat)==0) {
|
||||||
qty = qty.add(object.getBigDecimal("yem_qty"));
|
qty = qty.add(object.getBigDecimal("yem_qty"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user