Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035054Openbravo ERPZ. Otherspublic2017-01-25 12:452017-03-31 15:11
maite 
AtulOpenbravo 
urgenttrivialalways
closedfixed 
5
 
3.0PR17Q2 
aferraz
Advanced Payables and Receivables Mngmt
No
0035054: It is not possible to pay a negative purchase invoice using credit and selecting "Refund amount to customer"
It is not possible to pay a negative purchase invoice using credit and selecting "Refund amount to customer"
1. Register Reversed Purchase Invoice for "Bebidas Alegres". Add line for any product, set qty=-10 and process.
2. Register Payment Out for "Bebidas Alegres" setting Generated Credit=1000. Process payment
3. Register Payment Out for "Bebidas Alegres". Run "Add details" process, select available credit and select only negative invoice line. Choose option "Refund amount to customer" in overpayment action combo and try to process payment. Error "It is not necessary to use credit for this payment: Actual Payment is greater than Expected Payment." will be raised
- In case this should be a supported action then expected behavior will be to return credit+negative invoice amount to this business partner
- In case this should not be a supported action then proper error should be raised or scenario should be properly handled
No tags attached.
related to defect 00266493.0PR14Q4 closed pramakrishnan Wrong payment details when "using credit" but total amount to pay is negative 
related to feature request 0035655 new Triage Omni OMS Do not display Credit to Use grid in Add Payment in case negative payments 
jpg Issue_35054.jpg (37,780) 2017-02-02 15:35
https://issues.openbravo.com/file_download.php?file_id=10379&type=bug
jpg
Issue History
2017-01-25 12:45maiteNew Issue
2017-01-25 12:45maiteAssigned To => Triage Finance
2017-01-25 12:45maiteModules => Advanced Payables and Receivables Mngmt
2017-01-25 12:45maiteResolution time => 1487113200
2017-01-25 12:45maiteTriggers an Emergency Pack => No
2017-01-25 12:45maiteIssue Monitored: networkb
2017-01-25 17:24markmm82Assigned ToTriage Finance => collazoandy4
2017-01-31 15:05markmm82Assigned Tocollazoandy4 => Sanjota
2017-02-02 10:27psanjuanNote Added: 0094009
2017-02-02 10:29SanjotaStatusnew => scheduled
2017-02-02 13:55psanjuanNote Edited: 0094009bug_revision_view_page.php?bugnote_id=0094009#r14443
2017-02-02 14:01psanjuanNote Added: 0094020
2017-02-02 14:03psanjuanNote Edited: 0094020bug_revision_view_page.php?bugnote_id=0094020#r14445
2017-02-02 14:05psanjuanNote Edited: 0094020bug_revision_view_page.php?bugnote_id=0094020#r14446
2017-02-02 15:17psanjuanNote Edited: 0094020bug_revision_view_page.php?bugnote_id=0094020#r14447
2017-02-02 15:35psanjuanFile Added: Issue_35054.jpg
2017-02-16 12:21psanjuanNote Edited: 0094020bug_revision_view_page.php?bugnote_id=0094020#r14612
2017-02-16 12:47psanjuanNote Edited: 0094009bug_revision_view_page.php?bugnote_id=0094009#r14613
2017-02-16 12:50psanjuanNote Added: 0094387
2017-02-16 14:02psanjuanNote Edited: 0094387bug_revision_view_page.php?bugnote_id=0094387#r14619
2017-02-17 13:48psanjuanNote Edited: 0094387bug_revision_view_page.php?bugnote_id=0094387#r14631
2017-02-17 14:09psanjuanNote Edited: 0094020bug_revision_view_page.php?bugnote_id=0094020#r14632
2017-02-17 14:15psanjuanNote Edited: 0094387bug_revision_view_page.php?bugnote_id=0094387#r14633
2017-02-21 10:28AtulOpenbravoAssigned ToSanjota => AtulOpenbravo
2017-02-27 07:10AtulOpenbravoNote Added: 0094620
2017-02-27 07:11AtulOpenbravoNote Edited: 0094620bug_revision_view_page.php?bugnote_id=0094620#r14677
2017-02-27 07:24AtulOpenbravoNote Added: 0094621
2017-02-27 07:55AtulOpenbravoNote Edited: 0094620bug_revision_view_page.php?bugnote_id=0094620#r14678
2017-02-27 08:26AtulOpenbravoNote Added: 0094622
2017-02-27 15:34psanjuanNote Edited: 0094621bug_revision_view_page.php?bugnote_id=0094621#r14685
2017-03-02 11:53AtulOpenbravoNote Edited: 0094622bug_revision_view_page.php?bugnote_id=0094622#r14720
2017-03-02 14:59hgbotCheckin
2017-03-02 14:59hgbotNote Added: 0094687
2017-03-02 14:59hgbotStatusscheduled => resolved
2017-03-02 14:59hgbotResolutionopen => fixed
2017-03-02 14:59hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f2018a902ed3caa99b2920fcc7bc094817a781ab [^]
2017-03-02 15:00markmm82Review Assigned To => markmm82
2017-03-02 15:00markmm82Note Added: 0094688
2017-03-02 15:00markmm82Statusresolved => closed
2017-03-02 15:00markmm82Fixed in Version => 3.0PR17Q2
2017-03-15 20:20hudsonbotCheckin
2017-03-15 20:20hudsonbotNote Added: 0095250
2017-03-23 17:42markmm82Note Added: 0095547
2017-03-23 17:42markmm82Statusclosed => new
2017-03-23 17:42markmm82Resolutionfixed => open
2017-03-23 17:42markmm82Fixed in Version3.0PR17Q2 =>
2017-03-28 13:53AtulOpenbravoStatusnew => scheduled
2017-03-29 13:51aferrazRelationship addedrelated to 0026649
2017-03-30 12:25hgbotCheckin
2017-03-30 12:25hgbotNote Added: 0095704
2017-03-30 12:45aferrazNote Deleted: 0094688
2017-03-30 14:18aferrazRelationship addedrelated to 0035655
2017-03-30 14:19hgbotCheckin
2017-03-30 14:19hgbotNote Added: 0095712
2017-03-30 14:19hgbotStatusscheduled => resolved
2017-03-30 14:19hgbotResolutionopen => fixed
2017-03-30 14:19hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/f2018a902ed3caa99b2920fcc7bc094817a781ab [^] => http://code.openbravo.com/erp/devel/pi/rev/c655a9a77fab63ea5f503305008712f39756126f [^]
2017-03-30 14:20aferrazReview Assigned Tomarkmm82 => aferraz
2017-03-30 14:20aferrazNote Added: 0095713
2017-03-30 14:20aferrazStatusresolved => closed
2017-03-30 14:20aferrazFixed in Version => 3.0PR17Q2
2017-03-30 14:21aferrazSeveritymajor => trivial
2017-03-30 14:39aferrazNote Added: 0095714
2017-03-30 14:39aferrazNote Deleted: 0095713
2017-03-30 14:39aferrazNote Added: 0095715
2017-03-31 15:11hudsonbotCheckin
2017-03-31 15:11hudsonbotNote Added: 0095770
2017-03-31 15:11hudsonbotCheckin
2017-03-31 15:11hudsonbotNote Added: 0095771

Notes
(0094009)
psanjuan   
2017-02-02 10:27   
(edited on: 2017-02-16 12:47)
A proper Proposed Solution need to be included in this issue. Under research.

Same applies to sales

(0094020)
psanjuan   
2017-02-02 14:01   
(edited on: 2017-02-17 14:09)
Step 1

Go to purchase invoice window and create a new one for F&B España, Bebidas Alegres business partner. Select "Reversed Purchase Invoice" in the field Transaction Document.

Go to lines and select any product, for instance "Vino Blanco 0.75L", enter a quantity = -10. Complete and Post the invoice (reverse invoice).

Write down invoice number (i.e. 100000). Total Gross Amount = -42.96.

Step 2

Go to payment out window and create a new one for F&B España, Bebidas Alegres business partner. Save it.
In the field Generated Credit, enter 1000.00.

Press on Add Details. Do not select anything but just go down and press "Done".
Make sure that Overpayment action field is set to "Leave the credit to be used later".

Step 3

Go to Payment Out window and create a new one for F&B España, Bebidas Alegres business partner.

Press "Add Details", select negative invoice just created in Order/Invoice section. Reverse Invoice 100000. Check that Amount field is fille in with -42.96.
Go down to "Credit to Use" section and select the record there.

Go down and fill any of the options available in the field "Overpayment Action". Press Done.

