Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0010749Openbravo ERP04. Warehouse managementpublic2009-09-24 17:442009-10-27 00:00
networkb 
gorkaion 
highminoralways
closedfixed 
5
2.40MP6 
2.40MP11 
Core
No
0010749: Generate average cost does not calculate properly end date
End dates are not properly calculated when generate average cost is executed.

In our scenario a permanent cost is introduced. Then a purchase order + good receipt is created. After executing it, end dates are the same.

Also it happens if more purchase orders + good receipts are created.

Please, see attached file
Go to Master Data Management > Product. Create a new one and select Average as Cost type.
Go to Costing tab and generate a new record. Select Permanent, and Manual.
Enter as Starting date, quantity and price.
Go to Procurement management > Transactions > Purchase Order. Create a new one with this product. Process it.
Go to Procurement management > Transactions > Good Receipt. Create a new one with same partner. Use "Create lines from" button to enter its lines. Select the previous Order to select it line.
Complete it.
Go to Warehouse Management > Transactions > Generate average cost. Execute it.
Go back to Costing tab, in Product window. See end dates. They are wrong.
250MP8, main
depends on backport 00107512.40MP11 closed gorkaion Generate average cost does not calculate properly end date 
related to defect 00110202.40MP11 closed gorkaion Generate Average cost does not work properly if products have ad_client_id = 0 
png Pantallazo.png (222,655) 2009-09-24 17:44
https://issues.openbravo.com/file_download.php?file_id=1783&type=bug
png
Issue History
2009-09-24 17:44networkbNew Issue
2009-09-24 17:44networkbAssigned To => rafaroda
2009-09-24 17:44networkbFile Added: Pantallazo.png
2009-09-24 17:45networkbTarget Version => 2.40MP11
2009-09-24 17:45networkbNote Added: 0020346
2009-09-24 18:04psarobeStatusnew => scheduled
2009-09-24 18:04psarobeAssigned Torafaroda => gorkaion
2009-09-24 18:04psarobefix_in_branch => pi
2009-09-24 19:13hgbotCheckin
2009-09-24 19:13hgbotNote Added: 0020347
2009-09-24 19:13hgbotStatusscheduled => resolved
2009-09-24 19:13hgbotResolutionopen => fixed
2009-09-24 19:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f12253b7af5cbcf024bea1456e607c36cd646616 [^]
2009-09-25 07:05rafarodaPriorityimmediate => high
2009-09-25 07:05rafarodafix_in_branchpi =>
2009-09-29 14:18hgbotCheckin
2009-09-29 14:18hgbotNote Added: 0020511
2009-09-29 14:18hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/f12253b7af5cbcf024bea1456e607c36cd646616 [^] => http://code.openbravo.com/erp/devel/pi-pageddatagrid/rev/f12253b7af5cbcf024bea1456e607c36cd646616 [^]
2009-10-07 09:48sureshbabuNote Added: 0020814
2009-10-08 08:59sureshbabuNote Edited: 0020814
2009-10-16 09:38networkbNote Added: 0021094
2009-10-16 17:10gorkaionNote Added: 0021122
2009-10-16 17:15networkbNote Added: 0021123
2009-10-16 17:47gorkaionRelationship addedrelated to 0011020
2009-10-21 08:36arunkumarNote Added: 0021240
2009-10-21 08:41sureshbabuNote Edited: 0021240
2009-10-22 19:26psarobeTag Attached: main
2009-10-22 19:33psarobeTag Attached: 250MP8
2009-10-23 14:02gorkaionNote Added: 0021363
2009-10-26 11:41plujanStatusresolved => closed
2009-10-27 00:00anonymoussf_bug_id0 => 2886771

Notes
(0020346)
networkb   
2009-09-24 17:45   
It also has been tested in MP9, and also it fails
(0020347)
hgbot   
2009-09-24 19:13   
Repository: erp/devel/pi
Changeset: f12253b7af5cbcf024bea1456e607c36cd646616
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Thu Sep 24 19:11:57 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f12253b7af5cbcf024bea1456e607c36cd646616 [^]

Fixed issue 10749. Changed the initial dateTo calculation.

---
M src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
---
(0020511)
hgbot   
2009-09-29 14:18   
Repository: erp/devel/pi-pageddatagrid
Changeset: f12253b7af5cbcf024bea1456e607c36cd646616
Author: Gorka Ion Damián <gorkaion.damian <at> openbravo.com>
Date: Thu Sep 24 19:11:57 2009 +0200
URL: http://code.openbravo.com/erp/devel/pi-pageddatagrid/rev/f12253b7af5cbcf024bea1456e607c36cd646616 [^]

Fixed issue 10749. Changed the initial dateTo calculation.

---
M src-db/database/model/functions/M_GENERATE_AVERAGE_COSTS.xml
---
(0020814)
sureshbabu   
2009-10-07 09:48   
(edited on: 2009-10-08 08:59)
Hi Gorka,

Kindly let me know what is the fix here, since i am not finding any difference to the one reported by the user.

(0021094)
networkb   
2009-10-16 09:38   
Please, reopen the issue because the solution provided is not right.
(0021122)
gorkaion   
2009-10-16 17:10   
Hi,

suresh, to reproduce the issue you have the date of the first fixed cost has to be later than the firs receipt.

good receipt 2009-09-10
fixed cost 2009-10-10
good receipt 2009-11-10

the solution to the issue described is right so I won't open this one. Please open a new one in order to study why it is still failing.
(0021123)
networkb   
2009-10-16 17:15   
Function fails when products were created with ad_client_id = 0, and are used in diferent clients.
(0021240)
arunkumar   
2009-10-21 08:36   
(edited on: 2009-10-21 08:41)
Still I see the end dates are 31-12-9999 for the created Goods Receipt.I do not find the fix here.

(0021363)
gorkaion   
2009-10-23 14:02   
Go to Master Data Management > Product. Create a new one and select Average as Cost type.
Go to Costing tab and generate a new record. Select Permanent, and Manual.
Enter as Starting date=01-10-2009, quantity=10, price=10 and cost=10.
Go to Procurement management > Transactions > Purchase Order. Create a new one with this product with date ordered 01-09-2009. Process it.
Go to Procurement management > Transactions > Good Receipt. Create a new one with same partner with date 01-09-2009. Use "Create lines from" button to enter its lines. Select the previous Order to select it line.
Complete it.
Create a new order and receipt following previous steps with date 01-11-2009.
Go to Warehouse Management > Transactions > Generate average cost. Execute it.
Go back to Costing tab, in Product window to check the results. Expected results are:

good receipt. datefrom 01-09-2009 dateto 01-10-2009
fixed cost datefrom 01-10-2009 dateto 01-11-2009
good receipt datefrom 01-11-2009 dateto 31-12-9999