From 7b10395b3b9dcf1e2e6345cb92eee4aee1963ca7 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Mon, 8 Jun 2015 15:10:37 +0200 Subject: [PATCH] IDEMPIERE-2665 Accounting Fact Reconcilation (Manual) schema validation missing --- .../org/compiere/apps/form/FactReconcile.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java index d99e8cf47f..05b68014b2 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java @@ -253,4 +253,41 @@ public class FactReconcile { rec.setMatchCode(null); return rec.save(); } + + protected Vector getAccount(){ + Vector vector = new Vector(); + String sql = MRole.getDefault().addAccessSQL( + "SELECT ev.C_ElementValue_ID, ev.Value || ' ' || ev.Name FROM C_ElementValue ev", "ev", + MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO) + + "AND ev.IsActive='Y' AND ev.IsSummary='N' " + + "AND EXISTS (SELECT 1 FROM C_AcctSchema_Element ase " + + "WHERE ase.C_Element_ID=ev.C_Element_ID AND ase.ElementType='AC' " + + "AND ase.C_AcctSchema_ID=" + m_C_AcctSchema_ID + " AND ase.AD_Client_ID=" + m_AD_Client_ID + ") " + + "ORDER BY 2"; + + PreparedStatement pstmt = null; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, null); + rs = pstmt.executeQuery(); + while (rs.next()) + { + vector.add(new KeyNamePair(rs.getInt(1), rs.getString(2))); + } + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return vector; + } + }