From 10e6c73b2be2d07f5a84ef324cd26c774ad1458e Mon Sep 17 00:00:00 2001 From: Deon George Date: Fri, 23 Jul 2021 17:49:59 +1000 Subject: [PATCH] Missed some references to ab_payments in d463239 --- app/Models/User.php | 14 +++++++------- .../adminlte/u/payment/widgets/list.blade.php | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index fbddc5b..a8f11ca 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -528,7 +528,7 @@ class User extends Authenticatable */ private function query_payment_items() { - return DB::table('ab_payment_item') + return DB::table('payment_items') ->select([ 'payment_id', 'invoice_id', @@ -573,9 +573,9 @@ class User extends Authenticatable DB::raw('SUM(fees_amt) AS payment_fees'), ]) ->from($this->query_payment_items(),'PI') - ->join('ab_payment',['ab_payment.id'=>'PI.payment_id']) + ->join('payments',['payments.id'=>'PI.payment_id']) ->whereIN('account_id',$this->all_accounts()->pluck('id')->unique()->toArray()) - //->where('ab_payment.active',TRUE) // @todo To implement + //->where('payments.active',TRUE) // @todo To implement ->groupBy(['invoice_id']); $summary = (new Invoice) @@ -618,20 +618,20 @@ class User extends Authenticatable ]) ->from($this->query_payment_items(),'PI') - //->where('ab_payment.active',TRUE) // @todo To implement + //->where('payments.active',TRUE) // @todo To implement ->groupBy(['payment_id']); return (new Payment) ->select([ - DB::raw('ab_payment.id AS id'), + DB::raw('payments.id AS id'), 'date_orig', 'payment_date', 'total_amt', //'fees_amt', DB::raw('total_amt-allocate AS balance'), ]) - ->rightJoin('ab_payment',['ab_payment.id'=>'summary.id']) - //->where('ab_payment.active',TRUE) // @todo To implement + ->rightJoin('payments',['payments.id'=>'summary.id']) + //->where('payments.active',TRUE) // @todo To implement ->whereIN('account_id',$this->all_accounts()->pluck('id')->unique()->toArray()) ->from($payment,'summary'); } diff --git a/resources/views/theme/backend/adminlte/u/payment/widgets/list.blade.php b/resources/views/theme/backend/adminlte/u/payment/widgets/list.blade.php index d13908d..103c1e9 100644 --- a/resources/views/theme/backend/adminlte/u/payment/widgets/list.blade.php +++ b/resources/views/theme/backend/adminlte/u/payment/widgets/list.blade.php @@ -5,7 +5,7 @@
- @if(($x=$o->payments()->where('ab_payment.date_orig','>',\Carbon\Carbon::now()->subMonths(12)->unix())->with(['items','account'])->get())->count()) + @if(($x=$o->payments()->where('payments.date_orig','>',\Carbon\Carbon::now()->subMonths(12)->unix())->with(['items','account'])->get())->count())