Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementmajoralways2019-07-19 03:442019-08-22 14:45
ReporterlbressanView Statuspublic 
Assigned Tocollazoandy4 
PriorityhighResolutionfixedFixed in Version3.0PR19Q4
StatusclosedFix in branchFixed in SCM revision4134f50a66ff
ProjectionnoneETAnoneTarget Version
OSLinux 64 bitDatabasePostgreSQLJava version7.x
OS VersionOpenbravo Appliance 14.04Database version9.3.xAnt version1.9.x
Product Version3.0PR19Q2SCM revision 
Review Assigned Todmiguelez
Web browserGoogle Chrome
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo

0041404: Discount Invoice Report error

DescriptionWhen selected "Show only Discounted", under certain circunstancies, it is showing:
No conversion rate defined
ERROR: division by zero

The error is generated on the method:
org.openbravo.erpCommon.ad_reports.ReportInvoiceDiscountJR.printPageDataHtml(HttpServletRequest, HttpServletResponse, VariablesSecureApp, String, String, String, String, String)

when trying to execute:
data =, strCurrencyId, Utility.getContext(
readOnlyCP, vars, "#User_Client", "ReportInvoiceDiscountJR"), Utility.getContext(
readOnlyCP, vars, "#AccessibleOrgTree", "ReportInvoiceDiscountJR"), strDateFrom,
strDateTo, strcBpartnerId, (StringUtils.equals(localStrDiscount, "N")) ? ""
: "discount");
Steps To ReproduceCreate a Sales Invoice in any date with any business partner.
Create a new line with any product that has no other invoice on the same date as the invoice date for the same business partner for any quantity with any price.
Complete the invoice.
Create a new Sales invoice with the same date and business partner that the other invoice.
Create a new line with the same product and quantity that the line of the other invoice, and with the same price but negative.
Complete the invoice.
Open the Discount Invoice Report
Select the dates from the previous invoices.
Select "Show only Discounted".
Press "HTML Format".
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
collazoandy4 (developer)
2019-07-21 08:11

Test Plan
  Create a Sales Invoice for Alimentos y Supermercados, S.A
    Create a new record in Lines tab with:
      Product: Agua sin Gas 1L
      Invoiced Quantity: 10
    Complete the invoice
  Create a new Sales Invoice for same BP, product and invoiced quantity but with negative price and complete it
  Create a Sales Invoice for Alimentos y Supermercados, S.A
    Create a new record in Lines tab with:
      Product: Bebida Energ├ętica 0,5L
      Invoiced Quantity: 5
    Create a new record in Basic Discount tab with Descuento 10%
    Complete the invoice
  Open the Discount Invoice Report
    Select the dates from the previous invoices.
    Press "HTML Format" and check only two records are shown
    Select "Show only Discounted".
    Press "HTML Format" and check that only the last invoice is shown in the report
hgbot (developer)
2019-07-24 08:41

Repository: erp/devel/pi
Changeset: 4134f50a66ff6e0e59acd0818303a7c3493f3f97
Author: Armaignac <collazoandy4 <at>>
Date: Tue Jul 23 17:06:53 2019 +0200
URL: [^]

Fixes issue 41404:Discount Invoice Report error

If TotalLine is 0 a cero division exception was throw if Show only Discounted option
is selected.

Now a new validation check was added when totalline is 0 to avoid cero division exception

M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount_data.xsql
dmiguelez (developer)
2019-07-24 08:42

Code Review + Testing Ok
hudsonbot (developer)
2019-08-22 14:45

A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2019-07-19 03:44 lbressan New Issue
2019-07-19 03:44 lbressan Assigned To => Triage Finance
2019-07-19 03:44 lbressan Web browser => Google Chrome
2019-07-19 03:44 lbressan Modules => Core
2019-07-19 03:44 lbressan Triggers an Emergency Pack => No
2019-07-19 09:50 dmiguelez Assigned To Triage Finance => collazoandy4
2019-07-21 08:10 collazoandy4 Status new => scheduled
2019-07-21 08:11 collazoandy4 Note Added: 0113553
2019-07-24 08:41 hgbot Checkin
2019-07-24 08:41 hgbot Note Added: 0113606
2019-07-24 08:41 hgbot Status scheduled => resolved
2019-07-24 08:41 hgbot Resolution open => fixed
2019-07-24 08:41 hgbot Fixed in SCM revision => [^]
2019-07-24 08:42 dmiguelez Review Assigned To => dmiguelez
2019-07-24 08:42 dmiguelez Note Added: 0113607
2019-07-24 08:42 dmiguelez Status resolved => closed
2019-07-24 08:42 dmiguelez Fixed in Version => 3.0PR19Q4
2019-08-22 14:45 hudsonbot Checkin
2019-08-22 14:45 hudsonbot Note Added: 0114173

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker