From 2dfefe0ecd58ebd5dd8b6b28ee168805f96e4f2d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 28 Mar 2015 09:19:29 -0500 Subject: [PATCH 1/3] IDEMPIERE-2543 Completing invoices paid in cash assigning inactive account --- org.adempiere.base/src/org/compiere/model/MInvoice.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.base/src/org/compiere/model/MInvoice.java b/org.adempiere.base/src/org/compiere/model/MInvoice.java index e309535460..9163f41b3b 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoice.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoice.java @@ -1718,6 +1718,7 @@ public class MInvoice extends X_C_Invoice implements DocAction String whereClause = "AD_Org_ID=? AND C_Currency_ID=?"; MBankAccount ba = new Query(getCtx(),MBankAccount.Table_Name,whereClause,get_TrxName()) .setParameters(getAD_Org_ID(), getC_Currency_ID()) + .setOnlyActiveRecords(true) .setOrderBy("IsDefault DESC") .first(); if (ba == null) { From 7b07b5831483359ea45c2d8481a45b5be3aabcbb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Apr 2015 09:40:13 -0500 Subject: [PATCH 2/3] IDEMPIERE-2555 Fact Reconciliation statement leak --- .../org/compiere/process/FactReconcile.java | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/process/FactReconcile.java b/org.adempiere.base/src/org/compiere/process/FactReconcile.java index 4f8dafb533..70c6654dbe 100644 --- a/org.adempiere.base/src/org/compiere/process/FactReconcile.java +++ b/org.adempiere.base/src/org/compiere/process/FactReconcile.java @@ -17,7 +17,6 @@ package org.compiere.process; import java.sql.PreparedStatement; -import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; @@ -118,7 +117,6 @@ public class FactReconcile extends SvrProcess if (log.isLoggable(Level.INFO)) log.info("AD_PInstance_ID= " + getAD_PInstance_ID()); PreparedStatement pstmt = null; - ResultSet rs = null; int count; int unmatched; @@ -126,8 +124,8 @@ public class FactReconcile extends SvrProcess if (seq == null) throw new AdempiereException("No sequence for Fact_Reconciliation table"); - try - { + try + { // add new facts into reconciliation table sql = "INSERT into Fact_Reconciliation " + "(Fact_Reconciliation_ID, AD_Client_ID, AD_Org_ID, Created, CreatedBy, Updated, UpdatedBy, " + @@ -144,6 +142,7 @@ public class FactReconcile extends SvrProcess pstmt.setInt(1, seq.getAD_Sequence_ID()); pstmt.setInt(2, account.get_ID()); count = pstmt.executeUpdate(); + DB.close(pstmt); pstmt = null; if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Inserted " + count + " new facts into Fact_Reconciliation"); // set the matchcode based on the rule found in AD_Rule @@ -160,6 +159,7 @@ public class FactReconcile extends SvrProcess pstmt = DB.prepareStatement(sql, get_TrxName()); pstmt.setInt(1, account.get_ID()); count = pstmt.executeUpdate(); + DB.close(pstmt); pstmt = null; if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Updated " + count + " match codes."); @@ -180,18 +180,17 @@ public class FactReconcile extends SvrProcess unmatched = pstmt.executeUpdate(); if (log.isLoggable(Level.FINE))log.log(Level.FINE, "Cleared match codes from " + unmatched + " unreconciled facts."); - - } - catch (SQLException e) - { + } + catch (SQLException e) + { log.log(Level.SEVERE, sql, e); return e.getLocalizedMessage(); - } - finally - { - DB.close(rs, pstmt); - rs = null; pstmt = null; - } + } + finally + { + DB.close(pstmt); + pstmt = null; + } return "Matched " + (count-unmatched) + " facts"; } // doIt From 82377b98e2ad5248e5886f481590a64190ab4370 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Apr 2015 11:40:21 -0500 Subject: [PATCH 3/3] IDEMPIERE-2548 Misspelling in Unit of Measure Type --- migration/i2.1/oracle/201504011139_IDEMPIERE-2548.sql | 11 +++++++++++ .../i2.1/postgresql/201504011139_IDEMPIERE-2548.sql | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 migration/i2.1/oracle/201504011139_IDEMPIERE-2548.sql create mode 100644 migration/i2.1/postgresql/201504011139_IDEMPIERE-2548.sql diff --git a/migration/i2.1/oracle/201504011139_IDEMPIERE-2548.sql b/migration/i2.1/oracle/201504011139_IDEMPIERE-2548.sql new file mode 100644 index 0000000000..acde239547 --- /dev/null +++ b/migration/i2.1/oracle/201504011139_IDEMPIERE-2548.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2548 Misspelling in Unit of Measure Type +-- Apr 1, 2015 11:39:33 AM COT +UPDATE AD_Ref_List SET Name='Weight',Updated=TO_DATE('2015-04-01 11:39:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53530 +; + +SELECT register_migration_script('201504011139_IDEMPIERE-2548.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201504011139_IDEMPIERE-2548.sql b/migration/i2.1/postgresql/201504011139_IDEMPIERE-2548.sql new file mode 100644 index 0000000000..e5a6178080 --- /dev/null +++ b/migration/i2.1/postgresql/201504011139_IDEMPIERE-2548.sql @@ -0,0 +1,8 @@ +-- IDEMPIERE-2548 Misspelling in Unit of Measure Type +-- Apr 1, 2015 11:39:33 AM COT +UPDATE AD_Ref_List SET Name='Weight',Updated=TO_TIMESTAMP('2015-04-01 11:39:33','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Ref_List_ID=53530 +; + +SELECT register_migration_script('201504011139_IDEMPIERE-2548.sql') FROM dual +; +