Error is shown:

"It is not necessary to use credit for this payment: Actual Payment is greater than Expected Payment."

(0094387)
psanjuan   
2017-02-16 12:50   
(edited on: 2017-02-17 14:15)
Proposed solution is:

While paying a negative (reverse) invoice, it should not be possible to "Use Credit".

Step 3

Go to Payment Out window and create a new one for F&B España, Bebidas Alegres business partner.

Press "Add Details", select negative invoice just created in Order/Invoice section. Reverse Invoice 100000.

Make sure that:
A) In the case of a Payment Out, the field "Expected Payment " is "negative", for instance -42.96

B) In the case of a Payment In, the fields "Expected Payment" and "Actual Payment" are "negative", for instance -18.51


In those case go down and verify that "Credit to Use" section is not there anymore as it does not make sense to use credit while paying a negative invoice(s).

(0094620)
AtulOpenbravo   
2017-02-27 07:10   
(edited on: 2017-02-27 07:55)
Test Plan

Go to purchase invoice window and create a new one for F&B España, Bebidas Alegres business partner. Select "AP Invoice" in the field Transaction Document.
Go to lines and select any product, for instance "Vino Blanco 0.75L", enter a quantity = 100. Complete and Post the invoice.
Write down invoice number. Total Gross Amount = 429.55
Create Purchase invoice for F&B España, Bebidas Alegres business partner. Select "Reversed Purchase Invoice" in the field Transaction Document.
Go to lines and select product, for instance "Vino Blanco 0.75L", enter a quantity = -10. Complete and Post the invoice (reverse invoice).
Write down invoice number. Total Gross Amount = -42.96.
Go to payment out window and create a new one for F&B España, Bebidas Alegres business partner. Save it.
In the field Generated Credit, enter 1000.00
Press on Add Details. Do not select anything but just go down and press "Done".
Make sure that Overpayment action field is set to "Leave the credit to be used later".
Go to Payment Out window and create a new one for F&B España, Bebidas Alegres business partner.
Press "Add Details", select negative invoice just created in Order/Invoice section. Reverse Invoice. Check that Amount field is fill in with -42.96.
Check that expected payment amount is negative.
Check that No record can be selected from Credit to Use section.
In the Order/Invoice section, Along with Reverse Invoice select the positive value invoice. Check that Amount field is fill in with 429.55.
Check that expected payment amount is positive now.
Check that record can be selected from Credit to Use section.
Use the credit payment record with amount 1000.

Check that if user want to use Overpayment Action = Refund amount to customer then it can be done. Difference Amount = 613.41
Check that if user want to make use of Overpaymnent Action = Leave the Credit to be used later. Error is shown as "Credit amount should not be greater than total amount". User needs to edit the credit amount as 386.59 so that Difference Amount = 0 and proceed further.

(0094621)
AtulOpenbravo   
2017-02-27 07:24   
(edited on: 2017-02-27 15:34)
Test Plan

- Go to payment out window and create a new one for F&B España, Bebidas Alegres business partner. Save it.
In the field Generated Credit, enter 1000.00
Press on Add Details. Do not select anything but just go down and press "Done".
Make sure that Overpayment action field is set to "Leave the credit to be used later".

- Create Purchase invoice for F&B España, Bebidas Alegres business partner. Keep any document type "Reversed Purchase Invoice" or "AP Invoice" in the field Transaction Document.
- Go to lines and select product, for instance "Vino Blanco 0.75L", enter a quantity = -10. This is negative amount invoice.
- Check that after completing invoice, Credit to Use pop up does not appear.

- Create Purchase invoice for F&B España, Bebidas Alegres business partner. Keep document type "AP Invoice" in the field Transaction Document.
- Go to lines and select product, for instance "Vino Blanco 0.75L", enter a quantity = 10. This is positive amount.
- Check that after completing invoice, Credit to Use pop up appears.

Same test plan for sales flow. Verified.

