Merge branch 'fronkdev' into 'master'

Fixed missing decimal places in Contract prices

See merge request fronk/thetool!776
This commit is contained in:
Frank Schubert
2024-12-03 17:57:45 +00:00
2 changed files with 4 additions and 1 deletions

View File

@@ -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).")";
}
}

View File

@@ -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);
}
}