Payment Selection Can Create the Same Invoice Multiple TImes

Description

When creating Payment Selection Lines, it is desirable to be able to pull from different places. This means running the 'Create Lines...' process multiple times. There is an issue with the current code in that it allows the same Invoice to exist on a Payment Selection multiple times.

The attached patch prevents this scenario. Therefore, you can run the 'Create Lines..." process as many times as is needed without the risk of adding the same invoice multiple times.

In the current code, if you add the same Invoice multiple times, you will create a payment for double the amount of the Invoice. The Payment will be flagged as isAllocated=Y and the Invoice will not be flagged as Paid (isPaid=N). When you run aging, the Invoice will show a balance equal to the original balance*(-1). Thus, it is over allocated.

Environment

Created from Jenkins on the same day as this ticket

Attachments

1

Activity

Show:

Hiep LqJanuary 26, 2025 at 6:18 PM

I can't reproduce the issue on release-12; it might have been resolved by IDEMPIERE-5453

Deepak PansheriyaJune 25, 2020 at 8:08 AM

Triaged and reproduced by

Issue is still reproducible with 7.1.

Steps to reproduce

  1. Create a AP invoice with payment term immediate and complete it

  2. Create new record on Payment selection window with name PSTest1

  3. use create form to add AP invoice created.

  4. Create another Payment selection records with name PSTest2

  5. use create form to add AP incoice created in step 1. System let’s add same

  6. Use Payment print/export process for PSTest1 and create export, create payment and print. This will create payment and allocations. Invoice is marked as paid.

  7. Use Payment Print/Export process for PStest2 and export, confirm and create payment. Check invoice. it is marked as non paid. Invoice has 2 payment allocated.

Duplicate

Details

Assignee

Reporter

Components

Affects versions

Priority

Created May 23, 2014 at 11:58 PM
Updated January 26, 2025 at 6:18 PM
Resolved January 26, 2025 at 6:18 PM