scope added #2znd43c
This commit is contained in:
parent
c9cc1fed89
commit
ffe445d0f3
@ -35,7 +35,7 @@ class Transactions extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$transactions = Transaction::with('account', 'category', 'contact')->isNotRecurring()->collect(['paid_at'=> 'desc']);
|
$transactions = Transaction::with('account', 'category', 'contact')->isNotRecurring()->isNotSplit()->collect(['paid_at'=> 'desc']);
|
||||||
|
|
||||||
$totals = [
|
$totals = [
|
||||||
'income' => 0,
|
'income' => 0,
|
||||||
|
@ -190,6 +190,16 @@ class Transaction extends Model
|
|||||||
return $query->where($this->qualifyColumn('type'), 'not like', '%-recurring');
|
return $query->where($this->qualifyColumn('type'), 'not like', '%-recurring');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function scopeIsSplit(Builder $query): Builder
|
||||||
|
{
|
||||||
|
return $query->where($this->qualifyColumn('type'), 'like', '%-split');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function scopeIsNotSplit(Builder $query): Builder
|
||||||
|
{
|
||||||
|
return $query->where($this->qualifyColumn('type'), 'not like', '%-split');
|
||||||
|
}
|
||||||
|
|
||||||
public function scopeIsTransfer(Builder $query): Builder
|
public function scopeIsTransfer(Builder $query): Builder
|
||||||
{
|
{
|
||||||
return $query->where('category_id', '=', Category::transfer());
|
return $query->where('category_id', '=', Category::transfer());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user