Compare commits

...

2 Commits

Author SHA1 Message Date
xuhaihui 5432763ef9 支出合同结算提交校验逻辑优化 2025-11-14 10:21:05 +08:00
xuhaihui f24e11f8c0 入库单优化 2025-11-14 10:20:42 +08:00
3 changed files with 30 additions and 12 deletions

View File

@ -349,14 +349,6 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
} else {
this.getModel().setValue("zcgj_freight_invoice", false, rowIndex);//运费发票
}
DynamicObject invoiceTypeId = invoice.getDynamicObject("invoicetypeid");
if (invoiceTypeId != null) {
String invoiceTypeIdName = invoiceTypeId.getString("name");
if (!invoiceTypeIdName.contains("")) {
this.getModel().setValue("zcgj_invoicetax", BigDecimal.ZERO, rowIndex);
this.getModel().setValue("zcgj_oftaxinvoiceamount", dataEntity.get("zcgj_invoiceamount"), rowIndex);
}
}
} else {
this.getModel().setValue("zcgj_freight_invoice", false);//运费发票
}
@ -403,6 +395,23 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
BigDecimal transAmount = (BigDecimal) this.getModel().getValue("transamount");//总运费
BigDecimal totalAmount = matAmount.add(transAmount);
this.getModel().setValue("totalamount", totalAmount);//入库总金额
} else if ("zcgj_applyinvoftaxamt".equals(key)) {
//本次申请金额
ChangeData[] changeSet = e.getChangeSet();
ChangeData changeData = changeSet[0];
int rowIndex = changeData.getRowIndex();
DynamicObject dataEntity = changeData.getDataEntity();
DynamicObject invoice = dataEntity.getDynamicObject("zcgj_invoice");//发票号码
if (invoice != null) {
DynamicObject invoiceTypeId = invoice.getDynamicObject("invoicetypeid");
if (invoiceTypeId != null) {
String invoiceTypeIdName = invoiceTypeId.getString("name");
if (!invoiceTypeIdName.contains("")) {
this.getModel().setValue("zcgj_invoicetax", BigDecimal.ZERO, rowIndex);
this.getModel().setValue("zcgj_oftaxinvoiceamount", dataEntity.get("zcgj_invoiceamount"), rowIndex);
}
}
}
}
}

View File

@ -34,6 +34,7 @@ public class MaterialInBillSubmitValidatorOp extends AbstractOperationServicePlu
e.getFieldKeys().add("matamount");
e.getFieldKeys().add("mataxamount");
e.getFieldKeys().add("zcgj_freight_invoice");
e.getFieldKeys().add("zcgj_no_invoice");
}
@Override
@ -48,9 +49,10 @@ public class MaterialInBillSubmitValidatorOp extends AbstractOperationServicePlu
ExtendedDataEntity[] extendedDataEntities = this.getDataEntities();
for (ExtendedDataEntity extendedDataEntity : extendedDataEntities) {
DynamicObject ecma_MaterialInBill = extendedDataEntity.getDataEntity();
boolean zcgj_no_invoice = ecma_MaterialInBill.getBoolean("zcgj_no_invoice");//无物资发票
DynamicObjectCollection entryEntityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息
DynamicObjectCollection entryEntity2Collection = ecma_MaterialInBill.getDynamicObjectCollection("entryentity");//入库单分录
if (entryEntityCollection != null && entryEntityCollection.size() > 0 && entryEntity2Collection != null && entryEntity2Collection.size() > 0) {
if (!zcgj_no_invoice && entryEntity2Collection != null && entryEntity2Collection.size() > 0) {
String invoice_type = ecma_MaterialInBill.getString("zcgj_invoice_type");//发票类型
boolean zcgj_notraninvoice = ecma_MaterialInBill.getBoolean("zcgj_notraninvoice");//无运费发票

View File

@ -23,6 +23,9 @@ public class OutContractValidatorSubOp extends AbstractOperationServicePlugIn {
super.onPreparePropertys(e);
e.getFieldKeys().add("iseqsettle");//按设备费用结算单结算
e.getFieldKeys().add("eqsettleentry");//设备费用结算分录
e.getFieldKeys().add("contract");//合同类型
e.getFieldKeys().add("itementry");//支付项分录
e.getFieldKeys().add("zcgj_processallocatentity");//工序分摊
}
@Override
@ -57,9 +60,13 @@ public class OutContractValidatorSubOp extends AbstractOperationServicePlugIn {
"qtzchtzy".equals(contractTypeNumber);
}
DynamicObjectCollection processAllocEntityCollection = dataEntity.getDynamicObjectCollection("zcgj_processallocatentity");//设备费用结算分录
boolean processAllocEmpty = processAllocEntityCollection.size() == 0;
DynamicObjectCollection itemEntryCollection = dataEntity.getDynamicObjectCollection("itementry");//支付项分录
boolean processAllocEmpty = false;
if (itemEntryCollection.size() > 0) {
DynamicObject itemEntry = itemEntryCollection.get(0);
DynamicObjectCollection processAllocEntityCollection = itemEntry.getDynamicObjectCollection("zcgj_processallocatentity");//工序分摊
processAllocEmpty = processAllocEntityCollection.size() == 0;
}
if (priceTypeMatch && contractTypeMatch && processAllocEmpty) {
this.addFatalErrorMessage(extendedDataEntity, "工序分摊必填!!");
}