Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039616Openbravo ERP09. Financial managementpublic2018-11-13 13:332019-03-28 14:55
dmiguelez 
dmiguelez 
urgentmajoralways
closedfixed 
5
 
3.0PR19Q1 
Sandrahuguet
Core
No
0039616: Wrong Cost Adjustment created from a Landed Cost with multiple Currencies
Wrong Cost Adjustment created from a Landed Cost with multiple Currencies
Log in as F&B Admin

Go to Landed Cost Type Window and create two new records with:
* Organization: F&B US
* Name: LCT1
* Landed Cost Distribution Algorithm: Distribution By Amount
* Account: Company Capital

* Organization: F&B US
* Name: LCT2
* Landed Cost Distribution Algorithm: Distribution By Amount
* Account: Company Capital


Go to Landed Cost Window and create a new record with:
* Organization: F&B US West Coast

Move to Cost Tab and create 4 records with:
* Landed Cost Type: LCT1
* Amount: 10
* Currency: USD

* Landed Cost Type: LCT1
* Amount: 20
* Currency: EUR

* Landed Cost Type: LCT2
* Amount: 30
* Currency: USD

* Landed Cost Type: LCT2
* Amount: 40
* Currency: EUR

Move to Receipts Tab and create a record with:
* Goods Receipt: 10000525 - 10-09-2018 - Be Soft Drinker, Inc.
* Goods Receipt Line: 10000525 - 10-09-2018 - Be Soft Drinker, Inc. - 20 - Cola - 82000.00

Process the Landed Cost Document


Go to Cost Adjustment Window and check the Cost Adjustment created when the Landed Cost was processed
Check that it has one line with:
* Adjustment Amount: 100
* Currency: EUR

And it should have had two lines with:
* Adjustment Amount: 40
* Currency: USD

* Adjustment Amount: 60
* Currency: EUR
No tags attached.
Issue History
2018-11-13 13:33dmiguelezNew Issue
2018-11-13 13:33dmiguelezAssigned To => Triage Finance
2018-11-13 13:33dmiguelezModules => Core
2018-11-13 13:33dmiguelezResolution time => 1543878000
2018-11-13 13:33dmiguelezTriggers an Emergency Pack => No
2018-11-13 13:34dmiguelezNote Added: 0107881
2018-11-13 16:17martinsdanIssue Monitored: martinsdan
2018-11-13 17:12SandrahuguetAssigned ToTriage Finance => dmiguelez
2018-11-14 09:54SandrahuguetStatusnew => scheduled
2018-11-14 12:41hgbotCheckin
2018-11-14 12:41hgbotNote Added: 0107905
2018-11-14 12:41hgbotStatusscheduled => resolved
2018-11-14 12:41hgbotResolutionopen => fixed
2018-11-14 12:41hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/e028e67c832cd5a9de510e175778967be67a50a1 [^]
2018-11-14 12:43SandrahuguetReview Assigned To => Sandrahuguet
2018-11-14 12:43SandrahuguetNote Added: 0107906
2018-11-14 12:43SandrahuguetStatusresolved => closed
2018-11-14 12:43SandrahuguetFixed in Version => 3.0PR19Q1
2018-12-11 20:22hudsonbotCheckin
2018-12-11 20:22hudsonbotNote Added: 0108468
2019-01-18 10:25hgbotCheckin
2019-01-18 10:25hgbotNote Added: 0109012
2019-03-28 14:55hudsonbotCheckin
2019-03-28 14:55hudsonbotNote Added: 0110737

Notes
(0107881)
dmiguelez   
2018-11-13 13:34   
Test Plan I:

Log in as F&B Admin

Go to Landed Cost Type Window and create two new records with:
* Organization: F&B US
* Name: LCT1
* Landed Cost Distribution Algorithm: Distribution By Amount
* Account: Company Capital

* Organization: F&B US
* Name: LCT2
* Landed Cost Distribution Algorithm: Distribution By Amount
* Account: Company Capital


Go to Landed Cost Window and create a new record with:
* Organization: F&B US West Coast

Move to Cost Tab and create 4 records with:
* Landed Cost Type: LCT1
* Amount: 10
* Currency: USD

* Landed Cost Type: LCT1
* Amount: 20
* Currency: EUR

* Landed Cost Type: LCT2
* Amount: 30
* Currency: USD

* Landed Cost Type: LCT2
* Amount: 40
* Currency: EUR

Move to Receipts Tab and create a record with:
* Goods Receipt: 10000525 - 10-09-2018 - Be Soft Drinker, Inc.
* Goods Receipt Line: 10000525 - 10-09-2018 - Be Soft Drinker, Inc. - 20 - Cola - 82000.00

Process the Landed Cost Document


Go to Cost Adjustment Window and check the Cost Adjustment created when the Landed Cost was processed
has two lines with:
* Adjustment Amount: 40
* Currency: USD

* Adjustment Amount: 60
* Currency: EUR


Test Plan II:

Using the scenario created to reproduce the issue without the fix.
Reactivate the Landed Cost and process it again.
Check that a Cost Adjustment has been created with two lines with:
* Adjustment Amount: 40
* Currency: USD

* Adjustment Amount: 60
* Currency: EUR
(0107905)
hgbot   
2018-11-14 12:41   
Repository: erp/devel/pi
Changeset: e028e67c832cd5a9de510e175778967be67a50a1
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue Nov 13 13:40:29 2018 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/e028e67c832cd5a9de510e175778967be67a50a1 [^]

Fixes Issue 39616. When searching for previously created
Cost Adjustment Lines take into account different currencies.
This is important for Landed Costs in which the same adjustment
can happen for the same transaction with different currencies.

* Create new API to be able to send the currency of the Landed
  Cost line as a parameter
* Use the currency in the Query to filter the Cost Adjustment Lines
* Send the Landed Cost Currency when creating a new Cost Adjustment
  Line

---
M src/org/openbravo/costing/CostAdjustmentUtils.java
M src/org/openbravo/costing/LandedCostProcess.java
---
(0107906)
Sandrahuguet   
2018-11-14 12:43   
Code review + testing OK
(0108468)
hudsonbot   
2018-12-11 20:22   
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/470e3cd384c5 [^]
Maturity status: Test
(0109012)
hgbot   
2019-01-18 10:25   
Repository: erp/devel/pi
Changeset: 8d73ffc2b531b2a5d34039a1cff737480961325e
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Jan 17 14:57:34 2019 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/8d73ffc2b531b2a5d34039a1cff737480961325e [^]

Related To Issue 39616:Added junit tests for the Landed Cost with
multiple currency records in Cost Tab

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
A src-test/src/org/openbravo/test/costing/TestIssue39616.java
---
(0110737)
hudsonbot   
2019-03-28 14:55   
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/b2fbc1588df4 [^]
Maturity status: Test