diff --git a/app/Helpers/locale_helper.php b/app/Helpers/locale_helper.php index 2ef0b2ab0..245682262 100644 --- a/app/Helpers/locale_helper.php +++ b/app/Helpers/locale_helper.php @@ -435,7 +435,7 @@ function to_decimals(?float $number, string $decimals = null, int $type = Number { if(!isset($number)) { - return ""; + return ''; } $config = config(OSPOS::class)->settings; @@ -481,9 +481,9 @@ function parse_decimals(string $number, int $decimals = null) { return $number; } - + $locale_safe_number = prepare_decimal($number); - + if ($locale_safe_number > MAX_PRECISION) //TODO: This breaks when the string passed does not use . as the decimal separator. { return false; diff --git a/app/Views/item_kits/form.php b/app/Views/item_kits/form.php index 2f461ef41..03005bb1f 100644 --- a/app/Views/item_kits/form.php +++ b/app/Views/item_kits/form.php @@ -89,7 +89,7 @@ 'maxlength' => '5', 'id' => 'kit_discount', 'class' => 'form-control input-sm', - 'value' => $item_kit_info->kit_discount + 'value' => $item_kit_info->kit_discount_type === FIXED ? to_currency_no_money($item_kit_info->kit_discount) : to_decimals($item_kit_info->kit_discount) ]) ?> @@ -197,7 +197,7 @@ ?>