|
@@ -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 ("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);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|