对公报销单专票校验

This commit is contained in:
zhangzhiguo 2025-09-19 10:41:11 +08:00
parent eced8b9638
commit e645995b8d
1 changed files with 15 additions and 2 deletions

View File

@ -43,16 +43,22 @@ public class InvoiceDeductionCheckOp extends AbstractOperationServicePlugIn {
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
DynamicObject dataEntity = extendedDataEntity.getDataEntity();
DynamicObject costCompany = dataEntity.getDynamicObject("costcompany");//费用承担公司
String formid = dataEntity.getDynamicObjectType().getName();
if (costCompany != null) {
Long companyId = costCompany.getLong("id");
if (OrgCheckUtils.isKS(companyId)) {
DynamicObjectCollection expenseentryentity = dataEntity.getDynamicObjectCollection("expenseentryentity");//费用明细
boolean isCkInvoice= false;
boolean isCkInvoicezp= false;
DynamicObjectCollection expenseentryentity = dataEntity.getDynamicObjectCollection("expenseentryentity");//费用明细
for (DynamicObject dynamicObject : expenseentryentity) {
boolean offset = dynamicObject.getBoolean("offset");
boolean offset = dynamicObject.getBoolean("offset");//可抵扣
if(offset){
isCkInvoice = offset;
}
boolean specialInvoice = dynamicObject.getBoolean("is_special_invoice");//专票
if(specialInvoice){
isCkInvoicezp = specialInvoice;
}
}
if(isCkInvoice){
String zcgjInvoiceremark = dataEntity.getString("zcgj_invoiceremark");
@ -61,6 +67,13 @@ public class InvoiceDeductionCheckOp extends AbstractOperationServicePlugIn {
String message = String.format("费用可抵扣,必须上传发票 或 填写特殊说明 才能提交");
this.addFatalErrorMessage(extendedDataEntity, message);
}
}else if(isCkInvoicezp){
String zcgjInvoiceremark = dataEntity.getString("zcgj_invoiceremark");
DynamicObjectCollection invoiceentry = dataEntity.getDynamicObjectCollection("invoiceentry");
if( (invoiceentry == null || invoiceentry.isEmpty()) && StringUtils.isEmpty(zcgjInvoiceremark) ){
String message = String.format("费用包含专票,必须上传发票 或 填写特殊说明 才能提交");
this.addFatalErrorMessage(extendedDataEntity, message);
}
}