Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035209Openbravo ERP04. Warehouse managementpublic2017-02-08 18:082017-04-11 15:46
ngarcia 
collazoandy4 
urgentmajoralways
scheduledopen 
5
 
 
Core
No
0035209: Negative average cost after validating a costing rule in the past
Negative average cost after validating a costing rule in the past
As group admin role:
   Launch the Initial Organization Setup process and create a new legal with accounting organization
   Create a new fiscal calendar
   Add 2016 and 2017 years to it and create its periods
   Assign the calendar to the organization and set it as ready
   Open the periods
   Create a new warehouse in that organization
   Add 4 storage bins to it
   Create a new product in that organization
   Increase its stock in the 4 storage bins by a physical inventory:
      Movement Date: 31-12-2016
      Quantities: 8916, 4099, 3921 and 4329
   Set the following preferences to Y:
      Enable Negative Stock Corrections
      Enable automatic Price Difference Corrections
   Create a new costing rule for that organization:
      Starting date: 01-01-2017
      Select the option of Backdated Transactions Fixed
   Add an average cost of 241.8 to the product
      Starting date: 01-01-2017
      Ending date: 31-12-9999
   Launch the Costing Background Process and check it finishes successfully
   Check a negative average cost has been calculated for the product (-175.05)
   Create a new physical inventory in which stock is decreased, launch the costing background process and check the cost of the transaction is negative
Different possible solutions:

- Costing Rule should create closing and opening inventories only for stock generated with movement date and transaction process date < costing rule starting date.
Transactions created with movement date < costing rule but transaction process date >= costing rule starting date will have zero cost.
In this case, you will have stock > 0 but valuation = 0.
If you create an outgoing transaction after costing rule validation and then an incoming transaction with less movement quantity than outgoing transaction, you will get a negative cost (positive stock but negative valuation).

- Costing Rule should create closing and opening inventories only for stock generated with movement date and transaction process date < costing rule starting date and should set zero cost only to transactions created with movement date and transaction process date < costing rule starting date.
In this case, transactions with movement date < costing rule starting date but transaction process date >= costing rule starting date will be calculated with the new costing rule.
This solution disagree with issue 0028401 proposed solution.

- Show a warning or an error in case you try to validate a costing rule and there is a transaction with movement date < costing rule starting date and transaction process date > costing rule starting date.
No tags attached.
related to feature request 0012205 new Triage Omni WMS Allow Physical Inventory with previous date 
related to feature request 0022895 new dmiguelez It would be fine to create a new costing rule taking into account stock in the past 
related to feature request 0020995 closed jonalegriaesarte Physical inventory does not work properly when the date is different from now 
related to defect 00120422.50MP12 closed rafaroda The Book Quantity on Physical Inventory is not correct 
related to defect 0021406 closed gorkaion Costing Background Process blocked by Transactions without cost calculated. 
related to defect 0028401 closed dmiguelez [Costing] Initialized All Trx process needs to be changed 
Issue History
2017-02-08 18:08ngarciaNew Issue
2017-02-08 18:08ngarciaAssigned To => Triage Finance
2017-02-08 18:08ngarciaModules => Core
2017-02-08 18:08ngarciaResolution time => 1488322800
2017-02-08 18:08ngarciaTriggers an Emergency Pack => No
2017-02-08 18:08ngarciaIssue Monitored: networkb
2017-02-09 11:56ngarciaRelationship addedrelated to 0012205
2017-02-09 12:30ngarciaNote Added: 0094174
2017-02-10 21:41markmm82Assigned ToTriage Finance => collazoandy4
2017-02-22 17:44IntegritasIssue Monitored: Integritas
2017-03-15 15:31collazoandy4Statusnew => scheduled
2017-03-17 09:12aferrazAssigned Tocollazoandy4 => aferraz
2017-03-17 10:14ngarciaNote Deleted: 0094174
2017-03-17 10:53aferrazAssigned Toaferraz => ngarcia
2017-03-17 10:53aferrazStatusscheduled => feedback
2017-03-17 10:54aferrazNote Added: 0095363
2017-04-03 11:23ngarciaAssigned Tongarcia => Triage Finance
2017-04-03 11:23ngarciaStatusfeedback => new
2017-04-03 11:23ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=14935#r14935
2017-04-03 11:30ngarciaResolution time1488322800 => 1492207200
2017-04-03 12:44aferrazAssigned ToTriage Finance => collazoandy4
2017-04-06 16:34aferrazRelationship addedrelated to 0022895
2017-04-06 16:35aferrazRelationship addedrelated to 0020995
2017-04-06 16:36aferrazRelationship addedrelated to 0012042
2017-04-10 23:23collazoandy4Statusnew => scheduled
2017-04-10 23:24collazoandy4Note Added: 0095959
2017-04-11 11:51aferrazRelationship addedrelated to 0021406
2017-04-11 13:22aferrazRelationship addedrelated to 0028401
2017-04-11 15:42aferrazNote Added: 0095985
2017-04-11 15:42aferrazTypedefect => design defect
2017-04-11 15:42aferrazProposed Solution updated
2017-04-11 15:46aferrazProposed Solution updated

