This commit is contained in:
James Cole
2023-10-30 19:11:02 +01:00
parent 6790c318e2
commit d36feebb71
3 changed files with 10 additions and 6 deletions

View File

@@ -86,7 +86,7 @@ class BillTransformer extends AbstractTransformer
foreach ($payDates as $string) {
$payDatesFormatted[] = Carbon::createFromFormat('!Y-m-d', $string, config('app.timezone'))->toAtomString();
}
$nextExpectedMatch = '';
$nextExpectedMatch = null;
if (null !== ($payDates[0] ?? null)) {
$nextExpectedMatch = Carbon::createFromFormat('!Y-m-d', $payDates[0], config('app.timezone'))->toAtomString();
}

View File

@@ -201,7 +201,7 @@ class BillTransformer extends AbstractTransformer
// date for currency conversion
/** @var Carbon|null $startParam */
$startParam = $this->parameters->get('start');
/** @var Carbon|null $start */
/** @var Carbon|null $date */
$date = null === $startParam ? today() : clone $startParam;
@@ -290,8 +290,8 @@ class BillTransformer extends AbstractTransformer
/**
* Returns the latest date in the set, or start when set is empty.
*
* @param Collection $dates
* @param Carbon $default
* @param array $dates
* @param Carbon $default
*
* @return Carbon
*/

View File

@@ -80,7 +80,9 @@
{{ trans('firefly.not_expected_period') }}
</td>
<td class="expected_in_period hidden-sm hidden-xs">
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
{% if entry.next_expected_match %}
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
{% endif %}
</td>
{% endif %}
@@ -116,7 +118,9 @@
{% endfor %}
</td>
<td class="expected_in_period hidden-sm hidden-xs">
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
{% if entry.next_expected_match %}
{{ formatDate(entry.next_expected_match, monthAndDayFormat) }}
{% endif %}
</td>
{% endif %}
{# bill is not active #}