Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033325Openbravo ERP07. Sales managementpublic2016-06-22 12:212016-08-11 18:40
maite 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4 
aferraz
Core
No
0033325: "Sales Invoice Dimensional Report Legacy" shows positive cost for Credit Memo when it should be negative
As Credit Memo document is a return document Cost should be displayed in negative, similar to a negative Standard Sales Invoice
0. Instance NOT migrated to new costing engine is required to be able to run "legacy" report. In order to configure instance as NOT migrated:
 - in a fresh environment, delete contents of "sampledata" folder and run ant install.source
 - run "Initial Client Setup" process Not checking "include accounting" option but applying reference data
 - delete preference with attribute "Cost_Eng_Ins_Migrated"
 - log as client's admin and run "initial organization setup". Access organization and "Set as ready"
 - create new product (and all related elements: product category, tax category, price list...)
 - create new Costing record for this product as "Legacy Average" and set any cost
 - stop tomcat and start it again
1. Register new Goods Shipment (business partner, warehouse and so on needs to be created) for this product with amount=-1 and process
2. Register Standard Sales Invoice, run Create Lines from process and select previous shipment. Process invoice
3. Run Generate Average cost process
4. Run "Sales Invoice Dimensional Report Legacy" for valid dates and selecting "Documentno" in Dimensions and realize that both amount and cost appears in negative
5. Register new Goods Shipment (business partner, warehouse and so on needs to be created) for this product with amount=-1 and process
6. Register Credit Memo Invoice, run Create Lines from process and select previous shipment. Access invoice line and change amount from -1 to +1 (as required per credit memo document type configuration) Process invoice
7. Run Generate Average cost process
4. Run "Sales Invoice Dimensional Report Legacy" for valid dates and selecting "Documentno" in Dimensions and realize that amount appears in negative but cost appears in positive, which is not correct

NOTE: if you follow same steps in a migrated costing environment and run report ""Sales Invoice Dimensional Report" then credit memo is properly shown a negative cost value
No tags attached.
Issue History
2016-06-22 12:21maiteNew Issue
2016-06-22 12:21maiteAssigned To => Triage Finance
2016-06-22 12:21maiteModules => Core
2016-06-22 12:21maiteResolution time => 1468274400
2016-06-22 12:21maiteTriggers an Emergency Pack => No
2016-06-22 12:22maiteIssue Monitored: networkb
2016-06-23 12:40aferrazAssigned ToTriage Finance => markmm82
2016-06-27 11:00aferrazTarget Version3.0PR16Q3 =>
2016-06-30 15:08markmm82Statusnew => scheduled
2016-07-11 19:44markmm82Note Added: 0088377
2016-07-13 11:33hgbotCheckin
2016-07-13 11:33hgbotNote Added: 0088436
2016-07-13 11:33hgbotStatusscheduled => resolved
2016-07-13 11:33hgbotResolutionopen => fixed
2016-07-13 11:33hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/3bc16b78fc85ca7004aa024ea1473ea0dbf47253 [^]
2016-07-13 11:33hgbotCheckin
2016-07-13 11:33hgbotNote Added: 0088437
2016-07-13 11:38aferrazReview Assigned To => aferraz
2016-07-13 11:38aferrazNote Added: 0088438
2016-07-13 11:38aferrazStatusresolved => closed
2016-07-13 11:38aferrazFixed in Version => 3.0PR16Q4
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089008
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089009

Notes
(0088377)
markmm82   
2016-07-11 19:44   
Test Plan 1
0. Instance NOT migrated to new costing engine is required to be able to run "legacy" report. In order to configure instance as NOT migrated:
 - in a fresh environment, delete contents of "sampledata" folder and run ant install.source
 - run "Initial Client Setup" process Not checking "include accounting" option but applying reference data
 - delete preference with attribute "Cost_Eng_Ins_Migrated"
 - log as client's admin and run "initial organization setup". Access organization and "Set as ready"
 - create new product (and all related elements: product category, tax category, price list...)
 - create new Costing record for this product as "Legacy Average" and set any cost
 - stop tomcat and start it again
1. Register new Goods Shipment (business partner, warehouse and so on needs to be created) for this product with amount=-1 and process
2. Register Standard Sales Invoice, run Create Lines from process and select previous shipment. Process invoice
3. Run Generate Average cost process
4. Run "Sales Invoice Dimensional Report Legacy" for valid dates, selecting "Documentno" in Dimensions and DO NOT CHECK "Comparative Report". Realize that both amount and cost appears in negative.
5. Register new Goods Shipment for this product with amount=-1 and process
6. Go to Sales Invoice and Register Credit Memo Invoice, run Create Lines from process and select previous shipment. Access invoice line and change amount from -1 to +1 (as required per credit memo document type configuration) Process invoice
7. Run Generate Average cost process
8. Run "Sales Invoice Dimensional Report Legacy"
    Select valid dates, select "Documentno" in Dimensions and DO NOT CHECK "Comparative Report"
    Press the HTML Format button and realize that both amount and cost appears in negative which is correct.

Test Plan 2
Repeat the test above but selecting the "Comparative Report" field before running the "Sales Invoice Dimensional Report Legacy".

Test Plan 3
1. Apply the patch.
2. Follow same steps in a migrated costing environment and run report ""Sales Invoice Dimensional Report" then credit memo is properly shown a negative cost value
(0088436)
hgbot   
2016-07-13 11:33   
Repository: erp/devel/pi
Changeset: 3bc16b78fc85ca7004aa024ea1473ea0dbf47253
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Jul 11 13:40:10 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/3bc16b78fc85ca7004aa024ea1473ea0dbf47253 [^]

Fixes issue 33325: Sales Inv Report Legacy shows negative cost for Credit Memo

Fixed the way how the cost is calculated in ReportInvoiceCustomerDimensionalAnalysesJR_legacy_data to retrieve the document cost of a Credit Memo document in negative because it is a return document, similar to a negative Standard Sales Invoice.

---
M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_legacy_data.xsql
---
(0088437)
hgbot   
2016-07-13 11:33   
Repository: erp/devel/pi
Changeset: fbb6588f5b6d813fd63523fc81201d606804c218
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Jul 13 01:09:53 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fbb6588f5b6d813fd63523fc81201d606804c218 [^]

Related to issue 33325: Code review improvements

---
M src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_legacy_data.xsql
---
(0088438)
aferraz   
2016-07-13 11:38   
Code review + Testing OK
(0089008)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test
(0089009)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test