Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0034322Openbravo ERPZ. Otherspublic2016-10-27 14:082016-12-16 18:38
ngarcia 
rqueralta 
urgentmajoralways
closedfixed 
5
 
3.0PR17Q1 
aferraz
Core
No
0034322: Payment of 0 amount created when voiding an unpaid invoice is created in Awaiting Execution status
Payment of 0 amount created when voiding an unpaid invoice is created in Awaiting Execution status.

The execution process associated to the payment method of the invoice should not be executed in this case
As system admin role:
   Install Remittances Infrastructure module
As group admin role:
   Apply the module's dataset
   Include the Remittance payment method in a financial account
   Create a Sales Invoice with that payment method
   Add a line to it, complete it and do not add any payment to it
   Void it
   Check the payment that includes both the original and the voiding invoice is in Awaiting Execution status
   Check the Sales Invoice is set as not paid until you execute the Payment In
   If you execute it the payment of 0 amount will be included in a remittance
No tags attached.
related to defect 00309713.0PR16Q1 closed aferraz When voiding an unpaid invoice, payment schedule details should be canceled instead of deleted 
related to defect 0031367 scheduled markmm82 It should not be possible to change the payment method of an awaiting execution payment without being reactivated 
related to defect 0033492 scheduled Sanjota Not possible to pay a void invoice if voided one has been already paid. 
related to defect 0034589 closed rqueralta Error message needed in case of voiding an invoice having an "Awaiting Execution" or "Awaiting Payment" payment related. 
related to defect 0034385 closed rqueralta Payment of 0 amount created when voiding an unpaid invoice should be created with Exchange Rate record from invoice (if any) 
Issue History
2016-10-27 14:08ngarciaNew Issue
2016-10-27 14:08ngarciaAssigned To => Triage Finance
2016-10-27 14:08ngarciaModules => Core
2016-10-27 14:08ngarciaResolution time => 1479337200
2016-10-27 14:08ngarciaTriggers an Emergency Pack => No
2016-10-27 14:08ngarciaRelationship addedrelated to 0030971
2016-10-27 14:08ngarciaIssue Monitored: networkb
2016-10-27 14:09ngarciaRelationship addedrelated to 0031367
2016-11-03 20:57aferrazAssigned ToTriage Finance => nonofrancisco
2016-11-04 10:03aferrazRelationship addedrelated to 0034385
2016-11-11 12:46psanjuanNote Added: 0091390
2016-11-11 12:51psanjuanNote Edited: 0091390bug_revision_view_page.php?bugnote_id=0091390#r13640
2016-11-11 12:51psanjuanNote Edited: 0091390bug_revision_view_page.php?bugnote_id=0091390#r13641
2016-11-11 14:24psanjuanNote Added: 0091403
2016-11-11 14:29psanjuanNote Edited: 0091403bug_revision_view_page.php?bugnote_id=0091403#r13645
2016-11-11 15:31rqueraltaAssigned Tononofrancisco => rqueralta
2016-11-14 11:42psanjuanNote Added: 0091439
2016-11-14 11:46psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13655
2016-11-16 10:22psanjuanNote Added: 0091596
2016-11-16 10:27psanjuanNote Edited: 0091596bug_revision_view_page.php?bugnote_id=0091596#r13771
2016-11-16 11:05psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13772
2016-11-16 13:00psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13775
2016-11-16 13:03psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13776
2016-11-16 13:55psanjuanNote Edited: 0091596bug_revision_view_page.php?bugnote_id=0091596#r13777
2016-11-16 15:44psanjuanNote Edited: 0091596bug_revision_view_page.php?bugnote_id=0091596#r13778
2016-11-18 11:17psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13809
2016-11-18 11:21psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13810
2016-11-18 11:22psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13811
2016-11-18 11:28psanjuanNote Edited: 0091596bug_revision_view_page.php?bugnote_id=0091596#r13812
2016-11-18 11:28psanjuanNote Added: 0091654
2016-11-18 11:29psanjuanNote Edited: 0091596bug_revision_view_page.php?bugnote_id=0091596#r13813
2016-11-18 11:34psanjuanNote Edited: 0091654bug_revision_view_page.php?bugnote_id=0091654#r13815
2016-11-18 11:36psanjuanNote Added: 0091656
2016-11-18 11:36psanjuanNote Added: 0091657
2016-11-18 11:36psanjuanNote Added: 0091658
2016-11-18 11:38psanjuanNote Added: 0091659
2016-11-18 12:34psanjuanNote Edited: 0091654bug_revision_view_page.php?bugnote_id=0091654#r13817
2016-11-18 12:41psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13819
2016-11-18 12:41psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13820
2016-11-18 12:41psanjuanRelationship addedrelated to 0033492
2016-11-18 12:43psanjuanNote Edited: 0091654bug_revision_view_page.php?bugnote_id=0091654#r13821
2016-11-18 12:46psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13822
2016-11-18 12:48psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13823
2016-11-18 12:49psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13824
2016-11-18 12:51psanjuanNote Edited: 0091657bug_revision_view_page.php?bugnote_id=0091657#r13826
2016-11-18 13:01psanjuanNote Edited: 0091657bug_revision_view_page.php?bugnote_id=0091657#r13827
2016-11-18 13:11psanjuanNote Edited: 0091657bug_revision_view_page.php?bugnote_id=0091657#r13828
2016-11-18 13:52psanjuanNote Edited: 0091658bug_revision_view_page.php?bugnote_id=0091658#r13830
2016-11-18 13:57psanjuanNote Edited: 0091658bug_revision_view_page.php?bugnote_id=0091658#r13831
2016-11-18 14:15psanjuanNote Edited: 0091659bug_revision_view_page.php?bugnote_id=0091659#r13839
2016-11-21 11:11psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13844
2016-11-21 11:22psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13845
2016-11-21 11:56psanjuanRelationship addedrelated to 0034589
2016-11-21 11:59psanjuanNote Edited: 0091439bug_revision_view_page.php?bugnote_id=0091439#r13849
2016-11-21 12:18psanjuanNote Edited: 0091654bug_revision_view_page.php?bugnote_id=0091654#r13850
2016-11-21 12:18psanjuanNote Deleted: 0091654
2016-11-21 12:18psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13851
2016-11-21 12:19psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13852
2016-11-21 12:21psanjuanNote Edited: 0091656bug_revision_view_page.php?bugnote_id=0091656#r13853
2016-11-21 12:21psanjuanNote Edited: 0091657bug_revision_view_page.php?bugnote_id=0091657#r13854
2016-11-21 12:21psanjuanNote Edited: 0091658bug_revision_view_page.php?bugnote_id=0091658#r13855
2016-11-21 12:22psanjuanNote Edited: 0091659bug_revision_view_page.php?bugnote_id=0091659#r13856
2016-11-21 12:49psanjuanNote Added: 0091695
2016-11-21 13:44hgbotCheckin
2016-11-21 13:44hgbotNote Added: 0091697
2016-11-21 13:44hgbotStatusnew => resolved
2016-11-21 13:44hgbotResolutionopen => fixed
2016-11-21 13:44hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9e84e90e2f2ae882a7dc59c8de46d25f1d0d445d [^]
2016-11-21 13:45aferrazReview Assigned To => aferraz
2016-11-21 13:45aferrazNote Added: 0091698
2016-11-21 13:45aferrazStatusresolved => closed
2016-11-21 13:45aferrazFixed in Version => 3.0PR17Q1
2016-12-16 18:38hudsonbotCheckin
2016-12-16 18:38hudsonbotNote Added: 0092647

Notes
(0091390)
psanjuan   
2016-11-11 12:46   
(edited on: 2016-11-11 12:51)
Please check if below aternative solution can work for the partner/end-customer or not:

Void the sales invoice.

Once the payment in is created in "Awaiting Execution" status, including the invoice (positive amount +100.00) and the reverse sales invoice (negative amount -100.00), execute the payment by:
* unselecting the check "Include in existing remittance or create a new one"
* selecting the check "Write-off total Amount".
Then press Execute.

Once done both sales invoice and reverse invoice are shown as payment complete = yes.

Only thing to consider is that write off action implies below posting with a null net effect.

100.00 (43000) Customer account (DEBIT)
100.00 (43000) Customer account (DEBIT)
100.00 (69400) Write-off account (DEBIT)
100.00 (69400) Write-off account (CREDIT)


Please check whether this alternative works for the customer or not.

(0091403)
psanjuan   
2016-11-11 14:24   
(edited on: 2016-11-11 14:29)
Above solution can work for "remittance" type automatic payment method.

Therefore, proposed solution can be:

"Automatic" Payment in/out created after voiding an invoice, need to be created as "Payment Made/Received", therefore there is no need to execute them.
This kind of payment created after voiding an invoice include an invoice and its reversed invoide, and a payment amount = 0.00

To be confirmed.

(0091439)
psanjuan   
2016-11-14 11:42   
(edited on: 2016-11-21 11:59)
Proposed solution:

Automatic payment in/out having an automatic payment method related, and an amount of 0,00 do not need to be executed, therefore must be created either with "Payment Made" or "Payment Receive" status.

Above payments can be the result of voiding an invoice that is NOT paid.

The status of not paid invoices will end being the same as if the payment was executed, while it was not as there is no need (amount = 0.00)

See scenario below.

(*) Proposed scenario not paid invoice (having an automatic payment method related)

Create a Sales Invoice for F&B España, Alimentos business partner.
Change payment method to an automatic payment method such as "Print Check Simple process" or "Remittance", set up as "Deferred" = Yes.

Add any line to the invoice. Complete and Post the invoice.
Do not pay it but void it.

Check that a payment in with an amount = 0.00 has been created in status "Payment Received" (therefore there is no need to execute this payment, because its amount is 0.00). This payment includes two lines, one for the invoice (81.07€) and another one for the reversed invoice (-81.07€).

Go back to the sales invoice and check that:
Payment Complete = Yes
Go to Payment Plan tab and verify that
Expected Amount = Received Amount = 81.07 (Invoice total gross amount)
Outstanding Amount = 0.00

Go to Payment Details and check that:
Payment in created is shown in there with all the data required.

Go back to the reverse sales invoice and check that:
Payment Complete = Yes
Go to Payment Plan tab and verify that
Expected Amount = Received Amount = -81.07 (Invoice total gross amount)
Outstanding Amount = 0.00

Go to Payment Details and check that:
Payment in created is shown in there with all the data required.

(0091596)
psanjuan   
2016-11-16 10:22   
(edited on: 2016-11-18 11:29)
Test Plan

(*) Test Case 1 - "Remittance" payment method & Invoice Not Paid and Void.

As system admin role, istall Remittances Infrastructure module.

As group admin role, apply the module's dataset to F&B España organization.
Include "Remittance" payment method in a F&B España financial account

Create a Sales Invoice for F&B España org, Alimentos business partner. Change payment method to "Remittance".

Go to lines tab and add any line to it.
complete it and do not add any payment to the invoice but void it.

Check that a payment in has been created with a 0.00 amount, including both the original and the void invoice.
The status of the payment is "Payment Received".

Check that Sales Invoice and Void Sales Invoice are set as Payment Complete = Yes and there is no "outstanding" amount to be paid for any of them.

Repeat same test as above for a purchase invoice.

(*) Test Case 2 - "Simple Check" payment method & Invoice Not Paid and Void.

Go to "Cuenta de Banco" financial account and make sure that "Cheque" payment method is setup as described below for both payment in/payment out:
Execution Type: Automatic
Execution Process: Print Check simple process.
Deferred: Yes

Create a Sales Invoice for F&B España org, Alimentos business partner. Change payment method to "Cheque".

Go to lines tab and add any line to it.
complete it and do not add any payment to the invoice but void it.

Check that a payment in has been created with a 0.00 amount, including both the original and the void invoice.
The status of the payment is "Payment Received".

Check that Sales Invoice and Void Sales Invoice are set as Payment Complete = Yes and there is no "outstanding" amount to be paid for any of them.

Repeat same test as above for a purchase invoice.

(0091656)
psanjuan   
2016-11-18 11:36   
(edited on: 2016-11-21 12:21)
Test Case 3 - Invoice totally paid by an automatic payment method (Check). Invoice void.

Create a sales invoice for F&B España, Alimentos business partner.
Change payment method to "Cheque".

Go to lines and add any product and invoiced quantity.
Complete the invoice and pay it. Execute the payment.

Void the invoice. Verify that the created reversed invoice is not paid but it can be paid by using "Add Payment" process button.

Repeat same test for a purchase invoice. see issue: 33492

(0091657)
psanjuan   
2016-11-18 11:36   
(edited on: 2016-11-21 12:21)
Test Case 4 - Set New Currency process run for a supplier having credit generated with an automatic payment method.

Go to business partner window and create a new one for F&B España.
Name it as "Client TC7" for instance.
Select a customer BP Category.

Go to Customer tab and select below setup:
price list : Tarifa de ventas
Payment Method : Cheque
Payment Terms : 30 d
Financial Account : Cuenta de Banco

Go to Location tab, and enter an Spanish location.

Go to Cuenta de Banco financial account, payment method tab, and make sure that "Cheque" payment method allows "Making/Receiving" payments in multiple currencies.

Navigate to Payment in window and enter a credit of 100.00 € for the customer just created.

Execute the payment.

Go back to business partner window, and check that "Client TC7" balance is -100.00 €.
Run Set new currency process

Select USD, remove "Use default conversion rate", enter a conversion rate = 15 and select a G/L item. Press Done.

Check that current balance of customer has changed to 1500.00

Go to payment in window and filter by the payments created for the customer.

Verify that the last one is a credit payment of a 0.00 amount with status "Payment Received".


(**) second and third payment are in "Awaiting Execution" status.


Test Case 5 - Set New Currency process run for a customer having credit generated with an automatic payment method.

Go to business partner window and create a new one for F&B España.
Name it as "Supplier TC8" for instance.
Select a suppleir BP Category.

Go to Vendor tab and select below setup:
price list : Tarifa Bebidas Alegres
Payment Method : Cheque
Payment Terms : 30 d
Financial Account : Cuenta de Banco

Go to Location tab, and enter an Spanish location.

Navigate to Payment out window and enter a credit of 100.00 € for the vendor just created.

Execute the payment.

Go back to business partner window, and check that "Supplier TC8" balance is 100.00 €.
Run Set new currency process

Select USD, remove "Use default conversion rate", enter a conversion rate = 15 and select a G/L item. Press Done.

Check that current balance of supplier has changed to 1500.00

Go to payment out window and filter by the payments created for the customer.

Verify that the last one is a credit payment of a 0.00 amount with status "Payment Made".

(**) second and third payment are in "Awaiting Execution" status.

(0091658)
psanjuan   
2016-11-18 11:36   
(edited on: 2016-11-21 12:21)
Test Case 6 - Cancel and Replace netting payment.

Enable Cancel and Replace preference.

Go to sales order window, and create a new one for F&B España, Alimentos business partner. Change payment method to "Cheque".

Go to lines and add 15 units of any product. Complete the order.
Write down sales order number (1000382 for instance).
Pay the order partially.

Execute the payment.

Press Cancel and Replace. In the "Temporarl" order created changed ordered quantity to 25. Confirm Cancel and Replace. Press Done.

Go to Sales order 1000382. Navigate to payment plan tab, and then to payment details tabl.

Check that two payment details can be found.
Navigate to the *Z* Netting payment created.

Verify it is a 0.00 amount payment with status "Payment Received".

(0091659)
psanjuan   
2016-11-18 11:38   
(edited on: 2016-11-21 12:22)
Test Case 7 - Invoice do not paid and void (manual payment method)

Create a sales invoice for F&B España, Alimentos business partner.
Check that payment method is Transferencia.

Add any line and any invoiced quantity. Complete the invoice. Void the invoice.

Check that a payment in is created including the invoice and the reverse invoice, for an amount of 0.00 in status "Payment Received". Received (Financial Account) field = 0.00

Repeat same test for a purchase invoice.

Test Case 8 - Invoice partially paid and void (manual payment method)

Create a sales invoice for F&B España, Alimentos business partner.
Check that payment method is Transferencia.

Add any line and any invoiced quantity. Complete the invoice. Pay it partially.

Verify that no new payment in is created therefore invoice remains as partially paid and reverse invoice is not paid.

Repeat same test for a Purchase Invoice.

Test Case 9 - Invoice paid and void (manual payment method)

Create a sales invoice for F&B España, Alimentos business partner.
Check that payment method is Transferencia.

Add any line and any invoiced quantity. Complete the invoice. Pay it.

Void the invoice.

Verify that reverse sales invoice is not paid, and can be paid through "Add Payment" process button.

Repeat same test for a Purchase Invoice.

(0091695)
psanjuan   
2016-11-21 12:49   
Test plan above verified. While testing this issue a new issue has been opened to improve partially paid invoices. See issue relate 34589.

Please review the code and close the issue.
(0091697)
hgbot   
2016-11-21 13:44   
Repository: erp/devel/pi
Changeset: 9e84e90e2f2ae882a7dc59c8de46d25f1d0d445d
Author: Rafael Queralta Pozo <rqueralta <at> nauta.cu>
Date: Fri Nov 18 14:11:43 2016 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/9e84e90e2f2ae882a7dc59c8de46d25f1d0d445d [^]

Fixes issue 34322: Payment of 0 amount created when voiding an unpaid invoice

Payment of 0 amount created when voiding an unpaid invoice was created in Awaiting Execution status.
Now, if Automatic Payment In/Out having an automatic payment method related with an amount of 0,00
it is created in "Payment Receive" or "Payment Made" status.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0091698)
aferraz   
2016-11-21 13:45   
Code review OK
(0092647)
hudsonbot   
2016-12-16 18:38   
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/dc8bf00badd0 [^]
Maturity status: Test