Compare commits
2 Commits
684677b725
...
a4447de1fa
Author | SHA1 | Date |
---|---|---|
“wyx12345678” | a4447de1fa | |
“wyx12345678” | f1831e3b13 |
|
@ -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);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue