Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0032579Openbravo ERPZ. Otherspublic2016-04-04 12:372016-06-17 19:37
ngarcia 
markmm82 
urgentmajoralways
closedfixed 
5
 
3.0PR16Q3 
aferraz
Core
No
0032579: Generated credit is set as used although it is not possible to process the payment that uses it
Generated credit is set as used although it is not possible to process the payment that uses it
As group admin role:
   Create a Payment In for a Business Partner and an amount of 100
   When adding details, do not select any invoice or GL item and select the leave the credit to be used later option in the Overpayment Action field
   Create a new Payment In for the same Business partner and an amount of -100
   When adding details, do not select any invoice or GL item and select the previously created credit to be used
   Check the following error is raised:
      It is not possible to process a Payment without line
   Check the Used Credit field of the payment remains as 0. This is correct
   Check the Used Credit Source field of the Payment has been filled with the credit used. This is wrong
   Check the Used Credit of the payment where the credit was generated has been updated. This is wrong
   The credit will not be available any more as the Used Credit of the first payment is not updated even when you delete the second one
No tags attached.
related to defect 0030086 scheduled AtulOpenbravo Error in the log when refunding a credit in Add Payment process 
related to defect 0027182 closed eduardo_Argal Wrong source payment selected when refunding credit to the customer 
related to defect 0027155 closed eduardo_Argal Cannot return the credit to a customer 
related to defect 0029615 closed umartirena Wrong amount in Used Credit Source tab when paying an invoice with credit and refunding the difference to the customer 
Issue History
2016-04-04 12:37ngarciaNew Issue
2016-04-04 12:37ngarciaAssigned To => Triage Finance
2016-04-04 12:37ngarciaModules => Core
2016-04-04 12:37ngarciaResolution time => 1462658400
2016-04-04 12:37ngarciaTriggers an Emergency Pack => No
2016-04-04 12:37ngarciaIssue Monitored: networkb
2016-04-04 12:37ngarciaNote Added: 0085412
2016-04-04 14:55eugeniIssue Monitored: eugeni
2016-04-05 12:17aferrazAssigned ToTriage Finance => markmm82
2016-04-07 09:59aferrazRelationship addedrelated to 0030086
2016-04-07 10:49aferrazRelationship addedrelated to 0027182
2016-04-07 10:49aferrazRelationship addedrelated to 0027155
2016-04-07 10:55aferrazRelationship addedrelated to 0029615
2016-04-07 13:43markmm82Statusnew => scheduled
2016-04-08 21:49markmm82Note Added: 0085539
2016-04-21 19:28hgbotCheckin
2016-04-21 19:28hgbotNote Added: 0085851
2016-04-21 19:28hgbotStatusscheduled => resolved
2016-04-21 19:28hgbotResolutionopen => fixed
2016-04-21 19:28hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/75af2f16cdb33231deb9d7f55c5e97fa7d4f0ac2 [^]
2016-04-21 19:29aferrazReview Assigned To => aferraz
2016-04-21 19:29aferrazNote Added: 0085854
2016-04-21 19:29aferrazStatusresolved => closed
2016-04-21 19:29aferrazFixed in Version => 3.0PR16Q3
2016-06-17 19:37hudsonbotCheckin
2016-06-17 19:37hudsonbotNote Added: 0087480

Notes
(0085412)
ngarcia   
2016-04-04 12:37   
Incorrect data should be corrected
(0085539)
markmm82   
2016-04-08 21:49   
Test plan 1 (for issue 32579):
As group admin role:
    Create a new Business Partner.
      Check the Current Balance is 0.
    Create a Payment In for the Business Partner and amount 100
      When adding details, do not select any invoice or GL item and select the leave the credit to be later option in the Overpayment action field.
      Check the Current Balance for the BP is -100.
    Create a new Payment In for the same BP and an amount of -100.
      When adding details, do not select any invoice or GL item and select the previously created credit to be used.
    Check the following error is raised:
     It is not possible to process a Payment without line.
    Check the Used Credit field of the Payment remains as 0.
    Check the Used Credit Source field of the Payment is empty.
    Check the Used Credit of the Payment where the credit was generated it was not updated and still 0.
    Check the credit is available and can be used.
          Check the Current Balance for the BP still -100.

Test plan 2 (for related issue 27182):
As group admin role:
    Generate credit for the same BP in two different Payment In for instance:
      Create a new Business Partner.
        Check the Current Balance is 0 for the BP.
      Create a Payment In for the Business Partner and amount 100
        When adding details, do not select any invoice or GL item and select the leave the credit to be later option in the Overpayment action field.
        Check the Current Balance for the BP is -100.
      Create a Payment In for the Business Partner and amount 200
        When adding details, do not select any invoice or GL item and select the leave the credit to be later option in the Overpayment action field.
        Check the Current Balance for the BP is -300.
      Create a Payment In for the Business Partner
        When adding details, Select the credit generated in the second payment and the option 'Refund amount to customer'
      Check that new refunded payment is created, and the credit has been consumed from the second payment as expected (it is referenced in the Used Credit Source tab)
      Check the Current Balance for the BP decrease in the amount refunded.

Test plan 3 (for related issue 27155):
Create a Payment In for Restaurantes Luna Llena, S.A. and an amount of 100
   When Adding details do not select any document
   Select Leave the credit to be used later as the Overpayment action
   Create another Payment In for Restaurantes Luna Llena, S.A. and an amount of 0
   When Adding details select the previously generated credit and
     Set the Payment amount to 100
     Select Refund amount to customer as the Overpayment action
   Refund amount to customer option was made succesfully.
   Used credit is 100 for the payment from the credit was used.

Test plan 4 (for related issue 29615):
As group admin role:
    Create a new Business Partner.
        Check the Current Balance is 0 for the BP.
    Create a Payment In where you leave 100 EUR as credit to the previously created Business Partner
        Check the Current Balance is -100 for the BP.
       Create a Sales Invoice of 74.05 EUR for the same Business Partner and complete it. (Add 40 Units of Agua sin gas product for instance)
        Check the Current Balance is -25.95 for the BP.
    Create a new Payment In, select the credit to use 74.05, the invoice to pay previous created and Refund the amount to the Customer
    Check two payments are created:
            One with the refund that having one record in the Used Credit tab with the difference refunded -25.95 and the payment selected
          One with the invoice payment that has a record of 74.05 EUR in the Used Credit Source tab
    Check Post of this last payment is the expected.
    Check the Current Balance is 0, as 74.05 was consumed by the invoice and 25.95 refunded.
(0085851)
hgbot   
2016-04-21 19:28   
Repository: erp/devel/pi
Changeset: 75af2f16cdb33231deb9d7f55c5e97fa7d4f0ac2
Author: Mark <m.molina <at> nectus.com>
Date: Fri Apr 08 15:28:54 2016 -0400
URL: http://code.openbravo.com/erp/devel/pi/rev/75af2f16cdb33231deb9d7f55c5e97fa7d4f0ac2 [^]

Fixes issue 32579: Generated credit set as used when it should not

Generated credit was set as used although it is not possible to process the payment that uses it, when an exception is thrown the payment processing aborts and can't be created or updated the credits.

---
M modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
---
(0085854)
aferraz   
2016-04-21 19:29   
Code review + Testing OK
(0087480)
hudsonbot   
2016-06-17 19:37   
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/0dc7be081b1c [^]
Maturity status: Test