Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0027461Openbravo ERP07. Sales managementpublic2014-08-25 14:232014-12-30 23:23
VictorVillar 
vmromanos 
urgentmajoralways
closedfixed 
5
pi 
3.0PR15Q1pi 
reinaldoguerra
Core
No
0027461: The cost on the Sales invoice Dimensional Report should be different for Credit Memo invoices
The cost on the Sales invoice Dimensional Report should be different for Credit Memo invoices
As group Admin role,
Go to Goods Shipment window,
 create a new register: España Región Norte.
 lines tab:
   Producto: Vino Tinto 0,75L
   Qty: 1
Complete it.
 
Go to Sales invoice window:
  Create a new register: España región Norte
  Document type: AR Credit Memo
 Click on Create Lines From button and select the Goods Shipment created before.

Process it.

Check that the Costing Background Process has finished successfully.
Go to Sales invoice Dimensional Report. Select Date from: today and Date to: today

Filter by Vino Tinto and launch the report.

Realise that the qty is = 1, it is wrong, should be -1
Realise that the cost is = 2.39, it is wrong, should be= -2.39
No tags attached.
related to defect 00245953.0MP28 closed caristu Sales Invoice Dimensional Report shows wrong cost value under some circunstancies 
related to defect 0039517 closed markmm82 Sales Invoice Dimensional Report is showing a positive Margin % when the Profit is negative 
Issue History
2014-08-25 14:23VictorVillarNew Issue
2014-08-25 14:23VictorVillarAssigned To => dmiguelez
2014-08-25 14:23VictorVillarModules => Core
2014-08-25 14:23VictorVillarResolution time => 1411423200
2014-08-25 14:23VictorVillarTriggers an Emergency Pack => No
2014-08-25 14:24VictorVillarRelationship addedrelated to 0024595
2014-08-25 14:24VictorVillarIssue Monitored: networkb
2014-09-28 09:09reinaldoguerraAssigned Todmiguelez => reinaldoguerra
2014-09-28 09:09reinaldoguerraStatusnew => scheduled
2014-09-29 16:12jonalegriaesarteTarget Version3.0PR14Q4 => 3.0PR15Q1
2014-09-30 05:55reinaldoguerraNote Added: 0070528
2014-10-16 18:37vmromanosNote Added: 0071006
2014-10-16 18:37vmromanosStatusscheduled => feedback
2014-10-17 06:23VictorVillarNote Added: 0071009
2014-10-17 06:28VictorVillarStatusfeedback => scheduled
2014-10-17 06:28VictorVillarfix_in_branch => pi
2014-10-21 13:44hgbotCheckin
2014-10-21 13:44hgbotNote Added: 0071087
2014-10-21 13:44hgbotStatusscheduled => resolved
2014-10-21 13:44hgbotResolutionopen => fixed
2014-10-21 13:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d3523cde088bb8fbbf96f3395c30e2cc4cca8f0c [^]
2014-10-21 13:45vmromanosAssigned Toreinaldoguerra => vmromanos
2014-10-21 13:45vmromanosNote Added: 0071088
2014-10-21 13:45vmromanosStatusresolved => new
2014-10-21 13:45vmromanosResolutionfixed => open
2014-10-21 13:46vmromanosReview Assigned To => reinaldoguerra
2014-10-21 13:46vmromanosfix_in_branchpi =>
2014-10-21 13:46vmromanosStatusnew => scheduled
2014-10-21 13:46vmromanosfix_in_branch => pi
2014-10-21 13:46vmromanosStatusscheduled => resolved
2014-10-21 13:46vmromanosResolutionopen => fixed
2014-10-22 05:01reinaldoguerraNote Added: 0071108
2014-10-22 05:01reinaldoguerraStatusresolved => closed
2014-10-22 05:01reinaldoguerraFixed in Version => pi
2014-12-30 23:23hudsonbotCheckin
2014-12-30 23:23hudsonbotNote Added: 0072960
2018-10-29 19:19markmm82Relationship addedrelated to 0039517

Notes
(0070528)
reinaldoguerra   
2014-09-30 05:55   
Test plan used:
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 with Document type: AR Credit Memo
6- Click on Create Lines From button and select the Goods Shipment created before.
7- 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 and launch the report.
11- Realise that the qty now is -1 and the cost is -2.39
(0071006)
vmromanos   
2014-10-16 18:37   
Hi Víctor,

I think the cost should be positive in this scenario because it affects the Profit and the Margin.
On the other hand I do agree in the quantity field.

Please reply to my email to clarify about the cost field. Meanwhile the issue remains in feedback.

Thanks.
(0071009)
VictorVillar   
2014-10-17 06:23   
Hi,

as we have talked in the emails, the issue reported is correct and the cost should be negative.

Thank you.
(0071087)
hgbot   
2014-10-21 13:44   
Repository: erp/devel/pi
Changeset: d3523cde088bb8fbbf96f3395c30e2cc4cca8f0c
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Oct 21 13:40:33 2014 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/d3523cde088bb8fbbf96f3395c30e2cc4cca8f0c [^]

Fixed bug 27461: Sales invoice Dimensional Report improvements for Credit Memo

In case of credit memo documents, the following columns in the report should reflect a negative number:
 Quantity
 Amount
 Cost
 Profit
 Margin

Before this fix, only the Amount column reflected a negative number. Besides the Profit and Margin were wrongly calculated in credit memo scenario, because they are based on the Cost which had a wrong possitive sign for credit memos.
After this fix all these columns show a negative number in case of credit memo. Thus the Profit and Margin are properly calculated based on the right sign of the Cost column.

Note that the Margin formula has been also updated to reflect a negative sign in case the Profit is also negative:
Profit = Amount - Cost
Margin = 100 * ((Profit) / Amount) * sign(Profit)

That means the Margin will now be shown as a negative percentage for credit memo and negative invoices.

---
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
---
(0071088)
vmromanos   
2014-10-21 13:45   
Reopened to properly assign the "Assigned To" and "Review Assigned To" fields
(0071108)
reinaldoguerra   
2014-10-22 05:01   
Tests plan used:

Test plan 1: 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 with Document type: AR Credit Memo
6- Click on Create Lines From button and select the Goods Shipment created before.
7- 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 format
14- Also fields Quantity, Amount, Cost, Profit and Margin are taking negative values

Test plan 2: 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 format
14- Also fields Amount, Cost, Profit and Margin are taking negative values

Test plan 3: 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 format
14- Also fields Amount, Cost, Profit and Margin are taking negative values.

Test plan 4: 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 5: 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 with Document type: AR Credit Memo
6- Click on Create Lines From button and select the Goods Shipment created before.
7- 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 6: 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 7: 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 with Document type: AR Invoice
6- Select another date for example: a day after today.
7- Click on Create Lines From button and select the Goods Shipment created before.
8- 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 8: 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 9: 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 with Document type: AR Invoice
6- Select another date for example: a day after today.
7- Click on Create Lines From button and select the Goods Shipment created before.
8- 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 10: 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).
(0072960)
hudsonbot   
2014-12-30 23:23   
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/6525fe229e06 [^]
Maturity status: Test