支出合同结算 微调金额/税额

This commit is contained in:
程小伟 2025-05-20 17:42:55 +08:00
parent 183b88a3bb
commit cd0de0c717
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
package zcgj.zcdev.zcdev.pr.plugin.form;
import dm.jdbc.util.StringUtil;
import kd.bos.bill.AbstractBillPlugIn;
import kd.bos.entity.datamodel.events.PropertyChangedArgs;
import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.sdk.plugin.Plugin;
public class AdjustAmountOftaxBillPlugin extends AbstractBillPlugIn implements Plugin {
private static final Log log = LogFactory.getLog(AdjustAmountOftaxBillPlugin.class);
@Override
public void propertyChanged(PropertyChangedArgs e) {
super.propertyChanged(e);
String key = e.getProperty().getName();
log.info(AdjustAmountOftaxBillPlugin.class.getName() + ":变化的字段: " + key);
if(StringUtil.equals(key,"zcgj_adjustmount")){
log.info(AdjustAmountOftaxBillPlugin.class.getName() + "微调金额/税额字段发生变动 " + key);
boolean isAdjust = this.getModel().getDataEntity().getBoolean("zcgj_adjustmount");
int entryRowCount = this.getModel().getEntryRowCount("itementry");//获取支付分录数量
log.info(AdjustAmountOftaxBillPlugin.class.getName() + ":合同支付项分录总行L: " + entryRowCount);
if(isAdjust){
log.info(AdjustAmountOftaxBillPlugin.class.getName()+":微调金额:金额打开,税额锁定" );
for(int i = 0; i < entryRowCount; ++i) {
this.getView().setEnable(false, i, new String[]{"rate"});
this.getView().setEnable(true, i, new String[]{"amount"});
}
}else {
log.info(AdjustAmountOftaxBillPlugin.class.getName()+":微调税额:税额打开,金额锁定" );
for(int i = 0; i < entryRowCount; ++i) {
this.getView().setEnable(false, i, new String[]{"amount"});
this.getView().setEnable(true, i, new String[]{"rate"});
}
}
}
}
}