Skip to content
8 changes: 8 additions & 0 deletions Lib/ReportChart/Chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ protected function getSqlMySQL(Report $report): string
. "' ELSE '" . Tools::lang()->trans('does-not-have-a-value') . "' END";
break;

case 'HOUR':
$xCol = "DATE_FORMAT(" . $report->xcolumn . ", '%H')";
break;

case 'DAY':
$xCol = "DATE_FORMAT(" . $report->xcolumn . ", '%Y-%m-%d')";
break;
Expand Down Expand Up @@ -198,6 +202,10 @@ protected function getSqlPostgreSQL(Report $report): string
. "' ELSE '" . Tools::lang()->trans('does-not-have-a-value') . "' END";
break;

case 'HOUR':
$xCol = "to_char(" . $report->xcolumn . ", 'HH24')";
break;

case 'DAY':
$xCol = "to_char(" . $report->xcolumn . ", 'YY-MM-DD')";
break;
Expand Down
6 changes: 5 additions & 1 deletion Translation/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"featured": "Featured",
"fractional-payment-corporation-tax": "Fractional payment Corporate Tax",
"group-by-months": "Group by months",
"group-by-hour": "Group by hour",
"has-a-value": "Has a value",
"income-book": "Income ledger",
"income-book-description": "Registers all issued invoices",
Expand Down Expand Up @@ -242,5 +243,8 @@
"active-customers": "Active customers",
"active-customers-year": "Active customers this year",
"inactive-customers": "Deregistered customers",
"total-customers": "Total customers"
"total-customers": "Total customers",
"field-can-not-be-null": "The %fieldName% field cannot be empty.",
"table-not-found": "Table %tableName% not found.",
"no-data-found": "No data found."
}
6 changes: 5 additions & 1 deletion Translation/es_ES.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"featured": "Destacado",
"fractional-payment-corporation-tax": "Pago fraccionado Imp. Sociedades",
"group-by-months": "Agrupar por meses",
"group-by-hour": "Agrupar por hora",
"has-a-value": "Tiene valor",
"income-book": "Libro de ingresos",
"income-book-description": "Registra todas las facturas emitidas",
Expand Down Expand Up @@ -242,5 +243,8 @@
"active-customers": "Clientes activos",
"active-customers-year": "Clientes activos este año",
"inactive-customers": "Clientes dados de baja",
"total-customers": "Clientes totales"
"total-customers": "Clientes totales",
"field-can-not-be-null": "El campo %fieldName% no puede estar vacío.",
"table-not-found": "No se ha encontrado la tabla %tableName%.",
"no-data-found": "No se han encontrado datos."
}
1 change: 1 addition & 0 deletions XMLView/EditReport.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<values title="has-a-value">HAS_A_VALUE</values>
<values title="does-not-have-a-value">DOES_NOT_HAVE_A_VALUE</values>
<values title="group-by-day">DAY</values>
<values title="group-by-hour">HOUR</values>
<values title="group-by-week">WEEK</values>
<values title="group-by-month">MONTH</values>
<values title="group-by-months">MONTHS</values>
Expand Down
Loading