Skip to content

FIX: accountancy sales/purchases journal: sql error logged when no invoice in journal #34339

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

Merged

Conversation

marc-dll
Copy link
Contributor

@marc-dll marc-dll commented Jun 2, 2025

FIX: accountancy sales/purchases journal: sql error logged when no invoice in journal

In purchases and sales journal, when checking if some lines are not bound in the selected invoices, an SQL error occurs if no invoices are selected (this generates an SQL statement with AND fk_facture IN ()).

A simple check on array $tabfac being empty clears the error and has the added benefit of suppressing one superfluous SQL query.

And while fixing that, I discovered the check was not working for sales invoice as a copy/paste made in so that an incorrect sql result column was used ($obj->fk_facture_fourn instead of $obj->fk_facture).

@alexandre-janniaux
Copy link
Contributor

Hi, sorry I made the changes targetting only develop back then in #32573 and #32574 (but didn't made the $obj->fk_facture_fourn change). You might also be interested in #32675 ;)

@eldy eldy merged commit 6202f61 into Dolibarr:19.0 Jun 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants