Fix transaction not visible when paid on the end date of a reconciliation

This commit is contained in:
domkrm 2020-11-09 21:40:25 +01:00
parent 9e37f6cb8b
commit e7b0247bec

View File

@ -177,10 +177,10 @@ class Reconciliations extends Controller
*/
protected function getTransactions($account, $started_at, $ended_at)
{
$started = explode(' ', $started_at);
$ended = explode(' ', $ended_at);
$started = explode(' ', $started_at)[0] . ' 00:00:00';
$ended = explode(' ', $ended_at)[0] . ' 23:59:59';
$transactions = Transaction::where('account_id', $account->id)->whereBetween('paid_at', [$started[0], $ended[0]])->get();
$transactions = Transaction::where('account_id', $account->id)->whereBetween('paid_at', [$started, $ended])->get();
return collect($transactions)->sortByDesc('paid_at');
}