Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0004859Openbravo ERP03. Procurement managementpublic2008-09-08 17:362008-12-03 13:56
rafaroda 
cromero 
highminoralways
closedfixed 
20Ubuntu 7.10
pi 
 
Core
No
0004859: 'Purchase Order Report' does not work in PostgreSQL
'Purchase Order Report' does not work in PostgreSQL if you select any of the filters that points to an ID. In Oracle it works. Take into account that this filter window is WAD generated.

This is a regression since in Openbravo ERP 2.40 production it worked both in PostgreSQL and Oracle.

1) Go to 'Procurement Management || Analysis Tools || Purchase Order Report', do not select any filter and click on 'OK' button.
Report works correctly.

2) Launch the same report selecting any of the filters that points to an ID (e.g., Business Partner or Project).
Report breaks with error: ERROR org.openbravo.erpCommon.utility.PrintJR - Error captured: javax.servlet.ServletException: Error executing SQL statement for : ReportPurchaseOrder

Take into account that this filter window is WAD generated.
The problem is in the dates, that it is always using them in the query even when you don't specify anything.

As easy workaround you can set always the dates with any value and it will work fine.
No tags attached.
depends on backport 0005066 closed cromero 'Purchase Order Report' does not work in PostgreSQL 
related to defect 0005408 closed Hennadzi Date filters do no work in 'Purchase Order Report' 
Issue History
2008-09-08 17:36rafarodaNew Issue
2008-09-08 17:36rafarodaAssigned To => cromero
2008-09-08 17:36rafarodasf_bug_id0 => 2100474
2008-09-08 17:36rafarodaRegression testing => No
2008-09-16 13:09cromeroNote Added: 0009034
2008-09-16 13:53cromeroStatusnew => scheduled
2008-09-16 13:53cromerofix_in_branch => trunk
2008-09-16 13:55cromeroSeveritymajor => minor
2008-09-16 13:55cromerofix_in_branchtrunk =>
2008-09-16 13:55cromeroSteps to Reproduce Updated
2008-09-16 13:56svnbotCheckin
2008-09-16 13:56svnbotNote Added: 0009035
2008-09-16 13:56svnbotStatusscheduled => resolved
2008-09-16 13:56svnbotResolutionopen => fixed
2008-09-16 13:56svnbotsvn_revision => 7352
2008-10-03 16:03rafarodaRelationship addedrelated to 0005408
2008-12-03 13:56krishnaStatusresolved => closed

Notes
(0009034)
cromero   
2008-09-16 13:09   
This is the DB error:
SELECT C_ORDER.DOCUMENTNO AS DOCUMENTNO, C_ORDER.DATEORDERED AS DATEORDERED, C_BPARTNER.NAME AS CLIENT_NAME, SUM(C_ORDERLINE.QTYORDERED) AS QUANTITYORDER,
          C_ORDERLINE.PRICEACTUAL AS PRICEACTUAL, SUM(C_ORDERLINE.LINENETAMT) AS PRICELIST, M_PRODUCT.NAME AS PRODUCT_NAME, C_UOM.NAME AS UOMNAME
        FROM C_ORDER, C_ORDERLINE, C_BPARTNER, M_PRODUCT, C_UOM
        WHERE C_ORDER.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
          AND C_ORDER.C_ORDER_ID = C_ORDERLINE.C_ORDER_ID
          AND C_ORDERLINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
          AND C_ORDERLINE.C_UOM_ID = C_UOM.C_UOM_ID
          AND 1=1 AND C_ORDER.C_BPARTNER_ID = 1000008


          AND C_ORDER.DATEORDERED >= $1
          AND C_ORDER.DATEORDERED <= $2
          AND C_ORDER.ISSOTRX = 'N'
        GROUP BY C_BPARTNER.NAME, C_ORDERLINE.PRICEACTUAL, M_PRODUCT.NAME, C_UOM.NAME, C_ORDER.DOCUMENTNO, C_ORDER.DATEORDERED
        ORDER BY C_BPARTNER.NAME, C_ORDER.DATEORDERED


The problem is in the ReportPurchaseOrder.jrxml where it is harcoded:
  AND C_ORDER.DATEORDERED >= $P{DateFrom}
  AND C_ORDER.DATEORDERED <= $P{DateTo}

It could be replace by:
  AND C_ORDER.DATEORDERED >= TO_DATE($P{DateFrom})
  AND C_ORDER.DATEORDERED <= TO_DATE($P{DateTo})

but both parameters should be also optionals.
(0009035)
svnbot   
2008-09-16 13:56   
Repository: openbravo
Revision: 7352
Author: cromeroherrero
Date: 2008-09-16 13:56:17 +0200 (Tue, 16 Sep 2008)

Fixed bug 4859: 'Purchase Order Report' does not work in PostgreSQL

---
U trunk/src/org/openbravo/erpCommon/ad_reports/ReportPurchaseOrder.jrxml
---

https://dev.openbravo.com/websvn/openbravo/?rev=7352&sc=1 [^]