From 52f3c95429496172b6bf7abbec35eddee31fff82 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 27 Apr 2021 15:59:13 +0200 Subject: [PATCH 1/3] Update supplier_proposal.class.php --- .../class/supplier_proposal.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 0320a663ea8..768302af188 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -290,7 +290,9 @@ class SupplierProposal extends CommonObject $line->tva_tx = $tva_tx; $this->lines[] = $line; + return 1; } + return -1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1402,9 +1404,11 @@ class SupplierProposal extends CommonObject // Numbering module definition $soc = new Societe($this->db); $soc->fetch($this->socid); + + if ($soc < 0) return -1; // Define new ref - if (!$error && (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref))) { // empty should not happened, but when it occurs, the test save life + if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life $num = $this->getNextNumRef($soc); } else { $num = $this->ref; @@ -1525,6 +1529,7 @@ class SupplierProposal extends CommonObject return -1; } } + return 0; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -1555,6 +1560,7 @@ class SupplierProposal extends CommonObject return -1; } } + return 0; } @@ -1589,6 +1595,7 @@ class SupplierProposal extends CommonObject return -1; } } + return 0; } @@ -1663,7 +1670,9 @@ class SupplierProposal extends CommonObject public function cloture($user, $status, $note) { global $langs, $conf; - + $hidedetails = 0; + $hidedesc = 0; + $hideref = 0; $this->statut = $status; $error = 0; $now = dol_now(); @@ -1785,6 +1794,7 @@ class SupplierProposal extends CommonObject $this->db->rollback(); return -1; } + return 1; } /** @@ -1847,6 +1857,7 @@ class SupplierProposal extends CommonObject $this->db->rollback(); return -1; } + return 1; } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps @@ -2908,8 +2919,10 @@ class SupplierProposalLine extends CommonObjectLine $this->fk_unit = $objp->fk_unit; $this->db->free($result); + return 1; } else { dol_print_error($this->db); + return -1; } } From 3d38301be96b977d902ad99b995c922adabf8042 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Tue, 27 Apr 2021 14:06:10 +0000 Subject: [PATCH 2/3] Fixing style errors. --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 768302af188..1bf27c92b86 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1404,7 +1404,7 @@ class SupplierProposal extends CommonObject // Numbering module definition $soc = new Societe($this->db); $soc->fetch($this->socid); - + if ($soc < 0) return -1; // Define new ref From c7c1756703f83775a5f7679863eba7375035cb94 Mon Sep 17 00:00:00 2001 From: fr69400 <82267780+fr69400@users.noreply.github.com> Date: Tue, 27 Apr 2021 18:22:31 +0200 Subject: [PATCH 3/3] Update supplier_proposal.class.php --- htdocs/supplier_proposal/class/supplier_proposal.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index 1bf27c92b86..6e3230f871b 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -1403,9 +1403,9 @@ class SupplierProposal extends CommonObject // Numbering module definition $soc = new Societe($this->db); - $soc->fetch($this->socid); + $result = $soc->fetch($this->socid); - if ($soc < 0) return -1; + if ($result < 0) return -1; // Define new ref if (preg_match('/^[\(]?PROV/i', $this->ref) || empty($this->ref)) { // empty should not happened, but when it occurs, the test save life