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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0034713
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2016-12-09 12:582016-12-16 18:39
ReportermaiteView Statuspublic 
Assigned Toalekosmp86 
PriorityurgentResolutionfixedFixed in Version3.0PR17Q1
StatusclosedFix in branchFixed in SCM revisiondd02dedae9de
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

0034713: "getProductCost" method in AverageAlgorithm.java is checking cost per warehouse dimension for product defined as "production"

DescriptionWhen a product is defined as "production", it is init with "costDimensions = CostingUtils.getEmptyDimensions()" in "init" method of "CostingAlgorithm.java". However, when costing is checked for that product, "getProductCost" method in AverageAlgorithm.java if filtering by "warehouse" dimension (in case costing rule is defined like this) so error "No average cost found for given product and date" is reaised when it should not
Steps To Reproduce1. Create Costing rule "Average" and checked as "warehouse dimension". Validate rule
2. Create new product set as "production"=Y
3. Register new purchase order for this product. Complete
4. Register new goods receipt using "create lines from" previous order. Add record in Landed Cost tab and process receipt
5. Run Costing background process and "No average cost found for given product and date". Problem is that "getProductCost" method in AverageAlgorithm.java is searching m_costing report per warehouse when records was previously created without warehouse dimension, as it is a production record
Proposed SolutionLine 220 in AverageAlgorithm.java should be replaced by

if (costDimensions.get(CostDimension.Warehouse) != null && !product.isProduction()) {

Line 236 should be replaced by

if (costDimensions.get(CostDimension.Warehouse) != null && !product.isProduction()) {

Probably same change needs to be performed in new "getLastCumulatedCosting" method
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0092322)
alekosmp86 (reporter)
2016-12-13 16:28

Test plan

Log in as F&B GroupAdmin
   Go to Costing Rules screen
      Create a new document
         Organization: F&B España S.A
         Costing Algorithm: Average Algorithm
         Warehouse Dimension: checked

   Go to Product screen
      Create a new document
         Organization: F&B España S.A
         Product name: Producto A
         Production: checked
      Go to Price tab
         Create a new record
            Price List Version: Tarifas Bebidas Alegres
            Unit Price: 1.5
            List Price: 1.5

   Go to Purchase Order screen
      Create a new document
         BP: Bebidas Alegres S.L
      Go to Lines tab
         Create a new record
            Product: Producto A
            Ordered Quantity: 10
         Save the record
      Book the order

   Go to Goods Receipt screen
      Create a new record
         BP: Bebidas Alegres S.L
      Run "Create Lines From"
         Select the previously created order
         Select a warehouse
         Check the order's line(s)
      Click OK
      Go to Landed Cost tab
         Create a new record
            Landed Cost Type: Any (if there's none, create a new one)
            Landed Cost Distribution Algorithm: Distribution by Amount
         Save the record
      Complete the receipt

   Go to Process Request Screen
      Create a new record
         Client: F&B International Group
         Organization: F&B España S.A
         Process: Costing background process
         Timing: Run immediately
      Save the record
   Run Schedule Process

In Eclipse IDE, notice there's no error in console.
(0092346)
hgbot (developer)
2016-12-14 12:37

Repository: erp/devel/pi
Changeset: dd02dedae9ded134e7bf8a88975c76011dc2ad5c
Author: Alejandro <alekosmp86 <at> gmail.com>
Date: Tue Dec 13 10:01:21 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/dd02dedae9ded134e7bf8a88975c76011dc2ad5c [^]

Fixes issue 34713: getProductCost() is not checking if product is production

If a product is defined as "production", when costing is checked for
that product, "getProductCost" method in AverageAlgorithm.java was filtering by
"warehouse" dimension (in case costing rule is defined like this) so error "No
average cost found for given product and date" was raised, when it should not.
The proposed solution has been implemented, adding a validation when constructing
the "where" condition, so now there is no error.

---
M src/org/openbravo/costing/AverageAlgorithm.java
---
(0092347)
hgbot (developer)
2016-12-14 12:37

Repository: erp/devel/pi
Changeset: a2651b1e5d31f587634b07c4490cba3291e4ef8d
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Dec 14 12:35:05 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/a2651b1e5d31f587634b07c4490cba3291e4ef8d [^]

Related to issue 34713: Code review improvements

Fix also getLastCumulatedCosting method.

---
M src/org/openbravo/costing/AverageAlgorithm.java
---
(0092348)
aferraz (manager)
2016-12-14 12:37

Code review + Testing OK
(0092709)
hudsonbot (developer)
2016-12-16 18:39

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/dc8bf00badd0 [^]
Maturity status: Test
(0092710)
hudsonbot (developer)
2016-12-16 18:39

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

- Issue History
Date Modified Username Field Change
2016-12-09 12:58 maite New Issue
2016-12-09 12:58 maite Assigned To => Triage Finance
2016-12-09 12:58 maite Modules => Core
2016-12-09 12:58 maite Resolution time => 1482361200
2016-12-09 12:58 maite Triggers an Emergency Pack => No
2016-12-09 12:58 maite Issue Monitored: networkb
2016-12-12 16:23 aferraz Assigned To Triage Finance => collazoandy4
2016-12-12 17:22 alekosmp86 Assigned To collazoandy4 => alekosmp86
2016-12-12 17:23 alekosmp86 Status new => scheduled
2016-12-13 16:28 alekosmp86 Note Added: 0092322
2016-12-14 12:37 hgbot Checkin
2016-12-14 12:37 hgbot Note Added: 0092346
2016-12-14 12:37 hgbot Status scheduled => resolved
2016-12-14 12:37 hgbot Resolution open => fixed
2016-12-14 12:37 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/dd02dedae9ded134e7bf8a88975c76011dc2ad5c [^]
2016-12-14 12:37 hgbot Checkin
2016-12-14 12:37 hgbot Note Added: 0092347
2016-12-14 12:37 aferraz Review Assigned To => aferraz
2016-12-14 12:37 aferraz Note Added: 0092348
2016-12-14 12:37 aferraz Status resolved => closed
2016-12-14 12:37 aferraz Fixed in Version => 3.0PR17Q1
2016-12-16 18:39 hudsonbot Checkin
2016-12-16 18:39 hudsonbot Note Added: 0092709
2016-12-16 18:39 hudsonbot Checkin
2016-12-16 18:39 hudsonbot Note Added: 0092710


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker