Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0029709Openbravo ERPA. Platformpublic2015-04-27 16:422015-06-01 13:02
ngarcia 
NaroaIriarte 
urgentmajoralways
closedfixed 
5
 
3.0PR15Q3 
alostale
Core
No
0029709: Cannot save a physical inventory line with a negative small number in the Book Quantity field
Cannot save a physical inventory line with a negative small number in the Book Quantity field
Change the Format.xml as follow:

   <Number name="qtyRelation"
       decimal="." grouping="," formatOutput="#,##0.#######" formatInternal="#0.0000000" />
   <Number name="qtyEdition"
       decimal="." grouping="," formatOutput="#0.#######" formatInternal="#0.0000000" />
   <Number name="qtyExcel"
       decimal="." grouping="," formatOutput="#,##0.#######" formatInternal="#0.0000000" />

As group admin role:
   Go to Client window and in the Information tab, check the "Allow Negative Stock" checkbox.
   Create a new product
   Create a goods shipment for that product with the following quantity: 0.0003655
   Create a Physical Inventory and add the previously created product and a Quantity Count of 0
   The following error is shown:
      "Saving failed. Exception while trying to convert value:-->0.000-3655<-- null"
No tags attached.
related to defect 00261323.0PR14Q3 closed guillermogil wrong visualization value of quantity fields with very small numbers 
related to defect 00285523.0PR15Q2 closed alostale Purchase Invoice amount gets truncated upon saving, when the amount is big 
related to defect 0028720 closed alostale System is not saving big numbers properly 
related to defect 00257103.0PR14Q2 closed AugustoMauch Big numbers are not properly managed in amount fields 
related to defect 0030014 closed NaroaIriarte The function OB.Utilities.Number.OBMaskedToOBPlain is not working properly with negative big numbers 
Issue History
2015-04-27 16:42ngarciaNew Issue
2015-04-27 16:42ngarciaAssigned To => platform
2015-04-27 16:42ngarciaModules => Core
2015-04-27 16:42ngarciaTriggers an Emergency Pack => No
2015-04-27 16:43ngarciaRelationship addedrelated to 0026132
2015-04-27 16:43ngarciaIssue Monitored: networkb
2015-04-27 18:33ahernandezgilIssue Monitored: ahernandezgil
2015-04-27 18:36ngarciaResolution time => 1432504800
2015-04-28 07:57alostaleStatusnew => acknowledged
2015-05-22 10:19alostaleStatusacknowledged => scheduled
2015-05-22 10:19alostaleAssigned Toplatform => NaroaIriarte
2015-05-22 12:58NaroaIriarteSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=8643#r8643
2015-05-25 16:00NaroaIriarteReview Assigned To => alostale
2015-05-25 16:01NaroaIriarteIssue Monitored: alostale
2015-05-25 16:22hgbotCheckin
2015-05-25 16:22hgbotNote Added: 0077716
2015-05-25 16:22hgbotStatusscheduled => resolved
2015-05-25 16:22hgbotResolutionopen => fixed
2015-05-25 16:22hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/fdb573cffe5fff9d54cfbaef5c83e539a7126947 [^]
2015-05-26 09:29NaroaIriarteRelationship addedrelated to 0028552
2015-05-26 09:30NaroaIriarteRelationship addedrelated to 0028720
2015-05-26 09:32NaroaIriarteRelationship addedrelated to 0025710
2015-05-26 13:22NaroaIriarteRelationship addedrelated to 0030014
2015-05-26 15:08hudsonbotCheckin
2015-05-26 15:08hudsonbotNote Added: 0077761
2015-05-27 16:07hgbotCheckin
2015-05-27 16:07hgbotNote Added: 0077820
2015-05-28 01:10hudsonbotCheckin
2015-05-28 01:10hudsonbotNote Added: 0077844
2015-06-01 13:02alostaleNote Added: 0077928
2015-06-01 13:02alostaleStatusresolved => closed
2015-06-01 13:02alostaleFixed in Version => 3.0PR15Q3

Notes
(0077716)
hgbot   
2015-05-25 16:22   
Repository: erp/devel/pi
Changeset: fdb573cffe5fff9d54cfbaef5c83e539a7126947
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Mon May 25 16:18:51 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/fdb573cffe5fff9d54cfbaef5c83e539a7126947 [^]

Fixed issue 29709: Physical inventory cannot be created.

The problem was that if it was a very small negative Book Quantity number, it was not
possible to create a Physical Inventory line.

It was because the "ScientificToDecimal" function was not working properly with negative
numbers. The '-' sign was taken as a number instead of as a sign, that was the reason of
obtaining a value like 0.000-3655 when -0.0003655 was expected.

To fix this, a condition has been added which takes into account the fact of having
the '-' sign and to deal with the sign as a sign and not as a number.

---
M modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-number.js
---
(0077761)
hudsonbot   
2015-05-26 15:08   
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/b0c5594df387 [^]
Maturity status: Test
(0077820)
hgbot   
2015-05-27 16:07   
Repository: erp/devel/pi
Changeset: 56a6bfc4e4c726767bad25f5bb4606727406653f
Author: Naroa Iriarte <naroa.iriarte <at> openbravo.com>
Date: Wed May 27 16:05:43 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/56a6bfc4e4c726767bad25f5bb4606727406653f [^]

Related with issue 29709: Some test cases have been created.

Some test have been created for testing the correct behaviour of the OB.Utilities.Number.roundJSNumber,
OB.Utilities.Number.ScientificToDecimal and OB.Utilities.Number.OBMaskedToOBPlain functions.

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationComponentProvider.java
M modules/org.openbravo.client.kernel/web/org.openbravo.client.kernel/ui-test-suite/index.html
A modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-utilities-number-test.js
---
(0077844)
hudsonbot   
2015-05-28 01:10   
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/ae25da3bd47f [^]
Maturity status: Test
(0077928)
alostale   
2015-06-01 13:02   
code reviewed:

Tested issues:
0026132
0029709
0028552
0028720
0025710
0030014