From 8dea0ea99fcde47f4a27f1583a42936f91b22aa1 Mon Sep 17 00:00:00 2001 From: Rob Jackson Date: Tue, 9 Apr 2024 20:09:07 +0100 Subject: [PATCH] List all payment reasons on payment page filters --- app/Entities/Payment.php | 17 +++++++++++++++++ app/Http/Controllers/PaymentController.php | 9 +-------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/Entities/Payment.php b/app/Entities/Payment.php index 45913838..9b61503a 100755 --- a/app/Entities/Payment.php +++ b/app/Entities/Payment.php @@ -71,4 +71,21 @@ public function getRefAttribute() { return $this->attributes['reference']; } + + public static function getPaymentReasons() + { + return [ + 'subscription' => 'Subscription', + 'induction' => 'Equipment Access Fee', + 'snackspace' => 'Snackspace', + 'snackspace-kiosk' => 'Snackspace Kiosk (old)', + 'balance' => 'Balance', + 'Laser Materials' => 'Laser Materials', + 'equipment-fee' => 'Equipment Costs', + 'Fob' => 'Fob', + 'Heat Press Items' => 'Heat Press Items', + '3D Printer Filament' => '3D Printer Filament', + 'Misc Materials' => 'Misc Materials', + ]; + } } diff --git a/app/Http/Controllers/PaymentController.php b/app/Http/Controllers/PaymentController.php index 9cff5dcb..e157a348 100644 --- a/app/Http/Controllers/PaymentController.php +++ b/app/Http/Controllers/PaymentController.php @@ -91,14 +91,7 @@ public function index() $memberList = $this->userRepository->getAllAsDropdown(); - $reasonList = [ - 'subscription' => 'Subscription', - 'induction' => 'Equipment Access Fee', - 'balance' => 'Balance', - 'door-key' => 'Key Deposit', - 'storage-box' => 'Storage Box Deposit', - 'equipment-fee' => 'Equipment Costs' - ]; + $reasonList = Payment::getPaymentReasons(); return \View::make('payments.index')->with('payments', $payments)->with('dateRange', $dateRange) ->with('memberList', $memberList)->with('reasonList', $reasonList)->with('paymentTotal', $paymentTotal);