Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0012539Openbravo ERP09. Financial managementpublic2010-03-03 13:132010-04-10 00:00
networkb 
eduardo_Argal 
immediatemajoralways
closedfixed 
5
2.50MP10 
2.50MP14 
Core
No
0012539: DocPayment.java has no references to currency convert
DocPayment.java has no references to currency convert

Talked to EAR
1.-Create a manual settlement and payment (not direct posting) with foreign currency (distinct that accounting schema currency)
2.-create a bank statement and select the previously created payment as a line.
3.-process bank statement
4.-browse the settlement cancel of the payment and post it


Mind that accounting is wrong
Regression
related to defect 00116522.40MP12 closed eduardo_Argal Error when posting a manual payment with conversion rate 
Issue History
2010-03-03 13:13networkbNew Issue
2010-03-03 13:13networkbAssigned To => dalsasua
2010-03-03 17:02dalsasuaNote Added: 0025017
2010-03-03 17:02dalsasuaStatusnew => feedback
2010-03-08 16:05jpabloaeTarget Version2.50MP13 => 2.50MP14
2010-03-09 13:32azabaletaNote Added: 0025177
2010-03-09 13:34azabaletaNote Added: 0025178
2010-03-09 18:07dalsasuaAssigned Todalsasua => eduardo_Argal
2010-03-09 18:22eduardo_ArgalNote Added: 0025188
2010-03-09 18:22eduardo_ArgalDescription Updatedbug_revision_view_page.php?rev_id=145#r145
2010-03-09 18:22eduardo_ArgalSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=147#r147
2010-03-09 18:23dalsasuaAssigned Toeduardo_Argal => dalsasua
2010-03-09 18:23dalsasuaStatusfeedback => new
2010-03-15 13:40vmromanosStatusnew => scheduled
2010-03-15 13:40vmromanosAssigned Todalsasua => vmromanos
2010-03-15 13:40vmromanosfix_in_branch => pi
2010-03-15 15:54vmromanosRelationship addedrelated to 0011652
2010-03-15 23:50dalsasuaAssigned Tovmromanos => eduardo_Argal
2010-03-16 09:38vmromanosNote Added: 0025525
2010-03-16 11:32hgbotCheckin
2010-03-16 11:32hgbotNote Added: 0025533
2010-03-16 11:32hgbotStatusscheduled => resolved
2010-03-16 11:32hgbotResolutionopen => fixed
2010-03-16 11:32hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/26e1f6aab1c0423a8734a5e1d8832e8778c4f102 [^]
2010-03-17 09:01hudsonbotCheckin
2010-03-17 09:01hudsonbotNote Added: 0025557
2010-03-17 15:40psarobeTag Attached: Regression
2010-03-18 11:29pjuvaraversionpi => 2.50MP10
2010-03-18 11:29pjuvarafix_in_branchpi =>
2010-04-09 13:08arunkumarNote Added: 0026029
2010-04-09 13:08arunkumarStatusresolved => closed
2010-04-10 00:00anonymoussf_bug_id0 => 2984774

Notes
(0025017)
dalsasua   
2010-03-03 17:02   
Hi, please realize that EAR will not be involved in the fixing of this issue. Even we need a proper description and steps to reproduce so QA team can afterwards check the fix.

Thanks.
(0025177)
azabaleta   
2010-03-09 13:32   
David,

in this commit
https://code.openbravo.com/erp/devel/pi/rev/61632464a77e [^]

It seems that somehow some code about currency conversion is gone when cancelling payments that come from manual settlements.

I dont know whether this is a bug or not. I was told to report this issue.

Asier
(0025178)
azabaleta   
2010-03-09 13:34   
1.31 - String amountdebit = getConvertedAmt(data[j].amountdebit, line.C_Currency_ID_From,
    1.32 - C_Currency_ID, DateAcct, "", AD_Client_ID, AD_Org_ID, conn);
    1.33 - String amountcredit = getConvertedAmt(data[j].amountcredit, line.C_Currency_ID_From,
    1.34 - C_Currency_ID, DateAcct, "", AD_Client_ID, AD_Org_ID, conn);
    1.35 + String amountdebit = data[j].amountdebit;
    1.36 + String amountcredit = data[j].amountcredit;
(0025188)
eduardo_Argal   
2010-03-09 18:22   
in this commit
https://code.openbravo.com/erp/devel/pi/rev/61632464a77e [^]
code related to multi-currency for manual settlements disappear.
Rescue code.
(0025525)
vmromanos   
2010-03-16 09:38   
Eduardo, the issue 0011652 seems to be the responsible of this bug.

Please find bellow the concrete steps to reproduce this bug:

1- Create a Currency conversion from USD to EUR for day A (example multiply by 2)
2- Create a Currency conversion from USD to EUR for day B (example multiply by 3)
3- Create a Manual Settlement for day A in USD. Create a Payment in USD and process the Manual Settlement
4- Create a Bank Statement in EUR for day B and associate the previous payment. Post the Banks Statement.
5- Go to the Bank Statement line, click on linked items and navigate to the cancelled settlement.
6- Move to its header and post it. See the accounting enty is wrong

I have been trying to fix it and it's not enough to change the lines Asier proposed.

If you only do that, the line for the account "changes in currency differences" does not appear. The problem seems to be in the new code:

+ // For manual payment with direct posting = 'N' (no posting occurred at payment creation so no
+ // conversion, for currency gain-loss, is needed)
+ String convertedAmt = "";
+ if (line.isManual.equals("Y") && line.IsDirectPosting.equals("N")
+ && line.C_Settlement_Cancel_ID.equals(Record_ID))
+ convertedAmt = line.Amount;
+ else

After removing it, the proper account for differences in currency change appears, but the accounting entry is wrong because it doesn't take into account the proper day for calculating the currency conversion.

Please, could you please fix this issue? I don't want to break the fix of the 0011652 while fixing this one.

Thanks.
(0025533)
hgbot   
2010-03-16 11:32   
Repository: erp/devel/pi
Changeset: 26e1f6aab1c0423a8734a5e1d8832e8778c4f102
Author: Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
Date: Tue Mar 16 11:36:28 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/26e1f6aab1c0423a8734a5e1d8832e8778c4f102 [^]

Fixes bug 0012539: DocPayment.java has no references to currency convert

---
M src/org/openbravo/erpCommon/ad_forms/DocPayment.java
---
(0025557)
hudsonbot   
2010-03-17 09:01   
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/26e1f6aab1c0 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/859b8a1e96e9 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/core/obx/OpenbravoERP-2.50CI.16735.obx [^]
(0026029)
arunkumar   
2010-04-09 13:08   
Tested & working fine