diff --git a/app/Http/Controllers/Banking/Transactions.php b/app/Http/Controllers/Banking/Transactions.php index 6a672aeef..dee840e17 100644 --- a/app/Http/Controllers/Banking/Transactions.php +++ b/app/Http/Controllers/Banking/Transactions.php @@ -35,7 +35,7 @@ class Transactions extends Controller */ 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 = [ 'income' => 0, diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index 757a851d4..f658859f6 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -190,6 +190,16 @@ class Transaction extends Model 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 { return $query->where('category_id', '=', Category::transfer());