Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029701Openbravo ERP04. Warehouse managementpublic2015-04-27 12:152015-05-18 11:59
psanjuan 
aferraz 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
3.0PR15Q3 
umartirena
Core
No
0029701: [Cost Adjutments] - Costing Background process seems not to be working for price correction adjustment
[Cost Adjutments] - Costing Background process seems not to be working for price correction adjustment, once "Enable automatic Price Difference Corrections" property is set to Y
Enable the preference "Enable automatic Price Difference Corrections" for
Navigate to Process Request window and create a new record, select your client and (*) Organization. Configure and schedule the background process every 3 seconds.

Navigate to Preference window and create a new record.
Select your client, select a legal entity organization, the one you would like to calculate cost for, and select "Enable automatic price difference corrections" property.
Enter Y in the field Value, make sure there are no empty spaces in that field but just Y

Do not select any value within Visibility group of fields.

Run below scenario which should cause a price correction, and realize that no price correction is created.

Before that create a Costing rule for your legal entity with below setup:
Average Algorithm
Warehouse Dimension = Yes
Backdated Transactions Fixed = Yes

and a product named "Product Price Correction" with below setup:
Price List Version = Purchase Price List = Unit Price = List Price = 100

Dated on 10-01-2015 create a purchase order for 5 units of the product created below. Book the order.

Complete and Post a Goods Receipt for that order dated on 11-01-2015
Create a goods shipment dated on 15-01-2015 for 1 unit of the product. Complete and post it.
Dated on 16-01-2015 register a purchase invoice, by using the feature "Create Lines From" the receipt.
Navigate to Purchase Invoice "Lines" tab and change the price to 105 €/Ud.
Complete and Post the invoice.

Realize that no price correction adjustment is created but that is not correct.
A 25.00€ adjustment needs to be created for the input transaction (Goods Recetip) and a 5.00€ adjustment needs to be created for the output transaction (Goods Shipment).

Above adjustments only happen by running the "Price Correction Background" process.








No tags attached.
depends on backport 00298893.0PR15Q2.1 closed aferraz [Cost Adjutments] - Costing Background process seems not to be working for price correction adjustment 
depends on backport 00298903.0PR15Q1.4 closed aferraz [Cost Adjutments] - Costing Background process seems not to be working for price correction adjustment 
Issue History
2015-04-27 12:15psanjuanNew Issue
2015-04-27 12:15psanjuanAssigned To => Triage Finance
2015-04-27 12:15psanjuanModules => Core
2015-04-27 12:15psanjuanTriggers an Emergency Pack => No
2015-04-27 12:18psanjuanProposed Solution updated
2015-04-27 12:36psanjuanProposed Solution updated
2015-05-11 16:45aferrazAssigned ToTriage Finance => aferraz
2015-05-13 12:32aferrazNote Added: 0077376
2015-05-13 12:51aferrazNote Edited: 0077376bug_revision_view_page.php?bugnote_id=0077376#r8538
2015-05-14 13:47hgbotCheckin
2015-05-14 13:47hgbotNote Added: 0077444
2015-05-14 13:47hgbotStatusnew => resolved
2015-05-14 13:47hgbotResolutionopen => fixed
2015-05-14 13:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/14775af5b6a0ac9017cb674f11c04a873c4dec07 [^]
2015-05-14 16:55aferrazStatusresolved => new
2015-05-14 16:55aferrazResolutionfixed => open
2015-05-14 16:56aferrazStatusnew => scheduled
2015-05-14 16:57aferrazStatusscheduled => resolved
2015-05-14 16:57aferrazFixed in Version => 3.0PR15Q3
2015-05-14 16:57aferrazResolutionopen => fixed
2015-05-16 05:21hudsonbotCheckin
2015-05-16 05:21hudsonbotNote Added: 0077507
2015-05-18 11:59umartirenaReview Assigned To => umartirena
2015-05-18 11:59umartirenaNote Added: 0077526
2015-05-18 11:59umartirenaStatusresolved => closed

Notes
(0077376)
aferraz   
2015-05-13 12:32   
(edited on: 2015-05-13 12:51)
With the fix of this issue, if you follow this flow: Purchase Order - Goods Receipt - Purchase Invoice with price difference - Run Costing Background; Price Correction will be automatically called from Costing Background.

Before the fix, in this first flow, Price Correction was not being called from Costing Background.

If you follow this other flow: Purchase Order - Goods Receipt - Run Costing Background- Purchase Invoice with price difference - Run Costing Background; Price Correction will NOT be automatically called from Costing Background.
The first time Costing Background is called, there isn't any price difference yet, and transaction's cost will be calculated with the price of the purchase order.
The second time Costing Background is called, it exists a price difference, but the transaction has also been calculated and Costing Background will not call Price Difference (it will do nothing).
In that case, Price Difference process must be run manually in order to create price difference adjustments (or it should be scheduled).

The fix does not change the behaviour of this second flow.

(0077444)
hgbot   
2015-05-14 13:47   
Repository: erp/devel/pi
Changeset: 14775af5b6a0ac9017cb674f11c04a873c4dec07
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed May 13 12:11:18 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/14775af5b6a0ac9017cb674f11c04a873c4dec07 [^]

Fixes issue 29701 & Fixes issue 29861: Error in Price Correction Background

IsCostCalculated will not be considered to set CheckPriceDifference flag, when completing an invoice.
Instead, when running Price Correction Background, transactions will be filtered by IsCostCalculated to avoid calculate price differences in transactions where cost has not been calculated.

---
M src-db/database/model/functions/C_INVOICE_POST.xml
M src/org/openbravo/costing/PriceDifferenceProcess.java
---
(0077507)
hudsonbot   
2015-05-16 05:21   
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/33b0ebaa36ae [^]
Maturity status: Test
(0077526)
umartirena   
2015-05-18 11:59   
Code Review + Testing OK