Fix bar, also multi currency #2977

This commit is contained in:
James Cole
2020-03-21 15:12:23 +01:00
parent 790e29f15e
commit cf4f76f211
5 changed files with 61 additions and 2 deletions

View File

@@ -290,4 +290,16 @@ class AvailableBudgetRepository implements AvailableBudgetRepositoryInterface
{
$this->user->availableBudgets()->delete();
}
/**
* @inheritDoc
*/
public function getByCurrencyDate(Carbon $start, Carbon $end, TransactionCurrency $currency): ?AvailableBudget
{
return $this->user
->availableBudgets()
->where('transaction_currency_id', $currency->id)
->where('start_date', $start->format('Y-m-d 00:00:00'))
->where('end_date', $end->format('Y-m-d 00:00:00'))->first();
}
}