Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028266Openbravo ERP04. Warehouse managementpublic2014-11-24 17:502014-12-30 23:26
aferraz 
Sandrahuguet 
highminorhave not tried
closedfixed 
30Professional Appliance
 
 
aferraz
Core
No
0028266: [Costing] "Parent Cost Adjustment Line" field in Cost Adjustment Line should always be assigned in the same order
"Parent Cost Adjustment Line" field in Cost Adjustment Line should always be assigned in the same order
In "QA Testing" client:

Create a new Product named "Costing LC101" for Spain organization, "Purchase" price list and a unit/list price of 150 €.
Create a new Product named "Costing LC201" for Spain organization, "Purchase" price list and a unit/list price of 185 €.

Go to Goods Receipt window and create a new receipt dated on 30-11-2014. Create a new line with product "Costing LC101" and quantity 100 units. Create another line with product "Costing LC201" and quantity 200 units. Complete. Let's say this is receipt 10001795. Navigate to Process Request window and run "Costing Background process". Go to receipt window and post the receipt 10001795.

Go to Landed Cost window and create a new landed cost for Spain organization, reference date 30-11-2014. Move to Cost tab and add a new line with landed cost type Fees and amount 535 EUR. Add another line with landed cost type Transportation Cost and amount 105 EUR. Add another line with landed cost type USD Cost and amount 20 USD. Move to Receipt tab and add a new line with goods receipt 10001795. Click on Process button.

Navigate to Cost Adjustment window and select the last created record. Move to Line tab and realize that there are 4 records:

- Line 1: Adjustment Amount: 5.77 - Transaction: Receipt 10001795 line 10 - Parent Cost Adjustment Line: null

- Line 2: Adjustment Amount: 14.23 - Transaction: Receipt 10001795 line 20 - Parent Cost Adjustment Line: null

- Line 3: Adjustment Amount: 184.62 - Transaction: Receipt 10001795 line 10 - Parent Cost Adjustment Line: Cost Adjustment Line 10

- Line 4: Adjustment Amount: 455.38 - Transaction: Receipt 10001795 line 20 - Parent Cost Adjustment Line: Cost Adjustment Line 20

The field "Parent Cost Adjustment Line" should always have these values in this order, but it has not.
The query which assigns the "Parent Cost Adjustment Line" field in Cost Adjustment Line, should have an orderBy clause to assign the field in the same order which related inventory transaction was created (this is well done), and another orderBy clause to assign the field ordering the lines by amount (asc) if the transaction date is the same.
No tags attached.
related to feature request 0028148 closed umartirena Cost Adjustment Lines of type Landed Cost should always be created in the same order 
png 1.png (43,967) 2014-11-24 17:54
https://issues.openbravo.com/file_download.php?file_id=7537&type=bug
png

png 2.png (44,111) 2014-11-24 17:54
https://issues.openbravo.com/file_download.php?file_id=7538&type=bug
png
Issue History
2014-11-24 17:50aferrazNew Issue
2014-11-24 17:50aferrazAssigned To => Sandrahuguet
2014-11-24 17:50aferrazModules => Core
2014-11-24 17:50aferrazTriggers an Emergency Pack => No
2014-11-24 17:54aferrazFile Added: 1.png
2014-11-24 17:54aferrazFile Added: 2.png
2014-11-24 17:55aferrazRelationship addedrelated to 0028148
2014-12-04 20:51hgbotCheckin
2014-12-04 20:51hgbotNote Added: 0072292
2014-12-04 20:51hgbotStatusnew => resolved
2014-12-04 20:51hgbotResolutionopen => fixed
2014-12-04 20:51hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/51adc29c2514d9f39a0f43b4fde23b65b64778af [^]
2014-12-04 20:54aferrazReview Assigned To => aferraz
2014-12-04 20:54aferrazStatusresolved => closed
2014-12-30 23:26hudsonbotCheckin
2014-12-30 23:26hudsonbotNote Added: 0073178

Notes
(0072292)
hgbot   
2014-12-04 20:51   
Repository: erp/devel/pi
Changeset: 51adc29c2514d9f39a0f43b4fde23b65b64778af
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Dec 01 16:54:02 2014 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/51adc29c2514d9f39a0f43b4fde23b65b64778af [^]

Fixes bug 28266 ParentCostAdjustmentLine should always be assigned in the same order

In order to help JUnit tests assert Cost Adjustment lines, an orderBy clause has been added when assigning the field "Parent Cost Adjustment Line" to follow always the same order

---
M src/org/openbravo/costing/CostAdjustmentProcess.java
---
(0073178)
hudsonbot   
2014-12-30 23:26   
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/6525fe229e06 [^]
Maturity status: Test