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

Closed
JphenixB opened this issue May 8, 2024 · 0 comments · Fixed by #29939
Closed

Impossible to delete Draft Invoice because of delete_linked_contact empty #29640

JphenixB opened this issue May 8, 2024 · 0 comments · Fixed by #29939
Assignees
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
@rycks rycks self-assigned this Jun 8, 2024
@rycks rycks mentioned this issue Jun 8, 2024
eldy added a commit that referenced this issue Jun 8, 2024
* FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (#29710)

* fix restrictedArea on selectobject (#29882)

* Fix travis

* Fix : expense report reapproval email, wrong date format + missing parameter (#29874)

* delete_linked_contact is < 0 in case of error

---------

Co-authored-by: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com>
Co-authored-by: Rémi Champlon <85104766+Kazimir42@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
Co-authored-by: Maxime Kohlhaas <maxime@atm-consulting.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
vdegrandpre pushed a commit to vdegrandpre/dolibarr that referenced this issue Jun 9, 2024
* FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (Dolibarr#29710)

* fix restrictedArea on selectobject (Dolibarr#29882)

* Fix travis

* Fix : expense report reapproval email, wrong date format + missing parameter (Dolibarr#29874)

* delete_linked_contact is < 0 in case of error

---------

Co-authored-by: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com>
Co-authored-by: Rémi Champlon <85104766+Kazimir42@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
Co-authored-by: Maxime Kohlhaas <maxime@atm-consulting.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
vdegrandpre pushed a commit to vdegrandpre/dolibarr that referenced this issue Jun 9, 2024
* FIX REPLENISH MANY FOURN WHEN ORDER ALREADY CREATE (Dolibarr#29710)

* fix restrictedArea on selectobject (Dolibarr#29882)

* Fix travis

* Fix : expense report reapproval email, wrong date format + missing parameter (Dolibarr#29874)

* delete_linked_contact is < 0 in case of error

---------

Co-authored-by: IC-Mathieu <95343351+IC-Mathieu@users.noreply.github.com>
Co-authored-by: Rémi Champlon <85104766+Kazimir42@users.noreply.github.com>
Co-authored-by: Laurent Destailleur <eldy@users.sourceforge.net>
Co-authored-by: Maxime Kohlhaas <maxime@atm-consulting.fr>
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
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

Successfully merging a pull request may close this issue.

2 participants