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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0037580
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] 07. Sales managementmajoralways2018-01-03 21:462018-02-22 18:18
Reportermatias-bernalView Statuspublic 
Assigned Tocollazoandy4 
PriorityhighResolutionfixedFixed in Version3.0PR18Q2
StatusclosedFix in branchFixed in SCM revisionb37dfca128c9
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product Version3.0PR16Q3.4SCM revision 
Review Assigned Todmiguelez
Web browser
ModulesCore
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0037580: "division by zero" error when book sales order with BOM products

DescriptionWe created a sales order and a sales order line with a BOM product and quantity ordered > 0, book this order and try close it then OB show this error "division by zero"(see attachment).

When C_ORDER_POST runs the trigger C_ORDERLINE_TRG tries to calculate the variable v_PriceActual using :new.qtyordered equals to 0. So that, it returns division by zero error.

This error is also present in livebuilds for BOM products
Steps To Reproduce1 - Create a New sales order
2 - Create a New sales order line whit quantity ordered > 0 and a product BOM.
3 - Book this order.
4 - Close this order.
Proposed SolutionModify the C_ORDERLINE_TRG.xml
Replace in

https://code.openbravo.com/erp/devel/pi/file/a8b6912d30a3/src-db/database/model/triggers/C_ORDERLINE_TRG.xml#l227 [^]

this line:

 v_PriceActual := ROUND(v_NetActual / :new.qtyordered, v_price_prec);

using this:

      IF (:new.qtyordered <> 0) THEN
        v_PriceActual := ROUND(v_NetActual / :new.qtyordered, v_price_prec);
      ELSE
        v_PriceActual := 0;
      END IF;
TagsNo tags attached.
Attached Filespng file icon Selección_379.png [^] (141,967 bytes) 2018-01-03 21:46

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0101604)
collazoandy4 (developer)
2018-01-06 02:06

As F&B International Group Admin Role
  Go to Tax Category and edit IVA Normal record:
    As per BOM: Y
  Go to Price List window and edit Tarifa de ventas record:
    Price Include Tax: Y
  Go to Product window and create a new record:
    Search Key/Name: IssueProduct
    Bill of Material: Y
    Create a new record in Price Tab:
      Price List Version: Tarifa de ventas
      Unit/List Price: 7
    Create a new record in Bill of Material tab:
      BOM Product: Agua sin Gas 1L
      BOM Quantity: 5
    Clic on Verify BOM
  Go to Sales Order and create a new record:
    Business Partner: Hoteles Buenas Noches, S.A.
    Create a new record in Lines tab:
      Product: Issue Product
      Tax: Entregas IVA 21%
    Book the order and check process ends successfull
    Close the order and check ends successfull
(0101635)
hgbot (developer)
2018-01-09 10:26

Repository: erp/devel/pi
Changeset: b37dfca128c9d4d7c315704e81f82c31a1aae42e
Author: Armaignac <collazoandy4 <at> gmail.com>
Date: Fri Jan 05 18:57:17 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/b37dfca128c9d4d7c315704e81f82c31a1aae42e [^]

Fixes issue 37580: "division by zero" error when book sales order with BOM
products

When closing a sales order with a BOM product a division by zeror error was raise
while the process tries to calculate the v_PriceActual variable.

A validation was added to only calculate the value when the qtyordered is
different from cero, if not the v_PriceActual value is cero.

---
M src-db/database/model/triggers/C_ORDERLINE_TRG.xml
---
(0101636)
dmiguelez (developer)
2018-01-09 10:28

Code Review + Testing Ok
(0102651)
hudsonbot (developer)
2018-02-22 18:18

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

- Issue History
Date Modified Username Field Change
2018-01-03 21:46 matias-bernal New Issue
2018-01-03 21:46 matias-bernal Assigned To => Triage Finance
2018-01-03 21:46 matias-bernal File Added: Selección_379.png
2018-01-03 21:46 matias-bernal Modules => Core
2018-01-03 21:46 matias-bernal Triggers an Emergency Pack => No
2018-01-03 22:21 rbianchini Issue Monitored: rbianchini
2018-01-04 17:41 dmiguelez Assigned To Triage Finance => collazoandy4
2018-01-06 02:05 collazoandy4 Status new => scheduled
2018-01-06 02:06 collazoandy4 Note Added: 0101604
2018-01-09 10:26 hgbot Checkin
2018-01-09 10:26 hgbot Note Added: 0101635
2018-01-09 10:26 hgbot Status scheduled => resolved
2018-01-09 10:26 hgbot Resolution open => fixed
2018-01-09 10:26 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/b37dfca128c9d4d7c315704e81f82c31a1aae42e [^]
2018-01-09 10:28 dmiguelez Review Assigned To => dmiguelez
2018-01-09 10:28 dmiguelez Note Added: 0101636
2018-01-09 10:28 dmiguelez Status resolved => closed
2018-01-09 10:28 dmiguelez Fixed in Version => 3.0PR18Q2
2018-02-22 18:18 hudsonbot Checkin
2018-02-22 18:18 hudsonbot Note Added: 0102651


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker