Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035029Openbravo ERPZ. Otherspublic2017-01-23 10:552017-03-17 02:25
maite 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q2 
markmm82
Advanced Payables and Receivables Mngmt
No
0035029: Wrong Reverse Payment accounting entry when referring an invoice declared as doubtful debt
An invoice declared as doubtful debt can lately be paid. Accounting entry of this payment is properly posted according with documentation: http://wiki.openbravo.com/wiki/Doubtful_Debt [^]
But in case this payment is reversed, accounting entry of reversed payment is not undoing previous posting
1. Register Sales Invoice for any org and bp. Set invoice date in November and payment term=30 days. Add any line and process. Post invoice
2. Create Doubtful Debt Run for same org, bp, today's date and days overdue=30. Run "select doubtful debt" and select previous invoice. Process document
3. Access Doubtful Debt window and post document
4. Access previous Sales Invoice and run "Add payment" process to completely pay invoice. Post created payment and realize that accounting entry is the expected one, according with: http://wiki.openbravo.com/wiki/Doubtful_Debt [^]
5. Run "Reverse Payment" process (should be previously enabled: http://wiki.openbravo.com/wiki/Projects:Reversepayment/User_Manual [^]), access reversed payment created and post it. Realize that accounting entry is not reverting effect of previous entry
No tags attached.
Issue History
2017-01-23 10:55maiteNew Issue
2017-01-23 10:55maiteAssigned To => Triage Finance
2017-01-23 10:55maiteModules => Advanced Payables and Receivables Mngmt
2017-01-23 10:55maiteTriggers an Emergency Pack => No
2017-01-23 10:55maiteIssue Monitored: networkb
2017-01-23 10:56maiteResolution time => 1486940400
2017-01-24 15:42markmm82Assigned ToTriage Finance => collazoandy4
2017-01-31 15:05markmm82Assigned Tocollazoandy4 => Sanjota
2017-02-06 13:42SanjotaStatusnew => scheduled
2017-02-23 16:41markmm82Assigned ToSanjota => AtulOpenbravo
2017-03-08 14:41AtulOpenbravoNote Added: 0094835
2017-03-15 13:48psanjuanNote Added: 0095032
2017-03-15 13:55psanjuanNote Added: 0095033
2017-03-15 14:01psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14802
2017-03-15 14:02psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14803
2017-03-15 14:04psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14804
2017-03-15 14:04psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14805
2017-03-16 12:23psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14816
2017-03-16 12:26psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14817
2017-03-16 12:27psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14818
2017-03-16 12:27psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14819
2017-03-16 12:29psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14820
2017-03-16 12:29psanjuanNote Edited: 0095032bug_revision_view_page.php?bugnote_id=0095032#r14822
2017-03-16 12:29psanjuanNote Edited: 0095032bug_revision_view_page.php?bugnote_id=0095032#r14823
2017-03-16 13:14psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14824
2017-03-16 13:15psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14825
2017-03-16 13:25psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14826
2017-03-16 13:26psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14827
2017-03-16 13:27psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14828
2017-03-16 13:39psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14829
2017-03-16 13:41psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14830
2017-03-16 13:42psanjuanNote Added: 0095321
2017-03-16 15:38psanjuanNote Edited: 0095033bug_revision_view_page.php?bugnote_id=0095033#r14835
2017-03-16 15:44psanjuanNote Edited: 0095321bug_revision_view_page.php?bugnote_id=0095321#r14837
2017-03-16 15:54psanjuanNote Added: 0095327
2017-03-16 16:00psanjuanNote Edited: 0095327bug_revision_view_page.php?bugnote_id=0095327#r14839
2017-03-16 16:01psanjuanNote Added: 0095328
2017-03-16 19:47hgbotCheckin
2017-03-16 19:47hgbotNote Added: 0095342
2017-03-16 19:47hgbotStatusscheduled => resolved
2017-03-16 19:47hgbotResolutionopen => fixed
2017-03-16 19:47hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/32d462335fc9fe926a69325edfbcdadfcdce38fe [^]
2017-03-16 19:47markmm82Review Assigned To => markmm82
2017-03-16 19:47markmm82Note Added: 0095343
2017-03-16 19:47markmm82Statusresolved => closed
2017-03-16 19:47markmm82Fixed in Version => 3.0PR17Q2
2017-03-17 02:25hudsonbotCheckin
2017-03-17 02:25hudsonbotNote Added: 0095350

Notes
(0094835)
AtulOpenbravo   
2017-03-08 14:41   
Test Plan

1. Register Sales Invoice for any org and bp. Set invoice date in November and payment term=30 days. Add any line and process. Post invoice
2. Create Doubtful Debt Run for same org, bp, today's date and days overdue=30. Run "select doubtful debt" and select previous invoice. Process document
3. Access Doubtful Debt window and post document
4. Access previous Sales Invoice and run "Add payment" process to completely pay invoice. Post created payment and realize that accounting entry is the expected one, according with: http://wiki.openbravo.com/wiki/Doubtful_Debt [^] [^]
5. Run "Reverse Payment" process (should be previously enabled: http://wiki.openbravo.com/wiki/Projects:Reversepayment/User_Manual [^] [^]), access reversed payment created and post it. Check that accounting entry is reverting effect of previous entry

Tested above flow when

1. Payment In Posting enabled - Payment Method in Financial Account has "Upon Receipt Use" configuration set as "In Transit Payment Account"

2. Payment In Posting disabled - Payment Method in Financial Account has "Upon Receipt Use" configuration set as blank and "Upon Deposit Use Account" set as "Deposited Payment Account". In this case testing is done by posting related Financial Account Transaction.
(0095032)
psanjuan   
2017-03-15 13:48   
(edited on: 2017-03-16 12:29)
Issue verified as described below:

As system admin go to windows, tabs and fields and display "Reverse Payment" field. Compile the window as explained here: http://wiki.openbravo.com/wiki/Projects:Reversepayment/User_Manual [^]

Go to Doubtful Deb Method and create a new one with below setup:

Days Overdue = 30

In F&B España. Go to Business Partner Category and make sure you configure below accounts for the two general ledgers:

Doubtful Debt Account
Bad Debt Expense
Bad Debt Revenue
Allowance for doubtful debt account

Go to business partner and create a new one for F&B España, named for instance "Cliente Dudoso Cobro". Make sure you enter 30 days payment terms, and Transferecia payment method.

Go to Financial Account Cuenta de Banco and make sure that Transferencia payment method is configured to account in Upon Receipt Use (In Transit payment account), and Automatic Withdrawal = No.

Go to Sales Invoice window and create a new one for the new bp, dated on 22-11-2016, enter any product. Complete and post the invoice.

Below posting is shown:
901.45 (43000) Account Receivables DEBIT
750.00 (70000) Product Revenue CREDIT
156.45 (47000) Sales VAT CREDIT

Go to Doutbful Debt Run and create a new one by selecting doutful deb method just created. Press Select Doubtful Debt and select the invoice just created.
Press Done and process.

Go to Doubtful Debt window, select the record just created and post it.Check that below posting is shown:

901.45 (43600) Doubtful Debt DEBIT
901.45 (43000) Accounts Receivable CREDIT
901.45 (65000) Bad debt Expense Account DEBIT
901.45 (62500) Allowance for doubtful debt account CREDIT

Go to the sales invoice dated on November 2016 and fully pay it, dated on current's date. Process the payment, do not deposit it.

Go to payment in window and post the payment. Verify below posting is shown:

901.45 (55500) Payment In Account DEBIT
901.45 (43600) Doubtful Debt CREDIT
901.45 (62500) Allowance for doubtful debt account DEBIT
901.45 (79549) Bad Debt Revenue CREDIT

Go to the payment in created and reverse it. Verify below posting is shown for the reverse payment created, which is NOT correct as it does not reverse doubtful debt.

901.45 (62500) Allowance for doubtful debt account DEBIT
901.45 (79549) Bad Debt Revenue CREDIT


901.45 (43600) Doubtful Debt DEBIT
901.45 (55500) Payment In Account DEBIT
1802.90 (43000) Accounts Receivable CREDIT

(0095033)
psanjuan   
2017-03-15 13:55   
(edited on: 2017-03-16 15:38)
Test case 1 - Doubtful Debt sales invoice fully paid. Payment in posting.

Go to Sales Invoice window and create a new one for the new bp, dated on 23-11-2016, enter any product. Complete and post the invoice.

Below posting is shown:
209.81 (43000) Account Receivables DEBIT
173.40 (70000) Product Revenue CREDIT
36.41 (47000) Sales VAT CREDIT

Go to Doutbful Debt Run and create a new one by selecting doutful deb method just created. Press Select Doubtful Debt and select the invoice just created.
Press Done and process.

Go to Doubtful Debt window, select the record just created and post it. Check that below posting is shown:

209.81 (43600) Doubtful Debt DEBIT
209.81 (43000) Accounts Receivable CREDIT

209.81 (65000) Bad debt Expense Account DEBIT
209.81 (62500) Allowance for doubtful debt account CREDIT

Go to the sales invoice dated on November 2016 and fully pay it, dated on current's date. Process the payment, do not deposit it.

Go to payment in window and post the payment. Verify below posting is shown:

209.81 (55500) Payment In Account DEBIT
209.81 (43600) Doubtful Debt CREDIT

209.81 (62500) Allowance for doubtful debt account DEBIT
209.81 (79549) Bad Debt Revenue CREDIT

Go to the payment in created and reverse it. Verify below posting is shown for the reverse payment created, which is correct.

209.81 (43600) Doubtful Debt DEBIT
209.81 (55500) Payment In Account CREDIT

209.81 (79549) Bad Debt Revenue DEBIT
209.81 (62500) Allowance for doubtful debt account CREDIT

Test Case 2 - Doubtful Debt sales invoice fully paid. FA transaction posting.

Repeat same test case as above but posting the financial account transaction once reverse payment has been deposited.

Transaction posting is:

209.81 (57200) Payment In Account DEBIT
209.81 (43600) Doubtful Debt CREDIT

209.81 (62500) Allowance for doubtful debt account DEBIT
209.81 (79549) Bad Debt Revenue CREDIT

Reverse payment transaction posting is:

209.81 (43600) Doubtful Debt DEBIT
209.81 (57200) Payment In Account CREDIT

209.81 (79549) Bad Debt Revenue DEBIT
209.81 (62500) Allowance for doubtful debt account CREDIT

(0095321)
psanjuan   
2017-03-16 13:42   
(edited on: 2017-03-16 15:44)
Test case 3 - Doubtfull Debt sales invoice partially paid. Payment in posting.

Go to Sales Invoice window and create a new one for the new bp, dated on 27-11-2016, enter any product. Complete and post the invoice.

Below posting is shown:
180.29 (43000) Account Receivables DEBIT
149.00(70000) Product Revenue CREDIT
31.29 (47000) Sales VAT CREDIT

Go to Doutbful Debt Run and create a new one by selecting doutful deb method just created. Press Select Doubtful Debt and select the invoice just created.
Press Done and process.

Go to Doubtful Debt window, select the record just created and post it. Check that below posting is shown:

180.29 (43600) Doubtful Debt DEBIT
180.29 (43000) Accounts Receivable CREDIT

180.29 (65000) Bad debt Expense Account DEBIT
180.29 (62500) Allowance for doubtful debt account CREDIT

Go to the sales invoice dated on November 2016 and pay 100.00, dated on current's date. Process the payment, do not deposit it.

Go to payment in window and post the payment. Verify below posting is shown:

100.00 (55500) Payment In Account DEBIT
100.00 (43600) Doubtful Debt CREDIT

100.00 (62500) Allowance for doubtful debt account DEBIT
100.00 (79549) Bad Debt Revenue CREDIT

Go to the payment in created and reverse it. Verify below posting is shown for the reverse payment created, which is correct.

100.00 (43600) Doubtful Debt DEBIT
100.00 (55500) Payment In Account CREDIT

100.00 (79549) Bad Debt Revenue DEBIT
100.00 (62500) Allowance for doubtful debt account CREDIT

Test Case 4 - Doubtfull Debt sales invoice partially paid. FA transaction posting.

Repeat same test case as above but posting the financial account transaction once reverse payment has been deposited.

Transaction posting is:

100.00 (57200) Payment In Account DEBIT
100.00 (43600) Doubtful Debt CREDIT

100.00 (62500) Allowance for doubtful debt account DEBIT
100.00 (79549) Bad Debt Revenue CREDIT

Reverse payment transaction posting is:

100.00 (43600) Doubtful Debt DEBIT
100.00 (57200) Payment In Account CREDIT

100.00 (79549) Bad Debt Revenue DEBIT
100.00 (62500) Allowance for doubtful debt account CREDIT

(0095327)
psanjuan   
2017-03-16 15:54   
(edited on: 2017-03-16 16:00)
Test Case 5 - Sales Invoice fully paid and payment reversed.

Go to Sales Invoice window and create a new invoice for Alimentos y Supermercados business partner. Pay it.

Go to payment in window and post the payment. Reverse that payment. Post reversed payment and check that payment accounting entries are reversed.

Test Case 6 - Sales Invoice partially paid and payment reversed.

Go to Sales Invoice window and create a new invoice for Alimentos y Supermercados business partner. Pay it partially.

Go to payment in window and post the payment. Reverse that payment. Post reversed payment and check that payment accounting entries are reversed.

(0095328)
psanjuan   
2017-03-16 16:01   
Test plan above verified.

Issue can be code reviewed and closed.
(0095342)
hgbot   
2017-03-16 19:47   
Repository: erp/devel/pi
Changeset: 32d462335fc9fe926a69325edfbcdadfcdce38fe
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Wed Mar 08 19:17:53 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/32d462335fc9fe926a69325edfbcdadfcdce38fe [^]

Fixes Issue 35029:Wrong Reverse Payment accounting
entry when referring an invoice declared as doubtful debt

When payment is reversed the doubtfuldebtamount is not set in the
fin payment schedule detail being created for reversed payment.
Now it is correctly set as negative value of doubtfuldebt
amount of the fin payment schedule detail of the payment being
reversed.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0095343)
markmm82   
2017-03-16 19:47   
Code review + Testing OK
(0095350)
hudsonbot   
2017-03-17 02:25   
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/d8d787cce2bb [^]
Maturity status: Test