入库单发票导入插件优化
This commit is contained in:
parent
aafc6c63b6
commit
3b0deb688d
|
@ -129,7 +129,7 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
|
||||||
ListSelectedRowCollection rows = (ListSelectedRowCollection) event.getReturnData();
|
ListSelectedRowCollection rows = (ListSelectedRowCollection) event.getReturnData();
|
||||||
DynamicObject[] invArr = new DynamicObject[rows.size()];
|
DynamicObject[] invArr = new DynamicObject[rows.size()];
|
||||||
int index = 0;
|
int index = 0;
|
||||||
DynamicObject upContract = (DynamicObject) this.getModel().getValue("zcgj_contract");
|
// DynamicObject upContract = (DynamicObject) this.getModel().getValue("zcgj_contract");
|
||||||
for (ListSelectedRow row : rows) {
|
for (ListSelectedRow row : rows) {
|
||||||
Object invoicePk = row.getPrimaryKeyValue().toString();
|
Object invoicePk = row.getPrimaryKeyValue().toString();
|
||||||
int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity");
|
int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity");
|
||||||
|
@ -144,8 +144,8 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
|
||||||
this.getModel().setValue("zcgj_applyinvoftaxamt", invoice.getBigDecimal("unapplyamount"), rowIndex);
|
this.getModel().setValue("zcgj_applyinvoftaxamt", invoice.getBigDecimal("unapplyamount"), rowIndex);
|
||||||
invArr[index++] = invoice;
|
invArr[index++] = invoice;
|
||||||
invoice.set("isclaimed", true);
|
invoice.set("isclaimed", true);
|
||||||
invoice.set("contract", upContract);
|
// invoice.set("contract", upContract);
|
||||||
invoice.set("project", (DynamicObject) this.getModel().getValue("zcgj_project"));
|
invoice.set("project", (DynamicObject) this.getModel().getValue("project"));
|
||||||
invoice.set("connecttype", "contract");
|
invoice.set("connecttype", "contract");
|
||||||
}
|
}
|
||||||
SaveServiceHelper.save(invArr);
|
SaveServiceHelper.save(invArr);
|
||||||
|
@ -252,7 +252,7 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
|
||||||
if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double) 0.0F) {
|
if (unApplyAmount != null && unApplyAmount.doubleValue() <= (double) 0.0F) {
|
||||||
this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s,金额已经被关联完毕,不可重复使用", "PaymentApplyEditUI_23", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno")));
|
this.getView().showTipNotification(String.format(ResManager.loadKDString("发票号码%s,金额已经被关联完毕,不可重复使用", "PaymentApplyEditUI_23", "ec-contract-formplugin", new Object[0]), invoice.getString("invoiceno")));
|
||||||
} else {
|
} else {
|
||||||
DynamicObject upContract = (DynamicObject) this.getModel().getValue("zcgj_contract");
|
// DynamicObject upContract = (DynamicObject) this.getModel().getValue("zcgj_contract");
|
||||||
int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity");
|
int rowIndex = this.getModel().createNewEntryRow("zcgj_entryentity");
|
||||||
this.getModel().setValue("zcgj_invoice", invoice.getPkValue(), rowIndex);
|
this.getModel().setValue("zcgj_invoice", invoice.getPkValue(), rowIndex);
|
||||||
this.getModel().setValue("zcgj_invoicecurrency", invoice.getDynamicObject("currency") == null ? Long.valueOf("0") : invoice.getDynamicObject("currency").getPkValue(), rowIndex);
|
this.getModel().setValue("zcgj_invoicecurrency", invoice.getDynamicObject("currency") == null ? Long.valueOf("0") : invoice.getDynamicObject("currency").getPkValue(), rowIndex);
|
||||||
|
@ -263,8 +263,8 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
|
||||||
this.getModel().setValue("zcgj_unapplyinvtax", invoice.getBigDecimal("unapplyinvtax"), rowIndex);
|
this.getModel().setValue("zcgj_unapplyinvtax", invoice.getBigDecimal("unapplyinvtax"), rowIndex);
|
||||||
this.getModel().setValue("zcgj_applyinvoftaxamt", invoice.getBigDecimal("unapplyamount"), rowIndex);
|
this.getModel().setValue("zcgj_applyinvoftaxamt", invoice.getBigDecimal("unapplyamount"), rowIndex);
|
||||||
invoice.set("isclaimed", true);
|
invoice.set("isclaimed", true);
|
||||||
invoice.set("contract", upContract);
|
// invoice.set("contract", upContract);
|
||||||
invoice.set("project", (DynamicObject) this.getModel().getValue("zcgj_project"));
|
invoice.set("project", (DynamicObject) this.getModel().getValue("project"));
|
||||||
invoice.set("connecttype", "contract");
|
invoice.set("connecttype", "contract");
|
||||||
invArr.add(invoice);
|
invArr.add(invoice);
|
||||||
}
|
}
|
||||||
|
@ -309,7 +309,7 @@ public class MaterialInbFinaceConfirmeInvoicePlugin extends AbstractBillPlugIn i
|
||||||
// DynamicObjectType subDT = this.getModel().getDynamicObjectCollection("zcgj_entryentity").getDynamicObjectType();
|
// DynamicObjectType subDT = this.getModel().getDynamicObjectCollection("zcgj_entryentity").getDynamicObjectType();
|
||||||
QFilter filter = new QFilter("zcgj_entryentity.zcgj_invoice", "in", updateInvoicePks);
|
QFilter filter = new QFilter("zcgj_entryentity.zcgj_invoice", "in", updateInvoicePks);
|
||||||
filter.and("id", "!=", this.getModel().getDataEntity().getPkValue());
|
filter.and("id", "!=", this.getModel().getDataEntity().getPkValue());
|
||||||
DynamicObjectCollection invoiceApplyEntries = QueryServiceHelper.query("zcgj_ecma_materialinb_ext", "zcgj_entryentity.zcgj_invoice", new QFilter[]{filter});
|
DynamicObjectCollection invoiceApplyEntries = QueryServiceHelper.query("ecma_materialinbill", "zcgj_entryentity.zcgj_invoice", new QFilter[]{filter});
|
||||||
if (invoiceApplyEntries != null && !invoiceApplyEntries.isEmpty()) {
|
if (invoiceApplyEntries != null && !invoiceApplyEntries.isEmpty()) {
|
||||||
for (DynamicObject subEntry : invoiceApplyEntries) {
|
for (DynamicObject subEntry : invoiceApplyEntries) {
|
||||||
updateInvoicePks.remove(subEntry.get("zcgj_entryentity.zcgj_invoice"));
|
updateInvoicePks.remove(subEntry.get("zcgj_entryentity.zcgj_invoice"));
|
||||||
|
|
Loading…
Reference in New Issue