mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Added FORMATTER form_formatNullToStringNumber: formats NULL to '0.00'
Now this is used to display 0.00 in Betrag-column when the value is null.
This commit is contained in:
@@ -126,6 +126,20 @@ $this->load->view(
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Formatters - changes display information, not the data itself
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Formats null values to a string number '0.00'
|
||||
var form_formatNulltoStringNumber = function(cell){
|
||||
if (cell.getValue() == null){
|
||||
return '0.00';
|
||||
}
|
||||
else {
|
||||
return cell.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Header filter
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -370,7 +370,7 @@ $filterWidgetArray = array(
|
||||
stunden: {align:"right",
|
||||
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
|
||||
bottomCalc:"sum", bottomCalcParams:{precision:1}, width: "5%"},
|
||||
betrag: {align:"right",
|
||||
betrag: {align:"right", formatter: form_formatNulltoStringNumber,
|
||||
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
|
||||
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"},
|
||||
width: "8%"},
|
||||
|
||||
@@ -151,6 +151,20 @@ $this->load->view(
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Formatters - changes display information, not the data itself
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Formats null values to a string number '0.00'
|
||||
var form_formatNulltoStringNumber = function(cell){
|
||||
if (cell.getValue() == null){
|
||||
return '0.00';
|
||||
}
|
||||
else {
|
||||
return cell.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Header filter
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -390,7 +390,7 @@ $filterWidgetArray = array(
|
||||
stunden: {align:"right",
|
||||
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
|
||||
bottomCalc:"sum", bottomCalcParams:{precision:1}},
|
||||
betrag: {align:"right",
|
||||
betrag: {align:"right", formatter: form_formatNulltoStringNumber,
|
||||
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
|
||||
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money", bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}},
|
||||
vertrag_id: {visible: false},
|
||||
|
||||
@@ -150,6 +150,20 @@ $this->load->view(
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Formatters - changes display information, not the data itself
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Formats null values to a string number '0.00'
|
||||
var form_formatNulltoStringNumber = function(cell){
|
||||
if (cell.getValue() == null){
|
||||
return '0.00';
|
||||
}
|
||||
else {
|
||||
return cell.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Header filter
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -395,7 +395,7 @@ $filterWidgetArray = array(
|
||||
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
|
||||
bottomCalc:"sum", bottomCalcParams:{precision:1}},
|
||||
stundensatz: {visible: false},
|
||||
betrag: {align:"right",
|
||||
betrag: {align:"right", formatter: form_formatNulltoStringNumber,
|
||||
headerFilter:"input", headerFilterFunc: hf_filterStringnumberWithOperator,
|
||||
bottomCalc:"sum", bottomCalcParams:{precision:2}, bottomCalcFormatter:"money",
|
||||
bottomCalcFormatterParams:{decimal: ",", thousand: ".", symbol:"€"}},
|
||||
|
||||
Reference in New Issue
Block a user