Merge branch 'develop' of https://github.com/snipe/snipe-it into develop
This commit is contained in:
commit
7b447a2f16
3 changed files with 15 additions and 4 deletions
|
@ -67,7 +67,7 @@ class Helper
|
||||||
{
|
{
|
||||||
$colors = [
|
$colors = [
|
||||||
"#008941",
|
"#008941",
|
||||||
"#FF4A46",
|
"#FF851B",
|
||||||
"#006FA6",
|
"#006FA6",
|
||||||
"#A30059",
|
"#A30059",
|
||||||
"#1CE6FF",
|
"#1CE6FF",
|
||||||
|
|
|
@ -176,7 +176,6 @@ class StatuslabelsController extends Controller
|
||||||
|
|
||||||
foreach ($statuslabels as $statuslabel) {
|
foreach ($statuslabels as $statuslabel) {
|
||||||
if ($statuslabel->assets_count > 0) {
|
if ($statuslabel->assets_count > 0) {
|
||||||
|
|
||||||
$labels[]=$statuslabel->name. ' ('.number_format($statuslabel->assets_count).')';
|
$labels[]=$statuslabel->name. ' ('.number_format($statuslabel->assets_count).')';
|
||||||
$points[]=$statuslabel->assets_count;
|
$points[]=$statuslabel->assets_count;
|
||||||
|
|
||||||
|
@ -184,8 +183,8 @@ class StatuslabelsController extends Controller
|
||||||
$colors_array[] = $statuslabel->color;
|
$colors_array[] = $statuslabel->color;
|
||||||
} else {
|
} else {
|
||||||
$colors_array[] = Helper::defaultChartColors($default_color_count);
|
$colors_array[] = Helper::defaultChartColors($default_color_count);
|
||||||
$default_color_count++;
|
|
||||||
}
|
}
|
||||||
|
$default_color_count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -595,11 +595,23 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function cleanFloat(number) {
|
||||||
|
if ("{{$snipeSettings->digit_separator}}" == "1.234,56") {
|
||||||
|
// yank periods, change commas to periods
|
||||||
|
periodless = number.toString().replace("\.","");
|
||||||
|
decimalfixed = periodless.replace(",",".");
|
||||||
|
} else {
|
||||||
|
// yank commas, that's it.
|
||||||
|
decimalfixed = number.toString().replace(",","");
|
||||||
|
}
|
||||||
|
return parseFloat(decimalfixed);
|
||||||
|
}
|
||||||
|
|
||||||
function sumFormatter(data) {
|
function sumFormatter(data) {
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
var field = this.field;
|
var field = this.field;
|
||||||
var total_sum = data.reduce(function(sum, row) {
|
var total_sum = data.reduce(function(sum, row) {
|
||||||
return (sum) + (parseFloat(row[field]) || 0);
|
return (sum) + (cleanFloat(row[field]) || 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
return numberWithCommas(total_sum.toFixed(2));
|
return numberWithCommas(total_sum.toFixed(2));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue