Merge pull request #1661 from domkrm/fix/reconciliation-ignore-time

Fix transaction not visible when paid on the end date of a reconciliation
This commit is contained in:
Cüneyt Şentürk 2020-11-10 22:03:01 +03:00 committed by GitHub
commit ce2fee9d0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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');
}