Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039517Openbravo ERP07. Sales managementpublic2018-10-23 17:052018-12-11 20:22
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR19Q1 
vmromanos
Core
No
0039517: Sales Invoice Dimensional Report is showing a positive Margin % when the Profit is negative
Sales Invoice Dimensional Report is showing a positive Margin % when the Profit is negative
As group admin role:
   Create a Sales Order
   Add a product to it
   Set a Net Unit Price below the current average cost of the product
   Book it
   Create a goods shipment from it
   Create a sales invoice to it
   
   Launch the Costing Background Process and check it finishes successfully

   Go to Sales Invoice Dimensional Report:
      From Date: today
      To Date: today
      Organization: select invoice's organization
      Dimensions:
         Documentno
         Product

   Check the Profit is shown in negative as it is Amount - Cost
   Check the Margin is shown as positive. This is wrong
No tags attached.
related to defect 00274613.0PR15Q1 closed vmromanos The cost on the Sales invoice Dimensional Report should be different for Credit Memo invoices 
Issue History
2018-10-23 17:05ngarciaNew Issue
2018-10-23 17:05ngarciaAssigned To => Triage Finance
2018-10-23 17:05ngarciaModules => Core
2018-10-23 17:05ngarciaResolution time => 1542063600
2018-10-23 17:05ngarciaTriggers an Emergency Pack => No
2018-10-23 17:12rafarodaIssue Monitored: rafaroda
2018-10-24 08:43dmiguelezAssigned ToTriage Finance => markmm82
2018-10-25 02:08markmm82Statusnew => scheduled
2018-10-25 20:35markmm82Note Added: 0107605
2018-10-29 17:21markmm82Note Edited: 0107605bug_revision_view_page.php?bugnote_id=0107605#r17883
2018-10-29 19:19markmm82Note Added: 0107645
2018-10-29 19:19markmm82Relationship addedrelated to 0027461
2018-10-31 12:34hgbotCheckin
2018-10-31 12:34hgbotNote Added: 0107698
2018-10-31 12:34hgbotStatusscheduled => resolved
2018-10-31 12:34hgbotResolutionopen => fixed
2018-10-31 12:34hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/7ba289b96606324c420fcdbc57850f53454de02e [^]
2018-10-31 12:34vmromanosReview Assigned To => vmromanos
2018-10-31 12:34vmromanosNote Added: 0107699
2018-10-31 12:34vmromanosStatusresolved => closed
2018-10-31 12:34vmromanosFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108450

Notes
(0107605)
markmm82   
2018-10-25 20:35   
(edited on: 2018-10-29 17:21)
Test plan 1: Cases defined when the Profit is negative
 As group admin role:
   Create a Sales Order
   Add a product to it
   Set a Net Unit Price below the current average cost of the product
   Book it
   Create a goods shipment from it
   Create a sales invoice to it
   
   Launch the Costing Background Process and check it finishes successfully

   Go to Sales Invoice Dimensional Report:
      From Date: today
      To Date: today
      Organization: select invoice's organization
      Dimensions:
         Documentno
         Product

   Check the Profit is shown in negative as it is Amount - Cost
   Check the Margin is shown as negative.
  Export the report as PDF as well as XLS and notice the Margin is shown in negative too.

   Check Comparative report flag and define today as From/To Reference Day.
   If you export the report as HTML, PDF or XLS you will notice that the Margin is shown in negative too, also the Margin reference is negative too.

(0107645)
markmm82   
2018-10-29 19:19   
Test cases related to issue 27461

Test plan 2: Credit Memo non comparative Product dimension report

1- Login into Openbravo ERP
2- Go to Goods Shipment window, create a new register: España Región Norte.
3- Go to lines tab, add Producto: Vino Tinto 0,75L with Qty: 1
4- Complete it.
5- Go to Sales invoice window, create a new register: España región Norte.
6- Click on Create Lines From Shipment button and select the Goods Shipment created before.
7- Change the Document type to AR Credit Memo. Process it.
8- Check that the Costing Background Process has finished successfully.
9- Go to Sales invoice Dimensional Report. Select Date from: today and Date to: today
10- Filter by Vino Tinto.
11- Select Product in dimensions filters and launch HTML format report.
12- Realise that fields Quantity, Amount, Cost, Profit and Margin are taking negative values
13- Select printing in PDF and XLS format
14- Also fields Quantity, Amount, Cost, Profit and Margin are taking negative values

Test plan 3: Credit Memo non comparative Business Partner dimension report

1- Login into Openbravo ERP
2- Repeat 2-10 steps.
11- Select Business Partner in dimensions filters and launch HTML format report.
12- Realise that fields Amount, Cost, Profit and Margin are taking negative values
13- Select printing in PDF adn XLS format
14- Also fields Amount, Cost, Profit and Margin are taking negative values. Also check the Margin reference is negative too.

Test plan 4: Credit Memo non comparative DocumentNo dimension report

1- Login into Openbravo ERP
2- Repeat 2-10 steps.
11- Select DocumentNo in dimensions filters and launch HTML format report.
12- Realise that fields Amount, Cost, Profit and Margin are taking negative values for created Sales Invoice.
13- Select printing in PDF and XLS format
14- Also fields Amount, Cost, Profit and Margin are taking negative values.

Test plan 5: Credit Memo non comparative multi dimensional report

1- Login into Openbravo ERP
2- Repeat 2-10 steps.
11- Select Product, Product Group, Business Partner Group, Business Partner and DocumentNo in dimensions filters and launch HTML format report.
12- Realise that a report with 5 levels of grouping is shown. Fields Quantity, Amount, Cost, Profit and Margin are taking negative values.
13- Select printing in PDF format
14- Also a report with 5 levels of grouping is shown. Fields Amount, Cost, Profit and Margin are taking negative values.

