From e20a528398a6296aa0f396d03eb49a8390280ddb Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 3 Dec 2024 18:57:22 +0100 Subject: [PATCH] Fixed missing decimal places in Contract prices --- application/Contract/ContractModel.php | 2 ++ lib/Helper/Helper.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/application/Contract/ContractModel.php b/application/Contract/ContractModel.php index e52d99a9a..5530a3fcc 100644 --- a/application/Contract/ContractModel.php +++ b/application/Contract/ContractModel.php @@ -495,6 +495,8 @@ class ContractModel { $product_id = $filter['product_id']; if(is_numeric($product_id)) { $where .= " AND Contract.product_id=$product_id"; + } elseif(is_array($product_id)) { + $where .= " AND Contract.product_id IN (".implode(",", $product_id).")"; } } diff --git a/lib/Helper/Helper.php b/lib/Helper/Helper.php index 0613c5112..a3ea44ea5 100644 --- a/lib/Helper/Helper.php +++ b/lib/Helper/Helper.php @@ -162,7 +162,8 @@ class Helper { * @return float */ public static function formatNumber($number, int $decimals = 2, string $decPoint = ",", string $thousandsSep = "."): string { - return number_format(intval($number), $decimals, $decPoint, $thousandsSep); + if(!is_numeric($number)) return ""; + return number_format($number, $decimals, $decPoint, $thousandsSep); } } \ No newline at end of file