Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0036028Openbravo ERP04. Warehouse managementpublic2017-05-17 18:522017-06-09 02:49
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q3 
aferraz
Core
No
0036028: Wrong stock in Valued Stock Report if there exists more than one record in Transaction Costs tab with different Accounting Date
Wrong stock in Valued Stock Report if there exists more than one record in Transaction Costs tab with different Accounting Date

The problem is that some transactions are taken into account more than once as they are joint with more than one record of the following subquery:

LEFT JOIN (SELECT Sum(cost) AS trxcost,
                          m_transaction_id,
                          c_currency_id,
                          COALESCE(dateacct, costdate) AS movementdate
                   FROM m_transaction_cost
                   WHERE dateacct < To_date('18-05-2017')
                          AND dateacct > To_date('01-01-0001')
                   GROUP BY m_transaction_id,
                             c_currency_id,
                             COALESCE(dateacct, costdate)) tc
As group admin role:
   Create a product and add a purchase price list to it
   Create a goods receipt and receive 100 units of it
   Launch the Costing Background Process and check it has finished successfully
   Add a manual cost adjustment to it with an accounting date one day after the goods receipt movement date
   Launch the Valued Stock Report for this accounting date and check the stock is shown duplicated
 
No tags attached.
Issue History
2017-05-17 18:52ngarciaNew Issue
2017-05-17 18:52ngarciaAssigned To => Triage Finance
2017-05-17 18:52ngarciaModules => Core
2017-05-17 18:52ngarciaResolution time => 1496786400
2017-05-17 18:52ngarciaTriggers an Emergency Pack => No
2017-05-17 18:52ngarciaIssue Monitored: networkb
2017-05-17 18:57heccamIssue Monitored: heccam
2017-05-19 13:30aferrazAssigned ToTriage Finance => collazoandy4
2017-05-22 15:33rbianchiniIssue Monitored: rbianchini
2017-06-03 02:18collazoandy4Statusnew => scheduled
2017-06-06 21:17collazoandy4Note Added: 0097173
2017-06-08 17:10hgbotCheckin
2017-06-08 17:10hgbotNote Added: 0097222
2017-06-08 17:10hgbotStatusscheduled => resolved
2017-06-08 17:10hgbotResolutionopen => fixed
2017-06-08 17:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/40bb5c5e4947774629da8c8cfa2c63bc0eb7a6ba [^]
2017-06-08 17:11aferrazReview Assigned To => aferraz
2017-06-08 17:11aferrazNote Added: 0097223
2017-06-08 17:11aferrazStatusresolved => closed
2017-06-08 17:11aferrazFixed in Version => 3.0PR17Q3
2017-06-09 02:49hudsonbotCheckin
2017-06-09 02:49hudsonbotNote Added: 0097264

Notes
(0097173)
collazoandy4   
2017-06-06 21:17   
As group admin role:
   Go to Product window and create a new record:
     Search Key/Name: IssueProduct
     Product Category: Fruit juice
     Create a new record in Price tab:
       Price List Version: Tarifa Bebidas Alegres
       Unit Price/List Price: 10
   Go to goods receipt window and create a new record:
     Business Partner: Bebidas Alegres, S.L.
     Create a new record in Lines tab:
       Product: IssueProduct
       Movement Quantity: 100
     Complete the receipt
   Launch the Costing Background Process and check it has finished successfully
   Go to Product window and select the previous one created:
     Check a new entry in Costing tab with total movement quantity = 100
     In Transaction tab select the record and clic on Manual Cost Adjustment
       Total Cost amount: 500
       Accounting date: Tomorrow
   Launch the Valued Stock Report for F&B EspaƱa S.A organization Fruit juice Product Category Tomorrow Date and check the stock doesn't shown duplicated
(0097222)
hgbot   
2017-06-08 17:10   
Repository: erp/devel/pi
Changeset: 40bb5c5e4947774629da8c8cfa2c63bc0eb7a6ba
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Tue Jun 06 18:36:25 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/40bb5c5e4947774629da8c8cfa2c63bc0eb7a6ba [^]

Fixes issue 36028: Wrong stock in Valued Stock Report

Some transactions are taken into account more than once as they are joint with
more than one record of the m_transaction_cost with different Accounting date
making a duplicate product stock.

The accounting date was removed from the joint query for a correct group of records
with m_transaction_id and c_currency_id.

The transaction movement date is now used instance of accounting date for group the stock
records

---
M src/org/openbravo/erpCommon/ad_reports/ReportValuationStock_data.xsql
---
(0097223)
aferraz   
2017-06-08 17:11   
Code review + Testing OK
(0097264)
hudsonbot   
2017-06-09 02:49   
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/682983c2eead [^]
Maturity status: Test