Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0042040
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2019-10-16 13:442019-12-12 23:01
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR20Q1
StatusclosedFix in branchFixed in SCM revision52830302ff4b
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned ToSandrahuguet
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0042040: Cannot print to PDF the Valued Stock Report if there exists a transaction in which the cost is not calculated

DescriptionCannot print to PDF the Valued Stock Report if there exists a transaction in which cost is not calculated.

The problem is in the following line of ReportValuationStock class:

spc.addCost(new BigDecimal(row.totalCost));

As the select query in ReportValuationStock_data.xsql is returning a null value in the total_cost column
Steps To ReproduceAs group admin role:
   Go to Process Request window and unschedule the costing background process
   Create a goods receipt, add a product and complete it
   Go to Valued Stock Report and filter it by the goods receipt organization and warehouse
   Check the product included in the goods receipt is shown with the UNIT COST and VALUATION columns empty and the following warning is shown:

Transactions with no available cost found

   Try to export it to PDF (Print record toolbar button) and check the following error is shown:
      java.lang.NumberFormatException

The log shows:

ERROR org.openbravo.erpCommon.ad_reports.ReportValuationStock - Error captured:
java.lang.NumberFormatException: null
    at java.math.BigDecimal.<init>(BigDecimal.java:624) ~[?:?]
    at java.math.BigDecimal.<init>(BigDecimal.java:401) ~[?:?]
    at java.math.BigDecimal.<init>(BigDecimal.java:834) ~[?:?]
    at org.openbravo.erpCommon.ad_reports.ReportValuationStock.printPageDataPDF(ReportValuationStock.java:473) ~[classes/:?]
    at org.openbravo.erpCommon.ad_reports.ReportValuationStock.buildData(ReportValuationStock.java:243) ~[classes/:?]
    at org.openbravo.erpCommon.ad_reports.ReportValuationStock.doPost(ReportValuationStock.java:122) ~[classes/:?]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:661) ~[tomcat8-servlet-api-8.5.39.jar:?]
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0115131)
markmm82 (developer)
2019-10-17 02:11

Test Plan:
As group admin role:
   Go to Process Request window and unschedule the costing background process.
   Create a goods receipt header:
     Organization = F&B España - Región Sur,
     Warehouse = España Región Sur
     Business Partner = Bebidas Alegres, S.L.
   Add a line to it:
     Product = Cola de Cereza 0,5L
     Qty = 100
   Complete it
   Go to Valued Stock Report and filter it by the goods receipt organization and warehouse:
     Organization = F&B España - Región Sur,
     Warehouse = España Región Sur
   Export as HTML Format.
     Notice there is an entry with the product included in the goods receipt (Cola de Cereza 0,5L). It is shown with the UNIT COST and VALUATION columns empty, and with quantity as 100.
     Notice a warning is shown:
      "Transactions with no available cost found"

   Try to export it to PDF (Print record toolbar button) and check the document is generated successfully.
   Open the exported PDF.
      Notice there is an entry with the product included in the goods receipt (Cola de Cereza 0,5L). It is shown with the UNIT COST and VALUATION columns empty, and with quantity as 100.


   Go to Process Request window and reschedule the costing background process to be run immediately.
   Go back to the report and execute it again with the same filters as HTML.
     Notice that the entry for the product was updated with the calculated cost.
   Execute it again as PDF and notice the generated PDF has the same values than the report exported as HTML.
(0115156)
hgbot (developer)
2019-10-18 08:39

Repository: erp/devel/pi
Changeset: 52830302ff4b99b0ae2ba69dab6d1ae8bdaa5427
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Wed Oct 16 21:18:08 2019 -0300
URL: http://code.openbravo.com/erp/devel/pi/rev/52830302ff4b99b0ae2ba69dab6d1ae8bdaa5427 [^]

Fixes issue 42040: Avoid NumberFormatException exporting as PDF Valued Stock Rep
ort if there exists a transaction in which the cost is not calculated

When there is a transaction without calculated cost the Valued Stock Report was failling
trying to export as PDF because the totalCost is got as an empty string and a NumberFormatException]
is thrown converting as BigDecimal. Fixed adding the totalCost if it was calculated (it
is not an empty value retrieved by the sql query)

---
M src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.java
---
(0115157)
Sandrahuguet (developer)
2019-10-18 08:45

code review + testing ok
(0116255)
hudsonbot (developer)
2019-12-12 23:01

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/954d2b7a66fb [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2019-10-16 13:44 ngarcia New Issue
2019-10-16 13:44 ngarcia Assigned To => Triage Finance
2019-10-16 13:44 ngarcia Modules => Core
2019-10-16 13:44 ngarcia Triggers an Emergency Pack => No
2019-10-16 15:08 Sandrahuguet Assigned To Triage Finance => markmm82
2019-10-17 01:29 markmm82 Status new => scheduled
2019-10-17 02:11 markmm82 Note Added: 0115131
2019-10-18 08:39 hgbot Checkin
2019-10-18 08:39 hgbot Note Added: 0115156
2019-10-18 08:39 hgbot Status scheduled => resolved
2019-10-18 08:39 hgbot Resolution open => fixed
2019-10-18 08:39 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/52830302ff4b99b0ae2ba69dab6d1ae8bdaa5427 [^]
2019-10-18 08:45 Sandrahuguet Review Assigned To => Sandrahuguet
2019-10-18 08:45 Sandrahuguet Note Added: 0115157
2019-10-18 08:45 Sandrahuguet Status resolved => closed
2019-10-18 08:45 Sandrahuguet Fixed in Version => 3.0PR20Q1
2019-12-12 23:01 hudsonbot Checkin
2019-12-12 23:01 hudsonbot Note Added: 0116255


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker