Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031374Openbravo ERPA. Platformpublic2015-11-05 13:172022-02-01 08:09
aferraz 
Triage Platform Base 
normalminoralways
acknowledgedopen 
30
 
 
Core
No
0031374: Different order identifier when creating an invoice from an order in Oracle
When creating a new invoice from "Create Lines From" button, and try to select an order with a total gross amount without decimals (25.00 for instance), the identifier changes if we are using PostgreSQL or Oracle:
- PostgreSQL: order_documentno - order_date - 25.00
- Oracle: order_documentno - order_date - 25
As F&B Admin in PostgreSQL:

- Create a Purchase Order for "Bebidas Alegres, S.L." business partner.
  Add a line with "Cerveza Ale" product, quantity = 100 and "Compras exentas" tax.
  Book it.
  Realize total gross amount is: 136.00.
  Let say it has "1000151" documentno and "05-11-2015" date.

- Create a Purchase Invoice for "Bebidas Alegres, S.L." business partner.
  Click on Create Lines From button.
  Realize created order appears in Order selector with the following identifier:
  1000151 - 05-11-2015 - 136.00

As F&B Admin in Oracle:

- Create a Purchase Order for "Bebidas Alegres, S.L." business partner.
  Add a line with "Cerveza Ale" product, quantity = 100 and "Compras exentas" tax.
  Book it.
  Realize total gross amount is: 136.00.
  Let say it has "1000151" documentno and "05-11-2015" date.

- Create a Purchase Invoice for "Bebidas Alegres, S.L." business partner.
  Click on Create Lines From button.
  Realize created order appears in Order selector with the following identifier:
  1000151 - 05-11-2015 - 136
  when it should be:
  1000151 - 05-11-2015 - 136.00
No tags attached.
related to defect 0028153 closed AugustoMauch Creating identifier for some windows it is used dd-mm-yyyy format instead mm-dd-yyyy even when you are using USA format 
Issue History
2015-11-05 13:17aferrazNew Issue
2015-11-05 13:17aferrazAssigned To => platform
2015-11-05 13:17aferrazModules => Core
2015-11-05 13:17aferrazTriggers an Emergency Pack => No
2015-11-05 14:53alostaleRelationship addedrelated to 0028153
2015-11-06 10:13alostaleNote Added: 0081546
2015-11-06 10:13alostaleStatusnew => acknowledged
2015-11-06 10:13alostaleTypedefect => design defect
2015-11-06 10:13alostaleTarget Version3.0PR16Q1 =>
2016-02-02 09:38hgbotCheckin
2016-02-02 09:38hgbotNote Added: 0083824
2016-02-02 09:38hgbotCheckin
2016-02-02 09:38hgbotNote Added: 0083825
2016-09-26 15:40hgbotCheckin
2016-09-26 15:40hgbotNote Added: 0090267
2016-10-27 16:57hgbotCheckin
2016-10-27 16:57hgbotNote Added: 0090963
2016-10-27 16:58hgbotCheckin
2016-10-27 16:58hgbotNote Added: 0090964
2022-02-01 08:09alostaleAssigned Toplatform => Triage Platform Base

Notes
(0081546)
alostale   
2015-11-06 10:13   
The case defined affects 2.50 style identifiers generated using ad_column_identifier function.

The C_Order.grandTotal part of the identifier is composed by TO_CHAR(COALESCE(TO_CHAR(GrandTotal),'')) both in Oracle and PostgreSQL but it returns different values in both cases.

Note this behavior also affects DAL identifiers.

The root cause of the problem is due how internally DB handles output of numeric values with different precision.

PG:
  CREATE TABLE test
   ( n numeric,
    n1 numeric (10,2),
        n2 numeric(10,4)
   );

   insert into test values (10.20, 10.20, 10.20);

   select * from test;

   n | n1 | n2
-------+-------+---------
 10.20 | 10.20 | 10.2000

Oracle:
  CREATE TABLE test
   ( n NUMBER,
        n1 NUMBER (10,2),
      n2 NUMBER(10,4)
   );
   
   insert into test values (10.20, 10.20, 10.20);
   
   select * from test;

         N N1 N2
---------- ---------- ----------
      10.2 10.2 10.2

