Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037963Openbravo ERP07. Sales managementpublic2018-02-16 15:022018-03-07 01:04
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q2 
dmiguelez
Core
No
0037963: Payment in Awaiting payment status is created when an invoice cannot be voided because document cancelled is a return
Payment in Awaiting payment status is created when an invoice cannot be voided because document cancelled is a return and original invoice has a line with negative quantity
As group admin role:
   Go to Document Type window and check the 'Reversed Sales Invoice' document type is set as Return (do not allow positive lines) and it is set as Document Cancelled for 'AR Invoice' document type
   Create a Sales Invoice
   Add two lines to it, one with positive quantity and one with negative quantity and lower amount
   Complete it
   Try to void it and check the following error message is shown:
      "Return Invoices do not allow lines with positive quantities."
   Check in Payment Plan - Payment Details tab that a new payment has been created for the invoice
   
   Go to Document Type window and remove the Return option to 'Reversed Sales Invoice' document type

   Try to void the invoice and check the following error message is shown now:
      "Invoice can not be voided as there is an awaiting execution payment related. Please either execute that payment or cancel it"
No tags attached.
related to defect 0034589 closed rqueralta Error message needed in case of voiding an invoice having an "Awaiting Execution" or "Awaiting Payment" payment related. 
has duplicate defect 0036420 closed Triage Omni OMS Void process create a new payment for not paid invoice if c_invoice_post process fail 
Issue History
2018-02-16 15:02ngarciaNew Issue
2018-02-16 15:02ngarciaAssigned To => Triage Finance
2018-02-16 15:02ngarciaModules => Core
2018-02-16 15:02ngarciaTriggers an Emergency Pack => No
2018-02-16 15:02ngarciaIssue Monitored: networkb
2018-02-16 15:02ngarciaRelationship addedrelated to 0034589
2018-02-19 11:37ngarciaResolution time => 1520550000
2018-03-02 14:07dmiguelezAssigned ToTriage Finance => markmm82
2018-03-02 17:54markmm82Statusnew => scheduled
2018-03-05 18:33markmm82Note Added: 0102996
2018-03-05 20:59markmm82Note Edited: 0102996bug_revision_view_page.php?bugnote_id=0102996#r16809
2018-03-06 11:30hgbotCheckin
2018-03-06 11:30hgbotNote Added: 0103020
2018-03-06 11:30hgbotStatusscheduled => resolved
2018-03-06 11:30hgbotResolutionopen => fixed
2018-03-06 11:30hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/6fa4003bddbe8e121d349a60439a28599d22fc91 [^]
2018-03-06 11:32dmiguelezReview Assigned To => dmiguelez
2018-03-06 11:32dmiguelezNote Added: 0103021
2018-03-06 11:32dmiguelezStatusresolved => closed
2018-03-06 11:32dmiguelezFixed in Version => 3.0PR18Q2
2018-03-07 01:04hudsonbotCheckin
2018-03-07 01:04hudsonbotNote Added: 0103049
2018-04-18 10:00ngarciaRelationship addedhas duplicate 0036420

Notes
(0102996)
markmm82   
2018-03-05 18:33   
(edited on: 2018-03-05 20:59)
Test Plan 1:
As group admin role:
   Go to Document Type window and check the 'Reversed Sales Invoice' document type is set as Return (do not allow positive lines)
   Set it as Document Cancelled for 'AR Invoice' document type
   Create a Sales Invoice
   Add two lines to it, one with positive quantity and one with negative and lower quantity
     1st Line: Product = Cerveza Ale 0,5L, Quantity = 10
     2nd Line: Product = Cerveza LAger 0,5L, Quantity = -5
   Complete it
   Notice there is a Payment Plan created for the invoice.
   Go to Payment Details tab and notice there aren't any record.

   Try to void it and check the following error message is shown:
      "Return Invoices do not allow lines with positive quantities."
   Check in Payment Plan - Payment Details tab that still without any record created for the invoice
   
   Go to Document Type window and remove the Return option to 'Reversed Sales Invoice' document type

   Try to void the invoice and check the process is completed successfully and a new reversed document has been created reversing the original one.


Test cases related to issue 34589
  Test Plan 2 - voice partially paid by an automatic payment method (Remittance) and void. First Payment not executed.

  Go to Sales Invoice and create a new invoice for F&B España, Alimentos business partner. Select Remittance payment method. Complete the invoice.

  Partially paid the invoice.
  Verify that a payment in is created with status "Awaiting Execution".
  Do not execute the payment created.

  Void the invoice.
     Notice an error message is shown:
       Error:
       Invoice can not be voided as there is an awaiting execution payment related. Please either execute that payment or cancel it

  Repeat same test case for a purchase invoice.


Test Plan 3 - Invoice partially paid by an automatic payment method (Check) and void. First Payment executed.
  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.

  Partially pay the invoice and do NOT execute that payment, therefore payment created is in status "Awaiting Execution".
  Go to the payment and press the button Reactivate. Choose "Reactivate" action, therefore payment status is "Awaiting Payment".

  Try to void the invoice.
    Notice an error message is shown:
       Invoice can not be voided as there is an awaiting execution payment related. Please either execute that payment or cancel it

(0103020)
hgbot   
2018-03-06 11:30   
Repository: erp/devel/pi
Changeset: 6fa4003bddbe8e121d349a60439a28599d22fc91
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Mar 05 12:10:20 2018 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/6fa4003bddbe8e121d349a60439a28599d22fc91 [^]

Fixes issue 37963: Payment in Awaiting payment status is created when an invoice
cannot be voided because document cancelled is a return

A commit and close was performed at the end of the invoice processing to get the
error message from the database, but it left all previously created data into the
database just like the dummy payment when it is needed is to rollback the changes.

If at the end of processing there is some error then a rollback is performed.
Also the message is created from the pinstance object instead of retrieve the Instance
data from the database.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
---
(0103021)
dmiguelez   
2018-03-06 11:32   
Code Review + Testing Ok
(0103049)
hudsonbot   
2018-03-07 01:04   
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/14b1dec19bfc [^]
Maturity status: Test