Repeat same test plan for all sales/purchase invoice type.
Credit can be used to settle only positive AR Invoice and AP Invoice

(0094622)
AtulOpenbravo   
2017-02-27 08:26   
(edited on: 2017-03-02 11:53)
Test plan for Sales Flow

Create a Payment In for business partner "Hoteles Buenas Noches, S.A"
In the Amount field enter 1000.
In Add Details, Do not select anything but just go down and press "Done".
Make sure that Overpayment action field is set to "Leave the credit to be used later".

Create a Sales Invoice for same business partner as above.
Add product "Cerveza Ale 0,5L" quantity 400.
Complete Invoice. Amount = 987.36
Check that Credit To Use popup appears. Do not use Credit.

Create a Sales Invoice for same business partner as above.
Document Type - AR Invoice or Reversed Sales Invoice.
Add product "Cerveza Ale 0,5L" quantity -100.
Complete the Invoice. Amount = -246.84
Check that Credit To Use popup does not appear.

Create a Payment In for same business partner as above.
In Add Details.
In Order To Invoice section only select negative amount invoice.
Check Expected Amount is negative.
Check that Credit To Use section has no records selection.
In Order TO Invoice section select positive amount invoice,
keeping the negative amount invoice selected.
Check that Credit To Use section has record to be selected.
Select record with amount 1000 in the Credit To use section.

It is possible for user to take "Refund amount to customer" action in Overpayment Action.

It is not possible to use "Leave the credit to be used later" action as it is already a credit payment. Error message is shown "Credit amount should not be greater than total amount".

(0094687)
hgbot   
2017-03-02 14:59   
Repository: erp/devel/pi
Changeset: f2018a902ed3caa99b2920fcc7bc094817a781ab
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Mon Feb 27 12:32:13 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/f2018a902ed3caa99b2920fcc7bc094817a781ab [^]

Fixes Issue 35054:It is not possible to pay a negative purchase invoice
using credit and selecting "Refund amount to customer"

It is not possible to make use of "Credit To Use" after processing
Reversed Invoice (Sales / Purchase) or negative AP or AR Invoice if
there are credit payments for business partner used in such invoices.

In Add Payment process definition it not possible to use Credit To Use
whenever selected order/invoices section records sum up expected amount
to a negative value.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0095250)
hudsonbot   
2017-03-15 20:20   
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/54e102bef53e [^]
Maturity status: Test
(0095547)
markmm82   
2017-03-23 17:42   
Reopened because although you open add payment process for a business partner with no credit available, Credit to Use section is displayed.
(0095704)
hgbot   
2017-03-30 12:25   
Repository: erp/devel/pi
Changeset: 7a02fed0461a950590dcc14053ff320340935816
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Mar 30 11:47:35 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/7a02fed0461a950590dcc14053ff320340935816 [^]

Related to issue 35054: Backout changeset f2018a902ed3

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java
M modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
---
(0095712)
hgbot   
2017-03-30 14:19   
Repository: erp/devel/pi
Changeset: c655a9a77fab63ea5f503305008712f39756126f
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Thu Mar 30 14:00:53 2017 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/c655a9a77fab63ea5f503305008712f39756126f [^]

Fixes issue 35054: Improve APRM_CreditWithNegativeAmt message

It is not possible to pay a negative invoice using credit.
Improve APRM_CreditWithNegativeAmt error message to inform about this impediment:
"It is not possible to use credit in negative payments. Please, unselect credit records."

---
M modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_actionButton/CreditPaymentGrid.html
---
(0095714)
aferraz   
2017-03-30 14:39   
Severity moved to trivial according to our guidelines: Wrong terminology:

Small errors that do not prevent or hinder functionality, typos, grammar mistakes, wrong terminology, general usability issues and styling.

http://wiki.openbravo.com/wiki/Bug_Reporting_Guidelines [^]
(0095715)
aferraz   
2017-03-30 14:39   
Code review + Testing OK
(0095770)
hudsonbot   
2017-03-31 15:11   
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/2fc0a768a178 [^]
Maturity status: Test
(0095771)
hudsonbot   
2017-03-31 15:11   
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/2fc0a768a178 [^]
Maturity status: Test