This commit is contained in:
James Cole 2023-04-30 19:12:49 +02:00
parent 46bba9d799
commit 59427ba5c2
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80

View File

@ -80,7 +80,10 @@ class IndexController extends Controller
$defaultCurrency = app('amount')->getDefaultCurrency();
$parameters = new ParameterBag();
$parameters->set('start', $start);
// sub one day from temp start so the last paid date is one day before it should be.
$tempStart = clone $start;
$tempStart->subDay();
$parameters->set('start', $tempStart);
$parameters->set('end', $end);
/** @var BillTransformer $transformer */
@ -108,18 +111,6 @@ class IndexController extends Controller
'object_group_title' => $array['object_group_title'],
'bills' => [],
];
// var_dump($array);exit;
// // expected today? default:
// $array['next_expected_match_diff'] = trans('firefly.not_expected_period');
// $nextExpectedMatch = new Carbon($array['next_expected_match']);
// if ($nextExpectedMatch->isToday()) {
// $array['next_expected_match_diff'] = trans('firefly.today');
// }
// $current = $array['pay_dates'][0] ?? null;
// if (null !== $current && !$nextExpectedMatch->isToday()) {
// $currentExpectedMatch = Carbon::createFromFormat('Y-m-d\TH:i:sP', $current);
// $array['next_expected_match_diff'] = $currentExpectedMatch->diffForHumans(today(), Carbon::DIFF_RELATIVE_TO_NOW);
// }
$currency = $bill->transactionCurrency ?? $defaultCurrency;
$array['currency_id'] = $currency->id;