|
@@ -0,0 +1,91 @@
|
|
|
+package fi.em.editPlugin;
|
|
|
+
|
|
|
+
|
|
|
+import com.kingdee.bos.qing.publish.model.BillModel;
|
|
|
+import fi.em.service.PayamountCalcExt;
|
|
|
+import kd.bos.dataentity.entity.DynamicObject;
|
|
|
+import kd.bos.dataentity.entity.DynamicObjectCollection;
|
|
|
+import kd.bos.entity.datamodel.events.ChangeData;
|
|
|
+import kd.bos.entity.datamodel.events.PropertyChangedArgs;
|
|
|
+import kd.bos.list.plugin.AbstractListPlugin;
|
|
|
+import kd.fi.er.business.daily.reimburse.AmountObject;
|
|
|
+import kd.fi.er.mservice.ext.IErService4Ext;
|
|
|
+import kd.sdk.plugin.Plugin;
|
|
|
+import java.math.BigDecimal;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * @author cjz
|
|
|
+ * @date 2024/8/13 18:00
|
|
|
+ * @description:计算收款金额
|
|
|
+ */
|
|
|
+public class AmountEditPlugin extends AbstractListPlugin implements Plugin,IErService4Ext {
|
|
|
+
|
|
|
+ public static String nckd_unexporiusedamount="nckd_unexporiusedamount";
|
|
|
+ public static String nckd_er_tripreimburse_ext="nckd_er_tripreimburse_ext";
|
|
|
+ public static String orientryamount="orientryamount";
|
|
|
+ public static BigDecimal amount_all=new BigDecimal("0");
|
|
|
+ public static BigDecimal orgamount_all=new BigDecimal("0");
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void propertyChanged(PropertyChangedArgs e)
|
|
|
+ {
|
|
|
+ super.beforePropertyChanged(e);
|
|
|
+ String name = e.getProperty().getName();
|
|
|
+
|
|
|
+ if(nckd_unexporiusedamount.equals(name))
|
|
|
+ {
|
|
|
+ DynamicObject data=this.getModel().getDataEntity();
|
|
|
+ DynamicObjectCollection tripentry = data.getDynamicObjectCollection("tripentry");
|
|
|
+
|
|
|
+ for (DynamicObject item:tripentry) {
|
|
|
+ DynamicObjectCollection entryentity_cl=item.getDynamicObjectCollection("entryentity");
|
|
|
+ for (int i=0;i< entryentity_cl.size();i++) {
|
|
|
+
|
|
|
+ if (entryentity_cl.get(i).getBigDecimal("orientryamount").compareTo(BigDecimal.ZERO)>0) {
|
|
|
+ BigDecimal amount=entryentity_cl.get(i).getBigDecimal("orientryamount");
|
|
|
+ this.getModel().setValue("orientryamount",0,i);
|
|
|
+ this.getModel().setValue("orientryamount",amount,i);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nckd_unexporiusedamount.equals(name)||orientryamount.equals(name))
|
|
|
+ {
|
|
|
+ DynamicObject data=this.getModel().getDataEntity();
|
|
|
+
|
|
|
+ BigDecimal orgiexpebalanceamount_sum = new BigDecimal("0");
|
|
|
+
|
|
|
+ BigDecimal amountfy=new BigDecimal("0");
|
|
|
+
|
|
|
+ DynamicObjectCollection tripentry = data.getDynamicObjectCollection("tripentry");
|
|
|
+ for (DynamicObject item:tripentry) {
|
|
|
+ DynamicObjectCollection entryentity_cl=item.getDynamicObjectCollection("entryentity");
|
|
|
+ for (int i=0;i< entryentity_cl.size();i++) {
|
|
|
+
|
|
|
+ amountfy=amountfy.add(entryentity_cl.get(i).getBigDecimal("orientryamount"));
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ DynamicObjectCollection nckd_clearloanentry = data.getDynamicObjectCollection("nckd_clearloanentry");
|
|
|
+ for (DynamicObject entryentity:nckd_clearloanentry)
|
|
|
+ {
|
|
|
+
|
|
|
+ BigDecimal orgiexpebalanceamount=entryentity.getBigDecimal("nckd_unexporiusedamount");
|
|
|
+
|
|
|
+ orgiexpebalanceamount_sum=orgiexpebalanceamount_sum.add(orgiexpebalanceamount);
|
|
|
+ }
|
|
|
+
|
|
|
+ this.getModel().setValue("orireceiveamount",amountfy.subtract(orgiexpebalanceamount_sum),0);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|