Skip to content

A free open source IT asset/license management system

Fix license output, tweak CleanFloat function to handle numbers over 1 million

Brady Wetheringtonae466be15308
diff --git a/app/Http/Transformers/LicensesTransformer.php b/app/Http/Transformers/LicensesTransformer.php
index 48d5152688..ba58b4fb3d 100644
--- a/app/Http/Transformers/LicensesTransformer.php
+++ b/app/Http/Transformers/LicensesTransformer.php
@@ -31,7 +31,8 @@ class LicensesTransformer
'purchase_date' => Helper::getFormattedDateObject($license->purchase_date, 'date'),
'termination_date' => Helper::getFormattedDateObject($license->termination_date, 'date'),
'depreciation' => ($license->depreciation) ? ['id' => (int) $license->depreciation->id,'name'=> e($license->depreciation->name)] : null,
- 'purchase_cost' => e($license->purchase_cost),
+ 'purchase_cost' => Helper::formatCurrencyOutput($license->purchase_cost),
+ 'purchase_cost_numeric' => $license->purchase_cost,
'notes' => e($license->notes),
'expiration_date' => Helper::getFormattedDateObject($license->expiration_date, 'date'),
'seats' => (int) $license->seats,
diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php
index 3d92bacd34..3d90ff4d89 100644
--- a/resources/views/partials/bootstrap-table.blade.php
+++ b/resources/views/partials/bootstrap-table.blade.php
@@ -601,8 +601,8 @@
}
if ("{{$snipeSettings->digit_separator}}" == "1.234,56") {
// yank periods, change commas to periods
- periodless = number.toString().replace("\.","");
- decimalfixed = periodless.replace(",",".");
+ periodless = number.toString().replace(/\./g,"");
+ decimalfixed = periodless.replace(/,/g,".");
} else {
// yank commas, that's it.
decimalfixed = number.toString().replace(",","");