付款申请单退款校验
This commit is contained in:
parent
1c2d589c84
commit
cbf4570246
|
|
@ -10,8 +10,11 @@ import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
|||
import kd.bos.entity.validate.AbstractValidator;
|
||||
import kd.bos.servicehelper.user.UserServiceHelper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 付款申请单关联单据校验
|
||||
* 退款时付款金额负数校验
|
||||
*/
|
||||
public class PaymentapplyRelationalCkOp extends AbstractOperationServicePlugIn {
|
||||
|
||||
|
|
@ -21,6 +24,7 @@ public class PaymentapplyRelationalCkOp extends AbstractOperationServicePlugIn {
|
|||
e.getFieldKeys().add("entryentity");//
|
||||
e.getFieldKeys().add("zcgj_maintenance");//设备维修申请单
|
||||
e.getFieldKeys().add("zcgj_purchaseapply");//采购申请单
|
||||
e.getFieldKeys().add("zcgj_payback");//退款
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -40,6 +44,7 @@ public class PaymentapplyRelationalCkOp extends AbstractOperationServicePlugIn {
|
|||
if(entryentity != null){
|
||||
boolean isshowwxsq = false;
|
||||
boolean isshowcgsq = false;
|
||||
boolean isnegative = false; //是否有负数
|
||||
for (DynamicObject dynamicObject : entryentity) {
|
||||
DynamicObject contract = dynamicObject.getDynamicObject("contract");
|
||||
String paymenttype = dynamicObject.getString("paymenttype");
|
||||
|
|
@ -53,6 +58,9 @@ public class PaymentapplyRelationalCkOp extends AbstractOperationServicePlugIn {
|
|||
isshowcgsq = true;
|
||||
}
|
||||
}
|
||||
BigDecimal thisapplyoftax = dynamicObject.getBigDecimal("thisapplyoftax");
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(isshowwxsq){
|
||||
|
|
@ -70,6 +78,18 @@ public class PaymentapplyRelationalCkOp extends AbstractOperationServicePlugIn {
|
|||
this.addWarningMessage(extendedDataEntity, String.format("请注意:采购申请单分录为空!"));
|
||||
}
|
||||
}
|
||||
|
||||
boolean payback = dataEntity.getBoolean("zcgj_payback");//如果时退款时
|
||||
if(payback){
|
||||
int i=1;
|
||||
for (DynamicObject dynamicObject : entryentity) {
|
||||
BigDecimal thisapplyoftax = dynamicObject.getBigDecimal("thisapplyoftax");
|
||||
if(thisapplyoftax.compareTo(BigDecimal.ZERO)>0){
|
||||
this.addErrorMessage(extendedDataEntity, String.format("付款信息第%d行,本次申请金额必须为负数!",i));
|
||||
}
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue