入库单添加发票逻辑添加过滤条件
This commit is contained in:
parent
3c2b27ed8b
commit
70570de660
|
@ -99,17 +99,30 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
|
|||
filter.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO));
|
||||
QFilter filter1 = new QFilter("isclaimed", "=", true);
|
||||
filter1.and(new QFilter("billstatus", "=", "C"));
|
||||
// DynamicObject contract = (DynamicObject) this.getModel().getValue("zcgj_contract");
|
||||
// if (contract != null) {
|
||||
// long contractId = contract.getLong("id");
|
||||
// filter1.and(new QFilter("contract", "=", contractId));
|
||||
filter1.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO));
|
||||
DynamicObjectCollection contInvEntryCol = this.getModel().getEntryEntity("zcgj_entryentity");
|
||||
DynamicObject contract = (DynamicObject) this.getModel().getValue("contract");//合同
|
||||
String matinsource = (String) this.getModel().getValue("matinsource");//入库来源
|
||||
if (contract != null && matinsource.equals("1")) {
|
||||
//入库来源为合同清单且合同字段不为空时,使用合同过滤
|
||||
long contractId = contract.getLong("id");
|
||||
filter1.and(new QFilter("contract", "=", contractId));
|
||||
filter1.and(new QFilter("unapplyamount", ">", BigDecimal.ZERO));
|
||||
} else {
|
||||
//入库来源不为合同时,根据项目过滤
|
||||
DynamicObject project = (DynamicObject) this.getModel().getValue("project");//项目
|
||||
if (project != null) {
|
||||
DynamicObject ec_in_invoice = BusinessDataServiceHelper.loadSingle("ec_in_invoice",
|
||||
new QFilter("project.billno", "=", project.getString("billno")).toArray());//进项发票登记
|
||||
if (ec_in_invoice != null) {
|
||||
filter1.and(new QFilter("invoiceno", "=", ec_in_invoice.getString("invoiceno")));//发票号码
|
||||
}
|
||||
}
|
||||
}
|
||||
DynamicObjectCollection contInvEntryCol = this.getModel().getEntryEntity("zcgj_entryentity");//发票分录
|
||||
if (contInvEntryCol.size() > 0) {
|
||||
List<Long> selectedInvIds = new ArrayList(8);
|
||||
|
||||
for (DynamicObject contInvEntryObj : contInvEntryCol) {
|
||||
DynamicObject invoice = contInvEntryObj.getDynamicObject("zcgj_invoice");
|
||||
DynamicObject invoice = contInvEntryObj.getDynamicObject("zcgj_invoice");//发票号码
|
||||
selectedInvIds.add(invoice.getLong("id"));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue