Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0041404Openbravo ERP07. Sales managementpublic2019-07-19 03:442019-08-22 14:45
lbressan 
collazoandy4 
highmajoralways
closedfixed 
30Openbravo Appliance 14.04
3.0PR19Q2 
3.0PR19Q4 
dmiguelez
Google Chrome
Core
No
0041404: Discount Invoice Report error
When 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 = ReportInvoiceDiscountData.select(readOnlyCP, strCurrencyId, Utility.getContext(
readOnlyCP, vars, "#User_Client", "ReportInvoiceDiscountJR"), Utility.getContext(
readOnlyCP, vars, "#AccessibleOrgTree", "ReportInvoiceDiscountJR"), strDateFrom,
strDateTo, strcBpartnerId, (StringUtils.equals(localStrDiscount, "N")) ? ""
: "discount");
Create 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".
No tags attached.
Issue History
2019-07-19 03:44lbressanNew Issue
2019-07-19 03:44lbressanAssigned To => Triage Finance
2019-07-19 03:44lbressanWeb browser => Google Chrome
2019-07-19 03:44lbressanModules => Core
2019-07-19 03:44lbressanResolution time => 1571349600
2019-07-19 03:44lbressanTriggers an Emergency Pack => No
2019-07-19 09:50dmiguelezAssigned ToTriage Finance => collazoandy4
2019-07-21 08:10collazoandy4Statusnew => scheduled
2019-07-21 08:11collazoandy4Note Added: 0113553
2019-07-24 08:41hgbotCheckin
2019-07-24 08:41hgbotNote Added: 0113606
2019-07-24 08:41hgbotStatusscheduled => resolved
2019-07-24 08:41hgbotResolutionopen => fixed
2019-07-24 08:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/4134f50a66ff6e0e59acd0818303a7c3493f3f97 [^]
2019-07-24 08:42dmiguelezReview Assigned To => dmiguelez
2019-07-24 08:42dmiguelezNote Added: 0113607
2019-07-24 08:42dmiguelezStatusresolved => closed
2019-07-24 08:42dmiguelezFixed in Version => 3.0PR19Q4
2019-08-22 14:45hudsonbotCheckin
2019-08-22 14:45hudsonbotNote Added: 0114173

Notes
(0113553)
collazoandy4   
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
(0113606)
hgbot   
2019-07-24 08:41   
Repository: erp/devel/pi
Changeset: 4134f50a66ff6e0e59acd0818303a7c3493f3f97
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Jul 23 17:06:53 2019 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/4134f50a66ff6e0e59acd0818303a7c3493f3f97 [^]

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
---
(0113607)
dmiguelez   
2019-07-24 08:42   
Code Review + Testing Ok
(0114173)
hudsonbot   
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: https://code.openbravo.com/erp/devel/main/rev/ad3efd3bd07c [^]
Maturity status: Test