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

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0029615
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Openbravo ERP] Z. Othersmajoralways2015-04-16 18:232016-02-02 09:34
ReporterngarciaView Statuspublic 
Assigned Toumartirena 
PriorityimmediateResolutionfixedFixed in Version
StatusclosedFix in branchFixed in SCM revision59ab316d3792
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tovmromanos
Web browser
ModulesCore
Regression levelProduction - Confirmed Stable
Regression date2014-06-19
Regression introduced in release3.0PR14Q3
Regression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/f94f08e02e3a [^]
Triggers an Emergency PackYes
Summary

0029615: 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 ]
depends on backport 00296193.0PR15Q2 closedumartirena Wrong amount in Used Credit Source tab when paying an invoice with credit and refunding the difference to the customer 
depends on backport 00296203.0PR15Q1.4 closedumartirena Wrong amount in Used Credit Source tab when paying an invoice with credit and refunding the difference to the customer 
caused by feature request 0029391 closedSandrahuguet Add Payment refactor project 
related to defect 0032579 closedmarkmm82 Generated credit is set as used although it is not possible to process the payment that uses it 

-  Notes
(0076609)
umartirena (developer)
2015-04-17 14:42

Test Plan:

1)

* 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 payment has a record of 25 EUR in the Used Credit Source tab
      - One with the invoice payment that has a record of 75 EUR in the Used Credit Source tab
* Post both payments:
      - The invoice payment posts 75 to "Customer Prepayments"
      - The refund payment posts 25 to "Customer Prepayments"

2)

* Create a Payment In where you leave 100 EUR as credit to a Business Partner
* Create a Payment In where you leave 50 EUR as credit to a Business Partner
* Create a Payment In where you leave 75 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 an amount of 50 of the second payment created.
      - select an amount of 75 of the third payment created.
      - select the invoice to pay
      - select "Refund the amount to the Customer" (difference of 50)
* Check two payments are created:
      - One with the refund payment has a record of 50 EUR in the Used Credit Source tab pointint to second or third payments.
      - One with the invoice payment that has a record of 75 EUR in the Used Credit Source tab pointing. to second or third payments.
* Post both payments:
      - The invoice payment posts 75 to "Customer Prepayments"
      - The refund payment posts 50 to "Customer Prepayments"
(0076632)
hgbot (developer)
2015-04-20 14:21

Repository: erp/devel/pi
Changeset: 59ab316d379204bc4370719e9d45c4630da1ee0b
Author: Unai Martirena <unai.martirena <at> openbravo.com>
Date: Fri Apr 17 14:56:13 2015 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/59ab316d379204bc4370719e9d45c4630da1ee0b [^]

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

There were two issues while managing this scenario:

[1] In 'addCredit' method inside AddPaymentActionHandler.java 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 FIN_PaymentProcess.java 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/AddPaymentActionHandler.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
---
(0076633)
vmromanos (developer)
2015-04-20 14:22

Code review + testing OK
(0077136)
hudsonbot (developer)
2015-05-07 22: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/a1817f84bd8b [^]
Maturity status: Test
(0077596)
umartirena (developer)
2015-05-20 10:20

Test in TestLink: https://testlink.openbravo.com/testlink/linkto.php?tprojectPrefix=Communit&item=testcase&id=Communit-8282 [^]
(0083803)
hgbot (developer)
2016-02-02 09:34

Repository: tools/automation/int
Changeset: cf90a167c46d3e1861737041feec679f622b2828
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Mon Sep 21 09:43:16 2015 +0200
URL: http://code.openbravo.com/tools/automation/int/rev/cf90a167c46d3e1861737041feec679f622b2828 [^]

Related to issue 29615: Added some automated tests

---
M src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/AddPaymentProcess.java
M src-test/com/openbravo/test/integration/erp/gui/financial/receivablespayables/transactions/paymentout/PaymentOutTab.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/RegressionSuite.java
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/build.xml
M src-test/com/openbravo/test/integration/erp/testscripts/financial/receivablespayables/transactions/PaymentOut.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRRegression015.java
---

- Issue History
Date Modified Username Field Change
2015-04-16 18:23 ngarcia New Issue
2015-04-16 18:23 ngarcia Assigned To => Triage Finance
2015-04-16 18:23 ngarcia Modules => Core
2015-04-16 18:23 ngarcia Triggers an Emergency Pack => No
2015-04-16 18:25 ngarcia Issue Monitored: networkb
2015-04-16 19:35 umartirena Regression level => Production - Confirmed Stable
2015-04-16 19:35 umartirena Regression date => 2014-06-19
2015-04-16 19:35 umartirena Regression introduced in release => 3.0PR14Q3
2015-04-16 19:35 umartirena Regression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/f94f08e02e3a [^]
2015-04-16 19:35 umartirena Triggers an Emergency Pack No => Yes
2015-04-16 19:38 umartirena Status new => scheduled
2015-04-16 19:38 umartirena Assigned To Triage Finance => umartirena
2015-04-17 14:42 umartirena Note Added: 0076609
2015-04-20 14:21 hgbot Checkin
2015-04-20 14:21 hgbot Note Added: 0076632
2015-04-20 14:22 hgbot Status scheduled => resolved
2015-04-20 14:22 hgbot Resolution open => fixed
2015-04-20 14:22 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/59ab316d379204bc4370719e9d45c4630da1ee0b [^]
2015-04-20 14:22 vmromanos Review Assigned To => vmromanos
2015-04-20 14:22 vmromanos Note Added: 0076633
2015-04-20 14:22 vmromanos Status resolved => closed
2015-04-22 10:12 dmitry_mezentsev Relationship added caused by 0029391
2015-05-07 22:16 hudsonbot Checkin
2015-05-07 22:16 hudsonbot Note Added: 0077136
2015-05-20 10:20 umartirena Note Added: 0077596
2016-02-02 09:34 hgbot Checkin
2016-02-02 09:34 hgbot Note Added: 0083803
2016-04-07 10:55 aferraz Relationship added related to 0032579


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker