Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0033494Openbravo ERP03. Procurement managementpublic2016-07-18 17:332016-08-11 18:40
maite 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q4 
aferraz
Core
No
0033494: Wrong Matched Invoice accounting entry when voiding invoice and related receipt and having several lines of same product
"Invoice price variance" account is used when no difference between cost and price has been registered
0. Define Conversion rate beween EUR and USD and rate=1
1. Register Purchase Order for Bebidas Alegres. Add line for "Cerveza Ale" and any qty. Add another line for "Cerveza Ale" and different qty and process
2. Register Goods Receipt for same vendor. Run "Create lines from" process, select both lines, set bin and process
3. Access Process Request window and "Run immediately" the Costing Background process
4. Post goods receipt
5. Register Purchase invoice for same vendor. Run "Create lines from" process, select previous order. Process and Post invoice
6. Access Matched Invoice window, filter by shipment/invoice and post both register. Realize that accounting entry is correct and no price variance is detected
7. Access previous invoice and run VOID process.
8. Access Matched Invoice window, filter by new reversed invoice and post both register. Realize that accounting entry is correct and no price variance is detected
9. Access previous goods receipt and run VOID process
10. Access Process Request window and "Run immediately" the Costing Background process
11. Access Matched Invoice window, filter by new reversed receipt and original invoice (matched document with negative qty). Post both register and realize that accounting entry is using Invoice price variance account when it should not
No tags attached.
Issue History
2016-07-18 17:33maiteNew Issue
2016-07-18 17:33maiteAssigned To => Triage Finance
2016-07-18 17:33maiteModules => Core
2016-07-18 17:33maiteResolution time => 1469829600
2016-07-18 17:33maiteTriggers an Emergency Pack => No
2016-07-18 17:33maiteIssue Monitored: networkb
2016-07-18 17:42aferrazAssigned ToTriage Finance => markmm82
2016-07-19 13:47psanjuanNote Added: 0088582
2016-07-19 13:52psanjuanNote Edited: 0088582bug_revision_view_page.php?bugnote_id=0088582#r12674
2016-07-19 14:00psanjuanNote Edited: 0088582bug_revision_view_page.php?bugnote_id=0088582#r12675
2016-07-19 14:08psanjuanNote Edited: 0088582bug_revision_view_page.php?bugnote_id=0088582#r12676
2016-07-19 14:10psanjuanNote Edited: 0088582bug_revision_view_page.php?bugnote_id=0088582#r12677
2016-07-19 14:11psanjuanNote Edited: 0088582bug_revision_view_page.php?bugnote_id=0088582#r12678
2016-07-19 17:54markmm82Statusnew => scheduled
2016-07-22 12:42psanjuanNote Added: 0088633
2016-07-22 13:00psanjuanNote Edited: 0088633bug_revision_view_page.php?bugnote_id=0088633#r12735
2016-07-22 13:27psanjuanNote Edited: 0088633bug_revision_view_page.php?bugnote_id=0088633#r12736
2016-07-22 13:27psanjuanNote Added: 0088638
2016-07-22 13:39hgbotCheckin
2016-07-22 13:39hgbotNote Added: 0088640
2016-07-22 13:39hgbotStatusscheduled => resolved
2016-07-22 13:39hgbotResolutionopen => fixed
2016-07-22 13:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c1dff2b0991a25ba6e15d49ddd6d335ceb84e688 [^]
2016-07-22 13:40aferrazReview Assigned To => aferraz
2016-07-22 13:40aferrazNote Added: 0088641
2016-07-22 13:40aferrazStatusresolved => closed
2016-07-22 13:40aferrazFixed in Version => 3.0PR16Q4
2016-08-11 18:40hudsonbotCheckin
2016-08-11 18:40hudsonbotNote Added: 0089025

Notes
(0088582)
psanjuan   
2016-07-19 13:47   
(edited on: 2016-07-19 14:11)
Step by Step process to reproduce the issue:

1 - Go to purchase order window and create a new one for F&B España, Bebidas Alegres BP.
- Go to lines and select Cerveza Ale 5L product. Ordered Quantity = 100
- Book the order.
- Check that Total Net Amount = 136.00 and Total Gross Amount = 164.56
- Take note of PO number (ie. 1000189)

2 - Go to Goods Receipt window and create a new one for F&B España, Bebidas Alegres BP.
- Use Create Lines From option. Select the order 189 above. Enter an Storage Bin. 100 units of the product are being receipt.
- Complete it.
- Run costing background process.
- Post the receipt.
- Take note of the number of the receipt (i.e. 10000354).
- Check that receipt posting looks like (just for Euro General Ledger):
136.00 (35000) DEBIT
136.00 (40090) CREDIT

3 - Go to Purchase Invoice window and create a new one for F&B España, Bebidas Alegres BP.
- Use Create Lines From option. Select the receipt 354 above.
- Complete and Post the invoice.
- Take note of the number of the invoice (i.e. 10000895).
- Check that invoice posting looks like (just for Euro General Ledger):
136.00 (60000) DEBIT
28.56 (47200) DEBIT
164.56 (40000) CREDIT

4- Go to Matched Invoice window.
- Check that a new record has been created with todays' date for Cerveza Ale 5L product (+100 units) that relates Invoice 895 and Goods Receipt 354. Post it.
- Check that matched invoice posting looks like (just for Euro General Ledger):
136.00 (40900) DEBIT
136.00 (60000) CREDIT

5- Go to Purchase Invoice window and search invoice 859. Void it.
- Navigate to the new purchase voided purchase invoice create.
- Take note of the voided invoice number (i.e. 1000016)
- Post it.
- Check that invoice posting looks like (just for Euro General Ledger):
164.56 (40000) DEBIT
136.00 (60000) CREDIT
28.56 (47200) CREDIT

6- Go to Matched Invoice window.
- Check that a new record has been created with todays' date for Cerveza Ale 5L product (-100 units) that relates Invoice 16 (voided) and Goods Receipt 354. Post it.
- Check that matched invoice posting looks like (just for Euro General Ledger):
136.00 (60000) DEBIT
136.00 (40900) CREDIT


7- Go to Goods Receipt window and search receipt 354. Void it.
- Navigate to the new goods receipt created for -100 units.
- Take note of the voided receipt number (i.e. 1000355)
- Run Costing Background Process
- Post the new receipt.
- Check that receipt posting looks like (just for Euro General Ledger):
136.00 (40090) DEBIT
136.00 (35000) CREDIT

8- Finally go to Matched Invoice window.
- Check that two new records have been created with todays' date for Cerveza Ale 0.5L product.
- First one relates Voided Invoice 16 (-100 units) and Voided Receipt 355 (-100). Check that Quantity shown in this matched invoice record is +100 units. Post it.
- Check that matched invoice posting looks like (just for Euro General Ledger):
136.00 (40090) DEBIT
136.00 (60000) CREDIT

- Second one relates Invoice 895 (+100 units) and Voided Receipt 355 (-100). Check that Quantity shown in this matched invoice record is -100 units. Post it.
- Check that matched invoice posting looks like (just for Euro General Ledger):
272.00 (99904) "Product Invoice Price Difference account" DEBIT
136.00 (40090) CREDIT
136.00 (60000) CREDIT

(*) this last posting is not correct as it should be:
136.00 (60000) DEBIT
136.00 (40090) CREDIT

(0088633)
psanjuan   
2016-07-22 12:42   
(edited on: 2016-07-22 13:27)
Test plan above verified.

Besides the above also tested:

- Repeat same test as above but creation of the Purchase Invoice by selecting purchase order (instead of receipt). Check posting is correct. OK

- Repeat same test as above but including more than one line in the purchase order, therefore in the goods receipt and purchase invoice. In that case there will be two matched invoice records. Check posting is correct. OK

- Repeat same test as above but creating three partial goods receipt of a two lines purchase order, two of them included in a purchase invoice and third one included in a second invoice. Void the two invoices and the three goods receipt. Check posting is correct. OK

(0088638)
psanjuan   
2016-07-22 13:27   
Functional review OK. Issue can be code reviewed and closed.
(0088640)
hgbot   
2016-07-22 13:39   
Repository: erp/devel/pi
Changeset: c1dff2b0991a25ba6e15d49ddd6d335ceb84e688
Author: Mark <markmm82 <at> gmail.com>
Date: Wed Jul 20 10:51:23 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/c1dff2b0991a25ba6e15d49ddd6d335ceb84e688 [^]

Fixes issue 33494: Wrong Matched Invoice accounting entry when voiding invoice

"Invoice price variance" account was used because an incorrect way of calculate the expenses, multiplying by -1 was generating differences and accounting unbalances.

---
M src/org/openbravo/erpCommon/ad_forms/DocMatchInv.java
---
(0088641)
aferraz   
2016-07-22 13:40   
Code review OK
(0089025)
hudsonbot   
2016-08-11 18:40   
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/edaa05b1fb18 [^]
Maturity status: Test