Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030114Openbravo ERPA. Platformpublic2015-06-02 09:292015-06-15 10:08
vmromanos 
caristu 
immediatecriticalalways
closedfixed 
5
 
3.0PR15Q1.53.0PR15Q1.5 
alostale
Core
No
0030114: 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.0PR15Q1.5
2015-06-10 09:25dmitry_mezentsevTag Attached: Approved
2015-06-10 10:33caristuIssue Monitored: alostale
2015-06-10 17:06hgbotCheckin
2015-06-10 17:06hgbotNote Added: 0078189
2015-06-10 17:07hgbotStatusscheduled => resolved
2015-06-10 17:07hgbotResolutionopen => fixed
2015-06-10 17:07hgbotFixed in SCM revision => http://code.openbravo.com/erp/backports/3.0PR15Q1.5/rev/6e1388c1e4224b9fd92a691cb3010d40ea0d4358 [^]
2015-06-15 10:07alostaleNote Added: 0078282
2015-06-15 10:07alostaleStatusresolved => closed
2015-06-15 10:08alostaleFixed in Version => 3.0PR15Q1.5

Notes
(0078189)
hgbot   
2015-06-10 17:06   
Repository: erp/backports/3.0PR15Q1.5
Changeset: 6e1388c1e4224b9fd92a691cb3010d40ea0d4358
Author: Carlos Aristu <carlos.aristu <at> openbravo.com>
Date: Wed Jun 10 10:32:27 2015 +0200
URL: http://code.openbravo.com/erp/backports/3.0PR15Q1.5/rev/6e1388c1e4224b9fd92a691cb3010d40ea0d4358 [^]

Fixes issue 30114: 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.
n 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
---
(0078282)
alostale   
2015-06-15 10:07   
code reviewed + tested with PG 9.3 lc_numeric 'es_ES'