This commit is contained in:
James Cole 2018-03-07 20:21:51 +01:00
parent fb5323c283
commit bae79063e1
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -317,8 +317,8 @@ class BudgetRepository implements BudgetRepositoryInterface
$amount = '0'; $amount = '0';
$availableBudget = $this->user->availableBudgets() $availableBudget = $this->user->availableBudgets()
->where('transaction_currency_id', $currency->id) ->where('transaction_currency_id', $currency->id)
->where('start_date', $start->format('Y-m-d')) ->where('start_date', $start->format('Y-m-d 00:00:00'))
->where('end_date', $end->format('Y-m-d'))->first(); ->where('end_date', $end->format('Y-m-d 00:00:00'))->first();
if (null !== $availableBudget) { if (null !== $availableBudget) {
$amount = strval($availableBudget->amount); $amount = strval($availableBudget->amount);
} }
@ -492,8 +492,8 @@ class BudgetRepository implements BudgetRepositoryInterface
{ {
$availableBudget = $this->user->availableBudgets() $availableBudget = $this->user->availableBudgets()
->where('transaction_currency_id', $currency->id) ->where('transaction_currency_id', $currency->id)
->where('start_date', $start->format('Y-m-d')) ->where('start_date', $start->format('Y-m-d 00:00:00'))
->where('end_date', $end->format('Y-m-d'))->first(); ->where('end_date', $end->format('Y-m-d 00:00:00'))->first();
if (null === $availableBudget) { if (null === $availableBudget) {
$availableBudget = new AvailableBudget; $availableBudget = new AvailableBudget;
$availableBudget->user()->associate($this->user); $availableBudget->user()->associate($this->user);