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

View Revisions: Issue #39993 Back to Issue ]
Summary 0039993: / by zero error in Costing Background Process with backdated and negative stock correction and voided goods receipt
Revision 2019-01-28 16:50 by ngarcia
Steps To Reproduce As group admin role:
   Set the 'Enable Negative Stock Corrections' to Y
   Log out and log in

   Go to Costing Rules window, select 'F&B España, S.A', launch 'Fix Backdated Transactions' process with '01-01-2019' starting date

   Create a new product
   Set a price of 5 in Tarifa Bebidas Alegres

   Create a new goods receipt with '16-01-2019' movement date and 2 units of the product
   Create a new goods shipment with '17-01-2019' movement date and 2 units of the product
   Void the goods receipt with a movement date of 'today'

   Create a purchase order with '16-01-2019' movement date and 2 units of the product. Increase its price to 7
   Create the related goods receipt with a movement date of '16-01-2019'

   Launch the Costing Background Process and check the following message is shown in Process Log field:
     / by zero

The log shows:
   [DefaultQuartzScheduler_Worker-8] ERROR org.openbravo.costing.CostingBackground - / by zero
java.lang.ArithmeticException: / by zero
    at java.math.BigDecimal.divideAndRound(BigDecimal.java:4106) ~[?:1.8.0_171]
    at java.math.BigDecimal.divide(BigDecimal.java:5183) ~[?:1.8.0_171]
    at java.math.BigDecimal.divide(BigDecimal.java:1561) ~[?:1.8.0_171]
    at java.math.BigDecimal.divide(BigDecimal.java:1591) ~[?:1.8.0_171]
    at org.openbravo.costing.AverageCostAdjustment.getRelatedTransactionsByAlgorithm(AverageCostAdjustment.java:376) ~[AverageCostAdjustment.class:?]
    at org.openbravo.costing.CostingAlgorithmAdjustmentImp.searchRelatedTransactionCosts(CostingAlgorithmAdjustmentImp.java:164) ~[CostingAlgorithmAdjustmentImp.class:?]
    at org.openbravo.costing.CostAdjustmentProcess.calculateAdjustmentAmount(CostAdjustmentProcess.java:235) ~[CostAdjustmentProcess.class:?]
    at org.openbravo.costing.CostAdjustmentProcess.processCostAdjustment(CostAdjustmentProcess.java:86) ~[CostAdjustmentProcess.class:?]
    at org.openbravo.costing.CostAdjustmentProcess.doProcessCostAdjustment(CostAdjustmentProcess.java:339) ~[CostAdjustmentProcess.class:?]
    at org.openbravo.costing.CostingServer.createAdjustment(CostingServer.java:385) ~[CostingServer.class:?]
    at org.openbravo.costing.CostingServer.checkCostAdjustments(CostingServer.java:313) ~[CostingServer.class:?]
    at org.openbravo.costing.CostingServer.process(CostingServer.java:136) ~[CostingServer.class:?]
    at org.openbravo.costing.CostingBackground.doExecute(CostingBackground.java:137) [CostingBackground.class:?]
    at org.openbravo.service.db.DalBaseProcess.execute(DalBaseProcess.java:84) [DalBaseProcess.class:?]
    at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:64) [DefaultJob.class:?]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-1.6.2.jar:1.6.2]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) [quartz-1.6.2.jar:1.6.2]
      
Revision 2019-01-24 16:53 by ngarcia
Steps To Reproduce As group admin role:
   Go to Costing Rules window, select 'F&B España, S.A', launch 'Fix Backdated Transactions' process with '01-01-2019' starting date

   Create a new product
   Set a price of 5 in Tarifa Bebidas Alegres

   Create a new goods receipt with '16-01-2019' movement date and 2 units of the product
   Create a new goods shipment with '17-01-2019' movement date and 2 units of the product
   Void the goods receipt with a movement date of 'today'

   Create a purchase order with '16-01-2019' movement date and 2 units of the product. Increase its price to 7
   Create the related goods receipt with a movement date of '16-01-2019'

   Launch the Costing Background Process and check the following message is shown in Process Log field:
     / by zero

The log shows:
   [DefaultQuartzScheduler_Worker-8] ERROR org.openbravo.costing.CostingBackground - / by zero
java.lang.ArithmeticException: / by zero
    at java.math.BigDecimal.divideAndRound(BigDecimal.java:4106) ~[?:1.8.0_171]
    at java.math.BigDecimal.divide(BigDecimal.java:5183) ~[?:1.8.0_171]
    at java.math.BigDecimal.divide(BigDecimal.java:1561) ~[?:1.8.0_171]
    at java.math.BigDecimal.divide(BigDecimal.java:1591) ~[?:1.8.0_171]
    at org.openbravo.costing.AverageCostAdjustment.getRelatedTransactionsByAlgorithm(AverageCostAdjustment.java:376) ~[AverageCostAdjustment.class:?]
    at org.openbravo.costing.CostingAlgorithmAdjustmentImp.searchRelatedTransactionCosts(CostingAlgorithmAdjustmentImp.java:164) ~[CostingAlgorithmAdjustmentImp.class:?]
    at org.openbravo.costing.CostAdjustmentProcess.calculateAdjustmentAmount(CostAdjustmentProcess.java:235) ~[CostAdjustmentProcess.class:?]
    at org.openbravo.costing.CostAdjustmentProcess.processCostAdjustment(CostAdjustmentProcess.java:86) ~[CostAdjustmentProcess.class:?]
    at org.openbravo.costing.CostAdjustmentProcess.doProcessCostAdjustment(CostAdjustmentProcess.java:339) ~[CostAdjustmentProcess.class:?]
    at org.openbravo.costing.CostingServer.createAdjustment(CostingServer.java:385) ~[CostingServer.class:?]
    at org.openbravo.costing.CostingServer.checkCostAdjustments(CostingServer.java:313) ~[CostingServer.class:?]
    at org.openbravo.costing.CostingServer.process(CostingServer.java:136) ~[CostingServer.class:?]
    at org.openbravo.costing.CostingBackground.doExecute(CostingBackground.java:137) [CostingBackground.class:?]
    at org.openbravo.service.db.DalBaseProcess.execute(DalBaseProcess.java:84) [DalBaseProcess.class:?]
    at org.openbravo.scheduling.DefaultJob.execute(DefaultJob.java:64) [DefaultJob.class:?]
    at org.quartz.core.JobRunShell.run(JobRunShell.java:202) [quartz-1.6.2.jar:1.6.2]
    at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:525) [quartz-1.6.2.jar:1.6.2]
      


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker