|
@@ -140,24 +140,48 @@ public class CostAllocationEditPlugin extends AbstractListPlugin implements Plug
|
|
|
this.getView().showForm(ShowParameter);
|
|
|
}
|
|
|
|
|
|
-// @Override
|
|
|
-// public void propertyChanged(PropertyChangedArgs e) {
|
|
|
-// super.beforePropertyChanged(e);
|
|
|
-// String name = e.getProperty().getName();//获取字段标识
|
|
|
-// if ("nckd_textfield2".equals(name)) {
|
|
|
-// ChangeData[] changeSet = e.getChangeSet();//获取值
|
|
|
-// for (ChangeData changeData : changeSet) {
|
|
|
-// int rowIndex = changeData.getRowIndex();
|
|
|
-// Object newValue = changeData.getNewValue();
|
|
|
-// Object oldValue = changeData.getOldValue();
|
|
|
-// String nckdTextfield2 = this.getModel().getValue("nckd_textfield2", rowIndex).toString();
|
|
|
-// QFilter nckd_orgamountFilter = new QFilter("im_purinbill.billentry.lotnumber", QCP.equals,nckdTextfield2);
|
|
|
-// //组织实体
|
|
|
-// DynamicObject im_purinbill = BusinessDataServiceHelper.loadSingle("im_purinbill","id,billentry.price",new QFilter[] {nckd_orgamountFilter});
|
|
|
-// BigDecimal price = im_purinbill.getBigDecimal("price");
|
|
|
-// this.getModel().setValue("nckd_pricefield1", price, rowIndex);
|
|
|
-//
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
+ @Override
|
|
|
+ public void propertyChanged(PropertyChangedArgs e) {
|
|
|
+ super.beforePropertyChanged(e);
|
|
|
+ String name = e.getProperty().getName();//获取字段标识
|
|
|
+ if ("tripstdshow".equals(name)) {
|
|
|
+ ChangeData[] changeSet = e.getChangeSet();//获取值
|
|
|
+ for (ChangeData changeData : changeSet) {
|
|
|
+ int rowIndex = changeData.getRowIndex();
|
|
|
+ Object newValue = changeData.getNewValue();
|
|
|
+ Object oldValue = changeData.getOldValue();
|
|
|
+ String nckdAmountfield4 = this.getModel().getValue("nckd_amountfield4").toString();
|
|
|
+ BigDecimal bigDecimal = new BigDecimal(nckdAmountfield4);
|
|
|
+ BigDecimal bigDecimal1 = new BigDecimal(0);
|
|
|
+ DynamicObjectCollection nckdClearloanentry = this.getModel().getEntryEntity("nckd_clearloanentry");
|
|
|
+ for(int i=0;i<nckdClearloanentry.size();i++){
|
|
|
+ DynamicObject dynamicObject = nckdClearloanentry.get(i);
|
|
|
+ BigDecimal nckdUnexporiusedamount = dynamicObject.getBigDecimal("nckd_unexporiusedamount");
|
|
|
+ bigDecimal1=bigDecimal1.add(nckdUnexporiusedamount);
|
|
|
+ }
|
|
|
+ if(bigDecimal1.compareTo(bigDecimal) == 1){
|
|
|
+ DynamicObjectCollection accountentry = this.getModel().getEntryEntity("accountentry");
|
|
|
+ DynamicObject dynamicObject = accountentry.get(0);
|
|
|
+ if(dynamicObject!=null){
|
|
|
+ this.getModel().setValue("orireceiveamount",new BigDecimal(0),0);
|
|
|
+
|
|
|
+ }
|
|
|
+ } else if (bigDecimal1.compareTo(bigDecimal) == 0) {
|
|
|
+ DynamicObjectCollection accountentry = this.getModel().getEntryEntity("accountentry");
|
|
|
+ DynamicObject dynamicObject = accountentry.get(0);
|
|
|
+ if(dynamicObject!=null){
|
|
|
+ this.getModel().setValue("orireceiveamount",new BigDecimal(0),0);
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ DynamicObjectCollection accountentry = this.getModel().getEntryEntity("accountentry");
|
|
|
+ DynamicObject dynamicObject = accountentry.get(0);
|
|
|
+ if(dynamicObject!=null){
|
|
|
+ bigDecimal=bigDecimal.subtract(bigDecimal1);
|
|
|
+ this.getModel().setValue("orireceiveamount",bigDecimal,0);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|