Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031308Openbravo ERP09. Financial managementpublic2015-10-30 09:412015-11-28 15:24
maite 
Triage Omni OMS 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q1 
dmiguelez
Core
No
0031308: Error when running Customer Statement report for a Customer who has not vendor accounting information defined
Error when running Customer Statement report for a Customer who has not vendor accounting information defined
1. Run "Customer Statement" report with:
  Report type= Customer
  Org= España
  Ledger= España
  BP= Alimentos y Supermercados
  Starting date=30/10/2014
2. Realize that information is obtained
3. Access Business Partner window, go to Alimentos y Supermercados record and navigate to Vendor Accounting tab. Delete record for España general ledger
4. Run "Customer Statement" report again with same filtering criteria and realize that report is not generated

Following error is raised in the log:

2015-10-30 09:30:33,776 [ajp-localhost%2F127.0.0.1-8809-4] ERROR org.openbravo.erpCommon.utility.PrintJR - Error captured:
javax.servlet.ServletException: Error evaluating expression :
    Source text : ReportsUtility.getBeginningBalance($P{AD_Org_ID}, $P{C_AcctSchema_ID}, $P{C_BPartner_ID}, $P{DateFrom}, false)
...
...
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near ")"
Problem is that although report is executed for Customer type, beginning balance is calculated for both customer and vendor accounts. Should not be necessary to have vendor accounting information defined when is run for customers
No tags attached.
Issue History
2015-10-30 09:41maiteNew Issue
2015-10-30 09:41maiteAssigned To => Triage Finance
2015-10-30 09:41maiteModules => Core
2015-10-30 09:41maiteResolution time => 1449097200
2015-10-30 09:41maiteTriggers an Emergency Pack => No
2015-10-30 09:41maiteIssue Monitored: networkb
2015-11-25 11:51dmiguelezStatusnew => scheduled
2015-11-27 09:52dmiguelezNote Added: 0082395
2015-11-27 09:58hgbotCheckin
2015-11-27 09:58hgbotNote Added: 0082398
2015-11-27 09:58hgbotStatusscheduled => resolved
2015-11-27 09:58hgbotResolutionopen => fixed
2015-11-27 09:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4ff7777b08051b05e4d18b7525ab56ccb9b6f046 [^]
2015-11-27 09:58hgbotCheckin
2015-11-27 09:58hgbotNote Added: 0082399
2015-11-27 09:59dmiguelezReview Assigned To => dmiguelez
2015-11-27 09:59dmiguelezNote Added: 0082400
2015-11-27 09:59dmiguelezStatusresolved => closed
2015-11-28 15:24hudsonbotCheckin
2015-11-28 15:24hudsonbotNote Added: 0082446
2015-11-28 15:24hudsonbotCheckin
2015-11-28 15:24hudsonbotNote Added: 0082447

Notes
(0082395)
dmiguelez   
2015-11-27 09:52   
Steps:
1. Run "Customer Statement" report with:
  Report type= Customer
  Org= España
  Ledger= España
  BP= Alimentos y Supermercados
  Starting date=30/10/2014
2. Realize that information is obtained
3. Access Business Partner window, go to Alimentos y Supermercados record and navigate to Vendor Accounting tab. Delete record for España general ledger
4. Run "Customer Statement" report again with same filtering criteria and realize that report is now generated!!!

The issue was caused when the getValidAccountsListVendor (getValidAccountsList too) method return an empty result list. Later add a Restrictions.in for an empty list throw a postgresql exception and the reports fails.

Report Customer Statement was customized too when No Data Set was returned from the query to avoid a blank report.
(0082398)
hgbot   
2015-11-27 09:58   
Repository: erp/devel/pi
Changeset: 4ff7777b08051b05e4d18b7525ab56ccb9b6f046
Author: Mark <markmm82 <at> gmail.com>
Date: Thu Nov 26 18:35:52 2015 +0000
URL: http://code.openbravo.com/erp/devel/pi/rev/4ff7777b08051b05e4d18b7525ab56ccb9b6f046 [^]

Fixes Issue 31308: Error when running Customer Statement report
Included two validations inside the method getBeginningBalance
to avoid add Restrictions.in for a null result.
To thereport set always visible the header when dataset was null
and some customizations for this case.

---
M src/org/openbravo/erpCommon/ReportsUtility.java
M src/org/openbravo/erpCommon/ad_reports/CustomerStatement.jrxml
---
(0082399)
hgbot   
2015-11-27 09:58   
Repository: erp/devel/pi
Changeset: 3ed255ed467ce96af68b29a94d9aa8cd2142dfe1
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Fri Nov 27 09:42:38 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/3ed255ed467ce96af68b29a94d9aa8cd2142dfe1 [^]

Related to Issue 31308. Code Review changes.

Added if condition to avoid empty list.
Also changed list.size for list.isEmtpy for performance improvement.

---
M src/org/openbravo/erpCommon/ReportsUtility.java
---
(0082400)
dmiguelez   
2015-11-27 09:59   
Code Review + Testing Ok
(0082446)
hudsonbot   
2015-11-28 15:24   
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/a30fd74371da [^]
Maturity status: Test
(0082447)
hudsonbot   
2015-11-28 15:24   
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/a30fd74371da [^]
Maturity status: Test