Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037244Openbravo ERPZ. Otherspublic2017-11-07 12:562018-02-22 17:24
psanjuan 
Triage Finance 
urgentmajoralways
closedfixed 
20Ubuntu 8.04.1
 
3.0PR18Q1 
dmiguelez
Core
No
0037244: Credit information do not updated if a payment containing credit info is reactivated.
Credit information do not updated if a payment containing credit info is reactivated.
In F&B España create a new business partner with basic setup.

Go to payment in window and create a new payment for this BP with below information:
Amount = 10.00
Press Add details and once in Add Details window, select the option "Leave the credit to be used later". Press Done.

Go to Sales Invoice window and create an invoice for this BP for an amount of 500.00. While completing do not use the credit available.

Go to payment in window and create a new one for this BP, enter an amount of 1000.00. Press Add Details.
Select the invoice and the credit. Select the option "Leave the credit to be used later". Press Done.

Once done, reactivate and delete payment lines. Press Ok.

In the same payment enter once again an amount of 1000.00
Press Add details.

Verify that the credit is not there anymore, and that is not correct.

Navigate to the payment in which the credit was generated and verify the credit is already used, and that is not correct.
If a payment that includes credit is reactivated, credit info needs to be updated based on that, therefore the credit is still generated credit and not used credit.
No tags attached.
related to defect 0037209 closed AtulOpenbravo Used credit field is not updated when credit is used in the same payment other credit is generated 
Issue History
2017-11-07 12:56psanjuanNew Issue
2017-11-07 12:56psanjuanAssigned To => Triage Finance
2017-11-07 12:56psanjuanModules => Core
2017-11-07 12:56psanjuanTriggers an Emergency Pack => No
2017-11-07 13:06psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=16243#r16243
2017-11-07 13:06psanjuanProposed Solution updated
2017-11-07 13:06psanjuanRelationship addedrelated to 0037209
2017-11-07 13:09ngarciaIssue Monitored: ngarcia
2017-11-07 14:07ngarciaResolution time => 1511391600
2017-11-10 13:13dmiguelezStatusnew => scheduled
2017-11-13 19:21AtulOpenbravoNote Added: 0100504
2017-11-13 19:22AtulOpenbravoNote Edited: 0100504bug_revision_view_page.php?bugnote_id=0100504#r16281
2017-11-16 12:16dmiguelezNote Added: 0100546
2017-11-16 12:17dmiguelezNote Edited: 0100546bug_revision_view_page.php?bugnote_id=0100546#r16302
2017-11-17 12:52hgbotCheckin
2017-11-17 12:52hgbotNote Added: 0100584
2017-11-17 12:52hgbotStatusscheduled => resolved
2017-11-17 12:52hgbotResolutionopen => fixed
2017-11-17 12:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/5e48183608e87d1ee11505e492a188e8a187050c [^]
2017-11-17 13:02dmiguelezReview Assigned To => dmiguelez
2017-11-17 13:02dmiguelezNote Added: 0100586
2017-11-17 13:02dmiguelezStatusresolved => closed
2017-11-17 13:02dmiguelezFixed in Version => 3.0PR18Q1
2018-01-03 12:39hudsonbotCheckin
2018-01-03 12:39hudsonbotNote Added: 0101436
2018-02-22 17:24hgbotCheckin
2018-02-22 17:24hgbotNote Added: 0102635

Notes
(0100504)
AtulOpenbravo   
2017-11-13 19:21   
(edited on: 2017-11-13 19:22)
In F&B España create a new business partner with basic setup.

- Go to payment in window and create a new credit payment for this BP with amount = 10.00, Press Add details and once in Add Details window, select the option "Leave the credit to be used later". Press Done.

- Go to Sales Invoice window and create an invoice for this BP for an amount of 500.00. While completing do not use the credit available.

- Go to payment in window and create a new one for this BP, enter an amount of 400.00. Press Add Details. Select the invoice and the credit payment. Select the option "Process Received Payments". Press Done.

- Realize that Used Credit amount is set as 10. Used Credit Source Tab shows the credit payment used information with amount 10.

- Navigate to Credit Payment, check that used credit is set to 10.

- Reactivate the above payment (which consumed the credit payment of amount 10) with Reactivate and Delete Lines option.

- Realize that Used Credit Source Tab is empty.

- Navigate to Credit Payment and realize that Used Credit is set back to 0 again.

- In the same payment that was reactivated enter once again an amount of 300.00
Press Add details. Verify that the credit payment appears in the credit to use grid.

(0100546)
dmiguelez   
2017-11-16 12:16   
(edited on: 2017-11-16 12:17)
Proposed solution:
It will not be possible to use credit up to the amount being paid. Therefore, a payment can not use existing credit to generate more credit in the same payment if the amount being paid is already covered.

For instance if we do have a credit of 100.00 and we need to pay an invoice of 500.00, and the payment in amount is 450.00; it will only be possible to use 50.00 of that credit.

A payment could only generate or consume credit but never both in the same payment.

(0100584)
hgbot   
2017-11-17 12:52   
Repository: erp/devel/pi
Changeset: 5e48183608e87d1ee11505e492a188e8a187050c
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Thu Nov 09 06:16:13 2017 +0530
URL: http://code.openbravo.com/erp/devel/pi/rev/5e48183608e87d1ee11505e492a188e8a187050c [^]

Fixes Issue 37209, Fixes Issue 37244: Used credit field is not updated
when credit is used in the same payment other credit is generated
and Credit information do not updated if a payment containing credit
info is reactivated.

** Reset usedCredit when traversing through the selected credit payment
Whenever there is sufficient payment amount to fully pay the invoice
and user still selects credit payments, discard the selection of credit
payment in such cases as credit is not actually being used.
** Set credit payment description only in case it is actually consumed

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
---
(0100586)
dmiguelez   
2017-11-17 13:02   
Code Review + Testing Ok
(0101436)
hudsonbot   
2018-01-03 12:39   
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/c81e0d3cbab5 [^]
Maturity status: Test
(0102635)
hgbot   
2018-02-22 17:24   
Repository: tools/automation/int
Changeset: 1ccac4a1255ef61ccf2eb2e36135e39d39f49bb1
Author: Atul Gaware <atul.gaware <at> openbravo.com>
Date: Tue Nov 21 09:17:28 2017 +0530
URL: http://code.openbravo.com/tools/automation/int/rev/1ccac4a1255ef61ccf2eb2e36135e39d39f49bb1 [^]

Related to issue 37209, related to issue 37244:Added some automated tests

---
M src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRIn_Regressions4/APRIn_RegressionSuite4.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRIn_Regressions4/APRRegression37209In.java
A src-test/com/openbravo/test/integration/erp/modules/functionalteam/addpayment/testsuites/APR_Regressions/APRIn_Regressions4/APRRegression37244In.java
---