Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038203Openbravo ERP04. Warehouse managementpublic2018-03-22 17:222018-05-09 19:29
gorkaion 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q3 
aferraz
Core
No
0038203: Permanently adjusted transactions wrongly included in Cost Adjustment process.
When a Transaction is Permanently Adjusted its Unit Cost should not change anymore.

In some scenarios when the Cost Adjustment Process is searching related transactions it is not checking if the transaction is permanently adjusted. Later the process end with errors as it is not possible to adjust the unit cost of these kind of transactions.

For example. If a "Movement To" transaction of a Goods Movements is permanently adjusted when the "Movement From" transaction is adjusted the "To" transaction should not be included in the Cost Adjustment.

When this error happens it is not possible to adjust any transaction before the permanently adjusted transaction as any Cost Adjustment Process will finish in this error.

1. Go to Goods Movement window and create a new header.
2. Add a line of Cerveza Ale and move 100 Uds from RN-0-0-0 to RN-1-0-0
3. Go to Product window and select Cerveza Ale.
4. On the Transactions tab search the Movement To transaction related to the Goods Movement recently processed.
5. Click on Manual Cost Adjustment and process it with following data:
** If the button is not visible go to Process Request and ensure that Costing Background Process is executed and that the goods movement transaction has its cost calculated.
- Amount: 140 (something different than current total cost)
- Date: leave default.
- Incremental: false.
6. Check that the transaction now has the Is Cost Permanent flag true.
7. Now select the previous receipt in the transactions tab:
    10000467 - 12-12-2017 - Bebidas Alegres, S.L. - 10
8. Add a Manual Cost Adjustment
- Amount: 50000
- Date: leave default.
- Incremental: true.
9. Check that the process fails and it is not possible to fix it.
It is not possible to process a Cost Adjustment that includes lines of transactions whose cost is permanently adjusted.\nLines: 50
- Unit Cost: false.
In the method CostingAlgorithmAdjustmentImp.addCostDependingTrx()

Check that the related transactions are not permanently adjusted before inserting the new Cost Adjustment Line.

The methods that have to be reviewed are:

      searchReturnShipments(costAdjLine);
      searchVoidInOut(costAdjLine);
      searchIntMovementTo(costAdjLine);
      searchVoidInternalConsumption(costAdjLine);
      searchBOMProducts(costAdjLine);
      searchManufacturingProduced(costAdjLine);
      searchOpeningInventory(costAdjLine);

Ideally a warning could be raised to the user.
No tags attached.
related to defect 0038202 closed AtulOpenbravo Wrong error management in Process Price Difference Adjustment 
related to defect 0038307 closed gorkaion Wrong negative correction amount when trx has no unit cost adjustments 
Issue History
2018-03-22 17:22gorkaionNew Issue
2018-03-22 17:22gorkaionAssigned To => Triage Finance
2018-03-22 17:22gorkaionModules => Core
2018-03-22 17:22gorkaionResolution time => 1523484000
2018-03-22 17:22gorkaionTriggers an Emergency Pack => No
2018-03-22 17:24gorkaionRelationship addedrelated to 0038202
2018-03-22 17:24ngarciaIssue Monitored: ngarcia
2018-03-22 17:42dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2018-04-08 19:39AtulOpenbravoStatusnew => scheduled
2018-04-10 13:46gorkaionIssue cloned0038307
2018-04-10 13:46gorkaionRelationship addedrelated to 0038307
2018-04-11 08:49AtulOpenbravoNote Added: 0103803
2018-04-11 14:16hgbotCheckin
2018-04-11 14:16hgbotNote Added: 0103812
2018-04-11 14:16hgbotStatusscheduled => resolved
2018-04-11 14:16hgbotResolutionopen => fixed
2018-04-11 14:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5e5c3183b5971eca4a863462f621774c00165f5d [^]
2018-04-11 14:19aferrazReview Assigned To => aferraz
2018-04-11 14:19aferrazNote Added: 0103814
2018-04-11 14:19aferrazStatusresolved => closed
2018-04-11 14:19aferrazFixed in Version => 3.0PR18Q3
2018-05-09 19:29hudsonbotCheckin
2018-05-09 19:29hudsonbotNote Added: 0104370

Notes
(0103803)
AtulOpenbravo   
2018-04-11 08:49   
Test Plan

- Go to Goods Movement window and create a new header.
- Add a line of Cerveza Ale and move 100 Uds from RN-0-0-0 to RN-1-0-0
- Go to Product window and select Cerveza Ale.
- On the Transactions tab search the Movement To transaction related to the Goods Movement recently processed.
- Click on Manual Cost Adjustment and process it with following data:
  ** If the button is not visible go to Process Request and ensure that Costing Background Process is executed and that the goods movement transaction has its cost calculated.
  - Amount: 140 (something different than current total cost)
  - Date: leave default.
  - Incremental: false.
- Check that the transaction now has the Is Cost Permanent flag true.
- Now select the previous receipt in the transactions tab:
    10000467 - 12-12-2017 - Bebidas Alegres, S.L. - 10
- Add a Manual Cost Adjustment
  - Amount: 50000
  - Date: leave default.
  - Incremental: true.
- Check that the process is completed successfully.
- Navigate to Cost Adjustment window and realize that goods movement transaction marked as Permanent Cost = true is not included in the lines.
(0103812)
hgbot   
2018-04-11 14:16   
Repository: erp/devel/pi
Changeset: 5e5c3183b5971eca4a863462f621774c00165f5d
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Apr 10 19:22:43 2018 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/5e5c3183b5971eca4a863462f621774c00165f5d [^]

Fixes Issue 38203:Permanently adjusted transactions wrongly included
in Cost Adjustment process.

Before adding cost adjustment line for transaction, check is done
whether a transaction has permanent cost flag set as true,
if yes do not add cost adjustment line for it.

---
M src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java
---
(0103814)
aferraz   
2018-04-11 14:19   
Code review + Testing OK
(0104370)
hudsonbot   
2018-05-09 19:29   
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/2be7d3efe606 [^]
Maturity status: Test