Note in case of PG, numbers are displayed maintaining their precision (right padding with zeroes up to precision value) whereas in Oracle they are displayed without padding.

C_Order.grandTotal is defined as numeric without indicating precision, which indicates any precision can be stored [1].

[1] http://www.postgresql.org/docs/current/static/datatype-numeric.html [^]
(0083824)
hgbot   
2016-02-02 09:38   
Repository: tools/automation/int
Changeset: b2175f871d6291ffb56d75d7fd646b77706741f1
Author: Lorenzo Fidalgo <lorenzo.fidalgo <at> openbravo.com>
Date: Wed Nov 11 16:37:45 2015 +0100
URL: http://code.openbravo.com/tools/automation/int/rev/b2175f871d6291ffb56d75d7fd646b77706741f1 [^]

Workaround added to avoid issue 31374

---
M src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseinvoice/CreateLinesFromPopUp.java
---
(0083825)
hgbot   
2016-02-02 09:38   
Repository: tools/automation/int
Changeset: 147f4a73668732757fda8ee55fa6d0af1f26dda4
Author: Lorenzo Fidalgo <lorenzo.fidalgo <at> openbravo.com>
Date: Wed Nov 11 17:06:25 2015 +0100
URL: http://code.openbravo.com/tools/automation/int/rev/147f4a73668732757fda8ee55fa6d0af1f26dda4 [^]

Workaround added to avoid issue 31374 in all CreateLinesFromPopUp classes

---
M src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/goodsreceipt/CreateLinesFromPopUp.java
M src-test/com/openbravo/test/integration/erp/gui/procurement/transactions/purchaseinvoice/CreateLinesFromPopUp.java
M src-test/com/openbravo/test/integration/erp/gui/sales/transactions/goodsshipment/CreateLinesFromPopUp.java
M src-test/com/openbravo/test/integration/erp/gui/sales/transactions/salesinvoice/CreateLinesFromPopUp.java
---
(0090267)
hgbot   
2016-09-26 15:40   
Repository: tools/automation/int
Changeset: 9b393cd998ff108791ef8f7845e605b0f2fad380
Author: IƱaki Garcia <inaki.garcia <at> openbravo.com>
Date: Wed May 11 12:56:13 2016 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/9b393cd998ff108791ef8f7845e605b0f2fad380 [^]

Adding fixes and workaround to issue 31374

---
M src-test/com/openbravo/test/integration/erp/modules/client/application/gui/OBForm.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/reservation/testsuites/RES_Regressions/RESRegression28907R27848R29003.java
M src-test/com/openbravo/test/integration/erp/modules/userinterface/smartclient/gui/Grid.java
M src-test/com/openbravo/test/integration/erp/modules/userinterface/smartclient/gui/SelectItem.java
M src-test/com/openbravo/test/integration/util/TestUtils.java
---
(0090963)
hgbot   
2016-10-27 16:57   
Repository: tools/automation/int
Changeset: 0e63b2463740efac19f4d5c6bfa29b6a8313ec5f
Author: Lorenzo Fidalgo <lorenzo.fidalgo <at> openbravo.com>
Date: Tue Oct 04 17:04:09 2016 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/0e63b2463740efac19f4d5c6bfa29b6a8313ec5f [^]

Workarounds for issue 31374 temporarily removed

---
M src-test/com/openbravo/test/integration/erp/modules/client/application/gui/OBForm.java
M src-test/com/openbravo/test/integration/erp/modules/userinterface/smartclient/gui/Grid.java
---
(0090964)
hgbot   
2016-10-27 16:58   
Repository: tools/automation/int
Changeset: 58ebfbe7ef3a703895eaf28e9148ac7b0317792e
Author: Lorenzo Fidalgo <lorenzo.fidalgo <at> openbravo.com>
Date: Thu Oct 20 10:51:21 2016 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/58ebfbe7ef3a703895eaf28e9148ac7b0317792e [^]

Workaround for issue 31374 added

---
M src-test/com/openbravo/test/integration/erp/modules/client/application/gui/OBForm.java
M src-test/com/openbravo/test/integration/erp/modules/userinterface/smartclient/gui/Grid.java
---