Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0020078Openbravo ERP09. Financial managementpublic2012-03-21 16:202013-05-23 01:32
dalsasua 
eduardo_Argal 
urgentmajoralways
closedfixed 
5
 
 
Core
No
0020078: Accounting engine stops in case of lots of organizations, and document types at organization level
In an instance with 97 different organization, each of them with specific API/ARI/APC/ARC document types, accounting stops after processing couple of organizations.
Create dozens of organizations, each of them with it's own document types.
Create hundreds of invoices for distinct organizations
Run accounting background process
Realize that stops after a while, leaving unposted invoices
diff --git a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java
@@ -63,6 +63,7 @@
   public String AD_Table_ID = "";
   public String AD_Client_ID = "";
   public String AD_Org_ID = "";
+ public String Caller_AD_Org_ID = "";
   public String Status = "";
   public String C_BPartner_ID = "";
   public String C_BPartner_Location_ID = "";
@@ -281,6 +282,7 @@
   public AcctServer(String m_AD_Client_ID, String m_AD_Org_ID, ConnectionProvider connectionProvider) {
     AD_Client_ID = m_AD_Client_ID;
     AD_Org_ID = m_AD_Org_ID;
+ Caller_AD_Org_ID = m_AD_Org_ID;
     this.connectionProvider = connectionProvider;
     if (log4j.isDebugEnabled())
       log4j.debug("AcctServer - LOADING ARRAY: " + m_AD_Client_ID);
@@ -314,7 +316,7 @@
 
       log4j.debug("AcctServer.run - AD_Client_ID: " + AD_Client_ID);
       AcctServerData[] data = AcctServerData.select(connectionProvider, tableName, AD_Client_ID,
- AD_Org_ID, strDateColumn, 0, Integer.valueOf(batchSize).intValue());
+ Caller_AD_Org_ID, strDateColumn, 0, Integer.valueOf(batchSize).intValue());
 
       if (data != null && data.length > 0) {
         if (log4j.isDebugEnabled()) {
@@ -1729,9 +1731,9 @@
     // log4j.debug("AcctServer - AcctSchema length-" + (this.m_as).length);
     for (int i = 0; i < docTypes.length; i++) {
       AcctServerData data = AcctServerData.selectDocuments(connectionProvider, tableName,
- AD_Client_ID, AD_Org_ID, docTypes[i].name, strDateColumn);
+ AD_Client_ID, Caller_AD_Org_ID, docTypes[i].name, strDateColumn);
 
- if (data != null) {
+ if (data != null && data.id != null) {
         if (data.id != null && !data.id.equals("")) {
           if (log4j.isDebugEnabled()) {
             log4j.debug("AcctServer - not posted - " + docTypes[i].name + " document id: "
No tags attached.
depends on backport 0020079 closed dalsasua Accounting engine stops in case of lots of organizations, and document types at organization level 
Issue History
2012-03-21 16:20dalsasuaNew Issue
2012-03-21 16:20dalsasuaAssigned To => dalsasua
2012-03-21 16:20dalsasuaModules => Core
2012-03-21 16:20dalsasuaStatusnew => scheduled
2012-03-21 16:20dalsasuafix_in_branch => pi
2012-04-18 10:52alostaleAssigned Todalsasua => vmromanos
2012-05-10 12:12gorka_gilAssigned Tovmromanos => mirurita
2013-05-02 17:52eduardo_ArgalAssigned Tomirurita => eduardo_Argal
2013-05-02 17:54hgbotCheckin
2013-05-02 17:54hgbotNote Added: 0058432
2013-05-02 17:54hgbotStatusscheduled => resolved
2013-05-02 17:54hgbotResolutionopen => fixed
2013-05-02 17:54hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f51008f9938602a5e72197e7d273514a10efb338 [^]
2013-05-08 11:34dmiguelezNote Added: 0058505
2013-05-08 11:34dmiguelezStatusresolved => closed
2013-05-23 01:32hudsonbotCheckin
2013-05-23 01:32hudsonbotNote Added: 0058761

Notes
(0058432)
hgbot   
2013-05-02 17:54   
Repository: erp/devel/pi
Changeset: f51008f9938602a5e72197e7d273514a10efb338
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Thu May 02 17:53:46 2013 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f51008f9938602a5e72197e7d273514a10efb338 [^]

Fixes bug 20078

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer_data.xsql
---
(0058505)
dmiguelez   
2013-05-08 11:34   
Code Review + Testing Ok
(0058761)
hudsonbot   
2013-05-23 01:32   
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/97c7f6256af7 [^]

Maturity status: Test