Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0036889
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2017-09-19 13:112018-01-03 12:38
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR18Q1
StatusclosedFix in branchFixed in SCM revisiona6c2534085d4
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0036889: [Valued Stock Report]: Wrong stock shown if Generate Aggregated Data Background process is launched with two costing rules

Description[Valued Stock Report]: Wrong stock shown if Generate Aggregated Data Background process is launched with two costing rules for same organization

Having the following costing rules for the same org:
   1. Starting Date: 31-12-2013 23:00:00
      Ending Date: 01-07-2014 04:28:21
   1. Starting Date: 01-07-2014 04:28:21
      Ending Date: null

The ResetValuedStockAggregated.getCostingRules is returning both of them for Jan-14 period (2014-01-01 - 2014-01-31)
Steps To ReproduceAs group admin role:
   Create a new Costing Rule for F&B España S.A. and validate it
   Create some warehouse transactions on it
   Close all the periods
   Go to Process Request window and run Generate Aggregated Data Background process
   Launch the Valued Stock Report and check the stock shown there is wrong
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0099705)
markmm82 (developer)
2017-10-02 20:51

Test Plan:
0. Go to Costing Rules windows.
   Notice there is an existing costing rule for F&B España, S.A organization, with starting date = 13-07-2012 14:06:26 and ending date = NULL.
1. Create a new Costing Rule:
   Organization = F&B España, S.A,
   Costing Algorithm = Average Algorithm
2. Validate previously created costing rule.
   Notice after save the new costing rule
   Starting Date = Today
   Ending date = NULL.

   Notice that previously costing rule updated this ending date to starting date of the new costing rule.

3. Create a new Goods receipt:
   Organization = F&B España, S.A,
   Business Partner = Bebidas Alegres, S.L.
   Warehouse = Región Norte
   Movemente Date = 02-10-2017
4. Add a line to it:
   Open product selector and choose product Vino Blanco 0,75L
   Storage bin = RN-0-0-0
   Movement Quantity = 10
5. Process Receipt.
6. Close all the periods.
7. Go to Process Request window and run Generate Aggregated Data Background process for Spain organization.
   If you debug the code for ResetValuedStockAggregated.java, in insertValuesIntoValuedStockAggregated() method:
   
   List<CostingRule> costingRulesList = getCostingRules(legalEntity, period.getStartingDate(),
          period.getEndingDate());
   Notice for Jul-12 period only is returned the costing rule existing before create the new costing rule (explained in step 0)
   Same for the rest of periods, only one and just the correct costing rule is returned for each one.
8. Launch the Valued Stock Report. Filter by:
   Organization = F&B España, S.A,
   Date = 02-10-2017 (Same of transaction)
   Product Category = Alcoholic
9. Check the stock shown there is right for Vino Blanco 0,75L.
   For instance if the stock of product was 42800, it will be updated to 42810 for the receipt of 10 units in step 4. Probably is needed to run the Costing Background process to see it.
(0099712)
hgbot (developer)
2017-10-03 09:21

Repository: erp/devel/pi
Changeset: a6c2534085d419446ff4caf0db8a0cf3db2945c9
Author: Mark <markmm82 <at> gmail.com>
Date: Sun Oct 01 19:56:56 2017 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/a6c2534085d419446ff4caf0db8a0cf3db2945c9 [^]

Fixes issue 36889: Wrong stock shown if Generate Aggregated Data Background
process is launched with two costing rules for same organization

Wrong stock shown if Generate Aggregated Data Background process is launched with
two costing rules for same organization.

Problem was that conditions in getCostingRules() method had conditions that retrieved
more than one costing rule for the same period because an incorrect condition when
validated if starting and ending dates are null.

To fix the problem was restructured the query to combine the three conditions in just two
conditions that includes the third one (period is completely included inside the costing
rule range) and avoid return more than one costing rule for period is processed.

Also, was replaced cr.organization.id in (:org) for cr.organization.id = :org) as :org
parameter will be only one organization and not a list of organizations.

---
M src/org/openbravo/materialmgmt/ResetValuedStockAggregated.java
---
(0099713)
aferraz (manager)
2017-10-03 09:22

Code review + Testing OK
(0101307)
hudsonbot (developer)
2018-01-03 12:38

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/c81e0d3cbab5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2017-09-19 13:11 ngarcia New Issue
2017-09-19 13:11 ngarcia Assigned To => Triage Finance
2017-09-19 13:11 ngarcia Modules => Core
2017-09-19 13:11 ngarcia Resolution time => 1507586400
2017-09-19 13:11 ngarcia Triggers an Emergency Pack => No
2017-09-19 13:11 ngarcia Issue Monitored: networkb
2017-09-26 17:24 aferraz Assigned To Triage Finance => markmm82
2017-09-28 19:33 markmm82 Status new => scheduled
2017-10-02 20:51 markmm82 Note Added: 0099705
2017-10-03 09:21 hgbot Checkin
2017-10-03 09:21 hgbot Note Added: 0099712
2017-10-03 09:21 hgbot Status scheduled => resolved
2017-10-03 09:21 hgbot Resolution open => fixed
2017-10-03 09:21 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/a6c2534085d419446ff4caf0db8a0cf3db2945c9 [^]
2017-10-03 09:22 aferraz Review Assigned To => aferraz
2017-10-03 09:22 aferraz Note Added: 0099713
2017-10-03 09:22 aferraz Status resolved => closed
2017-10-03 09:22 aferraz Fixed in Version => 3.0PR18Q1
2018-01-03 12:38 hudsonbot Checkin
2018-01-03 12:38 hudsonbot Note Added: 0101307


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker