Debit and Credit not equal for Purchase Invoice in Landed Cost Voucher (LCV) Distribute Manually

Hello how are you?

For some time now I have been looking for a solution to the LCV problem in manual distribution when there is more than one invoice or purchase receipt.

Steps to reproduce the issue:

  • Create two or more invoices with 2 or more products.
  • Create LCV with several positions (2 or more)
  • Apply manual distribution
  • Distribute costs
  • Save
  • Validate (Here is the error)

I have tried this on version 14.35.0 and later, recently on version 15.0.0 with the same result

I have posted the problem on github in the hope that someone will help with this issue.