Notes
(0095363)
aferraz   
2017-03-17 10:54   
Not reproducible
(0095959)
collazoandy4   
2017-04-10 23:24   
Test Plan
1 Go to Initial organization setup window and set the fields values:
    Organization: Organization
    Organization type: Legal with accounting
    Parent organization: F&B International Group
    Uncheck the Include Accounting File or Accounting Reference Data option
    Clic on Ok Button
2 Log out and Log in
3 Set the created organization as default in the user session and clic on Apply
4 Go to Fiscal Calendar window and create a new record:
    Name: TestCalendar
    Create a new record in the Year tab:
      Fiscal Year: 2016
    Create another record in the Year tab:
      Fiscal Year: 2017
    Select the 2016 record and Clic on Create Period button
    Select the 2017 record and Clic on Create Period button
5 Go to Organization window and edit the created organization
    Check Allow period control
    Calendar: TestCalendar
    General Ledger: F&B International Group US/A/US Dollar
    Currency: USD
    Clic on Set as Ready button
6 Go to Open/Close Period Control:
    Filter by Calendar: TestCalendar
    Select all the records and Clic on Open Period button
      Action: Open Period
      Clic on Ok button
7 Go to Warehouse and Storage bin window and create a new record:
    Search Key/Name: Warehouse
    Location/Address: Central ---- Spain
    Create a new Record in Storage bin Tab
      Search Key: STB1
      Row(X): 10
      Stack(Y): 10
      Level(Z): 10
    Create a new Record in Storage bin Tab
      Search Key: STB2
      Row(X): 20
      Stack(Y): 20
      Level(Z): 20
    Create a new Record in Storage bin Tab
      Search Key: STB3
      Row(X): 30
      Stack(Y): 30
      Level(Z): 30
    Create a new Record in Storage bin Tab
      Search Key: STB4
      Row(X): 40
      Stack(Y): 40
      Level(Z): 40
8 Go to Tax Category window and creare a new record:
    Name: Category
9 Go to Product window and create a new record:
    Search Key/Name: Product
10 Go to Physical Inventory window and create a new record:
    Movement Date: 31-12-2016
    Create a new record in Lines tab
      Product: Product
      Storage bin: STB1
      Quantity count: 8916
    Create a new record in Lines tab
      Product: Product
      Storage bin: STB2
      Quantity count: 4099
    Create a new record in Lines tab
      Product: Product
      Storage bin: STB3
      Quantity count: 3921
    Create a new record in Lines tab
      Product: Product
      Storage bin: STB4
      Quantity count: 4329
    Clic on Process Inventory Count button
11 Go to Preferences windows and create a new record:
    Property: Enable Negative Stock Corrections
    Value: Y
12 In the Preferences windows create a new record:
    Property: Enable automatic Price Difference Corrections
    Value: Y
13 Log out and Log in
14 Go to Costing Rules windows and create a new record
    Starting date: 31-12-2016
    Check the Backdated Transactions Fixed option
    Clic on Validate Costing Rule button
15 Go to Product window and select the previous product created
    Create a new record in Costing tab
      Cost: 241.8
      Starting date: 31-12-2016
16 Go to Process request windows and edit the Costing Background Process record:
    Timming: Run Immediately
    Clic on Schedule Process button
17 Go to Product window and check no average cost has been calculated for the product

Test Plan II
 Repeat all the steps in the previous test plan but with the Physical Inventory Movement Date and Costing Rules Starting Date: today
 and check no negative average cost is calculated for the products transactions
(0095985)
aferraz   
2017-04-11 15:42   
Moved to design defect.
Proposed solution should be analyzed with a real user case.