Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0014140Openbravo ERP03. Procurement managementpublic2010-08-06 12:582010-08-19 00:00
vmromanos 
adrianromero 
urgentmajoralways
closedfixed 
20Debian 5.0
pi 
2.50MP21 
Core
No
0014140: Multicurrency in purchase invoices doesn't work
When you create a purchase invoice with a currency different from your accounting schema one and with no conversion rate defined, the application allows you to complete the invoice. If you post it, the accounting entry has the credit and debit amount equal to NULL (a 0 in the database fact_acct table).

The sales invoices work fine.

It's only reproducible in PI, not in MP20. It seems to be related with the new flows.
0. Ensure there is no conversion rates in the system
1. As Openbravo Admin go to Master Data Management || Pricing || Price List, search the General Sales record and change the currency to, for example, "SOS"
2. Create a new purchase invoice selecting the "General Sales" price list
3. Insert a line
4. Try to complete the invoice. An error should be displayed informing there is no conversion rate available (see the one displayed in sales invoices)
5. If you post it, a wrong entry is created
Show error informing there is no conversion rate available, exactly the same one displayed for sales invoices when completing the invoice
No tags attached.
jpg null_entry.jpg (19,444) 2010-08-06 13:02
https://issues.openbravo.com/file_download.php?file_id=2819&type=bug
jpg
Issue History
2010-08-06 12:58vmromanosNew Issue
2010-08-06 12:58vmromanosAssigned To => adrianromero
2010-08-06 13:00vmromanosSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=654#r654
2010-08-06 13:00vmromanosProposed Solution updated
2010-08-06 13:02vmromanosFile Added: null_entry.jpg
2010-08-12 08:42adrianromeroPriorityimmediate => urgent
2010-08-12 08:42adrianromeroStatusnew => scheduled
2010-08-12 08:53adrianromeroNote Added: 0029899
2010-08-17 14:10hgbotCheckin
2010-08-17 14:10hgbotNote Added: 0030071
2010-08-17 14:10hgbotStatusscheduled => resolved
2010-08-17 14:10hgbotResolutionopen => fixed
2010-08-17 14:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ab63baf13ee9e1a0da20880a578b84153acbcb71 [^]
2010-08-17 14:50hgbotCheckin
2010-08-17 14:50hgbotNote Added: 0030073
2010-08-17 14:50hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/ab63baf13ee9e1a0da20880a578b84153acbcb71 [^] => http://code.openbravo.com/erp/devel/pi/rev/e1e3c5b69de3581519c31f04ff396024632abec0 [^]
2010-08-17 14:53adrianromeroNote Added: 0030074
2010-08-17 21:15hudsonbotCheckin
2010-08-17 21:15hudsonbotNote Added: 0030088
2010-08-18 00:39hudsonbotCheckin
2010-08-18 00:39hudsonbotNote Added: 0030090
2010-08-18 08:51sureshbabuNote Added: 0030096
2010-08-18 10:10sureshbabuNote Deleted: 0030096
2010-08-18 10:11sureshbabuNote Added: 0030100
2010-08-18 10:11sureshbabuStatusresolved => closed
2010-08-19 00:00anonymoussf_bug_id0 => 3048130

Notes
(0029899)
adrianromero   
2010-08-12 08:53   
This behavior is not a regression. Current version in pi and previous versions including MP20 have the same behavior.

Sales invoices behaves different than purchase invoices because when trying to complete a sales invoice, It is updated the Actual Life Time Value of the Customer and if it does not exist a valid change between the invoice currency and the customer currency an error is thrown.

The real problem is that when posting the invoice (not when completing the invoice) and the accounting entries are calculated. the Accounting engine (AcctServer.java) if it does not exist a valid change between the invoice currency and the accounting schema currency just a message is written to the logs, no error is thrown and the accounting entries are created with null values.

This behavior is implemented here: https://code.openbravo.com/erp/devel/pi/file/e485d4ccc287/src/org/openbravo/erpCommon/ad_forms/AcctServer.java#l1129 [^]
(0030071)
hgbot   
2010-08-17 14:10   
Repository: erp/devel/pi
Changeset: ab63baf13ee9e1a0da20880a578b84153acbcb71
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Tue Aug 17 14:09:40 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/ab63baf13ee9e1a0da20880a578b84153acbcb71 [^]

Fixes issue 0014140: Multicurrency in purchase invoices doesn't work
It has been fixed the condition that checks whether a document is convertible or not

---
M src/org/openbravo/erpCommon/ad_forms/AcctServer.java
---
(0030073)
hgbot   
2010-08-17 14:50   
Repository: erp/devel/pi
Changeset: e1e3c5b69de3581519c31f04ff396024632abec0
Author: Adrián Romero <adrianromero <at> openbravo.com>
Date: Tue Aug 17 14:49:38 2010 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/e1e3c5b69de3581519c31f04ff396024632abec0 [^]

Fixes issue 0014140: Multicurrency in purchase invoices doesn't work
It has been added the message for not convertible documents

---
M src-db/database/sourcedata/AD_MESSAGE.xml
---
(0030074)
adrianromero   
2010-08-17 14:53   
* Steps to test

Kindly follow the steps to reproduce and notice that when trying to post the invoice an error message will appear: Document currency cannot be converted to the Accounting Schema currency.

* Other areas affected

It only has been modified the logic of the accounting server when converting currencies making it more robust.
(0030088)
hudsonbot   
2010-08-17 21:15   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/ab63baf13ee9 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/c378f960e6c8 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18175.obx [^]
(0030090)
hudsonbot   
2010-08-18 00:39   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/e1e3c5b69de3 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/2cad794ceb55 [^]
Tests: http://builds.openbravo.com/view/int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.18177.obx [^]
(0030100)
sureshbabu   
2010-08-18 10:11   
verified, system allowing the user to complete the invoice, but when we post the invoice throws the below error as

"Document currency cannot be converted to the Accounting Schema currency."