Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0031354Openbravo ERP03. Procurement managementpublic2015-11-04 13:042016-03-17 10:56
maite 
vmromanos 
urgentmajoralways
closedfixed 
5
 
 
dmiguelez
Core
No
0031354: Wrong amtsourcedr and amtsourcecr when posting a Matched Invoice document
Wrong amtsourcedr and amtsourcecr when posting a Matched Invoice document
1. Register Purchase Order for España organization. Add line for any product and complete
2. Register Goods Receipt for España organization. Run "Create lines from" process and select previous order. Process receipt
3. Register Purchase Invoice for España organziation. Run "Create lines from" process and select previous receipt. Process invoice
4. Post goods receipt, access "Accounting transaction details" window and review accounting for "F&B International Group US/A/US Dollar" ledger: realize that debit <> foreign debit and credit <> foreign credit
5. Post purchase invoice, access "Accounting transaction details" window and review accounting for "F&B International Group US/A/US Dollar" ledger: realize that debit <> foreign debit and credit <> foreign credit
6. Post matched invoice, access "Accounting transaction details" window and review accounting for "F&B International Group US/A/US Dollar" ledger: realize that debit = foreign debit and credit = foreign credit (when it should be different as costing currency is different from ledger's currency)
costCurrency.getId() should be used instead of as.m_C_Currency_ID, when "createline" method in invoked from DocMatchInv.java
No tags attached.
related to defect 0023066 closed eduardo_Argal Matched Invoices accounting not using breakdown information 
related to defect 00218893.0MP18 closed ioritzCia The exchange rate defined on an invoice is not taken into account when posting the Matched Invoice 
related to design defect 0031549 new Triage Omni OMS Matched Invoices processing is not properly managing multi-currency feature. 
diff 31354_OK.diff (8,880) 2015-11-20 10:52
https://issues.openbravo.com/file_download.php?file_id=8753&type=bug
Issue History
2015-11-04 13:04maiteNew Issue
2015-11-04 13:04maiteAssigned To => Triage Finance
2015-11-04 13:04maiteModules => Core
2015-11-04 13:04maiteResolution time => 1449529200
2015-11-04 13:04maiteTriggers an Emergency Pack => No
2015-11-04 13:04maiteIssue Monitored: networkb
2015-11-16 12:42vmromanosRelationship addedrelated to 0023066
2015-11-16 12:47vmromanosRelationship addedrelated to 0021889
2015-11-17 08:16AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2015-11-17 08:16AtulOpenbravoStatusnew => scheduled
2015-11-17 09:13vmromanosAssigned ToAtulOpenbravo => vmromanos
2015-11-17 13:14vmromanosNote Added: 0081921
2015-11-20 10:52vmromanosFile Added: 31354_OK.diff
2015-11-20 12:11psanjuanNote Added: 0082020
2015-11-20 12:22psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10298
2015-11-20 12:27psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10299
2015-11-20 12:31psanjuanNote Edited: 0082020bug_revision_view_page.php?bugnote_id=0082020#r10301
2015-11-20 12:32psanjuanNote Edited: 0082020bug_revision_view_page.php?bugnote_id=0082020#r10302
2015-11-20 12:34psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10303
2015-11-20 12:49psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10310
2015-11-20 12:52psanjuanNote Added: 0082025
2015-11-20 12:55psanjuanRelationship addedrelated to 0031549
2015-11-20 12:57psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10311
2015-11-20 13:04psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10314
2015-11-20 13:08psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10315
2015-11-20 13:14psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r10316
2015-11-20 13:14psanjuanNote Edited: 0082025bug_revision_view_page.php?bugnote_id=0082025#r10318
2015-12-30 11:01vmromanosTarget Version3.0PR16Q1 =>
2016-02-12 10:04hgbotCheckin
2016-02-12 10:04hgbotNote Added: 0084142
2016-02-12 10:04hgbotStatusscheduled => resolved
2016-02-12 10:04hgbotResolutionopen => fixed
2016-02-12 10:04hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/ca914539af5d4292e2e136714a123cd2c85e1198 [^]
2016-02-12 10:04hgbotCheckin
2016-02-12 10:04hgbotNote Added: 0084143
2016-02-12 10:04hgbotCheckin
2016-02-12 10:04hgbotNote Added: 0084144
2016-02-12 14:51psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r11123
2016-02-12 15:03psanjuanNote Edited: 0081921bug_revision_view_page.php?bugnote_id=0081921#r11128
2016-02-12 15:37psanjuanNote Added: 0084166
2016-02-15 18:20dmiguelezReview Assigned To => dmiguelez
2016-02-15 18:20dmiguelezNote Added: 0084214
2016-02-15 18:20dmiguelezStatusresolved => closed
2016-02-15 18:51hgbotCheckin
2016-02-15 18:51hgbotNote Added: 0084215
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085132
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085133
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085134
2016-03-17 10:56hudsonbotCheckin
2016-03-17 10:56hudsonbotNote Added: 0085138

Notes
(0081921)
vmromanos   
2015-11-17 13:14   
(edited on: 2016-02-12 15:03)
Preconfiguration:
 Login as Openbravo Admin
 Go to Product window. Search for Cerveza Ale 0,5
  Go to tab Accounting
  Set Invoice Price Variance = 5610 for Acct. schema US Dollar
 Save it


Test plan I (basic scenario):
 Login as Openbravo Admin
 Create a purchase order for today. Business Partner: Bebidas Alegres. Product: Cerveza Ale 0,5. Quantity: 100. Book it
 Create a goods receipt for today for the previous order. Complete it and post it after running costing background process.
 Create a purchase invoice for today for the previous goods receipt. Complete it and post it.
 Go to Match Invoices window and search for the newly created record. Post it (you may need to wait until background process calculates the cost)
 Verify Journal entries report is:
   2120: Debit = 87.18, Credit = 0
   5360: Debit = 0 , Credit = 87.18
 Open Accounting Transaction Details window. Show columns: creation date, currency, foreign currency debit, foreign currency credit.
 Order records by created desc.
 Verify 2 records for the Match invoice document, F&B International Group US Dollar General Ledger, have EUR as currency, 87.18 USD as debit/credit (accounting schema currency) and 136.00 € as Foreign currency debit/credit (document currency)

Test plan II (different conversion rates):
Important: the conversion rate from EUR to USD is different in July (0.689655) and Nov (0.641026). months, so there is a Currency balancing when posting.
 Login as Openbravo Admin
 Create a purchase order for 7/7/2015. Business Partner: Bebidas Alegres. Product: Cerveza Ale 0,5. Quantity: 100. Book it
 Create a goods receipt for 7/7/2015 for the previous order. Complete it
 Create a purchase invoice for 11/11/2015 for the previous goods receipt. Complete it
 Go to Match Invoices window and search for the newly created record. Post it (you may need to wait until background process calculates the cost)
 Verify Journal entries report is:
   2120: Debit = 93.79, Credit = 0
   5360: Debit = 0 , Credit = 87.18
   5610: Debit = 0 , Credit = 6.61
 Open Accounting Transaction Details window. Show columns: creation date, currency, foreign currency debit, foreign currency credit.
 Order records by created desc.
 Verify 2 recors for the Match invoice document has EUR as currency, 87.18 as credit, 93.79 as debit and 136.00 as Foreign currency debit/credit.
 Verify there is another record with USD as currency and 6.61 in the credit


Test plan III (price variants):
 Login as Openbravo Admin
 Create a purchase order for today. Business Partner: Bebidas Alegres. Product: Cerveza Ale 0,5. Quantity: 100. Book it
 Create a goods receipt for today for the previous order. Complete it
 Create a purchase invoice for today for the previous goods receipt. Select the line and change the unit price to 1.35 (-0.01). Complete it
Make sure that your product has properly setup an "Invoice Price Variance" account for both general ledger.
 Go to Match Invoices window and search for the newly created record. Post it (you may need to wait until background process calculates the cost)
 Verify Journal entries report is:
   2120: Debit = 87.18, Credit = 0
   5360: Debit = 0 , Credit = 86.54
   5610: Debit = 0 , Credit = 0.64
 Open Accounting Transaction Details window. Show columns: creation date, currency, foreign currency debit, foreign currency credit.
 Order records by created desc.
 Verify 3 records have EUR as currency.
 Verify foreign credit amount are 135.00 (expense) and 1.00 (price variant).
 Verify foreign debit amount is 136.00

(0082020)
psanjuan   
2015-11-20 12:11   
(edited on: 2015-11-20 12:32)
Issue verified. Matched Invoices posting does not properly manage foreign currency debit/credit columns as well as debit/credit columns as it is showing in both type of columns the same amount based on the accounting schema currency.

Document currency is not taken into account in foreign currency debit/credit columns.

(0082025)
psanjuan   
2015-11-20 12:52   
(edited on: 2015-11-20 13:14)
Test plan above verified. Now document currency is taken into account in foreign currency debit/credit columns.

However, while testing this issue we have realized that multi-currency feature is not properly implemented in "Matched Invoices" window, but that is a different issue. See issue related: 31549 (Design Defect).

This issue can be code reviewed and closed.

(0084142)
hgbot   
2016-02-12 10:04   
Repository: erp/devel/pi
Changeset: ca914539af5d4292e2e136714a123cd2c85e1198
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Nov 17 17:32:11 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/ca914539af5d4292e2e136714a123cd2c85e1198 [^]

Fixed bug 31354: Wrong amtsourcedr and amtsourcecr when posting Matched Invoice

The cost is always calculated and posted in the organization's currency.
The expense is calculated and posted in the invoice's currency.

The conversion date from the cost currency to the acct. schema currency uses the shipment accounting date.
The conversion date from the invoice currency to the acct. schema currency uses the invoice accounting date.

The difference for the price variant is calculated and posted in the cost currency.

In case there is a difference in the conversion rate between the order and the invoice, the usual currency balance entry is automatically created

---
M src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java
---
(0084143)
hgbot   
2016-02-12 10:04   
Repository: erp/devel/pi
Changeset: 588f8a97fd4dc2894077c6205482d63adfb21b02
Author: Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
Date: Tue Feb 09 12:46:23 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/588f8a97fd4dc2894077c6205482d63adfb21b02 [^]

Related to issue 31354: Difference for price variant calculation

The difference for price variants is now calculated and posted in the Acct. Schema currency as it was originally done

---
M src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java
---
(0084144)
hgbot   
2016-02-12 10:04   
Repository: erp/devel/pi
Changeset: c4a8d69297b16a97be9d0a5b1dcd9a480e71b1ff
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Feb 11 09:50:00 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c4a8d69297b16a97be9d0a5b1dcd9a480e71b1ff [^]

Related to issue 31354: Adapt TestCosting

Fix foreign currency debit, foreign currency credit and currency checks for ReceiptInvoiceMatch document in assertDocumentPost method in testCostingMC444 and testCostingMC445 tests.

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
---
(0084166)
psanjuan   
2016-02-12 15:37   
Test Plan above verified.
(0084214)
dmiguelez   
2016-02-15 18:20   
Code Review + Testing Ok
(0084215)
hgbot   
2016-02-15 18:51   
Repository: erp/devel/pi
Changeset: 32f1e93479b483a51271b82b5414f37de0c7d12b
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Mon Feb 15 18:51:09 2016 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/32f1e93479b483a51271b82b5414f37de0c7d12b [^]

Related to Issue 31354. Updates copyright Issue.

---
M src-test/src/org/openbravo/test/costing/TestCosting.java
M src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java
---
(0085132)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test
(0085133)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test
(0085134)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test
(0085138)
hudsonbot   
2016-03-17 10:56   
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/b22fb0500156 [^]
Maturity status: Test