Anonymous | Login
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
TypeCategorySeverityReproducibilityDate SubmittedLast Update
backport[Openbravo ERP] Z. Othersmajoralways2015-04-16 18:232015-04-20 14:20
ReporterngarciaView Statuspublic 
Assigned Toumartirena 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision8bace9b56a9b
ProjectionnoneETAnoneTarget Version3.0PR15Q1.4
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
Regression levelProduction - Confirmed Stable
Regression date2014-06-19
Regression introduced in release3.0PR14Q3
Regression introduced by commit [^]
Triggers an Emergency PackYes

0029620: Wrong amount in Used Credit Source tab when paying an invoice with credit and refunding the difference to the customer

DescriptionWrong amount in Used Credit Source tab when paying an invoice with credit and refunding the difference to the customer
Steps To ReproduceAs group admin role:
   Create a Payment In where you leave 100 EUR as credit to a Business Partner
   Create a Sales Invoice of 75 EUR for the same Business Partner
   Create a new Payment In, select the credit to use, the invoice to pay and Refund the amount to the Customer
   Check two payments are created:
      One with the refund that do not have any record in the Used Credit tab
      One with the invoice payment that has a record of 100 EUR in the Used Credit Source tab
   Post this last payment and check the difference of 25 is posted to Currency balancing account
TagsNo tags attached.
Attached Files

- Relationships Relation Graph ] Dependency Graph ]
blocks defect 0029615 closedumartirena Wrong amount in Used Credit Source tab when paying an invoice with credit and refunding the difference to the customer 

-  Notes
hgbot (developer)
2015-04-20 14:19

Repository: erp/backports/3.0PR15Q1.4
Changeset: 8bace9b56a9b0a1e145015e99ec5043967d75af9
Author: Unai Martirena <unai.martirena <at>>
Date: Mon Apr 20 09:49:30 2015 +0200
URL: [^]

Fixes bug 29620: Correctly used credit when paying an invoice and refunding

There were two issues while managing this scenario:

[1] In 'addCredit' method inside class, a loop of Credit to Use grid is done, creating Payment Credit Used records assigned to the new created payment of the invoice. This method was not taking into account that could be credit amount that exceeds the invoice amount (amount to be refunded) and it was assigning all the credit amount as used to the payment of the invoice. So the refund payment that is created right after was been left without any used credit payment.

[2] After fixing the previous method, the second issue appears. The 'updateUsedCredit' method inside class retrieves all the payments of the business partner that has generated credit, and it assigns as used to the refund payment. The problem with this function is that before the Add Payment refactor it was not possible to select which credit payments we wanted to consume, it was only a total credit amount to be consumed and the system behind was being consuming any of them. But after the refactor it is possible to select the ones that want to be consumed.

In order to fix this last issue the selected credit line ids are added as a parameter to 'updateUsedCredit' method.

M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/
vmromanos (developer)
2015-04-20 14:20

Code review + testing OK

- Issue History
Date Modified Username Field Change
2015-04-16 19:38 umartirena Type defect => backport
2015-04-16 19:38 umartirena Target Version => 3.0PR15Q1.3
2015-04-17 14:25 umartirena Assigned To Triage Finance => umartirena
2015-04-17 14:47 umartirena Target Version 3.0PR15Q1.3 => 3.0PR15Q1.4
2015-04-20 14:19 hgbot Checkin
2015-04-20 14:19 hgbot Note Added: 0076628
2015-04-20 14:19 hgbot Status scheduled => resolved
2015-04-20 14:19 hgbot Resolution open => fixed
2015-04-20 14:19 hgbot Fixed in SCM revision => [^]
2015-04-20 14:20 vmromanos Review Assigned To => vmromanos
2015-04-20 14:20 vmromanos Note Added: 0076630
2015-04-20 14:20 vmromanos Status resolved => closed

Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker