allow empty date in export (#1338)
This commit is contained in:
@@ -3,7 +3,8 @@ root = true
|
|||||||
|
|
||||||
; Unix-style newlines
|
; Unix-style newlines
|
||||||
[*]
|
[*]
|
||||||
end_of_line = LF
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
|
||||||
[*.php]
|
[*.php]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
|
|||||||
@@ -143,8 +143,12 @@ class ExportController extends AbstractController
|
|||||||
*/
|
*/
|
||||||
protected function getEntries(ExportQuery $query): array
|
protected function getEntries(ExportQuery $query): array
|
||||||
{
|
{
|
||||||
$query->getBegin()->setTime(0, 0, 0);
|
if (null !== $query->getBegin()) {
|
||||||
$query->getEnd()->setTime(23, 59, 59);
|
$query->getBegin()->setTime(0, 0, 0);
|
||||||
|
}
|
||||||
|
if (null !== $query->getEnd()) {
|
||||||
|
$query->getEnd()->setTime(23, 59, 59);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->timesheetRepository->getTimesheetsForQuery($query, true);
|
return $this->timesheetRepository->getTimesheetsForQuery($query, true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,10 +122,10 @@ abstract class AbstractToolbarForm extends AbstractType
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function addDateRangeChoice(FormBuilderInterface $builder, $allowEmpty = true)
|
protected function addDateRangeChoice(FormBuilderInterface $builder, $allowEmpty = true, $required = false)
|
||||||
{
|
{
|
||||||
$builder->add('daterange', DateRangeType::class, [
|
$builder->add('daterange', DateRangeType::class, [
|
||||||
'required' => false,
|
'required' => $required,
|
||||||
'allow_empty' => $allowEmpty,
|
'allow_empty' => $allowEmpty,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'unit_price') }} text-nowrap">
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'unit_price') }} text-nowrap">
|
||||||
{{ rate|money(currency) }}
|
{{ rate|money(currency) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'duration') }} text-nowrap">
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'duration') }} text-nowrap" data-duration="{{ entry.duration }}">
|
||||||
{{ duration }}
|
{{ duration }}
|
||||||
</td>
|
</td>
|
||||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'total_rate') }} text-nowrap">
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'total_rate') }} text-nowrap">
|
||||||
|
|||||||
@@ -83,7 +83,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'unit_price') }} text-center">{{ rate|money(model.calculator.currency) }}</td>
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'unit_price') }} text-center">{{ rate|money(model.calculator.currency) }}</td>
|
||||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'amount') }} text-center text-nowrap">{{ amount }}</td>
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'amount') }} text-center text-nowrap">{{ amount }}</td>
|
||||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'duration') }} text-center text-nowrap">{{ duration }}</td>
|
<td class="{{ tables.data_table_column_class(tableName, columns, 'duration') }} text-center text-nowrap" data-duration="{{ entry.duration }}">{{ duration }}</td>
|
||||||
<td class="text-right text-nowrap">{{ entry.rate|money(model.calculator.currency) }}</td>
|
<td class="text-right text-nowrap">{{ entry.rate|money(model.calculator.currency) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user