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

Impossible to delete Draft Invoice because of delete_linked_contact empty #29640

Open
JphenixB opened this issue May 8, 2024 · 0 comments
Open
Labels
Bug This is a bug (something does not work as expected)

Comments

@JphenixB
Copy link

JphenixB commented May 8, 2024

Bug

Error when trying to delete a draft invoice.

In facture.class.php line 2871 the if do 3 tests at the same time that all need to be true :

  1. $this->db->query($sqlef)
  2. $this->db->query($sql)
  3. $this->delete_linked_contact()

In delete_linked_contact from the object CommonObject, the result can be :
Return integer <0 if KO, 0=Nothing done, >0 if OK

The ligne :
if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact()) {
Have to be change by:
if ($this->db->query($sqlef) && $this->db->query($sql) && $this->delete_linked_contact()>=0) {

Dolibarr Version

19.0.2

Environment PHP

8.2.5

Environment Database

MySQL or MariaDB 10.11.2-MariaDB

Steps to reproduce the behavior and expected behavior

Create a draft invoice.
Try do delete It.

Attached files

No response

@JphenixB JphenixB added the Bug This is a bug (something does not work as expected) label May 8, 2024
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

1 participant