支出合同结算优化
This commit is contained in:
parent
ff9dba8b48
commit
272f4a9eff
|
|
@ -107,6 +107,23 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
|
|||
QFilter qFilter = new QFilter("billno", QCP.equals, matInNumber);
|
||||
DynamicObject ecma_materialInBill = BusinessDataServiceHelper.loadSingle("ecma_materialinbill", new QFilter[]{qFilter});//入库单
|
||||
if (ecma_materialInBill != null) {
|
||||
if (zcgj_transset) {
|
||||
DynamicObjectCollection expensesummaryCollection = ecma_materialInBill.getDynamicObjectCollection("zcgj_expensesummary");//费用汇总
|
||||
for (DynamicObject entryEntity : expensesummaryCollection) {
|
||||
boolean zcgj_isfreightline = entryEntity.getBoolean("zcgj_isfreightline");//运费行
|
||||
if (!zcgj_isfreightline) {
|
||||
continue;
|
||||
}
|
||||
DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType);
|
||||
newProcessAllocEntity.set("zcgj_pa_amount", entryEntity.get("zcgj_pa_amount"));//价税合计-价税合计
|
||||
newProcessAllocEntity.set("zcgj_amountnotax", entryEntity.get("zcgj_amountnotax"));//不含税金额-不含税金额
|
||||
newProcessAllocEntity.set("zcgj_rateval", entryEntity.get("zcgj_rateval"));//税率(%)-税率(%)
|
||||
newProcessAllocEntity.set("zcgj_taxamt", entryEntity.get("zcgj_taxamt"));//税额-税额
|
||||
newProcessAllocEntity.set("zcgj_expenseitem", entryEntity.get("zcgj_expenseitem"));//费用项目-费用项目
|
||||
|
||||
processAllocEntityCollection.add(newProcessAllocEntity);
|
||||
}
|
||||
} else {
|
||||
DynamicObjectCollection entryEntityCollection = ecma_materialInBill.getDynamicObjectCollection("entryentity");//入库单分录
|
||||
for (DynamicObject entryEntity : entryEntityCollection) {
|
||||
DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType);
|
||||
|
|
@ -123,22 +140,6 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
|
|||
}
|
||||
newProcessAllocEntity.set("zcgj_expenseitem", expenseItem);//费用项目-对应费用项目
|
||||
|
||||
processAllocEntityCollection.add(newProcessAllocEntity);
|
||||
}
|
||||
if (zcgj_transset) {
|
||||
DynamicObjectCollection expensesummaryCollection = ecma_materialInBill.getDynamicObjectCollection("zcgj_expensesummary");//费用汇总
|
||||
for (DynamicObject entryEntity : expensesummaryCollection) {
|
||||
boolean zcgj_isfreightline = entryEntity.getBoolean("zcgj_isfreightline");//运费行
|
||||
if (!zcgj_isfreightline) {
|
||||
continue;
|
||||
}
|
||||
DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType);
|
||||
newProcessAllocEntity.set("zcgj_pa_amount", entryEntity.get("zcgj_pa_amount"));//价税合计-价税合计
|
||||
newProcessAllocEntity.set("zcgj_amountnotax", entryEntity.get("zcgj_amountnotax"));//不含税金额-不含税金额
|
||||
newProcessAllocEntity.set("zcgj_rateval", entryEntity.get("zcgj_rateval"));//税率(%)-税率(%)
|
||||
newProcessAllocEntity.set("zcgj_taxamt", entryEntity.get("zcgj_taxamt"));//税额-税额
|
||||
newProcessAllocEntity.set("zcgj_expenseitem", entryEntity.get("zcgj_expenseitem"));//费用项目-费用项目
|
||||
|
||||
processAllocEntityCollection.add(newProcessAllocEntity);
|
||||
}
|
||||
}
|
||||
|
|
@ -246,6 +247,23 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
|
|||
QFilter qFilter = new QFilter("billno", QCP.equals, matInNumber);
|
||||
DynamicObject ecma_materialInBill = BusinessDataServiceHelper.loadSingle("ecma_materialinbill", new QFilter[]{qFilter});//入库单
|
||||
if (ecma_materialInBill != null) {
|
||||
if (zcgj_transset) {
|
||||
DynamicObjectCollection expensesummaryCollection = ecma_materialInBill.getDynamicObjectCollection("zcgj_expensesummary");//费用汇总
|
||||
for (DynamicObject entryEntity : expensesummaryCollection) {
|
||||
boolean zcgj_isfreightline = entryEntity.getBoolean("zcgj_isfreightline");//运费行
|
||||
if (!zcgj_isfreightline) {
|
||||
continue;
|
||||
}
|
||||
DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType);
|
||||
newProcessAllocEntity.set("zcgj_pa_amount", entryEntity.get("zcgj_pa_amount"));//价税合计-价税合计
|
||||
newProcessAllocEntity.set("zcgj_amountnotax", entryEntity.get("zcgj_amountnotax"));//不含税金额-不含税金额
|
||||
newProcessAllocEntity.set("zcgj_rateval", entryEntity.get("zcgj_rateval"));//税率(%)-税率(%)
|
||||
newProcessAllocEntity.set("zcgj_taxamt", entryEntity.get("zcgj_taxamt"));//税额-税额
|
||||
newProcessAllocEntity.set("zcgj_expenseitem", entryEntity.get("zcgj_expenseitem"));//费用项目-费用项目
|
||||
|
||||
processAllocEntityCollection.add(newProcessAllocEntity);
|
||||
}
|
||||
} else {
|
||||
DynamicObjectCollection entryEntityCollection = ecma_materialInBill.getDynamicObjectCollection("entryentity");//入库单分录
|
||||
for (DynamicObject entryEntity : entryEntityCollection) {
|
||||
DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType);
|
||||
|
|
@ -262,22 +280,6 @@ public class CostAllocatorBillPlugin extends AbstractFormPlugin {
|
|||
}
|
||||
newProcessAllocEntity.set("zcgj_expenseitem", expenseItem);//费用项目-对应费用项目
|
||||
|
||||
processAllocEntityCollection.add(newProcessAllocEntity);
|
||||
}
|
||||
if (zcgj_transset) {
|
||||
DynamicObjectCollection expensesummaryCollection = ecma_materialInBill.getDynamicObjectCollection("zcgj_expensesummary");//费用汇总
|
||||
for (DynamicObject entryEntity : expensesummaryCollection) {
|
||||
boolean zcgj_isfreightline = entryEntity.getBoolean("zcgj_isfreightline");//运费行
|
||||
if (!zcgj_isfreightline) {
|
||||
continue;
|
||||
}
|
||||
DynamicObject newProcessAllocEntity = new DynamicObject(processAllocEntityType);
|
||||
newProcessAllocEntity.set("zcgj_pa_amount", entryEntity.get("zcgj_pa_amount"));//价税合计-价税合计
|
||||
newProcessAllocEntity.set("zcgj_amountnotax", entryEntity.get("zcgj_amountnotax"));//不含税金额-不含税金额
|
||||
newProcessAllocEntity.set("zcgj_rateval", entryEntity.get("zcgj_rateval"));//税率(%)-税率(%)
|
||||
newProcessAllocEntity.set("zcgj_taxamt", entryEntity.get("zcgj_taxamt"));//税额-税额
|
||||
newProcessAllocEntity.set("zcgj_expenseitem", entryEntity.get("zcgj_expenseitem"));//费用项目-费用项目
|
||||
|
||||
processAllocEntityCollection.add(newProcessAllocEntity);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,9 @@ import kd.ec.contract.opplugin.validator.OutContractSettleReferValidator;
|
|||
import kd.ec.contract.opplugin.validator.OutContractSettleTimeValidator;
|
||||
import kd.ec.contract.opplugin.validator.OutContractSettleValidator;
|
||||
|
||||
/**
|
||||
* 支出合同结算审核反审核系统插件二开
|
||||
*/
|
||||
public class OutContractSettleOpExt extends AbstractContractSettleOp {
|
||||
public OutContractSettleOpExt() {
|
||||
}
|
||||
|
|
@ -122,6 +125,7 @@ public class OutContractSettleOpExt extends AbstractContractSettleOp {
|
|||
boolean isSettleByMatIn = dataArr[i].getBoolean("issettlebymatin");
|
||||
boolean isSettleByReconciliation = dataArr[i].getBoolean("issettlebyreconc");
|
||||
boolean isSettleByEquipment = dataArr[i].getBoolean("iseqsettle");
|
||||
boolean zcgj_transset = dataArr[i].getBoolean("zcgj_transset");//按入库运费结算//二开添加
|
||||
Set<Long> materialInBillIds = new HashSet(16);
|
||||
Set<Long> reconciliationBillIds = new HashSet(16);
|
||||
Set<Long> equipmentBillIds = new HashSet(16);
|
||||
|
|
@ -151,7 +155,8 @@ public class OutContractSettleOpExt extends AbstractContractSettleOp {
|
|||
materialInBillIds.addAll(matInBillIdList);
|
||||
}
|
||||
|
||||
if (isSettleByMatIn) {
|
||||
// if (isSettleByMatIn) {//系统代码
|
||||
if (isSettleByMatIn || zcgj_transset) {//二开修改
|
||||
dynamicObjects = dataArr[i].getDynamicObjectCollection("materialinentry");
|
||||
|
||||
for (j = 0; j < dynamicObjects.size(); ++j) {
|
||||
|
|
@ -236,7 +241,6 @@ public class OutContractSettleOpExt extends AbstractContractSettleOp {
|
|||
bill.set("settlestatus", "0");
|
||||
}*///系统代码
|
||||
//二开修改↓
|
||||
boolean zcgj_transset = dataArr[i].getBoolean("zcgj_transset");//按入库运费结算
|
||||
if (StringUtils.equals("audit", operationKey)) {
|
||||
if (zcgj_transset) {
|
||||
bill.set("zcgj_settlestatus", "1");//运费已结算
|
||||
|
|
@ -304,7 +308,7 @@ public class OutContractSettleOpExt extends AbstractContractSettleOp {
|
|||
|
||||
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||
super.afterExecuteOperationTransaction(e);
|
||||
String operation = e.getOperationKey();
|
||||
/* String operation = e.getOperationKey();
|
||||
DynamicObject[] settleBills = e.getDataEntities();
|
||||
List<DynamicObject> settleBillList = Arrays.asList(settleBills);
|
||||
List<DynamicObject> listingEntrys = (List) settleBillList.stream().flatMap((settleBill) -> {
|
||||
|
|
@ -318,7 +322,7 @@ public class OutContractSettleOpExt extends AbstractContractSettleOp {
|
|||
this.updateListing(listingEntrys, true);
|
||||
} else if ("unaudit".equals(operation)) {
|
||||
this.updateListing(listingEntrys, false);
|
||||
}
|
||||
}*///二开注释掉的
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue