Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033937Openbravo ERP04. Warehouse managementpublic2016-09-09 11:172016-09-13 23:49
ngarcia 
markmm82 
immediatemajoralways
closedfixed 
5
 
3.0PR16Q4 
aferraz
Core
Production - Confirmed Stable
2016-02-09
3.0PR16Q2
https://code.openbravo.com/erp/devel/pi/rev/4e9e547d8199 [^]
No
0033937: Error in Costing Background Process if first costing rule validated with starting date,previous transactions cost not calculated
Error in Costing Background Process if first costing rule is validated by setting a starting date, the cost of all previous transactions is not set as calculated. The trxprocessdate of the opening inventory is wrong (the time is updated to 0:00:00)
As group admin role:
   1. Create the following master data:
      Legal with accounting organization (set its currency)
      Fiscal calendar, year and periods
      Business Partner (set it as vendor and set a location)
      Tax Category
      Product (set it as Item as Stocked)
      Warehouse and storage bin
   2. Allow period control and assign the fiscal calendar to the organization
      Set it as ready
      Open the periods
   3. Create a goods receipt with the previously created master data and complete it
   4. Validate a costing rule with average algorithm and a starting date (now)
   5. Go to Product - Transaction tab and check the transaction process date of the opening inventory is previous the transaction process date of the closing inventory. This is wrong
   6. Check also the cost of the Goods Receipt is not calculated and it should be 0
   7. Schedule the Costing Background process and check the following error message is shown:
      No valid Costing Rule found for given organization and date.
No tags attached.
depends on backport 00339573.0PR16Q3.2 closed markmm82 Error in Costing Background Process if first costing rule validated with starting date,previous transactions cost not calculated 
depends on backport 00339583.0PR16Q2.3 closed markmm82 Error in Costing Background Process if first costing rule validated with starting date,previous transactions cost not calculated 
caused by defect 00317723.0PR16Q2 closed aferraz Performance problem when you try to validate the costing rule with high volume of data 
related to defect 0036534 closed collazoandy4 Error in Costing Background Process if starting date of first costing rule is lower than movement date of existing transactions 
Issue History
2016-09-09 11:17ngarciaNew Issue
2016-09-09 11:17ngarciaAssigned To => Triage Finance
2016-09-09 11:17ngarciaModules => Core
2016-09-09 11:17ngarciaResolution time => 1475186400
2016-09-09 11:17ngarciaTriggers an Emergency Pack => No
2016-09-09 11:18ngarciaIssue Monitored: networkb
2016-09-09 11:21ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=13084#r13084
2016-09-09 12:33ngarciaDescription Updatedbug_revision_view_page.php?rev_id=13086#r13086
2016-09-09 12:35ngarciaDescription Updatedbug_revision_view_page.php?rev_id=13087#r13087
2016-09-09 13:20aferrazAssigned ToTriage Finance => markmm82
2016-09-12 16:22markmm82Statusnew => acknowledged
2016-09-12 18:56aferrazRegression level => Production - Confirmed Stable
2016-09-12 18:56aferrazRegression date => 2016-02-09
2016-09-12 18:56aferrazRegression introduced in release => 3.0PR16Q2
2016-09-12 18:56aferrazRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/4e9e547d8199 [^]
2016-09-12 18:56aferrazRelationship addedcaused by 0031772
2016-09-12 18:57aferrazStatusacknowledged => scheduled
2016-09-13 15:20markmm82Note Added: 0089918
2016-09-13 18:53hgbotCheckin
2016-09-13 18:53hgbotNote Added: 0089930
2016-09-13 18:53hgbotStatusscheduled => resolved
2016-09-13 18:53hgbotResolutionopen => fixed
2016-09-13 18:53hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/d45e9fe52bb38e513ea8660359a5d7a915f76895 [^]
2016-09-13 18:56aferrazReview Assigned To => aferraz
2016-09-13 18:56aferrazNote Added: 0089932
2016-09-13 18:56aferrazStatusresolved => closed
2016-09-13 18:56aferrazFixed in Version => 3.0PR16Q4
2016-09-13 23:49hudsonbotCheckin
2016-09-13 23:49hudsonbotNote Added: 0089936
2016-09-16 11:54aferrazNote Edited: 0089918bug_revision_view_page.php?bugnote_id=0089918#r13126
2017-07-26 17:10ngarciaRelationship addedrelated to 0036534

Notes
(0089918)
markmm82   
2016-09-13 15:20   
(edited on: 2016-09-16 11:54)
Test Plan: https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-10181 [^]
As group admin role:
Create the following master data:
1. Create a new organization by Initial organization setup as follow:
   Organization: Test
   Organization type: Legal with accounting.
   Uncheck the "Include Accounting File or Accounting Reference Data" flag.
   Select the existing data sets.
   Ok
2. Go to Warehouse and storage bin window and create a header:
   Search key/Name: WTest
3. Create a storage bin:
   Search key: WT-0-0-0
   Row = Stack = Level = 0.
   Save.
4. Go to Fiscal calendar and create a new one:
   Organization: Test
   Name: FCTest
5. Add 2016 Year to the created fiscal calendar and create periods for this year.
6. Go to General Ledger Configuration and create a new one for the org.
   Organization: Test
   Name: GLTest
7. Go to Organization window and select the previosuly org (Test). Update the following information:
   Currency: EUR
   Allow Period Control: Yes
   Calendar: FCTest
   General Ledger: GLTest
8. Go to Warehouses tab and add the previously created (WTest) to the organization
9. Set As Ready
10. Log out and log in. Change the profile to log as Group Admin, Test org and warehouse WTest. Apply to use these as default in next steps.
11. Go to Open/Close periods windows and open the periods for the created calendar (FCTest)
12. Go to Tax Category window and create a new one:
    Organization: Test
    Name: TCatTest
13. Go to Price List Schema window and create a new one.
    Organization: Test
    Name: PLSchTest
14. Add a line to it (with default data)
15. Create two Price lists (for sales and purchases)
    Price List 1
      Organization: Test
      Name: PLTest_SO
      Sales Price List: YES
     Add a version to it
      Name: SO
      Valid from: Today
      Price List Schema: PLSchTest

    Price List 2
      Organization: Test
      Name: PLTest_PO
      Sales Price List: NO
     Add a version to it
      Name: PO
      Valid from: Today
      Price List Schema: PLSchTest
16. Go to Product window and create a new one:
    Organization: Test
    Name: PTest
    Tax Category: TCatTest
    Purchase = Sale = Stocked = YES
17. Add a price to it (Sales):
    Price List Version: SO
    Unit Price = List Price = 10.00
18. Add a second price to it (Purchase):
    Price List Version: PO
    Unit Price = List Price = 10.00
19. Create a new Business Partner Category (BPCatTest)
20. Go to Business Partner window and create a new one:
    Organization: Test
    Business Partner Category: BPCatTest
    Name: BPTest
21. Mark as Vendor and use as Purchase Price list the previously created: PLTest_PO
22. Add a Location/Address to the business partner.

23. Create a goods receipt with the previously created master data:
    Organization: Test
    Business Partner: BPTest
24. Add a line to the receipt:
    Product: PTest
    Movement Quantity: 10
    Storage Bin: WT-0-0-0
    Complete it

25. Validate a costing rule with average algorithm and a starting date (now). To do this:
   Go to Costing Rules window and create a new costing rule with the following data:
   Organization: Test
   Costing Algorithm: Average Algorithm
   Starting Date: Now.
   Clic on Validate Costing Rule button.
   
26. Go to Product window, move to Transaction tab and check the transaction process date of the opening inventory is later than the transaction process date of the closing inventory. This is correct
   Check also the cost of the Goods Receipt is calculated and it is 0. It is correct.
   Notice the Closing inventory cost is also calculated and it is 0 too. It is correct.
   Notice the Opening inventory cost is not calculated yet. It is correct.
   
27. Schedule the Costing Background process. To do that:
   Go to Process and Request window and schedule (create) a new process only for the new organization.
   Organization: Test
   Process: Costing Background process
   Timing: Run immediately
   Clic on Schedule Process to run the Costing Background process.

   Notice that process ends successfully and no error message is shown in logs.
   Back again to the Product/Transaction tab and refresh. Check that the opening inventory is now calculated and costs are 100 (10 units x 10.00EUR price). It is correct.

(0089930)
hgbot   
2016-09-13 18:53   
Repository: erp/devel/pi
Changeset: d45e9fe52bb38e513ea8660359a5d7a915f76895
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Sep 12 15:06:46 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/d45e9fe52bb38e513ea8660359a5d7a915f76895 [^]

Fixes issue 33937: Fixed trx date of inventory in Costing Background Process

Used the setTimestamp method instead of the setDate, by this way the details like the hours, minutes and seconds of the transactions are not lost.

---
M src/org/openbravo/costing/CostingRuleProcess.java
---
(0089932)
aferraz   
2016-09-13 18:56   
Code review + Testing OK
(0089936)
hudsonbot   
2016-09-13 23:49   
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/65cb02a759ba [^]
Maturity status: Test