Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0030439
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Otherscriticalalways2015-07-28 13:482015-08-20 23:16
ReporterngarciaView Statuspublic 
Assigned Toaferraz 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revisionf0a956388321
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesAdvanced Payables and Receivables Mngmt
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0030439: Credit is consumed from other payment when refunding the difference to a customer who has available credit

DescriptionCredit is consumed from other payment when refunding the difference to a customer who has available credit
Steps To ReproduceAs group admin role:
   Create a Payment In of 50 to a customer and leave the amount to be used later
   Create a Sales Invoice of 60 to the same customer. Do not use the credit
   Create a new Payment In of 70 to the same customer. Select the option to Refund the difference to the customer
   Check the refund payment is pointing the payment where the credit was generated (first payment) instead of the payment where the invoice was paid (second payment): check the Used Credit Source tab of the refund payment and the used credit of the first payment
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]

-  Notes
(0079201)
aferraz (manager)
2015-08-05 13:50
edited on: 2015-08-05 13:54

Test Plan 1:

As F&B Admin:

Create a Payment In of 50 to a customer and leave the amount to be used later.
Create a Sales Invoice of 60 to the same customer. Do not use the credit.
  Click on Add Payment.
  Select an amount of 70.
  Select the option to Refund the difference to the customer.
Check in the Used Credit Source tab of the refund payment, that it points to the payment where the invoice was paid (second payment).
Check also the Generated Credit and Used Credit fields of three payments are correct.

Test Plan 2:

As F&B Admin:

Create a Payment In of 50 to a customer and leave the amount to be used later.
Create a Sales Invoice of 60 to the same customer. Do not use the credit.
  Click on Add Payment.
  Select an amount of 70.
  Select the available credit in Credit to Use grid.
  Select the option to Refund the difference to the customer.
Check in the Used Credit Source tab of the refund payment, that a record points to the payment where the invoice was paid (second payment) with an amount of 10 and another record points to the payment where the credit was generated (first payment) with an amount of 50.
Check also the Generated Credit and Used Credit fields of three payments are correct.

Test Plan 3:

As F&B Admin:

Create a Payment In of 50 to a customer and leave the amount to be used later.
Create a Sales Invoice of 60 to the same customer. Do not use the credit.
  Click on Add Payment.
  Select an amount of 0.
  Uncheck the invoice in the grid.
  Select the available credit in Credit to Use grid.
  Select the option to Refund the difference to the customer.
Check in the Used Credit Source tab of the refund payment, that a record points to the payment where the credit was generated (first payment) with an amount of 50.
Check also the Generated Credit and Used Credit fields of three payments are correct.

(0079245)
vmromanos (manager)
2015-08-07 10:44

Before fixing this issue, the credit was consumed from the oldest to the newest one (FIFO).
After this fix, in case of a refund, the credit is directly consumed from the payment that pays the invoice and generates the refund (regardless of a previous credit payment already exists)

This is a semantic functional change that has been approved by DME because it makes it easier to understand the flow.
Since the data generated by the previous behavior is correct (amounts are correct, only the credit source is difference), we have decided not to create a script to modify the existing data.
(0079246)
hgbot (developer)
2015-08-07 10:47

Repository: erp/devel/pi
Changeset: f0a9563883215bfb8e8d98eeeaf8b03aa55ef01e
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Aug 05 10:21:32 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/f0a9563883215bfb8e8d98eeeaf8b03aa55ef01e [^]

Fixes issue 30439: Credit wrongly consumed when refunding a difference

When refunding a payment difference to a customer who has available credit, credit was consumed by first generated credit instead of current payment.
If case of refunding an amount generated as credit in the same payment, this payment will be now used to consume the credit, sending payment info through strSelectedCreditLinesIds parameter.
Then, updateUsedCredit method in FIN_PaymentProcess will link them correctly.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
---
(0079247)
vmromanos (manager)
2015-08-07 10:48

Code review + testing OK
(0079532)
hudsonbot (developer)
2015-08-20 23:16

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/8c91718397a5 [^]
Maturity status: Test

- Issue History
Date Modified Username Field Change
2015-07-28 13:48 ngarcia New Issue
2015-07-28 13:48 ngarcia Assigned To => Triage Finance
2015-07-28 13:48 ngarcia Modules => Advanced Payables and Receivables Mngmt
2015-07-28 13:48 ngarcia Resolution time => 1441058400
2015-07-28 13:48 ngarcia Triggers an Emergency Pack => No
2015-07-28 13:48 ngarcia Issue Monitored: networkb
2015-07-28 13:59 jpcalvente Issue Monitored: jpcalvente
2015-07-29 13:17 ngarcia Priority urgent => immediate
2015-07-29 13:17 ngarcia Severity major => critical
2015-08-04 11:23 aferraz Assigned To Triage Finance => aferraz
2015-08-05 13:50 aferraz Note Added: 0079201
2015-08-05 13:54 aferraz Note Edited: 0079201 View Revisions
2015-08-07 08:36 vmromanos Status new => scheduled
2015-08-07 10:44 vmromanos Note Added: 0079245
2015-08-07 10:47 hgbot Checkin
2015-08-07 10:47 hgbot Note Added: 0079246
2015-08-07 10:47 hgbot Status scheduled => resolved
2015-08-07 10:47 hgbot Resolution open => fixed
2015-08-07 10:47 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/f0a9563883215bfb8e8d98eeeaf8b03aa55ef01e [^]
2015-08-07 10:48 vmromanos Review Assigned To => vmromanos
2015-08-07 10:48 vmromanos Note Added: 0079247
2015-08-07 10:48 vmromanos Status resolved => closed
2015-08-20 23:16 hudsonbot Checkin
2015-08-20 23:16 hudsonbot Note Added: 0079532


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker