From 21d5cc1e40eb54ad130def9f575acd3846320b24 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 14 Jun 2011 14:50:09 -0500 Subject: [PATCH] Validate Invoice commit when complete it in GenerateInvoice - fixes #36 http://bitbucket.org/idempiere/idempiere/issue/36 Thanks to fercho_comus for pointing here --- .../src/org/compiere/process/InvoiceGenerate.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java index 67159f3911..46cf40e1c2 100644 --- a/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java +++ b/org.adempiere.base.process/src/org/compiere/process/InvoiceGenerate.java @@ -213,7 +213,7 @@ public class InvoiceGenerate extends SvrProcess { log.warning("BPartner has no Schedule - set to After Delivery"); order.setInvoiceRule(MOrder.INVOICERULE_AfterDelivery); - order.save(); + order.saveEx(); } else { @@ -479,7 +479,7 @@ public class InvoiceGenerate extends SvrProcess ips.setAD_Org_ID(ops.getAD_Org_ID()); ips.setProcessing(ops.isProcessing()); ips.setIsActive(ops.isActive()); - ips.save(); + ips.saveEx(); } m_invoice.validatePaySchedule(); m_invoice.saveEx(); @@ -491,13 +491,8 @@ public class InvoiceGenerate extends SvrProcess log.warning("completeInvoice - failed: " + m_invoice); addLog("completeInvoice - failed: " + m_invoice); // Elaine 2008/11/25 } - ///fercho m_invoice.save(); - if (!m_invoice.save()) - { - log.warning("completeInvoice - failed: " + m_invoice); - addLog("completeInvoice - failed: " + m_invoice); - } - ///fercho + m_invoice.saveEx(); + addLog(m_invoice.getC_Invoice_ID(), m_invoice.getDateInvoiced(), null, m_invoice.getDocumentNo()); m_created++; }