From cc1454c8d5add9d70868428b8af68418b978b5f8 Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 13 Dec 2019 14:55:39 +0100 Subject: [PATCH 1/6] FIX : product_fourn_price_id was assigned too late for logPrice() function --- htdocs/fourn/class/fournisseur.product.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 786a650efb381..a6411942f75cc 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -434,11 +434,9 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn $sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'"); $sql .= ")"; - $idinserted = 0; - $resql = $this->db->query($sql); if ($resql) { - $idinserted = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); + $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); } else { $error++; @@ -461,7 +459,6 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn if (empty($error)) { $this->db->commit(); - $this->product_fourn_price_id = $idinserted; return $this->product_fourn_price_id; } else { $this->db->rollback(); From e9a0646f6f7ef55bdae6b85c880ace1247e513ab Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 22:25:34 +0100 Subject: [PATCH 2/6] Update fournisseur.product.class.php --- htdocs/fourn/class/fournisseur.product.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index a6411942f75cc..ac936f3033451 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -391,7 +391,6 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn return -2; } } - else { dol_syslog(get_class($this) . '::update_buyprice without knowing id of line, so we delete from company, quantity and supplier_ref and insert again', LOG_DEBUG); @@ -434,6 +433,8 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn $sql .= (empty($fk_barcode_type) ? 'NULL' : "'" . $this->db->escape($fk_barcode_type) . "'"); $sql .= ")"; + $this->product_fourn_price_id = 0; + $resql = $this->db->query($sql); if ($resql) { $this->product_fourn_price_id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_fournisseur_price"); From 2c4fd099c8fefe0089c46bcf84c1608553f36601 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 14 Dec 2019 22:27:45 +0100 Subject: [PATCH 3/6] Update fournisseur.product.class.php --- htdocs/fourn/class/fournisseur.product.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index ac936f3033451..4dbd2365c6fba 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -445,6 +445,7 @@ public function update_buyprice($qty, $buyprice, $user, $price_base_type, $fourn if (! $error && empty($conf->global->PRODUCT_PRICE_SUPPLIER_NO_LOG)) { // Add record into log table + // $this->product_fourn_price_id must be set $result = $this->logPrice($user, $now, $buyprice, $qty, $multicurrency_buyprice, $multicurrency_unitBuyPrice, $multicurrency_tx, $fk_multicurrenc, $multicurrency_code); if ($result < 0) { $error++; From 98bd4f3a667cbb1a23fbcf39467b88f95bfb9644 Mon Sep 17 00:00:00 2001 From: John Botella Date: Mon, 16 Dec 2019 09:44:08 +0100 Subject: [PATCH 4/6] Fix document module call --- htdocs/core/class/html.formfile.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index 7b885d36a52e7..2508ebce5ca01 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -675,7 +675,10 @@ public function showdocuments($modulepart, $modulesubdir, $filedir, $urlsource, else { $tmp=explode(':', $modulepart); - if (! empty($tmp[2])) $submodulepart=$tmp[2]; + if (! empty($tmp[1])){ + $modulepart=$tmp[0]; + $submodulepart=$tmp[1]; + } $file=dol_buildpath('/'.$modulepart.'/core/modules/'.$modulepart.'/modules_'.$submodulepart.'.php', 0); $res=include_once $file; } From bb6523b75d02e59108f9a058690808fd91346cfd Mon Sep 17 00:00:00 2001 From: florian HENRY Date: Tue, 17 Dec 2019 10:49:56 +0100 Subject: [PATCH 5/6] fix task document banner without thirdparty FATAL --- htdocs/projet/tasks/document.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index b8ff9a175ab97..827ac810695f1 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -256,9 +256,11 @@ $morehtmlref.='
'; // Third party - $morehtmlref.=$langs->trans("ThirdParty").': '; - $morehtmlref.=$projectstatic->thirdparty->getNomUrl(1); - $morehtmlref.=''; + if ($projectstatic->thirdparty->id > 0) { + $morehtmlref .= $langs->trans("ThirdParty") . ': '; + $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); + $morehtmlref .= ''; + } } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param); From 03bb395ad84e8e1201a311d042bd1aa9b9642a99 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Dec 2019 12:14:30 +0100 Subject: [PATCH 6/6] Update document.php --- htdocs/projet/tasks/document.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/projet/tasks/document.php b/htdocs/projet/tasks/document.php index 827ac810695f1..3fa4d5c6d7bfa 100644 --- a/htdocs/projet/tasks/document.php +++ b/htdocs/projet/tasks/document.php @@ -256,11 +256,11 @@ $morehtmlref.='
'; // Third party - if ($projectstatic->thirdparty->id > 0) { - $morehtmlref .= $langs->trans("ThirdParty") . ': '; - $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); - $morehtmlref .= ''; - } + $morehtmlref .= $langs->trans("ThirdParty") . ': '; + if (is_object($projectstatic->thirdparty) && $projectstatic->thirdparty->id > 0) { + $morehtmlref .= $projectstatic->thirdparty->getNomUrl(1); + } + $morehtmlref .= ''; } dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, $param);