details:   https://code.openbravo.com/erp/devel/pi/rev/d83edb2bcfe7
changeset: 22322:d83edb2bcfe7
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Mon Mar 03 10:59:20 2014 +0530
summary:   Fixes Issue 24651, Fixes Issue 25868: Wrong Balance Sheet 
information randomly

diffstat:

 src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java |  12 
+++++----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r 75f848b61c97 -r d83edb2bcfe7 
src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java
--- a/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java      
Thu Feb 06 14:23:45 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/GeneralAccountingReports.java      
Mon Mar 03 10:59:20 2014 +0530
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2013 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -326,7 +326,7 @@
   private String[] getYearsToClose(Date startingDate, String strOrg, Calendar 
calendar,
       String strcAcctSchemaId, boolean isYearRef) {
     String openingEntryOwner = "";
-    Set<Year> previousYears = getOrderedPreviousYears(startingDate, calendar);
+    ArrayList<Year> previousYears = getOrderedPreviousYears(startingDate, 
calendar);
     Set<String> notClosedYears = new HashSet<String>();
     for (Year previousYear : previousYears) {
       for (Organization org : getCalendarOwnerOrgs(strOrg)) {
@@ -370,9 +370,9 @@
     }
   }
 
-  private Set<Year> getOrderedPreviousYears(Date startingDate, Calendar 
calendar) {
+  private ArrayList<Year> getOrderedPreviousYears(Date startingDate, Calendar 
calendar) {
     final StringBuilder hqlString = new StringBuilder();
-    Set<Year> result = new HashSet<Year>();
+    ArrayList<Year> result = new ArrayList<Year>();
     hqlString.append("select y");
     hqlString.append(" from FinancialMgmtYear y, FinancialMgmtPeriod as p");
     hqlString
@@ -383,7 +383,9 @@
     query.setParameter("calendar", calendar);
     for (Object resultObject : query.list()) {
       final Year previousYear = (Year) resultObject;
-      result.add(previousYear);
+      if (!(result.contains(previousYear))) {
+        result.add(previousYear);
+      }
     }
     return result;
   }

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to