Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0037209Openbravo ERPZ. Otherspublic2017-11-02 14:322018-02-22 17:24
ngarcia 
AtulOpenbravo 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q1 
dmiguelez
Core
No
0037209: Used credit field is not updated when credit is used in the same payment other credit is generated
Used credit field is not updated when credit is used in the same payment other credit is generated

Used Credit field stores:

- In Payment's that use credit -> the credit amount used from other payments
- In Payment's that generate credit -> the credit amount used in other payments
As group admin role:
   Create a Payment In, set a Business Partner and Amount
   Add Details, do not select any invoice or G/L Item and select the Overpayment Option = 'Leave the credit to be used later'

   Create a Sales Invoice for the same BP
   Do not use credit when completing it

   Create a new Payment In, set a Business Partner and Amount
   Select the Invoice to be paid
   Select the credit to be used and set the invoice amount
   Select the Overpayment Option = 'Leave the credit to be used later'

   Check the Used Credit field remains as 0 but the credit used is informed in Used Credit Source tab
Analyze if it should be allowed to generate and use credit in the same payment
No tags attached.
related to design defect 0037243 closed Triage Omni OMS It should not be possible to use and generate credit in the same payment. 
related to defect 0037244 closed Triage Omni OMS Credit information do not updated if a payment containing credit info is reactivated. 
Issue History
2017-11-02 14:32ngarciaNew Issue
2017-11-02 14:32ngarciaAssigned To => Triage Finance
2017-11-02 14:32ngarciaModules => Core
2017-11-02 14:32ngarciaResolution time => 1511391600
2017-11-02 14:32ngarciaTriggers an Emergency Pack => No
2017-11-02 14:33ngarciaIssue Monitored: networkb
2017-11-02 17:03dmiguelezAssigned ToTriage Finance => AtulOpenbravo
2017-11-03 11:09psanjuanNote Added: 0100243
2017-11-07 12:33psanjuanNote Deleted: 0100243
2017-11-07 12:37psanjuanNote Added: 0100303
2017-11-07 12:46psanjuanNote Edited: 0100303bug_revision_view_page.php?bugnote_id=0100303#r16240
2017-11-07 12:55psanjuanRelationship addedrelated to 0037243
2017-11-07 12:55psanjuanNote Edited: 0100303bug_revision_view_page.php?bugnote_id=0100303#r16241
2017-11-07 13:06psanjuanRelationship addedrelated to 0037244
2017-11-07 15:01psanjuanNote Edited: 0100303bug_revision_view_page.php?bugnote_id=0100303#r16245
2017-11-09 04:51AtulOpenbravoStatusnew => scheduled
2017-11-09 10:19psanjuanNote Deleted: 0100303
2017-11-09 10:24psanjuanNote Added: 0100371
2017-11-13 19:05AtulOpenbravoNote Added: 0100503
2017-11-13 19:07AtulOpenbravoNote Edited: 0100503bug_revision_view_page.php?bugnote_id=0100503#r16279
2017-11-17 12:52hgbotCheckin
2017-11-17 12:52hgbotNote Added: 0100583
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: 0100585
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: 0101435
2018-02-22 17:24hgbotCheckin
2018-02-22 17:24hgbotNote Added: 0102634

Notes
(0100371)
psanjuan   
2017-11-09 10:24   
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.
(0100503)
AtulOpenbravo   
2017-11-13 19:05   
(edited on: 2017-11-13 19:07)
- Login as International Group Admin
- Create a Payment In, set a Business Partner and Amount = 100
- Add Details, do not select any invoice or G/L Item and select the Overpayment Option = 'Leave the credit to be used later', process payment.
- Create a Sales Invoice for the same BP for eg: Amount 200. Do not use credit when completing it.
- Create a new Payment In, set a Business Partner and Amount that is equal to invoice amount = 200 created in above step.
- Select the Invoice to be paid, set amount = 200
- Select the credit to be used and set the amount as 100
   Select the Overpayment Option = 'Leave the credit to be used later'
- Check the Used Credit field remains as 0 and Used Credit Source tab does not have any record for the credit payment selected in the above step.

- Login as International Group Admin
- Create a Payment In, set a Business Partner and Amount = 100
- Add Details, do not select any invoice or G/L Item and select the Overpayment Option = 'Leave the credit to be used later', process payment.
- Create a Sales Invoice for the same BP for eg: Amount 250. Do not use credit when completing it.
- Create a new Payment In, set a Business Partner and Amount that is less than invoice amount = 200 created in above step.
- Select the Invoice to be paid, set amount = 200
- Select the credit to be used and set the amount as 50
   Select the Overpayment Option = 'Leave the credit to be used later'
- Check the Used Credit field remains as 50 and Used Credit Source tab has the information about the credit payment selected and amount = 50.

(0100583)
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
---
(0100585)
dmiguelez   
2017-11-17 13:02   
Code Review + Testing Ok
(0101435)
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
(0102634)
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
---