Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0028962Openbravo ERP04. Warehouse managementpublic2015-02-16 19:122015-03-09 09:30
umartirena 
umartirena 
urgentmajoralways
closedfixed 
5
 
pi 
aferraz
Core
No
0028962: [Cost Adjustments] Orphan Lines cost calculation fails under certain circumstances
Orphan Lines cost calculation cannot calculate the cost of a return from customer when is a backdated transaction.
In F&B:
 * Enable "RM Allow Orphan Line" preference.
 * Have a valid average costing rule for F&B España org.
 * Create a Product
 * Add a Costing Record:
  - Org: F&B España
  - Cost: 5
  - Cost Type: Average
  - Starting Date: 01/01/2014
  - Ending Date: 31/12/9999
 * Create a Goods Shipment:
  - Org: F&B España
  - Business Partner: Alimentos y Supermercados
  - Movement Date: 10/02/2015
 * Add a Line:
  - Product: The new product
  - Qty: 10
  - Storage Bin: RN 0-0-0
 * Complete it
 * Go to Return from Customer window
 * Create a Header:
  - Org: F&B España
  - Business Partner: Alimentos y Supermercados
  - Order Date: 05/02/2015
 * Click on "Insert Orphan Line":
  - Product: The new product
  - Returned: 5
  - Unit Price: 12
  - Tax: Arrendamiento 21% (Cobros) - IVA Normal
 * Click OK and Book it
 * Go to Return Material Receipt:
 * Create a Header:
  - Org: F&B España
  - Business Partner: Alimentos y Supermercados
  - Movement Date: 05/02/2015
 * Click on Pick/Edit Lines:
 * Select the line created in previous Return from Customer
  - Returned: 5
  - Storage Bin: RN 0-0-0
 * Click Done and Complete it
 * Go to Process Request window
 * Run Costing Background process
 
 * Realize that the process ends successfully but the following message is obtained in Process Log:

 "No average cost found for the product on a date"

 
The process should be able to calculate the cost of the product on that case looking at Costing tab of the Product and finding a valid Average Cost.
No tags attached.
depends on backport 00291933.0PR15Q1.2 closed umartirena [Cost Adjustments] Orphan Lines cost calculation fails under certain circumstances 
Issue History
2015-02-16 19:12umartirenaNew Issue
2015-02-16 19:12umartirenaAssigned To => Sandrahuguet
2015-02-16 19:12umartirenaModules => Core
2015-02-16 19:12umartirenaTriggers an Emergency Pack => No
2015-02-16 19:12umartirenaAssigned ToSandrahuguet => umartirena
2015-02-16 19:13umartirenaProposed Solution updated
2015-02-17 17:27hgbotCheckin
2015-02-17 17:27hgbotNote Added: 0074562
2015-02-17 17:27hgbotStatusnew => resolved
2015-02-17 17:27hgbotResolutionopen => fixed
2015-02-17 17:27hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bc69189429632bbbcec2c1b755e3a6e1b6334163 [^]
2015-02-23 05:11hudsonbotCheckin
2015-02-23 05:11hudsonbotNote Added: 0074775
2015-03-06 15:18aferrazReview Assigned To => aferraz
2015-03-06 15:18aferrazNote Added: 0075250
2015-03-06 15:18aferrazStatusresolved => closed
2015-03-09 09:29umartirenaNote Added: 0075292
2015-03-09 09:29umartirenaStatusclosed => new
2015-03-09 09:29umartirenaResolutionfixed => open
2015-03-09 09:29umartirenaStatusnew => scheduled
2015-03-09 09:29umartirenaStatusscheduled => resolved
2015-03-09 09:29umartirenaFixed in Version => pi
2015-03-09 09:29umartirenaResolutionopen => fixed
2015-03-09 09:30umartirenaStatusresolved => closed

Notes
(0074562)
hgbot   
2015-02-17 17:27   
Repository: erp/devel/pi
Changeset: bc69189429632bbbcec2c1b755e3a6e1b6334163
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Tue Feb 17 17:25:49 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/bc69189429632bbbcec2c1b755e3a6e1b6334163 [^]

Fixes Bug 28962: Cost properly calculated for orphan lines in Cost Adjustments

The process was failing for orphan lines because it was trying to get the cost from a Purchase Price or an Standard Cost, and there is none. Before checking those two, the process now tries to find an Average Cost for that product on the movement date of the orphan line, and if it founds it assigns to the transaction.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
M src/org/openbravo/costing/CostingAlgorithmAdjustmentImp.java
---
(0074775)
hudsonbot   
2015-02-23 05:11   
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/6856352d7235 [^]
Maturity status: Test
(0075250)
aferraz   
2015-03-06 15:18   
Code review + Testing OK
(0075292)
umartirena   
2015-03-09 09:29   
Reopened to add backport for 3.0PR15Q1.2