From e9b5a52a4fc134b6ef12baf8682581855e5c863d Mon Sep 17 00:00:00 2001 From: atm-lena Date: Wed, 3 Feb 2021 15:22:04 +0100 Subject: [PATCH 1/4] Add hidden conf to display supplier in object lines --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 0e705f4f844..9e9da40c23a 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -166,7 +166,7 @@ else } } -if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0) +if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && !empty($conf->global->DISPLAY_SUPPLIER_OBJECTLINES)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $productfourn = new ProductFournisseur($this->db); From c5f73ec12aea794b14eecaa7b5fe1f4ee2c74d2b Mon Sep 17 00:00:00 2001 From: atm-lena Date: Thu, 4 Feb 2021 10:42:42 +0100 Subject: [PATCH 2/4] Resolve ret --- htdocs/core/tpl/objectline_view.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 9e9da40c23a..6b86c5aed8c 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -166,7 +166,7 @@ else } } -if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && !empty($conf->global->DISPLAY_SUPPLIER_OBJECTLINES)) +if ($user->rights->fournisseur->lire && $line->fk_fournprice > 0 && empty($conf->global->SUPPLIER_HIDE_SUPPLIER_OBJECTLINES)) { require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $productfourn = new ProductFournisseur($this->db); From 414a2366fb37cec4ec1d6079721efbffcebd581f Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sun, 7 Feb 2021 19:28:00 +0100 Subject: [PATCH 3/4] Fix links to go back on supplier invoice list --- htdocs/fourn/facture/contact.php | 2 +- htdocs/fourn/facture/info.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/contact.php b/htdocs/fourn/facture/contact.php index cce1b34822d..d9af2d00101 100644 --- a/htdocs/fourn/facture/contact.php +++ b/htdocs/fourn/facture/contact.php @@ -142,7 +142,7 @@ if ($id > 0 || !empty($ref)) dol_fiche_head($head, 'contact', $langs->trans('SupplierInvoice'), -1, 'bill'); - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref supplier diff --git a/htdocs/fourn/facture/info.php b/htdocs/fourn/facture/info.php index f7f99b020fc..74c429f0c2a 100644 --- a/htdocs/fourn/facture/info.php +++ b/htdocs/fourn/facture/info.php @@ -67,7 +67,7 @@ $head = facturefourn_prepare_head($object); $titre = $langs->trans('SupplierInvoice'); dol_fiche_head($head, 'info', $langs->trans('SupplierInvoice'), -1, 'bill'); -$linkback = ''.$langs->trans("BackToList").''; +$linkback = ''.$langs->trans("BackToList").''; $morehtmlref = '
'; // Ref supplier From 9f9ace056589d56c90cc6cdb9b9a61f30317afca Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 7 Feb 2021 22:15:21 +0100 Subject: [PATCH 4/4] FIX Localtax must be converted with price2num --- htdocs/admin/dict.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index 92675cbc883..a36d56f9d1d 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -758,8 +758,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $keycode = $listfieldvalue[$i]; if (empty($keycode)) $keycode = $value; - if ($value == 'price' || preg_match('/^amount/i', $value) || $value == 'taux') { - $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); + if ($value == 'price' || preg_match('/^amount/i', $value)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } + elseif ($value == 'taux' || $value == 'localtax1' || $value == 'localtax2') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); } elseif ($value == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]); @@ -791,7 +794,7 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) if ($result) // Add is ok { setEventMessages($langs->transnoentities("RecordSaved"), null, 'mesgs'); - $_POST = array('id'=>$id); // Clean $_POST array, we keep only + $_POST = array('id'=>$id); // Clean $_POST array, we keep only id } else { @@ -824,8 +827,11 @@ if (GETPOST('actionadd') || GETPOST('actionmodify')) $keycode = $listfieldvalue[$i]; if (empty($keycode)) $keycode = $field; - if ($field == 'price' || preg_match('/^amount/i', $field) || $field == 'taux') { - $_POST[$keycode] = price2num($_POST[$keycode], 'MU'); + if ($field == 'price' || preg_match('/^amount/i', $field)) { + $_POST[$keycode] = price2num(GETPOST($keycode), 'MU'); + } + elseif ($field == 'taux' || $field == 'localtax1' || $field == 'localtax2') { + $_POST[$keycode] = price2num(GETPOST($keycode), 8); } elseif ($field == 'entity') { $_POST[$keycode] = getEntity($tabname[$id]);