details:   https://code.openbravo.com/erp/devel/pi/rev/001203d51bb0
changeset: 22896:001203d51bb0
user:      Pandeeswari Ramakrishnan <pandeeswari.ramakrishnan <at> 
openbravo.com>
date:      Tue Apr 22 16:58:41 2014 +0530
summary:   Fixes Issue 26130: Reset Accounting is not working fine filling the 
Starting Date and Ending Date

diffstat:

 src/org/openbravo/financial/ResetAccounting.java |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r 3d8b217d74c1 -r 001203d51bb0 
src/org/openbravo/financial/ResetAccounting.java
--- a/src/org/openbravo/financial/ResetAccounting.java  Tue Apr 22 10:15:36 
2014 +0200
+++ b/src/org/openbravo/financial/ResetAccounting.java  Tue Apr 22 16:58:41 
2014 +0530
@@ -368,8 +368,10 @@
     String myQuery = "select distinct p from FinancialMgmtPeriodControl e left 
join e.period p left join p.year y left join y.calendar c where c.id = 
:calendarId and e.client.id = :clientId and e.documentCategory = :docbasetype 
and e.periodStatus = 'O' and e.organization.id = :orgPeriodControl";
 
     if (!("".equals(datefrom)) && !("".equals(dateto))) {
-      myQuery = myQuery + " and p.startingDate <= :dateFrom";
-      myQuery = myQuery + " and p.endingDate >= :dateTo";
+      myQuery = myQuery + " and ((p.startingDate between :dateFrom and 
:dateTo";
+      myQuery = myQuery + " or p.endingDate between :dateFrom and :dateTo)";
+      myQuery = myQuery + " or (p.startingDate <= :dateFrom";
+      myQuery = myQuery + " and p.endingDate >= :dateTo))";
     } else if (!("".equals(datefrom)) && ("".equals(dateto))) {
       myQuery = myQuery + " and p.endingDate >= :dateFrom";
     } else if (("".equals(datefrom)) && !("".equals(dateto))) {

------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to