Skip to content

Commit

Permalink
List all payment reasons on payment page filters
Browse files Browse the repository at this point in the history
  • Loading branch information
rjackson committed Apr 9, 2024
1 parent 8ed03ee commit 8dea0ea
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
17 changes: 17 additions & 0 deletions app/Entities/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
}
}
9 changes: 1 addition & 8 deletions app/Http/Controllers/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8dea0ea

Please sign in to comment.