Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incoherence in loan payment management #32339

Closed
thomas-Ngr opened this issue Dec 12, 2024 · 2 comments
Closed

Incoherence in loan payment management #32339

thomas-Ngr opened this issue Dec 12, 2024 · 2 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@thomas-Ngr
Copy link
Contributor

thomas-Ngr commented Dec 12, 2024

Bug

On module loan (htdocs/loan/list.php) , deleting a payment causes issues :

  1. The bank line still exists after deleting the payment. Should it still exist, or should it be deleted with the payment loan ?
  2. The bank line is not linked to the payment anymore, but is still linked to the loan. As a consequence :
    • on the loan screen, the payment is not shown
    • but, if the line is reconciliated, the loan can't be deleted. Moreover, no error is displayed (see PR FIX : display error when loan can't be deleted #32338). The user has no clue on what is going on. Even if there was an error, the user can't navigate from the loan to the faulty bank line, so they can't fix the problem.

Dolibarr Version

18.0, develop

Environment PHP

any

Environment Database

any

Steps to reproduce the behavior and expected behavior

To reproduce

  • create a loan
  • create a payment for this loan.
    • Observe that this has created a bank line. (expected behavior)
  • delete the payment
  • navigate to the bank line.
    • Observe that it is still linked to the loan
  • navigate to the loan.
    • Observe that there is no payment shown, so the user can't navigate to the related bank line.
  • Try to delete it.
    • Observe that it can't be deleted.

Expected behavior

I think that, when we delete a payment loan, the related bank line should be also deleted. And if the bank line is reconciliated, one should not be able to delete the payment.

Attached files

No response

@thomas-Ngr thomas-Ngr added the Bug This is a bug (something does not work as expected) label Dec 12, 2024
@thomas-Ngr
Copy link
Contributor Author

@aspangaro do you have a suggestion before I start implementing it ?

aspangaro added a commit to aspangaro/dolibarr that referenced this issue Dec 13, 2024
@aspangaro
Copy link
Member

aspangaro commented Dec 13, 2024

Hi @thomas-Ngr

I confirm this problem also in v21.

Thanks for the report, I propose the fix #32346 using the delete() function of the AccountLine class

aspangaro added a commit to aspangaro/dolibarr that referenced this issue Jan 11, 2025
eldy added a commit that referenced this issue Jan 13, 2025
FIX #32339 Delete a loan settlement is partial
eldy added a commit that referenced this issue Jan 20, 2025
FIX #32339 Delete a loan settlement is partial
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

2 participants