Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041175Openbravo ERP04. Warehouse managementpublic2019-06-25 18:102019-08-22 14:44
gsuarez 
collazoandy4 
highmajoralways
closedfixed 
5
pi 
3.0PR19Q4 
Sandrahuguet
Core
No
0041175: Incorrect date to get conversion rate in Valued Stock Report
When the process "Valued Stock Report" is run for a given date (e.g. 21/06/2019) and a given currency, USD for example, and exists a conversion rate for this currency on that date (e.g. EUR -> USD, from 21/06/2019 to 21/06/2019 ) and not exists a conversion rate for the next day (22/06/2019 in this case), the process throws an error message saying "There is no conversion rate defined from (EUR-€) to (USD-$) for date '22-06-2019'....".
The process is executed for the date 21/06/2019 but the error message shows a different date 22/06/2019, and for that date there is no conversion date defined as the image attached shows.
An example to reproduce this issue
1- Define a conversion rate for currencies EUR to USD from 21/06/2019 to 21/06/2019. Make sure there is no conversion range for those currencies for the date 22/06/2019
2-Launch the "Valued Stock Report" for the USD currency, for any organization on date 21/06/2019. The process will throw a Servlet Exception saying "javax.servlet.ServletException: CODE=0ERROR: current transaction is aborted, commands ignored until end of transaction block" as the image attached shows.
3-Reopen the "Valued Stock Report" process window and the conversion rate error mentioned in the description will appear.
Modify the "select" method of the ReportValuationStock_Data.xsql file, changing the COSTTYPE projection, using the date entered when executing the report, in date parameter of the C_CURRENCY_CONVERT_PRECISION function.

-The following is the projection that needs to be modified:

CASE a.iscostcalculated
     WHEN 'Y' THEN C_CURRENCY_CONVERT_PRECISION (P.COST,P.c_currency_id,?,to_date(?),NULL,A.AD_CLIENT_ID,?,'C')
     ELSE NULL END AS COSTTYPE
No tags attached.
png ValuedStockReport.png (30,523) 2019-06-25 18:10
https://issues.openbravo.com/file_download.php?file_id=13058&type=bug
png

png ServletException.png (21,103) 2019-06-25 18:11
https://issues.openbravo.com/file_download.php?file_id=13059&type=bug
png

png ConversionRate-EUR-USD.png (111,290) 2019-06-25 18:11
https://issues.openbravo.com/file_download.php?file_id=13060&type=bug
png

png ConversionRateError.png (46,194) 2019-06-25 18:11
https://issues.openbravo.com/file_download.php?file_id=13061&type=bug
png
Issue History
2019-06-25 18:10gsuarezNew Issue
2019-06-25 18:10gsuarezAssigned To => Triage Finance
2019-06-25 18:10gsuarezFile Added: ValuedStockReport.png
2019-06-25 18:10gsuarezModules => Core
2019-06-25 18:10gsuarezResolution time => 1562623200
2019-06-25 18:10gsuarezTriggers an Emergency Pack => No
2019-06-25 18:11gsuarezFile Added: ServletException.png
2019-06-25 18:11gsuarezFile Added: ConversionRate-EUR-USD.png
2019-06-25 18:11gsuarezFile Added: ConversionRateError.png
2019-06-26 16:00SandrahuguetAssigned ToTriage Finance => collazoandy4
2019-06-27 18:18collazoandy4Statusnew => scheduled
2019-06-28 15:50collazoandy4Note Added: 0113111
2019-07-02 12:16hgbotCheckin
2019-07-02 12:16hgbotNote Added: 0113138
2019-07-02 12:16hgbotStatusscheduled => resolved
2019-07-02 12:16hgbotResolutionopen => fixed
2019-07-02 12:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/1730269ab1e780d51603eca17df11c63c5e27b99 [^]
2019-07-02 12:17SandrahuguetReview Assigned To => Sandrahuguet
2019-07-02 12:17SandrahuguetNote Added: 0113139
2019-07-02 12:17SandrahuguetStatusresolved => closed
2019-07-02 12:17SandrahuguetFixed in Version => 3.0PR19Q4
2019-08-22 14:44hudsonbotCheckin
2019-08-22 14:44hudsonbotNote Added: 0114132

Notes
(0113111)
collazoandy4   
2019-06-28 15:50   
Test Plan
 Make sure there is no conversion rate from EUR to USD for the next month
 Launch the "Valued Stock Report" for the USD currency, for any organization on last date of current month and check the process shows the records
 Check Consolidated warehouse option and Launch the report again and check the process shows the records
(0113138)
hgbot   
2019-07-02 12:16   
Repository: erp/devel/pi
Changeset: 1730269ab1e780d51603eca17df11c63c5e27b99
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Thu Jun 27 21:07:48 2019 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/1730269ab1e780d51603eca17df11c63c5e27b99 [^]

Fixes issue 41175: Incorrect date to get conversion rate in Valued Stock Report

Use the date defined in the report to search for the conversion rate

---
M src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.java
M src/org/openbravo/erpCommon/ad_reports/ReportValuationStock_data.xsql
---
(0113139)
Sandrahuguet   
2019-07-02 12:17   
code review + testing ok
(0114132)
hudsonbot   
2019-08-22 14:44   
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/ad3efd3bd07c [^]
Maturity status: Test