From fdef117f63267403953d0fb23fdedb8ba6982146 Mon Sep 17 00:00:00 2001 From: Anthony Berton Date: Wed, 21 Sep 2022 18:11:00 +0200 Subject: [PATCH 1/2] FIX - php V8 propal index last draft --- htdocs/comm/propal/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index 9f020bc1613..5bfed3ff1c9 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -78,7 +78,7 @@ if ($tmp) { */ if (!empty($conf->propal->enabled)) { $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc"; - $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.email, s.entity, s.code_compta"; + $sql .= ", s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.email, s.entity, s.code_compta"; $sql .= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql .= ", ".MAIN_DB_PREFIX."societe as s"; if (empty($user->rights->societe->client->voir) && !$socid) { From 724490b94de89a00620e73205bbc2b6453efa924 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 23 Sep 2022 09:56:54 +0200 Subject: [PATCH 2/2] FIX wrong result check when update expensereport line --- htdocs/expensereport/class/expensereport.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/expensereport/class/expensereport.class.php b/htdocs/expensereport/class/expensereport.class.php index ca8f1698767..e0799a46f73 100644 --- a/htdocs/expensereport/class/expensereport.class.php +++ b/htdocs/expensereport/class/expensereport.class.php @@ -2069,6 +2069,7 @@ class ExpenseReport extends CommonObject if ($this->status == self::STATUS_DRAFT || $this->status == self::STATUS_REFUSED) { $this->db->begin(); + $error = 0; $type = 0; // TODO What if type is service ? // We don't know seller and buyer for expense reports @@ -2152,10 +2153,13 @@ class ExpenseReport extends CommonObject $this->applyOffset(); $this->checkRules(); - $error = 0; - $result = $this->line->update($user); - if ($result > 0 && !$notrigger) { + $result = $this->line->update($user); + if ($result < 0) { + $error++; + } + + if (!$error && !$notrigger) { // Call triggers $result = $this->call_trigger('EXPENSE_REPORT_DET_MODIFY', $user); if ($result < 0) { @@ -2164,7 +2168,7 @@ class ExpenseReport extends CommonObject // End call triggers } - if ($result > 0 && $error == 0) { + if (!$error) { $this->db->commit(); return 1; } else {