From a5baf2bc8810b2a4e9d25ae62472f8e55b0c4b27 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Wed, 26 Feb 2020 09:19:39 +0100 Subject: [PATCH 1/4] FIX search with '0' --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ed50e236ffe..2c3b29c73b0 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7587,7 +7587,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) $i3 = 0; foreach($tmpcrits as $tmpcrit) { - if(empty($tmpcrit)) continue; + if(!isset($tmpcrit)) continue; $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); From 009eb0d4a4dc10a5a177e52608fd33c648b12aaa Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Thu, 27 Feb 2020 09:34:20 +0100 Subject: [PATCH 2/4] FIX test on 0 better than isset --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2c3b29c73b0..8b2a31874ca 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -7587,7 +7587,7 @@ function natural_search($fields, $value, $mode = 0, $nofirstand = 0) $i3 = 0; foreach($tmpcrits as $tmpcrit) { - if(!isset($tmpcrit)) continue; + if($tmpcrit !== '0' && empty($tmpcrit)) continue; $newres .= (($i2 > 0 || $i3 > 0) ? ' OR ' : ''); From 284a4189b3945b5b743b57cac6c0a213b313a6ab Mon Sep 17 00:00:00 2001 From: gauthier Date: Fri, 28 Feb 2020 14:32:35 +0100 Subject: [PATCH 3/4] FIX : round MT in accountancy books --- htdocs/accountancy/journal/bankjournal.php | 2 +- htdocs/accountancy/journal/expensereportsjournal.php | 2 +- htdocs/accountancy/journal/purchasesjournal.php | 2 +- htdocs/accountancy/journal/sellsjournal.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php index 6bf387c9b0e..c38f9ecfd41 100644 --- a/htdocs/accountancy/journal/bankjournal.php +++ b/htdocs/accountancy/journal/bankjournal.php @@ -670,7 +670,7 @@ if (! $error && $action == 'writebookkeeping') { } } - if (price2num($totaldebit) != price2num($totalcredit)) + if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) { $error++; $errorforline++; diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php index 07982f107fd..98ba695ae21 100644 --- a/htdocs/accountancy/journal/expensereportsjournal.php +++ b/htdocs/accountancy/journal/expensereportsjournal.php @@ -349,7 +349,7 @@ if ($action == 'writebookkeeping') { } // Protection against a bug on line before - if (price2num($totaldebit) != price2num($totalcredit)) + if (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT')) { $error++; $errorforline++; diff --git a/htdocs/accountancy/journal/purchasesjournal.php b/htdocs/accountancy/journal/purchasesjournal.php index 14501ae9b82..01ff1cd7ac2 100644 --- a/htdocs/accountancy/journal/purchasesjournal.php +++ b/htdocs/accountancy/journal/purchasesjournal.php @@ -513,7 +513,7 @@ if ($action == 'writebookkeeping') { } // Protection against a bug on lines before - if (! $errorforline && (price2num($totaldebit) != price2num($totalcredit))) + if (! $errorforline && (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))) { $error++; $errorforline++; diff --git a/htdocs/accountancy/journal/sellsjournal.php b/htdocs/accountancy/journal/sellsjournal.php index 3b63b761183..e8f7f08e6a4 100644 --- a/htdocs/accountancy/journal/sellsjournal.php +++ b/htdocs/accountancy/journal/sellsjournal.php @@ -467,7 +467,7 @@ if ($action == 'writebookkeeping') { } // Protection against a bug on lines before - if (! $errorforline && (price2num($totaldebit) != price2num($totalcredit))) + if (! $errorforline && (price2num($totaldebit, 'MT') != price2num($totalcredit, 'MT'))) { $error++; $errorforline++; From 8eff3162a981acfdb476bd9c9e2c676d35ebe134 Mon Sep 17 00:00:00 2001 From: VESSILLER Date: Fri, 28 Feb 2020 11:16:39 +0100 Subject: [PATCH 4/4] FIX undefined function measuringUnitString in product list --- htdocs/product/list.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 9fc5eaa62d4..ce3f8f1cd81 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -36,6 +36,7 @@ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; if (!empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';