Compare commits
3 Commits
6af8068791
...
645588997d
| Author | SHA1 | Date |
|---|---|---|
|
|
645588997d | |
|
|
0fd3ee6f99 | |
|
|
7e9b42806a |
|
|
@ -690,55 +690,12 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
|
|||
}
|
||||
}
|
||||
|
||||
/* protected void contractChanged(ChangeData changeData) {
|
||||
this.getModel().setValue("issettlebymatin", false);
|
||||
this.getModel().deleteEntryData("materialinentry");
|
||||
this.getModel().setValue("issettlebyreconc", false);
|
||||
this.getModel().deleteEntryData("reconcentry");
|
||||
this.getModel().setValue("iseqsettle", false);
|
||||
this.getModel().deleteEntryData("eqsettleentry");
|
||||
DynamicObject contract = (DynamicObject) changeData.getNewValue();
|
||||
if (contract == null) {
|
||||
this.getView().setVisible(false, new String[]{"issettlebymatin"});
|
||||
this.getView().setVisible(false, new String[]{"issettlebyreconc"});
|
||||
this.getView().setVisible(false, new String[]{"iseqsettle"});
|
||||
} else {
|
||||
DynamicObject project = contract.getDynamicObject("project");
|
||||
if (project == null) {
|
||||
this.getView().setEnable(false, new String[]{"project"});
|
||||
}
|
||||
|
||||
boolean isPurchaseContract = this.isPurchaseType();
|
||||
if (isPurchaseContract) {
|
||||
String contractSettle = contract.getString("settlemethod");
|
||||
if (StringUtils.equals(contractSettle, "B")) {
|
||||
this.getModel().setValue("issettlebymatin", true);
|
||||
this.getModel().setValue("issettlebyreconc", false);
|
||||
} else if (StringUtils.equals(contractSettle, "A")) {
|
||||
this.getModel().setValue("issettlebymatin", false);
|
||||
this.getModel().setValue("issettlebyreconc", true);
|
||||
}
|
||||
}
|
||||
|
||||
this.getView().setVisible(isPurchaseContract, new String[]{"issettlebymatin"});
|
||||
this.getView().setVisible(isPurchaseContract, new String[]{"issettlebyreconc"});
|
||||
boolean isLeaseContract = this.isLeaseType();
|
||||
this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"});
|
||||
}
|
||||
}*///系统代码
|
||||
protected void contractChanged(ChangeData changeData) {
|
||||
this.getModel().setValue("issettlebymatin", false);
|
||||
this.getModel().deleteEntryData("materialinentry");
|
||||
this.getModel().setValue("issettlebyreconc", false);
|
||||
this.getModel().deleteEntryData("reconcentry");
|
||||
Object value = this.getModel().getValue("contattr");//合同属性
|
||||
if (value != null) {
|
||||
DynamicObject contAttr = (DynamicObject) value;
|
||||
String numebr = contAttr.getString("number");
|
||||
if (!numebr.equals("sbwbl")) {
|
||||
this.getModel().setValue("iseqsettle", false);
|
||||
}
|
||||
}
|
||||
this.getModel().setValue("iseqsettle", false);
|
||||
this.getModel().deleteEntryData("eqsettleentry");
|
||||
DynamicObject contract = (DynamicObject) changeData.getNewValue();
|
||||
if (contract == null) {
|
||||
|
|
@ -765,10 +722,17 @@ public class OutContractSettleEditPluginExt extends AbstractBillPlugIn implement
|
|||
|
||||
this.getView().setVisible(isPurchaseContract, new String[]{"issettlebymatin"});
|
||||
this.getView().setVisible(isPurchaseContract, new String[]{"issettlebyreconc"});
|
||||
boolean isLeaseContract = this.isLeaseType();
|
||||
this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"});
|
||||
/* boolean isLeaseContract = this.isLeaseType();
|
||||
this.getView().setVisible(isLeaseContract, new String[]{"iseqsettle"});*///二开注释掉的系统代码
|
||||
//二开添加逻辑↓
|
||||
DynamicObject contractType = contract.getDynamicObject("contracttype");//合同名称-合同类型
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("number", QCP.equals, contractType.get("number"))};
|
||||
DynamicObject ec_conttype = BusinessDataServiceHelper.loadSingle("ec_conttype", "contattr", qFilters);//合同类型
|
||||
DynamicObject contattr = ec_conttype.getDynamicObject("contattr");//合同属性
|
||||
this.getView().setVisible(contattr != null && contattr.getString("number").equals("sbwbl"), "iseqsettle");//按设备费用结算单结算隐显
|
||||
//二开添加逻辑↑
|
||||
}
|
||||
}//二开替换
|
||||
}
|
||||
|
||||
|
||||
protected void itemUnitProjectChanged(ChangeData changeData) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import kd.bos.entity.validate.AbstractValidator;
|
|||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.QueryServiceHelper;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
|
|
@ -28,6 +29,7 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl
|
|||
e.getFieldKeys().add("zcgj_entryentity");//合同进项发票信息
|
||||
e.getFieldKeys().add("zcgj_invoice");//发票号码
|
||||
e.getFieldKeys().add("zcgj_purchaseapply");//采购申请
|
||||
e.getFieldKeys().add("fiaccountorg");//财务记账组织
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -45,22 +47,56 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl
|
|||
String matinsource = ecma_MaterialInBill.getString("matinsource");//入库来源
|
||||
if ("6".equals(matinsource)) {
|
||||
//入库来源为采购申请
|
||||
boolean zcgj_ispurchaseapplys = ecma_MaterialInBill.getBoolean("zcgj_ispurchaseapplys");//多采购申请
|
||||
if (zcgj_ispurchaseapplys) {
|
||||
DynamicObjectCollection zcgj_purchaseapplyentryCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_purchaseapplyentry");//采购申请分录
|
||||
if (zcgj_purchaseapplyentryCollection.size() > 0) {
|
||||
for (DynamicObject zcgj_purchaseapplyentry : zcgj_purchaseapplyentryCollection) {
|
||||
DynamicObject zcgj_purchaseapply = zcgj_purchaseapplyentry.getDynamicObject("zcgj_purchaseapply_f7");//采购申请
|
||||
DynamicObject fiaccountorg = ecma_MaterialInBill.getDynamicObject("fiaccountorg");//财务记账组织
|
||||
if (fiaccountorg != null) {
|
||||
QFilter filter = new QFilter("zcgj_companyblentry.zcgj_org.id", QCP.equals, fiaccountorg.getPkValue());
|
||||
filter.and(new QFilter("zcgj_checkreqdate", QCP.equals, true));
|
||||
DynamicObject zcgj_companybelong = QueryServiceHelper.queryOne("zcgj_companybelong", "id", new QFilter[]{filter});
|
||||
if (zcgj_companybelong != null) {
|
||||
boolean zcgj_ispurchaseapplys = ecma_MaterialInBill.getBoolean("zcgj_ispurchaseapplys");//多采购申请
|
||||
if (zcgj_ispurchaseapplys) {
|
||||
DynamicObjectCollection zcgj_purchaseapplyentryCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_purchaseapplyentry");//采购申请分录
|
||||
if (zcgj_purchaseapplyentryCollection.size() > 0) {
|
||||
for (DynamicObject zcgj_purchaseapplyentry : zcgj_purchaseapplyentryCollection) {
|
||||
DynamicObject zcgj_purchaseapply = zcgj_purchaseapplyentry.getDynamicObject("zcgj_purchaseapply_f7");//采购申请
|
||||
if (zcgj_purchaseapply == null) {
|
||||
continue;
|
||||
}
|
||||
String zcgj_number = zcgj_purchaseapply.getString("zcgj_number");
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("billno", QCP.equals, zcgj_number)};
|
||||
DynamicObject ecma_purchaseapply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply", "auditdate", qFilters);//采购申请
|
||||
Date auditdate = ecma_purchaseapply.getDate("auditdate");//采购申请-审核时间
|
||||
Date bizdate = ecma_MaterialInBill.getDate("bizdate");//业务日期
|
||||
if (auditdate != null && bizdate != null && auditdate.after(bizdate)) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请单:" + zcgj_number + "的审批日期不能晚于业务日期!");
|
||||
continue;
|
||||
}
|
||||
DynamicObjectCollection zcgj_entryentityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息
|
||||
if (zcgj_entryentityCollection.size() > 0) {
|
||||
for (DynamicObject zcgj_entryentity : zcgj_entryentityCollection) {
|
||||
DynamicObject zcgj_invoice = zcgj_entryentity.getDynamicObject("zcgj_invoice");//发票号码
|
||||
if (zcgj_invoice != null) {
|
||||
Date invoicedate = zcgj_invoice.getDate("invoicedate");//发票号码-开票日期
|
||||
String billno = zcgj_invoice.getString("billno");
|
||||
if (invoicedate != null && auditdate != null && auditdate.after(invoicedate)) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请单:" + zcgj_number + "的审批日期不能晚于发票:" + billno + "的开票日期!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DynamicObject zcgj_purchaseapply = ecma_MaterialInBill.getDynamicObject("zcgj_purchaseapply");//采购申请
|
||||
if (zcgj_purchaseapply == null) {
|
||||
continue;
|
||||
}
|
||||
String zcgj_number = zcgj_purchaseapply.getString("zcgj_number");
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("billno", QCP.equals, zcgj_number)};
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("id", QCP.equals, zcgj_purchaseapply.getPkValue())};
|
||||
DynamicObject ecma_purchaseapply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply", "auditdate", qFilters);//采购申请
|
||||
Date auditdate = ecma_purchaseapply.getDate("auditdate");//采购申请-审核时间
|
||||
Date bizdate = ecma_MaterialInBill.getDate("bizdate");//业务日期
|
||||
if (auditdate != null && bizdate != null && auditdate.after(bizdate)) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请单:" + zcgj_number + "的审批日期不能晚于业务日期!");
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于业务日期!");
|
||||
continue;
|
||||
}
|
||||
DynamicObjectCollection zcgj_entryentityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息
|
||||
|
|
@ -71,39 +107,13 @@ public class MaterialInBillDateSubValidatorOp extends AbstractOperationServicePl
|
|||
Date invoicedate = zcgj_invoice.getDate("invoicedate");//发票号码-开票日期
|
||||
String billno = zcgj_invoice.getString("billno");
|
||||
if (invoicedate != null && auditdate != null && auditdate.after(invoicedate)) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请单:" + zcgj_number + "的审批日期不能晚于发票:" + billno + "的开票日期!");
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于发票:" + billno + "的开票日期!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
DynamicObject zcgj_purchaseapply = ecma_MaterialInBill.getDynamicObject("zcgj_purchaseapply");//采购申请
|
||||
if (zcgj_purchaseapply == null) {
|
||||
continue;
|
||||
}
|
||||
QFilter[] qFilters = new QFilter[]{new QFilter("id", QCP.equals, zcgj_purchaseapply.getPkValue())};
|
||||
DynamicObject ecma_purchaseapply = BusinessDataServiceHelper.loadSingle("ecma_purchaseapply", "auditdate", qFilters);//采购申请
|
||||
Date auditdate = ecma_purchaseapply.getDate("auditdate");//采购申请-审核时间
|
||||
Date bizdate = ecma_MaterialInBill.getDate("bizdate");//业务日期
|
||||
if (auditdate != null && bizdate != null && auditdate.after(bizdate)) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于业务日期!");
|
||||
continue;
|
||||
}
|
||||
DynamicObjectCollection zcgj_entryentityCollection = ecma_MaterialInBill.getDynamicObjectCollection("zcgj_entryentity");//合同进项发票信息
|
||||
if (zcgj_entryentityCollection.size() > 0) {
|
||||
for (DynamicObject zcgj_entryentity : zcgj_entryentityCollection) {
|
||||
DynamicObject zcgj_invoice = zcgj_entryentity.getDynamicObject("zcgj_invoice");//发票号码
|
||||
if (zcgj_invoice != null) {
|
||||
Date invoicedate = zcgj_invoice.getDate("invoicedate");//发票号码-开票日期
|
||||
String billno = zcgj_invoice.getString("billno");
|
||||
if (invoicedate != null && auditdate != null && auditdate.after(invoicedate)) {
|
||||
this.addFatalErrorMessage(extendedDataEntity, "采购申请的审批日期不能晚于发票:" + billno + "的开票日期!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,6 +74,17 @@ public class InContractSettleFiConfirmWorkFlowPlugin implements IWorkflowPlugin
|
|||
inFinaceconfirm.set("zcgj_amount_all",amountAll);
|
||||
inFinaceconfirm.set("zcgj_taxamt_all",taxamtAll);
|
||||
|
||||
DynamicObjectCollection meteringSummaryCollection1 = inContractSettle.getDynamicObjectCollection("zcgj_metering_summary");//结算单-计量汇总
|
||||
DynamicObjectCollection meteringSummaryCollection2 = inFinaceconfirm.getDynamicObjectCollection("zcgj_metering_summary");//财务确认单-计量汇总
|
||||
meteringSummaryCollection2.clear();
|
||||
for (DynamicObject meteringSummary1 : meteringSummaryCollection1){
|
||||
DynamicObject newMeteringSummary = meteringSummaryCollection2.addNew();
|
||||
newMeteringSummary.set("zcgj_rateval",meteringSummary1.getBigDecimal("zcgj_rateval"));//税率(%)
|
||||
newMeteringSummary.set("zcgj_pa_amount",meteringSummary1.getBigDecimal("zcgj_pa_amount"));//含税金额
|
||||
newMeteringSummary.set("zcgj_amountnotax",meteringSummary1.getBigDecimal("zcgj_amountnotax"));//不含税金额
|
||||
newMeteringSummary.set("zcgj_taxamt1",meteringSummary1.getBigDecimal("zcgj_taxamt"));//税额
|
||||
}
|
||||
|
||||
SaveServiceHelper.saveOperate("zcgj_ec_in_finaceconfirm", new DynamicObject[]{inFinaceconfirm}, null);//支出合同实体
|
||||
|
||||
//生成支出财务确认单 end
|
||||
|
|
|
|||
|
|
@ -75,6 +75,17 @@ public class InContractSettleInvalidWorkFlowPlugin implements IWorkflowPlugin {
|
|||
inFinaceconfirm.set("zcgj_amount_all",amountAll);
|
||||
inFinaceconfirm.set("zcgj_taxamt_all",taxamtAll);
|
||||
|
||||
DynamicObjectCollection meteringSummaryCollection1 = inContractSettle.getDynamicObjectCollection("zcgj_metering_summary");//收入合同结算单-计量汇总
|
||||
DynamicObjectCollection meteringSummaryCollection2 = inFinaceconfirm.getDynamicObjectCollection("zcgj_metering_summary");//收入财务确认单-计量汇总
|
||||
meteringSummaryCollection2.clear();
|
||||
for (DynamicObject meteringSummary1 : meteringSummaryCollection1){
|
||||
DynamicObject newMeteringSummary = meteringSummaryCollection2.addNew();
|
||||
newMeteringSummary.set("zcgj_rateval",meteringSummary1.getBigDecimal("zcgj_rateval"));//税率(%)
|
||||
newMeteringSummary.set("zcgj_pa_amount",meteringSummary1.getBigDecimal("zcgj_pa_amount"));//含税金额
|
||||
newMeteringSummary.set("zcgj_amountnotax",meteringSummary1.getBigDecimal("zcgj_amountnotax"));//不含税金额
|
||||
newMeteringSummary.set("zcgj_taxamt1",meteringSummary1.getBigDecimal("zcgj_taxamt"));//税额
|
||||
}
|
||||
|
||||
OperationResult ecInFinaceconfirm = SaveServiceHelper.saveOperate("zcgj_ec_in_finaceconfirm", new DynamicObject[]{inFinaceconfirm}, null);//支出合同实体
|
||||
if(ecInFinaceconfirm.isSuccess()){
|
||||
String sourceBillId = inContractSettle.getString("zcgj_invalidbillid");
|
||||
|
|
|
|||
Loading…
Reference in New Issue