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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0029194
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] 04. Warehouse managementmajoralways2015-02-26 12:442015-04-01 08:31
ReporterumartirenaView Statuspublic 
Assigned Toumartirena 
PriorityurgentResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision8ce0b518b9ea
ProjectionnoneETAnoneTarget Version3.0PR15Q1.2
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Toaferraz
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release3.0PR14Q4
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0029194: [Cost Adjustments] / by zero error while calculating backdated cost for movement qty 0 receipt

Description/ by zero error is obtained in Cost Adjustments while calculating backdated cost for movement qty 0 receipts.
Steps To ReproduceIn pgadmin III, open m_inout_post function:

 * Comment the 3 following lines (not reproducible in pi due to this issue https://issues.openbravo.com/view.php?id=26163 [^]):

IF v_Message_Qty != '' THEN
             RAISE EXCEPTION '%', '@Inline@ '||v_Message_Qty||' '||'@ProductNotNullAndMovementQtyZero@' ; --OBTG:-20000--
END IF;

 * Save the function.


In live.builds as F&B International:

 * Create a Product for F&B España. Add a Purchase Pricelist of 10.
 * Go to Goods Receipt and create a Header:
   - Org: F&B España
   - Movement Date: 05/02/2015
 * Add a line:
   - Product: The created product
   - Movement Qty: 10
 * Complete it
 * Create another Goods Receipt Header:
   - Org: F&B España
   - Movement Date: 15/02/2015
 * Add a line:
   - Product: The created product
   - Movement Qty: 0
 * Complete it
 * Create another Goods Receipt Header:
   - Org: F&B España
   - Movement Date: 10/02/2015
 * Add a line:
   - Product: The created product
   - Movement Qty: 12
 * Complete it
 * Run Costing Background process
 * Realize that following error is obtained:

ERROR org.openbravo.costing.CostingBackground - / by zero
java.lang.ArithmeticException: / by zero
    at java.math.BigDecimal.divideAndRound(BigDecimal.java:1424)
    at java.math.BigDecimal.divide(BigDecimal.java:1398)
    at java.math.BigDecimal.divide(BigDecimal.java:1513)
    at org.openbravo.costing.AverageCostAdjustment.getRelatedTransactionsByAlgorithm(AverageCostAdjustment.java:305)
    at org.openbravo.costing.CostingAlgorithmAdjustmentImp.searchRelatedTransactionCosts(CostingAlgorithmAdjustmentImp.java:160)
TagsApproved
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0029076 closedumartirena [Cost Adjustments] / by zero error while calculating backdated cost for movement qty 0 receipt 

-  Notes
(0075342)
hgbot (developer)
2015-03-09 18:47

Repository: erp/backports/3.0PR15Q1.2
Changeset: 8ce0b518b9eae91e39b9afd4048eaa251b39ec3a
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu Feb 26 15:29:20 2015 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.2/rev/8ce0b518b9eae91e39b9afd4048eaa251b39ec3a [^]

Fixes bug 29194: Division by zero error managed in Costing Background.

Under certain circumnstance a division by zero error was happening in Cost Adjustments process inside Costing Background (when calculating backdated adjustments of a transaction of movementqty zero). This problem has been managed by being sure that this division will not happen again. If the movementqty of the transaction is zero, the cost of the full transaction will be zero as well.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0075343)
aferraz (manager)
2015-03-09 18:48

Code review + Testing OK
(0076202)
hgbot (developer)
2015-04-01 08:06

Repository: erp/backports/3.0PR15Q2
Changeset: 8ce0b518b9eae91e39b9afd4048eaa251b39ec3a
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Thu Feb 26 15:29:20 2015 +0100
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/8ce0b518b9eae91e39b9afd4048eaa251b39ec3a [^]

Fixes bug 29194: Division by zero error managed in Costing Background.

Under certain circumnstance a division by zero error was happening in Cost Adjustments process inside Costing Background (when calculating backdated adjustments of a transaction of movementqty zero). This problem has been managed by being sure that this division will not happen again. If the movementqty of the transaction is zero, the cost of the full transaction will be zero as well.

---
M src/org/openbravo/costing/AverageCostAdjustment.java
---
(0076273)
priyam (administrator)
2015-04-01 08:31

closed again, as the status changed due the merge tag of 3.0PR15Q1.2 to backports/3.0PR15Q2

- Issue History
Date Modified Username Field Change
2015-03-09 09:31 umartirena Type defect => backport
2015-03-09 09:31 umartirena Target Version => 3.0PR15Q1.2
2015-03-09 18:47 hgbot Checkin
2015-03-09 18:47 hgbot Note Added: 0075342
2015-03-09 18:47 hgbot Status scheduled => resolved
2015-03-09 18:47 hgbot Resolution open => fixed
2015-03-09 18:47 hgbot Fixed in SCM revision http://code.openbravo.com/erp/devel/pi/rev/67607f6caaeef3bbc200e13b54801928b42396ee [^] => http://code.openbravo.com/erp/backports/3.0PR15Q1.2/rev/8ce0b518b9eae91e39b9afd4048eaa251b39ec3a [^]
2015-03-09 18:48 aferraz Note Added: 0075343
2015-03-09 18:48 aferraz Status resolved => closed
2015-03-09 20:01 dmitry_mezentsev Tag Attached: Approved
2015-04-01 08:06 hgbot Checkin
2015-04-01 08:06 hgbot Note Added: 0076202
2015-04-01 08:06 hgbot Status closed => resolved
2015-04-01 08:06 hgbot Fixed in SCM revision http://code.openbravo.com/erp/backports/3.0PR15Q1.2/rev/8ce0b518b9eae91e39b9afd4048eaa251b39ec3a [^] => http://code.openbravo.com/erp/backports/3.0PR15Q2/rev/8ce0b518b9eae91e39b9afd4048eaa251b39ec3a [^]
2015-04-01 08:31 priyam Status resolved => closed
2015-04-01 08:31 priyam Note Added: 0076273


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker