Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0030971Openbravo ERPZ. Otherspublic2015-09-29 18:122015-11-23 21:17
maite 
aferraz 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q1 
dmiguelez
Core
No
0030971: When voiding an unpaid invoice, payment schedule details should be canceled instead of deleted
When an unpaid invoice is voided using "Void" process, reversed invoice is created and both original invoice payment plan and reversed invoice payment plan are deleted so invoices are automatically canceled.

In some cases, this is creating differences between accounting balance and aging balance report (now that it is possible to include voided invoices)
- Install Aging Balance Report module.
- Enable preference "Enable void documents filter in Aging Reports".
1. Access Purchase Invoice window, set today's date, add any line and process invoice.
2. Post invoice
3. Run Payables aging report for tomorrow date and realize that balance match with accounting balance
4. Access previous invoice and run Void process, setting date for the day after tomorrow
5. Post reversed invoice
6. Run Payables aging report for tomorrow date and option "include void invoices" and realize that balance NO match with accounting balance. Problem is that purchase invoices don't have payment plan nor schedule details any more, so they are not considered in the report

Instead of delete schedule details from original and reversed invoice, payment document cancelling these details should be created. Doing that, aging balance and accounting information will match for any date
No tags attached.
related to defect 00317013.0PR16Q1 closed nonofrancisco Openbravo ERP It is not possible to modify order's payment terms when related partial invoice is in Void status 
related to defect 0034322 closed rqueralta Openbravo ERP Payment of 0 amount created when voiding an unpaid invoice is created in Awaiting Execution status 
related to defect 0034385 closed rqueralta Openbravo ERP Payment of 0 amount created when voiding an unpaid invoice should be created with Exchange Rate record from invoice (if any) 
related to defect 0034371 closed alekosmp86 Openbravo ERP Invoice Date and Accounting Date should be truncated when invoice is created using "Void" process 
related to defect 0034992 closed collazoandy4 Openbravo ERP Payment Plan deleted when Voiding an invoice which is prepaid via sales order 
related to defect 0052963 closed jamie_reid Modules Error in remittances and cancellation of invoices 
causes defect 0033339 closed markmm82 Openbravo ERP Error when trying to Void a NOT PAID invoice, logged with * organization 
causes defect 0033550 closed markmm82 Openbravo ERP Cannot void an invoice if the business partner does not have a default financial account defined 
causes defect 00338133.0PR16Q4 closed AtulOpenbravo Openbravo ERP Wrong payment date when voiding an unpaid invoice 
causes defect 0033817 closed AtulOpenbravo Openbravo ERP No error message shown when voiding an invoice and the period is closed for AP Payment and AR Receipt 
Issue History
2015-09-29 18:12maiteNew Issue
2015-09-29 18:12maiteAssigned To => Triage Finance
2015-09-29 18:12maiteModules => Core
2015-09-29 18:12maiteResolution time => 1446332400
2015-09-29 18:12maiteTriggers an Emergency Pack => No
2015-09-29 18:14maiteIssue Monitored: networkb
2015-10-29 19:07AtulOpenbravoAssigned ToTriage Finance => AtulOpenbravo
2015-10-29 19:08AtulOpenbravoStatusnew => scheduled
2015-10-29 19:10AtulOpenbravoSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=9969#r9969
2015-11-02 13:07psanjuanNote Added: 0081435
2015-11-02 13:08psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9983
2015-11-02 13:42psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9985
2015-11-02 13:45psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9986
2015-11-02 13:49psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9987
2015-11-02 13:53psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9988
2015-11-02 13:55psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9989
2015-11-02 14:18psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9990
2015-11-02 14:19psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9991
2015-11-02 14:24psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r9992
2015-11-09 11:55psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10110
2015-11-16 12:54aferrazNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10246
2015-11-16 12:55aferrazNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10247
2015-11-16 13:01aferrazNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10248
2015-11-16 13:10aferrazNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10249
2015-11-16 13:27aferrazAssigned ToAtulOpenbravo => aferraz
2015-11-16 14:19psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10250
2015-11-16 14:36psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10251
2015-11-16 14:45psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10252
2015-11-16 14:46psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10253
2015-11-16 14:51psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10254
2015-11-16 15:11psanjuanNote Edited: 0081435bug_revision_view_page.php?bugnote_id=0081435#r10255
2015-11-19 11:50hgbotCheckin
2015-11-19 11:50hgbotNote Added: 0081980
2015-11-19 11:50hgbotStatusscheduled => resolved
2015-11-19 11:50hgbotResolutionopen => fixed
2015-11-19 11:50hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/336cbe497bec883b0d50b8fc3a248cf3227cfcbb [^]
2015-11-19 11:51dmiguelezReview Assigned To => dmiguelez
2015-11-19 11:51dmiguelezNote Added: 0081981
2015-11-19 11:51dmiguelezStatusresolved => closed
2015-11-23 21:17hudsonbotCheckin
2015-11-23 21:17hudsonbotNote Added: 0082255
2015-12-17 12:05vmromanosRelationship addedrelated to 0031701
2016-06-23 12:09maiteRelationship addedcauses 0033339
2016-07-27 13:50ngarciaRelationship addedcauses 0033550
2016-08-25 14:53maiteRelationship addedcauses 0033813
2016-08-26 08:56ngarciaRelationship addedcauses 0033817
2016-10-27 14:08ngarciaRelationship addedrelated to 0034322
2016-11-04 09:15maiteRelationship addedrelated to 0034385
2016-11-09 09:18aferrazRelationship addedrelated to 0034371
2017-01-18 11:30maiteRelationship addedrelated to 0034992
2023-09-06 12:00aferrazRelationship addedrelated to 0052963

Notes
(0081435)
psanjuan   
2015-11-02 13:07   
(edited on: 2015-11-16 15:11)
Issue verified.

Test Plan

Prerequisites:

All of the below needs to be executed for F&B España org.

Install Aging Balance Report module

Go to Preference window, and enable preference "Enable void documents filter in Aging Reports".

Go to Business Partner window and create a new one named "Vendor 30971" for instance. Configure this new business partner as a supplier.

Test 1 - scenario 1

Create a purchase invoice for this new BP, dated on 02-11-2015, total gross amount = 2468.40.00 €. Invoice number 787

Create another purchase invoice for this new BP, dated on 02-11-2015, total gross amount = 1398.76 €. Invoice number 788

Launch Payable Aging Schedule for 03-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 3867.16 € which is correct.

Go to Purchase Invoice window and void second invoice with an void date of 04-11-2015. Void Accounting date 04-11-2015

Launch Payable Aging Schedule once again for 03-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 3867.16 € which is correct.

Launch Payable Aging Schedule once again for 04-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 2468.40 € which is correct.

Check that both, the Purchase Invoice 788 and the reversed purchase invoice created are now related to the same payment, therefore Payment Plan and Payment Details information is not deleted anymore.

A payment has been created for an amount of 0,00 (1398.76 -1398.76) for both the purchase invoice and the reversed purchase invoice and dated on 04-11-2015.

Check that this payment can not be added to the financial account.

Check also that both Purchase Invoice and Reversed Purchase Invoice have both the status "Voided" and Payment Complete = Yes. Total Paid = 1398.76 and Total Outstanding = 0.00 which is correct.

Test 2 - scenario 2

Post this payment and check that below accounting information is generated:

04-11-2015

1398.76 (2110) Accounts Payables (DEBIT)
1398.76 (40000) Vendor Liabilities (CREDIT)

Test 3 - scenario 3

Go to payment out window and Reactivate and Delete Lines.
check that payment details info is deleted from the purchase invoice and the reversed purchase invoice.

Launch Payable Aging Schedule once again for 03-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 3867.16 € which is correct.

Launch Payable Aging Schedule once again for 04-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 2468.40 € which is correct.

So, as it seems payment out reactivation did not have any impact on the report.

Go back to Payment Out window and press Add Details button. Select the purchase invoice 788 and the reversed purchase invoice. Select Process Made Payment(s) and Withdrawal. Press Done.

Check that Purchase invoice 788 and Reverse Purchase invoice Payment Complete = Yes. Total Paid = 1398.76 and Total Outstanding = 0.00

Test 4 - scenario 4

Go to Business Partner window and create a new one named "New Vendor 30971" for instance. Configure this new business partner as a supplier.

Create a purchase invoice for this new BP, dated on 16-11-2015, total gross amount = 246.84 €. Invoice number 802

Create another purchase invoice for this new BP, dated on 18-11-2015, total gross amount = 1810.16 €. Invoice number 803

Launch Payable Aging Schedule for 16-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 264.84 € which is correct.

Launch Payable Aging Schedule for 18-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 2057.00 € which is correct.

Go to Purchase Invoice window and void second invoice with an void date of 20-11-2015. Void Accounting date 30-11-2015

Post reversed invoice:

30-11-2015

1810.16 (40000) Account Payable (DEBIT)
1496.00 (60000) Product Expense (CREDIT)
314.16 (47200 ) Purchase Tax Amount (CREDIT)

Launch Payable Aging Schedule once again for 18-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 2057.00 € which is correct.

Launch Payable Aging Schedule once again for 20-11-2015 and F&B España Euro General Ledger. Check that the balance shown in there is 246.84 € which is correct.

Check that both, the Purchase Invoice 803 and the reversed purchase invoice created are now related to the same payment, dated on 20-11-2015 (void date), therefore Payment Plan and Payment Details information is not deleted anymore.

A payment has been created for an amount of 0,00 (1810.16 -1810.16) for both the purchase invoice and the reversed purchase invoice and dated on 20-11-2015 (Void Date).

Check that this payment can not be added to the financial account.

Check also that both Purchase Invoice and Reversed Purchase Invoice have both the status "Voided" and Payment Complete = Yes. Total Paid = 1810.16 and Total Outstanding = 0.00 which is correct.

Post the payment and verify that "Vendor Prepayment" ledger account is used because payment date 20-11-2015 is before the accounting date of the voided invoice 30-11-2015

20-11-2015

1810.16 (40000) Accounts Payables (DEBIT)
1810.16 (40700) Vendor Prepayment (CREDIT)

30-11-2015

1810.16 (40700) Vendor Prepayment (DEBIT)
1810.16 (40000) Accounts Payables (CREDIT)

Test 5 - scenario 5

Select Caja financial account and set Al contado payment method as active = false. Make sure that also financial account "Cuenta de Banco" does not have "Al contado" payment method configured as an available payment method in the tab "Payment MethoD".

Create a Purchase Invoice for created business partner and Al contado payment method. Complete it. Void it. Realize an error is shown because it does not exist any financial account available for this payment method.

Test 6 - scenario 6

Select Caja financial account and set Al contado payment method as active = True. Make sure that also financial account "Cuenta de Banco" does not have "Al contado" payment method configured as an available payment method in the tab "Payment Methos".

Go to Business Partner window and check that the financial account configured for the vendor is "Cuenta de Banco".

Create a Purchase Invoice for created business partner and "Al contado" payment method. Complete it. Void it.

Check that no error is shown because it does exist a financial account available for this payment method.

Check that the payment out created has been created on "Caja" financial account, regardless it can not be added to this financial account because payment out amount is = 0.00


Test Plan above verified. Issue can be closed once code review is done.

(0081980)
hgbot   
2015-11-19 11:50   
Repository: erp/devel/pi
Changeset: 336cbe497bec883b0d50b8fc3a248cf3227cfcbb
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Nov 16 13:39:15 2015 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/336cbe497bec883b0d50b8fc3a248cf3227cfcbb [^]

Fixes issue 30971: Cancel PaymentScheduleDetails when voiding an unpaid invoice

When voiding an unpaid invoice, a dummy payment will be created related with both the actual invoice and the voided invoice.
In case there is no financial account available for invoice payment method, an error will be shown.
getFinancialAccountPaymentMethod method has been moved from AddPaymentDefaultValuesHandler to FIN_Utility, in order to use it in ProcessInvoice class.

---
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java
---
(0081981)
dmiguelez   
2015-11-19 11:51   
Code Review + Testing Ok
(0082255)
hudsonbot   
2015-11-23 21:17   
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/7b56bebaaa88 [^]
Maturity status: Test