Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0021679Openbravo ERP09. Financial managementpublic2012-09-18 16:032012-09-26 17:33
xabiermerino 
Sandrahuguet 
immediatecriticalalways
closedfixed 
5
3.0MP14 
 
Core
Production - QA Approved
2012-05-28
https://code.openbravo.com/erp/devel/pi/rev/d73979000468 [^]
yes
0021679: The Acct Server process does not post reconciliations
The Acct Server process sets reconciliations 'Disabled for accounting'.

The problem is that, in the method 'documentGetPeriod' of the DocFINReconciliation, the organization used is *.
- As admin go to Financial Account
- Select 'Cuenta Banco' and go to Payment method
- Introduce account to be able to post reconciliations
- Go to Reconciliations and post the last one
- Unpost it
- Wait some second until the process will executed
- Refresh the reconciliation
- realize that the reconciliation is 'Disabled for accounting'
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
@@ -1076,7 +1077,7 @@
       }
       // Exists line in closed period
       for (FIN_FinaccTransaction line : transactionsToBePosted) {
- Period linePeriod = documentGetPeriod(line.getDateAcct());
+ Period linePeriod = documentGetPeriod(line.getDateAcct(), reconciliation.getOrganization());
         if (linePeriod == null) {
           setStatus(STATUS_PeriodClosed);
           return false;
@@ -1469,19 +1470,21 @@
     return account;
   }
 
- Period documentGetPeriod(Date date) {
+ Period documentGetPeriod(Date date, Organization organization) {
     OBCriteria<PeriodControl> obCriteria = OBDal.getInstance().createCriteria(PeriodControl.class);
     obCriteria.createAlias(PeriodControl.PROPERTY_PERIOD, "p");
     obCriteria.createAlias("p." + Period.PROPERTY_YEAR, "y");
     obCriteria.add(Restrictions.eq(PeriodControl.PROPERTY_PERIODSTATUS, "O"));
     obCriteria.add(Restrictions.eq(PeriodControl.PROPERTY_DOCUMENTCATEGORY,
         AcctServer.DOCTYPE_Reconciliation));
- obCriteria.add(Restrictions.eq("y." + Year.PROPERTY_CALENDAR, getCalendar(AD_Org_ID)));
+ obCriteria.add(Restrictions.eq("y." + Year.PROPERTY_CALENDAR, getCalendar(organization.getId())));
     obCriteria.add(Restrictions.in(PeriodControl.PROPERTY_ORGANIZATION + "."
         + Organization.PROPERTY_ID, OBContext.getOBContext().getOrganizationStructureProvider()
- .getNaturalTree(AD_Org_ID)));
+ .getNaturalTree(organization.getId())));
     obCriteria.add(Restrictions.le("p." + Period.PROPERTY_STARTINGDATE, date));
     obCriteria.add(Restrictions.ge("p." + Period.PROPERTY_ENDINGDATE, date));
+ obCriteria.add(Restrictions.eq("p." + Period.PROPERTY_CLIENT, organization.getClient()));
+ obCriteria.setFilterOnReadableClients(false);
     obCriteria.setFilterOnReadableOrganization(false);
     List<PeriodControl> lines = obCriteria.list();
     return lines.size() == 0 ? null : lines.get(0).getPeriod();
No tags attached.
Issue History
2012-09-18 16:03xabiermerinoNew Issue
2012-09-18 16:03xabiermerinoAssigned To => dmiguelez
2012-09-18 16:03xabiermerinoModules => Core
2012-09-18 16:05xabiermerinoRegression level => Production - QA Approved
2012-09-18 16:05xabiermerinoRegression date => 2012-05-28
2012-09-18 16:05xabiermerinoRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/d73979000468 [^]
2012-09-18 18:32SandrahuguetAssigned Todmiguelez => Sandrahuguet
2012-09-18 18:32SandrahuguetStatusnew => scheduled
2012-09-18 18:32Sandrahuguetfix_in_branch => pi
2012-09-18 18:42SandrahuguetNote Added: 0052213
2012-09-19 12:38dmiguelezNote Edited: 0052213bug_revision_view_page.php?bugnote_id=0052213#r3870
2012-09-19 12:39hgbotCheckin
2012-09-19 12:39hgbotNote Added: 0052221
2012-09-19 12:39hgbotStatusscheduled => resolved
2012-09-19 12:39hgbotResolutionopen => fixed
2012-09-19 12:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/571b10dd474d7c9952e802253344e089910aa975 [^]
2012-09-19 12:39dmiguelezClosed by => dmiguelez
2012-09-19 12:39dmiguelezNote Added: 0052222
2012-09-19 12:39dmiguelezStatusresolved => closed
2012-09-26 17:16hgbotCheckin
2012-09-26 17:16hgbotNote Added: 0052663
2012-09-26 17:16hgbotStatusclosed => resolved
2012-09-26 17:16hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/571b10dd474d7c9952e802253344e089910aa975 [^] => http://code.openbravo.com/erp/devel/pi/rev/957e0383b0af496969886791a34b48ac53f47ca5 [^]
2012-09-26 17:19hudsonbotCheckin
2012-09-26 17:19hudsonbotNote Added: 0052784
2012-09-26 17:33gorka_gilStatusresolved => closed

Notes
(0052213)
Sandrahuguet   
2012-09-18 18:42   
(edited on: 2012-09-19 12:38)
Test Plan.
-Go to Financial Account, select Cuenta de banco
-Navigate to Payment Method
-Select Tranferencia
  ·Upon Withdrawal Use= Withdrawn Payment Account
  ·Upon Reconciliation Use= In Transit Payment Account
-Select last reconciliation
-Unpost and delete accounting
-Notice that the button says 'Post'
-Go to process request
-Select F&B International Group and Unschedule process
-Go to reconciliation and refresh
-Notice that the reconciliation is posted and the button says 'Unpost'

(0052221)
hgbot   
2012-09-19 12:39   
Repository: erp/devel/pi
Changeset: 571b10dd474d7c9952e802253344e089910aa975
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Sep 18 18:35:14 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/571b10dd474d7c9952e802253344e089910aa975 [^]

Fixed bug 21679 The acct server process does not post reconciliations

---
M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
---
(0052222)
dmiguelez   
2012-09-19 12:39   
Code Review + Testing OK
(0052663)
hgbot   
2012-09-26 17:16   
Repository: erp/devel/pi
Changeset: 957e0383b0af496969886791a34b48ac53f47ca5
Author: Sandra Huguet <sandra.huguet <at> openbravo.com>
Date: Tue Sep 18 18:35:14 2012 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/957e0383b0af496969886791a34b48ac53f47ca5 [^]

Fixed bug 21679 The acct server process does not post reconciliations

---
M src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
---
(0052784)
hudsonbot   
2012-09-26 17:19   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/b780e90c6452 [^]

Maturity status: Test