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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0033197
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 04. Warehouse managementmajoralways2016-06-08 18:162016-06-21 14:48
ReporterngarciaView Statuspublic 
Assigned Tomarkmm82 
PriorityurgentResolutionfixedFixed in Version3.0PR16Q3
StatusclosedFix in branchFixed in SCM revisionfc24781d4355
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

0033197: / by zero error when processing a landed cost with a goods receipt with more than one line and 0 cost

Description/ by zero error when processing a landed cost with a goods receipt with more than one line and 0 cost
Steps To ReproduceAs group admin role:
   Create two products
   Add a purchase price list of 0 to them
   Create a goods receipt and include both products
   Launch the Costing Background Process and check the cost of the associated transactions is 0
   Create a Landed Cost Type:
      Landed Cost Distribution Algorithm: Distribution by Amount
   Create a Landed Cost
   Add a cost to it and select the previously created type
   Add the previously created goods receipt
   Try to process it and check the following error message is shown: / by zero

   The log shows:

ERROR org.openbravo.costing.LandedCostProcessHandler - Error in LandedCostProcessHandler: / 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.LandedCostDistributionByAmount.distributeAmount(LandedCostDistributionByAmount.java:110)
    at org.openbravo.costing.LandedCostProcess.distributeAmounts(LandedCostProcess.java:191)
    at org.openbravo.costing.LandedCostProcess.processLandedCost(LandedCostProcess.java:98)
    at org.openbravo.costing.LandedCostProcess.doProcessLandedCost(LandedCostProcess.java:298)
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
related to defect 00300173.0PR15Q3 closedaferraz Should not be possible to select negative receipts when registering a Landed Cost 

-  Notes
(0087209)
markmm82 (developer)
2016-06-13 18:19

Test Plan:
As group admin role:
   Create two products
   Add a purchase price list of 0 to both
   Create a goods receipt and include both products
   Launch the Costing Background Process and check the cost of the associated transactions is 0.00
   Create a Landed Cost Type:
      Landed Cost Distribution Algorithm: Distribution by Amount
   Create a Landed Cost
   Add a cost of 0 to it and select the previously created type
   Add the previously created goods receipt
   Try to process it and check the process is completed successfully and a new Cost adjustment is created.
   No error by /zero is shown.
(0087401)
hgbot (developer)
2016-06-17 14:32

Repository: erp/devel/pi
Changeset: fc24781d4355e9d02c456de93fed1230403fc2b5
Author: Mark <markmm82 <at> gmail.com>
Date: Sat Jun 11 18:58:10 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/fc24781d4355e9d02c456de93fed1230403fc2b5 [^]

Fixes issue 33197: Avoided / by zero error when processing a landed cost

Avoided / by zero error when processing a landed cost

---
M src/org/openbravo/costing/LandedCostDistributionByAmount.java
---
(0087402)
hgbot (developer)
2016-06-17 14:32

Repository: erp/devel/pi
Changeset: a4b0ffea953bc74625be777d96029a9ba777f04e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Fri Jun 17 14:03:50 2016 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/a4b0ffea953bc74625be777d96029a9ba777f04e [^]

Related to issue 33197: Code review improvements

Take receipt line amount and receipt amount as absolute values to calculate correct landed cost receipt amount in case we have one receipt with two lines with the same amount but one positive and the other negative.

---
M src/org/openbravo/costing/LandedCostDistributionByAmount.java
---
(0087403)
aferraz (manager)
2016-06-17 14:33

Code review + Testing OK
(0087726)
hudsonbot (developer)
2016-06-21 14:48

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/7f9896fd81e9 [^]
Maturity status: Test
(0087727)
hudsonbot (developer)
2016-06-21 14:48

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

- Issue History
Date Modified Username Field Change
2016-06-08 18:16 ngarcia New Issue
2016-06-08 18:16 ngarcia Assigned To => Triage Finance
2016-06-08 18:16 ngarcia Modules => Core
2016-06-08 18:16 ngarcia Resolution time => 1467151200
2016-06-08 18:16 ngarcia Triggers an Emergency Pack => No
2016-06-08 18:16 ngarcia Issue Monitored: networkb
2016-06-09 10:06 aferraz Assigned To Triage Finance => markmm82
2016-06-13 18:19 markmm82 Status new => scheduled
2016-06-13 18:19 markmm82 Note Added: 0087209
2016-06-17 13:32 aferraz Relationship added related to 0030017
2016-06-17 14:32 hgbot Checkin
2016-06-17 14:32 hgbot Note Added: 0087401
2016-06-17 14:32 hgbot Status scheduled => resolved
2016-06-17 14:32 hgbot Resolution open => fixed
2016-06-17 14:32 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fc24781d4355e9d02c456de93fed1230403fc2b5 [^]
2016-06-17 14:32 hgbot Checkin
2016-06-17 14:32 hgbot Note Added: 0087402
2016-06-17 14:33 aferraz Review Assigned To => aferraz
2016-06-17 14:33 aferraz Note Added: 0087403
2016-06-17 14:33 aferraz Status resolved => closed
2016-06-17 14:33 aferraz Fixed in Version => 3.0PR16Q3
2016-06-21 14:48 hudsonbot Checkin
2016-06-21 14:48 hudsonbot Note Added: 0087726
2016-06-21 14:48 hudsonbot Checkin
2016-06-21 14:48 hudsonbot Note Added: 0087727


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker