Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032440Openbravo ERP09. Financial managementpublic2016-03-09 09:232016-06-17 19:36
ngarcia 
Sanjota 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q3 
aferraz
Core
No
0032440: Different currency in Simple G/L Journal header and lines
Different currency in Simple G/L Journal header and lines
As group admin role:
   Create a Simple G/L Journal header and save it with the default currency shown
   Change the currency and save it again
   Add a line to it
   Check through database that the currency of the line is different from the currency of the header
      select j.documentno, j.c_currency_id, jl.c_currency_id
      from gl_journal j, gl_journalline jl
      where j.gl_journal_id = jl.gl_journal_id
      and j.gl_journal_id = <id>
   Complete it
   Check there is no conversion between lines currency and accounting schema currency
   Try to post it and check the following error message is shown:
      Document currency cannot be converted to the Accounting Schema currency
   Define a currency conversion between them and check you could post the document now although the amount is converted from the header currency to the accounting schema currency
Change the Default Value of the C_Currency_ID column of the GL_JournalLine table from @currency@ to @C_Currency_ID@
No tags attached.
related to design defect 0032441 closed Triage Omni OMS Organization and Currency fields are showing the last saved value as default value in Simple G/L Journal window 
Issue History
2016-03-09 09:23ngarciaNew Issue
2016-03-09 09:23ngarciaAssigned To => Triage Finance
2016-03-09 09:23ngarciaModules => Core
2016-03-09 09:23ngarciaResolution time => 1460325600
2016-03-09 09:23ngarciaTriggers an Emergency Pack => No
2016-03-09 09:42ngarciaIssue Monitored: networkb
2016-03-09 09:47ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11391#r11391
2016-03-09 11:00ngarciaRelationship addedrelated to 0032441
2016-03-22 12:36SanjotaAssigned ToTriage Finance => Sanjota
2016-03-22 12:36SanjotaStatusnew => scheduled
2016-03-28 13:35SanjotaNote Added: 0085309
2016-03-31 09:29psanjuanNote Added: 0085346
2016-03-31 09:29psanjuanNote Added: 0085347
2016-03-31 09:30psanjuanStatusscheduled => feedback
2016-03-31 09:30psanjuanResolutionopen => unable to reproduce
2016-03-31 09:41ngarciaStatusfeedback => scheduled
2016-03-31 09:41ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11571#r11571
2016-03-31 09:58ngarciaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=11572#r11572
2016-03-31 10:20psanjuanNote Added: 0085348
2016-03-31 10:24psanjuanNote Edited: 0085348bug_revision_view_page.php?bugnote_id=0085348#r11574
2016-03-31 11:00psanjuanNote Edited: 0085346bug_revision_view_page.php?bugnote_id=0085346#r11578
2016-03-31 11:00psanjuanNote Added: 0085349
2016-03-31 11:02psanjuanNote Edited: 0085346bug_revision_view_page.php?bugnote_id=0085346#r11579
2016-03-31 11:03psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11581
2016-03-31 11:04psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11582
2016-03-31 11:04psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11583
2016-03-31 11:07psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11584
2016-03-31 11:17psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11585
2016-03-31 12:29psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11590
2016-03-31 12:31psanjuanNote Edited: 0085346bug_revision_view_page.php?bugnote_id=0085346#r11591
2016-03-31 12:31psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11592
2016-03-31 12:39psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11593
2016-03-31 12:51psanjuanNote Added: 0085356
2016-03-31 12:57psanjuanNote Edited: 0085349bug_revision_view_page.php?bugnote_id=0085349#r11594
2016-04-04 19:11hgbotCheckin
2016-04-04 19:11hgbotNote Added: 0085421
2016-04-04 19:11hgbotStatusscheduled => resolved
2016-04-04 19:11hgbotResolutionunable to reproduce => fixed
2016-04-04 19:11hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/571e53e91071fba9a14e45bd7855249f2092e4c7 [^]
2016-04-04 19:11aferrazReview Assigned To => aferraz
2016-04-04 19:11aferrazNote Added: 0085422
2016-04-04 19:11aferrazStatusresolved => closed
2016-04-04 19:13aferrazFixed in Version => 3.0PR16Q3
2016-06-17 19:36hudsonbotCheckin
2016-06-17 19:36hudsonbotNote Added: 0087416

Notes
(0085309)
Sanjota   
2016-03-28 13:35   
Test Plan:
* Create a Simple G/L Journal header and save it with the default currency shown
* Change the currency and save it again
* Check through database that the currency of the line is same as currency of the header
* Complete it
* Check there is no currency between lines currency and accounting schema currency
* Try to post it and check the following error message is shown:
   'Document currency cannot be converted to the Accounting Schema currency'
   Define a currency conversion between them and check you could post the document now although the amount is converted from the header currency to the accounting schema currency
(0085346)
psanjuan   
2016-03-31 09:29   
(edited on: 2016-03-31 12:31)
Create a Simple G/L Journal header.
Check that you have below detailed information:

Organization = F&B España
General Ledger = F&B International Group US Dollar
Description (empty). Enter a description such as "Test Issue Currency"
Select the check "Multi-General Ledger". Note that General Ledger field is removed.
Save. Check that the currency shown is EUR.
Change the currency to AED for instance and save.

Add a line to it by selecting a GL Item. Enter a Debit amount = 100
Create another line and select another GL Item. Enter a Credit amount = 100
Complete.

Run this SQL query by adding GL Journal record id

select j.documentno, j.c_currency_id, jl.c_currency_id
      from gl_journal j, gl_journalline jl
      where j.gl_journal_id = jl.gl_journal_id
      and j.gl_journal_id = <id>

For instance

select j.documentno, j.c_currency_id, jl.c_currency_id
      from gl_journal j, gl_journalline jl
      where j.gl_journal_id = jl.gl_journal_id
      and j.gl_journal_id = 'FBEA79CB185A43AEB01844832FD05D78'

Verify that header curreny is 238 (AED) while lines currency is 102 (EUR). This is not correct.

Try to post it. An error is shown saying "Document currency cannot be converted to the Accounting Schema currency".

Go to conversion rates window and enter below conversions valid from 01-03-2016 to 31-03-2016:

AED to EUR 0.512821
EUR to AED 1.95
AED to USD 0.75
USD to AED 1.33333

Go back to the Simple G/L Journal and post it.

Verify below posting is shown:

F&B International Group US Dollar General Ledger:
DEBIT 75.00 (100.00 AED * 0.75)
CREDIT 75.00 (100.00 AED * 0.75)

F&B España EUR General Ledger:
DEBIT 51.28 (100.00 AED * 0.512821)
CREDIT 51.28 (100.00 AED * 0.512821)

Regardless posting is correct, currency of the lines is not.

(0085347)
psanjuan   
2016-03-31 09:29   
Issue set as in feedback because it can not be reproduced.
(0085348)
psanjuan   
2016-03-31 10:20   
(edited on: 2016-03-31 10:24)
Issue verified by using SQL query above. Currency set on the lines is not the same that the one in the header.
Once the conversion rate needed is entered in Openbravo, header currency is used to convert to accounting schema currency which is correct.

Real issue here is that currency set on the lines is not the same as the currency in the header.

(0085349)
psanjuan   
2016-03-31 11:00   
(edited on: 2016-03-31 12:57)
Test Plan

Scenario 1 - Simple G/L Journal.

Create a Simple G/L Journal header.
Check that you have below detailed information:

Organization = F&B España
General Ledger = F&B International Group US Dollar
Description (empty). Enter a description such as "Test Issue Currency"
Select the check "Multi-General Ledger". Note that General Ledger field is removed, same as Rate.
Save. Check that the currency shown is EUR.
Change the currency to AED for instance and save.

Add a line to it by selecting a GL Item. Enter a Debit amount = 100
Create another line and select another GL Item. Enter a Credit amount = 100
Complete.

Run this SQL query by adding GL Journal record id

select j.documentno, j.c_currency_id, jl.c_currency_id
      from gl_journal j, gl_journalline jl
      where j.gl_journal_id = jl.gl_journal_id
      and j.gl_journal_id = <id>


For instance

select j.documentno, j.c_currency_id, jl.c_currency_id
      from gl_journal j, gl_journalline jl
      where j.gl_journal_id = jl.gl_journal_id
      and j.gl_journal_id = 'FBEA79CB185A43AEB01844832FD05D78'

Verify that header curreny is 238 (AED) same as line currency 238 (AED).
This is correct.

Try to post it. An error is shown saying "Document currency cannot be converted to the Accounting Schema currency".

Go to conversion rates window and enter below conversions valid from 01-03-2016 to 31-03-2016:

AED to EUR 0.512821
EUR to AED 1.95
AED to USD 0.75
USD to AED 1.33333

Go back to the Simple G/L Journal and post it.

Verify below posting is shown:

F&B International Group US Dollar General Ledger:
DEBIT 75.00 (100.00 AED * 0.75)
CREDIT 75.00 (100.00 AED * 0.75)

F&B España EUR General Ledger:
DEBIT 51.28 (100.00 AED * 0.512821)
CREDIT 51.28 (100.00 AED * 0.512821)


Scenario 2 - Simple G/L Journal.

Create a Simple G/L Journal header.
Check that you have below detailed information:

Organization = F&B España
General Ledger = change to F&B España Euro
Description (empty). Enter a description such as "Test Issue Currency"
Save. Check that the currency shown is EUR.

Change the currency to GIP for instance and save.

Check that a conversion rates warning is shown. Enter a rate = 0.75. Save

Add a line to it by selecting an account. Enter a Debit amount = 100
Create another line and select another GL Item. Enter a Credit amount = 100
Complete.

Run this SQL query by adding GL Journal record id

select j.documentno, j.c_currency_id, jl.c_currency_id
      from gl_journal j, gl_journalline jl
      where j.gl_journal_id = jl.gl_journal_id
      and j.gl_journal_id = '8C89808096DB4385BF7EA6B57DC2CF8D'

Verify that header curreny is 166 (GIP) same as line currency 166 (GIP).
This is correct.

Try to post it. An error is shown saying "Document currency cannot be converted to the Accounting Schema currency".

This is not correct because there is a rate entered in the header of the Simple G/L Journal. See issue = 32564

Workaround is:

Go to conversion rates window and enter below conversions valid from 01-03-2016 to 31-03-2016:

GIP to EUR 2.5
EUR to GIP 0.4

Go back to the Simple G/L Journal and post it.

Verify below posting is shown:

F&B España EUR General Ledger:
DEBIT 51.28 (100.00 GIP * 0.75)
CREDIT 51.28 (100.00 GIP * 0.75)

Conversion rate set in the header of Simple G/L Journal is used.

Scenario 3 and 4 - repeat scenarios 1 and 2 for G/L Journal.

(0085356)
psanjuan   
2016-03-31 12:51   
Test Plan above verified.

Issue can be code reviewed and closed.
(0085421)
hgbot   
2016-04-04 19:11   
Repository: erp/devel/pi
Changeset: 571e53e91071fba9a14e45bd7855249f2092e4c7
Author: Sanjota <sanjota.nelagi <at> promantia.com>
Date: Mon Mar 28 16:16:15 2016 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/571e53e91071fba9a14e45bd7855249f2092e4c7 [^]

Fixes issue 32440: Same currency in Simple G/L Journal header and lines

---
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0085422)
aferraz   
2016-04-04 19:11   
Code review OK
(0087416)
hudsonbot   
2016-06-17 19:36   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/0dc7be081b1c [^]
Maturity status: Test