Test plan 6: Credit Memo comparative Product dimensional report

1- Login into Openbravo ERP
2- Go to Goods Shipment window, create a new register: España Región Norte.
3- Go to lines tab, add Producto: Vino Tinto 0,75L with Qty: 1
4- Complete it.
5- Go to Sales invoice window, create a new register: España región Norte
6- Click on Create Lines From Shipment button and select the Goods Shipment created before.
7- Change the Document type to AR Credit Memo and process it.
8- Check that the Costing Background Process has finished successfully.
9- Go to Sales invoice Dimensional Report. Select Date from: today and Date to: today
10- Check Comparative Report option and select From Reference Date: today and To Reference Date: today
11- Filter by Vino Tinto.
12- Select Product in dimensions filters and launch HTML format report.
13- Realise that fields Quantity, Amount, Cost, Profit and Margin are taking negative values. Also References for these fields take negative values too.
13- Select printing in PDF format
14- Also fields Quantity, Amount, Cost, Profit and Margin are taking negative values.

Test plan 7: Credit Memo comparative multi dimensional report

1- Login into Openbravo ERP
2- Repeat 2-11 steps.
12- Select Product, Product Group, Business Partner and DocumentNo in dimensions filters and launch HTML format report.
13- Realise that a report with 4 levels of grouping is shown. Fields Quantity, Amount, Cost, Profit and Margin are taking negative values. Also References for these fields take negative values too.
14- Select printing in PDF format
15- Also a report with 4 levels of grouping is shown. Fields Amount, Cost, Profit and Margin and their respective references are taking negative values.

In all these cases dimensional options XSL format ReportInvoiceCustomerDimensional sheet shows the same structure with fields Amount, Cost, Profit and Margin taking negative values.

Test plan 8: AR Invoice non comparative Product dimension report

1- Login into Openbravo ERP
2- Go to Goods Shipment window, create a new register: España Región Norte.
3- Go to lines tab, add Producto: Vino Tinto 0,75L with Qty: 1
4- Complete it.
5- Go to Sales invoice window, create a new register: España región Norte
6- Select another date for example: a day after today.
7- Click on Create Lines From Shipment button and select the Goods Shipment created before.
8- Change the Document type to AR Credit Memo and process it.
9- Check that the Costing Background Process has finished successfully.
10- Go to Sales invoice Dimensional Report. Select Date from: a day after today and Date to: a day after today
11- Filter by Vino Tinto.
12- Select Product in dimensions filters and launch HTML format report.
13- Realise that fields Quantity, Amount, Cost, Profit and Margin are taking positive values
14- Select printing in PDF format
15- Also fields Quantity, Amount, Cost, Profit and Margin are taking positive values

Test plan 9: AR Invoice non comparative multi dimensional report

1- Login into Openbravo ERP
2- Repeat 2-11 previous steps.
12- Select Product, Product Group, Business Partner Group, Business Partner and DocumentNo in dimensions filters and launch HTML format report.
13- Realise that a report with 5 levels of grouping is shown. Fields Amount, Cost, Profit and Margin are taking positive values.
14- Select printing in PDF format
15- Also a report with 5 levels of grouping is shown. Fields Amount, Cost, Profit and Margin are taking positive values.

Test plan 10: AR Invoice comparative multi dimensional report

1- Login into Openbravo ERP
2- Go to Goods Shipment window, create a new register: España Región Norte.
3- Go to lines tab, add Producto: Vino Tinto 0,75L with Qty: 1
4- Complete it.
5- Go to Sales invoice window, create a new register: España región Norte.
6- Select another date for example: a day after today.
7- Click on Create Lines From Shipment button and select the Goods Shipment created before.
8- Change the Document type to AR Credit Memo and process it.
9- Check that the Costing Background Process has finished successfully.
10- Go to Sales invoice Dimensional Report. Select Date from: a day after today and Date to: a day after today
11- Check Comparative Report option and select From Reference Date: a day after today and To Reference Date: a day after today
12- Select Product, Product Group, Business Partner and DocumentNo in dimensions filters and launch HTML format report.
13- Realise that a report with 4 levels of grouping is shown. Fields Quantity, Amount, Cost, Profit and Margin are taking positive values. Also References for these fields take positive values too.
14- Select printing in PDF format
15- Also a report with 4 levels of grouping is shown. Fields Amount, Cost, Profit and Margin and their respective references are taking positive values.

In these 2 last cases dimensional options XSL format ReportInvoiceCustomerDimensional sheet shows the same structure with fields Amount, Cost, Profit and Margin taking positive values.

Test plan 11: Credit Memo and AR Invoice comparative product dimension report.

1- Login into Openbravo ERP
2- Go to Sales invoice Dimensional Report. Select Date from: today and Date to: today
3- Check Comparative Report option and select From Reference Date: a day after today and To Reference Date: a day after today
4- Filter by Vino Tinto.
5- Select Product in dimensions filters and launch HTML format report.
6- Realise that negative values are reflected for normal fields (today Credit Memo) and positive ones for the references (a day after today AR Invoice).
(0107698)
hgbot   
2018-10-31 12:34   
Repository: erp/devel/pi
Changeset: 7ba289b96606324c420fcdbc57850f53454de02e
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Oct 29 12:14:27 2018 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/7ba289b96606324c420fcdbc57850f53454de02e [^]

Fixes issue 39517: Sales Invoice Dimensional Report is showing a positive Margin
% when the Profit is negative

Set the Margin % with the same sign of the profit.

---
M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml
M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_data.xsql
M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml
M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesXLS.jrxml
---
(0107699)
vmromanos   
2018-10-31 12:34   
Code review + testing OK
(0108450)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test