Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030113Openbravo ERPA. Platformpublic2015-06-02 09:292015-06-15 10:08
vmromanos 
caristu 
immediatecriticalalways
closedfixed 
5
 
3.0PR15Q2.23.0PR15Q2.2 
alostale
Core
No
0030113: Critical bug with decimals only in PostgreSQL 9.3
It seems that the way decimal numbers are managed by PostgreSQL 9.3 is different from PostgreSQL 9.1, and may create important issues in several flows.

The same query [select to_number('1.53')] returns different results depending on the PG version:

PG 9.1: 1.53
PG 9.3: 153
Login as Openbravo admin

Go to Sales Order and create a new record:
  Org: España Norte
  BP: Alimentos y Supermercados
  Invoice Terms: Immediate
Go to Lines and create a new record:
  Quantity: 10
  Product: Agua sin gas
 Verify unit price = 1.53
Book the sales order

Go to Sales Invoice and create a new record:
  Org: España Norte
  BP: Alimentos y SuperMercados
Press Create Lines From:
  In the sales order select the previously created
  In the grid select the 2 order lines
  Press OK
Go to lines and check that:
  the unit price is 153, when it should be 1.53
  the line net amount is 1530, when it should be 15.30
Approved
blocks defect 0030069 closed caristu Critical bug with decimals only in PostgreSQL 9.3 
Issue History
2015-06-05 11:43alostaleTypedefect => backport
2015-06-05 11:43alostaleTarget Version => 3.0PR15Q2.2
2015-06-10 09:25dmitry_mezentsevTag Attached: Approved
2015-06-10 17:17caristuIssue Monitored: alostale
2015-06-10 17:18hgbotCheckin
2015-06-10 17:18hgbotNote Added: 0078191
2015-06-10 17:18hgbotStatusscheduled => resolved
2015-06-10 17:18hgbotResolutionopen => fixed
2015-06-10 17:18hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/92288ee33eeb3b501dd18e65fb77a557fb283ac9 [^]
2015-06-15 10:08alostaleNote Added: 0078283
2015-06-15 10:08alostaleStatusresolved => closed
2015-06-15 10:08alostaleFixed in Version => 3.0PR15Q2.2

Notes
(0078191)
hgbot   
2015-06-10 17:18   
Repository: erp/backports/3.0PR15Q2.2
Changeset: 92288ee33eeb3b501dd18e65fb77a557fb283ac9
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jun 10 17:14:48 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q2.2/rev/92288ee33eeb3b501dd18e65fb77a557fb283ac9 [^]

Fixes issue 30113: Critical bug with decimals only in PostgreSQL 9.3

A new build validation has been added. This way, when executing update.database the result returned by the to_number() procedure is evaluated.
In case it does not return the expected result, the task will fail, showing a message with the link to the documentation.

---
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DatabaseDecimalNumberCheck.class
A src-util/buildvalidation/build/classes/org/openbravo/buildvalidation/DatabaseDecimalNumberCheckData.class
A src-util/buildvalidation/src/org/openbravo/buildvalidation/DatabaseDecimalNumberCheck.java
A src-util/buildvalidation/src/org/openbravo/buildvalidation/DatabaseDecimalNumberCheck_data.xsql
---
(0078283)
alostale   
2015-06-15 10:08   
code reviewed + tested with PG 9.3 lc_numeric 'es_ES'