Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0016702Openbravo ERP03. Procurement managementpublic2011-04-07 17:142011-04-09 00:00
psanjuan 
mtaal 
immediatemajoralways
closedfixed 
20Ubuntu 8.04.1
 
3.0RC6 
Core
No
0016702: Not possible to create a purchase invoice by using "Create Lines From"
It is not possible to create a purchase invoice by using "Create Lines From"
Create a purchase order for Vendor A.
Complete
Navigate to purchase invoice window and create a new one for Vendor A.
Click on "Create Lines From" button in order to select the just created Purchase Order.
Select the purchase order and press ok.
Below error is shown.

Same error in live builds - Oracle.
No tags attached.
png 16702.png (105,612) 2011-04-07 17:21
https://issues.openbravo.com/file_download.php?file_id=3854&type=bug
png
Issue History
2011-04-07 17:14psanjuanNew Issue
2011-04-07 17:14psanjuanAssigned To => adrianromero
2011-04-07 17:14psanjuanModules => Core
2011-04-07 17:20psanjuanAssigned Toadrianromero => alostale
2011-04-07 17:20psanjuanTarget Version => 3.0RC6
2011-04-07 17:20psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=1794#r1794
2011-04-07 17:21psanjuanAssigned Toalostale => adrianromero
2011-04-07 17:21psanjuanFile Added: 16702.png
2011-04-07 17:59egoitzNote Added: 0035745
2011-04-07 17:59egoitzIssue Monitored: egoitz
2011-04-07 18:37egoitzNote Added: 0035747
2011-04-07 20:03adrianromeroNote Added: 0035749
2011-04-07 20:30dmitry_mezentsevIssue Monitored: dmitry_mezentsev
2011-04-07 20:33adrianromeroAssigned Toadrianromero => mtaal
2011-04-07 20:35marvintmNote Added: 0035751
2011-04-07 20:53mtaalNote Added: 0035752
2011-04-08 08:16hgbotCheckin
2011-04-08 08:16hgbotNote Added: 0035753
2011-04-08 08:16hgbotStatusnew => resolved
2011-04-08 08:16hgbotResolutionopen => fixed
2011-04-08 08:16hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/bddb50a596435e4581dec99770d01c32cee7a5f3 [^]
2011-04-08 18:19iperdomoNote Added: 0035801
2011-04-08 18:19iperdomoStatusresolved => closed
2011-04-09 00:00anonymoussf_bug_id0 => 3281282

Notes
(0035745)
egoitz   
2011-04-07 17:59   
on CreateFrom.java file
on the
saveInvoice method
there is one catch where the message to show when error is not managed properly.

 
    } catch (final Exception e) {
      try {
        releaseRollbackConnection(conn);
      } catch (final Exception ignored) {
      }
      e.printStackTrace();
      log4j.warn("Rollback in transaction");
      myMessage = Utility.translateError(this, vars, vars.getLanguage(), "ProcessRunError");
    }
    return myMessage;
  }
(0035747)
egoitz   
2011-04-07 18:37   
LOG:

 SQL error in query: SELECT ROUND(M_GET_OFFERS_PRICE(TO_DATE(?),?,?,TO_NUMBER(?), TO_NUMBER(?), ?), (SELECT PRICEPRECISION FROM C_CURRENCY C, C_INVOICE I WHERE C.C_CURRENCY_ID = I.C_CURRENCY_ID AND I.C_INVOICE_ID = ?)) AS TOTAL FROM DUALException:java.sql.SQLDataException: ORA-01861: literal does not match format string
(0035749)
adrianromero   
2011-04-07 20:03   
The problem is executing the line

https://code.openbravo.com/erp/devel/pi/file/8d002e0b6285/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java#l1485 [^]

It is because the date format of the date in the var strDateInvoiced that is

2011-04-04T02:00:00

Because of this date format even this sql sentence fails:

select TO_DATE('2011-04-04T02:00:00') FROM DUAL
(0035751)
marvintm   
2011-04-07 20:35   
The problem is the following:

when a process is called, a call to the getContextInfo() is done, to retrieve the record values which are set in the request to the servlet.

These values need to be in "classic" format for our classic processes to work. Therefore, this function is called with the option classicMode=true (which is correct).

However, it seems like this getContextInfo() function only attempts to transform into classic format, values whose type contains a createClassicString function property, and it looks like dates do not have this function defined. Therefore, the dates are sent unchanged (so, in Javascript format), and this doesn't work in the servlet, which expects to receive a classic format.
(0035752)
mtaal   
2011-04-07 20:53   
This changeset is the cause:
https://code.openbravo.com/erp/devel/pi/rev/f12d09feabb5 [^]

It was done for this issue:
https://issues.openbravo.com/view.php?id=16380 [^]

I will investigate further
(0035753)
hgbot   
2011-04-08 08:16   
Repository: erp/devel/pi
Changeset: bddb50a596435e4581dec99770d01c32cee7a5f3
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Fri Apr 08 08:07:51 2011 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/bddb50a596435e4581dec99770d01c32cee7a5f3 [^]

Fixes issue 16702: Not possible to create a purchase invoice by using Create Lines From

---
M modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateUIDefinition.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/NumberUIDefinition.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/TimeUIDefinition.java
M modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/UIDefinition.java
---
(0035801)
iperdomo   
2011-04-08 18:19   
Tested using QA Test client on pi @ rev ab8b8b1cc6be