From 9eeb80151eefc59acc76f0eb0ce84d38df01104c Mon Sep 17 00:00:00 2001 From: TuxGasy Date: Fri, 9 Mar 2018 21:13:54 +0100 Subject: [PATCH 1/5] Fix bug when updating multi currency rate on invoice supplier --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index ab7afea77a4..4d44a4b6fec 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1560,7 +1560,7 @@ abstract class CommonObject $this->updateline($line->id, $line->desc, $line->subprice, $line->qty, $line->remise_percent, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, 'HT', $line->info_bits, $line->product_type, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); break; case 'invoice_supplier': - $this->updateline($line->id, $line->desc, $line->subprice, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->qty, 0, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); + $this->updateline($line->id, $line->desc, $line->subprice, $line->tva_tx, $line->localtax1_tx, $line->localtax2_tx, $line->qty, $line->fk_product, 'HT', $line->info_bits, $line->product_type, $line->remise_percent, false, $line->date_start, $line->date_end, $line->array_options, $line->fk_unit, $line->multicurrency_subprice); break; default: dol_syslog(get_class($this).'::setMulticurrencyRate no updateline defined', LOG_DEBUG); From fd36ade61a1a6e9a68079638a260e00b2cfff204 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 10 Mar 2018 11:20:32 +0100 Subject: [PATCH 2/5] Fix unit in replenish #7225 --- htdocs/product/stock/replenish.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 26c6ab1dfd1..23cb58ed7e3 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -154,6 +154,8 @@ if ($action == 'order' && isset($_POST['valid'])) $line->total_ttc = $line->total_ht + $line->total_tva; $line->remise_percent = $obj->remise_percent; $line->ref_fourn = $obj->ref_fourn; + $line->type = $product->type; + $line->fk_unit = $product->fk_unit; $suppliers[$obj->fk_soc]['lines'][] = $line; } } @@ -198,7 +200,13 @@ if ($action == 'order' && isset($_POST['valid'])) $line->remise_percent, 'HT', 0, - $line->info_bits + $line->type, + 0, + false, + null, + null, + 0, + $line->fk_unit ); } if ($result < 0) { From c00885384232356c0c51475a861c204242255334 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 10 Mar 2018 23:03:41 +0100 Subject: [PATCH 3/5] Fix #8057 --- htdocs/contact/class/contact.class.php | 21 +++++++++++-------- .../mailings/advthirdparties.modules.php | 6 +++--- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 3b7ce848731..21c7527dae2 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -991,9 +991,10 @@ class Contact extends CommonObject * @param string $option Where the link point to * @param int $maxlen Max length of * @param string $moreparam Add more param into URL + * @param int $notooltip 1=Disable tooltip * @return string String with URL */ - function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='') + function getNomUrl($withpicto=0,$option='',$maxlen=0,$moreparam='',$notooltip=0) { global $conf, $langs, $hookmanager; @@ -1012,13 +1013,15 @@ class Contact extends CommonObject $link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER)) - { - $label=$langs->trans("ShowContact"); - $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; - } - $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose.= ' class="classfortooltip">'; + if (empty($notooltip)) { + if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) + { + $label=$langs->trans("ShowContact"); + $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"'; + } + $linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose.= ' class="classfortooltip"'; + } if (! is_object($hookmanager)) { @@ -1030,7 +1033,7 @@ class Contact extends CommonObject $reshook=$hookmanager->executeHooks('getnomurltooltip',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks if ($reshook > 0) $linkclose = $hookmanager->resPrint; - $link.=$linkclose; + $link.=$linkclose.'>'; $linkend=''; diff --git a/htdocs/core/modules/mailings/advthirdparties.modules.php b/htdocs/core/modules/mailings/advthirdparties.modules.php index 9252ae5ec3a..a747bc3625c 100644 --- a/htdocs/core/modules/mailings/advthirdparties.modules.php +++ b/htdocs/core/modules/mailings/advthirdparties.modules.php @@ -100,7 +100,7 @@ class mailing_advthirdparties extends MailingTargets 'source_url' => $this->url($obj->id,'thirdparty'), 'source_id' => $obj->id, 'source_type' => 'thirdparty' - ); + ); } } @@ -289,11 +289,11 @@ class mailing_advthirdparties extends MailingTargets if ($type=='thirdparty') { $companystatic=new Societe($this->db); $companystatic->fetch($id); - return $companystatic->getNomUrl(0); + return $companystatic->getNomUrl(0,'',0,1); } elseif ($type=='contact') { $contactstatic=new Contact($this->db); $contactstatic->fetch($id); - return $contactstatic->getNomUrl(0); + return $contactstatic->getNomUrl(0,'',0,'',1); } } From c2397fad60d61f5939bf57775c9a3e7e8a95815b Mon Sep 17 00:00:00 2001 From: Inovea Conseil Date: Sat, 10 Mar 2018 23:49:43 +0100 Subject: [PATCH 4/5] Fix #8092 --- htdocs/societe/card.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index d3f629952b1..b5d643abc98 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -10,6 +10,7 @@ * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García * Copyright (C) 2015 Raphaël Doursenaud + * Copyright (C) 2018 Nicolas ZABOURI * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -295,7 +296,8 @@ if (empty($reshook)) if (! $error) { $result = $object->insertExtraFields(); - if ($result < 0) $error++; + if ($result < 0) $errors = $object->errors; + } if ($error) $action = 'edit_extras'; } From 03f7df88c622708db3d8f95b18317d29f3e4823c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 11 Mar 2018 00:05:32 +0100 Subject: [PATCH 5/5] Update card.php --- htdocs/societe/card.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index b5d643abc98..42abde0e09b 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -292,12 +292,15 @@ if (empty($reshook)) // Fill array 'array_options' with data from update form $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); $ret = $extrafields->setOptionalsFromPost($extralabels, $object, GETPOST('attribute')); - if ($ret < 0) $error++; + if ($ret < 0) { $error++; } if (! $error) { $result = $object->insertExtraFields(); - if ($result < 0) $errors = $object->errors; - + if ($result < 0) + { + $error++; + $errors = $object->errors; + } } if ($error) $action = 'edit_extras'; }