Compare commits

...

2 Commits

Author SHA1 Message Date
“wyx12345678” a4447de1fa Merge remote-tracking branch 'origin/master' 2024-06-14 15:55:04 +08:00
“wyx12345678” f1831e3b13 自动汇总汇率 2024-06-14 15:54:30 +08:00
1 changed files with 16 additions and 0 deletions

View File

@ -1,12 +1,14 @@
package shkd.fi.er.plugin.formplugin; package shkd.fi.er.plugin.formplugin;
import kd.bos.dataentity.entity.DynamicObject; import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.dataentity.metadata.IDataEntityProperty; import kd.bos.dataentity.metadata.IDataEntityProperty;
import kd.bos.entity.datamodel.IDataModel; import kd.bos.entity.datamodel.IDataModel;
import kd.bos.entity.datamodel.events.ChangeData; import kd.bos.entity.datamodel.events.ChangeData;
import kd.bos.entity.datamodel.events.PropertyChangedArgs; import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.form.plugin.AbstractFormPlugin; import kd.bos.form.plugin.AbstractFormPlugin;
import java.math.BigDecimal;
import java.util.EventObject; import java.util.EventObject;
/** /**
@ -54,6 +56,20 @@ public class ContractbillFromPlugin extends AbstractFormPlugin {
case "contractparty" : case "contractparty" :
DynamicObject newValue = (DynamicObject)changeData.getNewValue(); DynamicObject newValue = (DynamicObject)changeData.getNewValue();
this.getModel().setValue("costcompany",newValue); this.getModel().setValue("costcompany",newValue);
case "orientryamount":
DynamicObjectCollection expenseentryentity = this.getModel().getEntryEntity("expenseentryentity");
BigDecimal orientryamounttotal = BigDecimal.ZERO;
BigDecimal taxamounttotal = BigDecimal.ZERO;
for(int i = 0;i<expenseentryentity.size();i++){
DynamicObject dynamicObject = expenseentryentity.get(i);
BigDecimal orientryamount = dynamicObject.getBigDecimal("orientryamount");
BigDecimal taxamount = dynamicObject.getBigDecimal("taxamount");
orientryamounttotal = orientryamounttotal.add(orientryamount);
taxamounttotal = taxamounttotal.add(taxamount);
}
BigDecimal divide = orientryamounttotal.divide(taxamounttotal, 2, 4); //计算税率
this.getModel().setValue("taxrate",divide);
} }
} }
} }