mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Extended budgets and limits [skip-ci]
This commit is contained in:
@@ -11,6 +11,13 @@ namespace Firefly\Storage\Limit;
|
||||
|
||||
class EloquentLimitRepository implements LimitRepositoryInterface
|
||||
{
|
||||
|
||||
public function find($limitId)
|
||||
{
|
||||
return \Limit::with('limitrepetitions')->where('limits.id', $limitId)->leftJoin('components', 'components.id', '=', 'limits.component_id')
|
||||
->where('components.user_id', \Auth::user()->id)->first();
|
||||
}
|
||||
|
||||
public function store($data)
|
||||
{
|
||||
$budget = \Budget::find($data['budget_id']);
|
||||
@@ -74,8 +81,7 @@ class EloquentLimitRepository implements LimitRepositoryInterface
|
||||
{
|
||||
$type = \TransactionType::where('type', 'Withdrawal')->first();
|
||||
|
||||
$result = $budget->transactionjournals()->after($start)->
|
||||
before($end)->get();
|
||||
$result = $budget->transactionjournals()->after($start)->before($end)->get();
|
||||
|
||||
return $result;
|
||||
|
||||
|
@@ -9,4 +9,6 @@ interface LimitRepositoryInterface
|
||||
public function store($data);
|
||||
|
||||
public function getTJByBudgetAndDateRange(\Budget $budget, \Carbon\Carbon $start, \Carbon\Carbon $end);
|
||||
|
||||
public function find($limitId);
|
||||
}
|
Reference in New Issue
Block a user