Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0045838Openbravo ERP04. Warehouse managementpublic2021-02-03 10:552021-02-19 10:35
azabaleta 
markmm82 
highmajoralways
closedfixed 
5
 
PR21Q2 
Core
No
0045838: "Fix Backdated" process does not take into account previous manual adjustments
The "Fix backdated transactions" process can calculate incorrect costs for transactions that had a manual cost adjustements
-Create a goods receipt at a price of 10€ for a new product at day 1. Calculate costs
-Create a goods receipt at a price of 20€ for a new product at day 10. Calculate costs.
-Create a shipment for that product at day 5. Calculate costs
----> At this point the transaction has a cost calculated of 15.
-Create a manual cost adjustement for the second receipt transaction to set the cost to 30 instead of 20.Calculate costs
- Execute fix backdated transactions process
----> The shipment transaction should have been corrected to 10 but it remains at 15, as the "Fix backdated" should have seen the manual cost adjustment, but he didnt.




Make the "Fix backdated transaction" process more intelligent to take into account these manual adjustements
No tags attached.
Issue History
2021-02-03 10:55azabaletaNew Issue
2021-02-03 10:55azabaletaAssigned To => a_singh
2021-02-03 10:55azabaletaModules => Core
2021-02-03 10:55azabaletaResolution time => 1612911600
2021-02-03 10:55azabaletaTriggers an Emergency Pack => No
2021-02-03 15:13gorkaionResolution time1612911600 => 1614121200
2021-02-03 15:13gorkaionAssigned Toa_singh => Triage Finance
2021-02-03 15:13gorkaionPriorityurgent => high
2021-02-03 23:25markmm82Assigned ToTriage Finance => markmm82
2021-02-04 01:02markmm82Statusnew => scheduled
2021-02-12 00:28markmm82Note Added: 0126082
2021-02-12 15:23hgbotNote Added: 0126097
2021-02-16 16:25dmiguelezNote Edited: 0126082bug_revision_view_page.php?bugnote_id=0126082#r22129
2021-02-19 10:35hgbotResolutionopen => fixed
2021-02-19 10:35hgbotStatusscheduled => closed
2021-02-19 10:35hgbotNote Added: 0126202
2021-02-19 10:35hgbotFixed in Version => PR21Q2
2021-02-19 10:35hgbotNote Added: 0126203
2021-02-19 10:35hgbotNote Added: 0126204

Notes
(0126082)
markmm82   
2021-02-12 00:28   
(edited on: 2021-02-16 16:25)
Test Plan:

As F&B Admin:
  Create a new product and define a sales and purchase prices of 10.00 EUR
  Create a purchase order with created product and quantity 1.
     Be sure the price in the line is 10.00EUR.
     Set date as 01/02/2021
  Complete.
  Create a Goods receipt from previously created purchase order (Set date as 01/02/2021). Complete.
  Go to the Process Request window and schedule the "Costing Background process" to be executed immediately. Execute it to calculate costs.
  Go to the Transactions tab after selecting the created product and check the transaction cost is 10.

  Create another purchase order with same created product and quantity 1.
    This time change the price in the line to 20.00EUR.
    Set date as 10/02/2021
  Complete.
  Create a Goods receipt from previously created purchase order. Complete.
  Go to the Process Request and execute "Costing Background process" to calculate costs.
  Go to the Transactions tab after selecting the created product and check the transaction cost is 20.

  Create a goods shipment with same created product and quantity 1.
    Set date as 05/02/2021
  Complete.
  Go to the Process Request and execute "Costing Background process" to calculate costs.
  Go to the Transactions tab after selecting the created product and check the transaction cost is 15.

  Select the second receipt transaction and create a manual cost adjustement for it.
   Set the cost to 30 instead of 20.
  Go to the Process Request and execute "Costing Background process" to calculate costs.

  Go to Costing Rules and enable Backdated Transactions from 01/01/2021

  Go to the Transactions tab after selecting the created product and check the transaction cost for the shipment transaction have been corrected to 10

(0126097)
hgbot   
2021-02-12 15:23   
Merge Request created: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/312 [^]
(0126202)
hgbot   
2021-02-19 10:35   
Merge request merged: https://gitlab.com/openbravo/product/openbravo/-/merge_requests/312 [^]
(0126203)
hgbot   
2021-02-19 10:35   
Directly closing issue as related merge request is already approved.

Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: 8bbbdc0a42c45fe455c3964111032a2a0db5c0e7
Author: Mark <markmm82@gmail.com>
Date: 2021-02-19T09:34:34+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/8bbbdc0a42c45fe455c3964111032a2a0db5c0e7 [^]

Fixes BUG-45838: Take into account previous manual adjustments in "Fix Backdated" process

The reported problem occurred when correcting transactions already processed. When its cost was calculated
it was only taking into account the original calculated cost (trx.getTransactionCost()).
But it should also take into account any manual adjustments that the transaction may have already had.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0126204)
hgbot   
2021-02-19 10:35   
Repository: https://gitlab.com/openbravo/product/openbravo [^]
Changeset: d14c39ff4b7b56d0563f6ae74e08c680df342fe1
Author: Mark <markmm82@gmail.com>
Date: 2021-02-19T09:34:34+00:00
URL: https://gitlab.com/openbravo/product/openbravo/-/commit/d14c39ff4b7b56d0563f6ae74e08c680df342fe1 [^]

Related to BUG-45838: Renamed variable and add final modifier

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---