Portal > Payment search and filter
This commit is contained in:
parent
c1bfcb8b9a
commit
c502b73632
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Portal;
|
||||
|
||||
use App\Abstracts\Http\Controller;
|
||||
use App\Models\Banking\Transaction;
|
||||
use App\Models\Setting\Currency;
|
||||
use App\Http\Requests\Portal\PaymentShow as Request;
|
||||
use App\Utilities\Modules;
|
||||
|
||||
@ -16,7 +17,9 @@ class Payments extends Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$payments = Transaction::income()->where('contact_id', '=', user()->contact->id)->paginate();
|
||||
$search = request()->get('search');
|
||||
|
||||
$payments = Transaction::income()->where('contact_id', '=', user()->contact->id)->usingSearchString($search)->sortable('paid_at')->paginate();
|
||||
|
||||
$payment_methods = Modules::getPaymentMethods('all');
|
||||
|
||||
@ -36,4 +39,16 @@ class Payments extends Controller
|
||||
|
||||
return view('portal.payments.show', compact('payment', 'payment_methods'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function currencies()
|
||||
{
|
||||
$currencies = Currency::collect();
|
||||
|
||||
return $this->response('portal.currencies.index', compact('currencies'));
|
||||
}
|
||||
}
|
||||
|
@ -295,4 +295,19 @@ return [
|
||||
],
|
||||
],
|
||||
|
||||
App\Models\Portal\Banking\Transaction::class => [
|
||||
'columns' => [
|
||||
'paid_at' => ['date' => true],
|
||||
'amount',
|
||||
'currency_code' => [
|
||||
'route' => 'portal.payment.currencies'
|
||||
],
|
||||
'document_id',
|
||||
'description' => ['searchable' => true],
|
||||
'payment_method',
|
||||
'reference',
|
||||
'parent_id',
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
|
@ -13,9 +13,8 @@
|
||||
]) !!}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12 d-flex align-items-center">
|
||||
<span class="font-weight-400 d-none d-lg-block mr-2">{{ trans('general.search') }}:</span>
|
||||
<akaunting-search></akaunting-search>
|
||||
<div class="col-12 align-items-center">
|
||||
<x-search-string model="App\Models\Portal\Banking\Transaction" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -16,6 +16,7 @@ Route::group(['as' => 'portal.'], function () {
|
||||
Route::post('invoices/{invoice}/confirm', 'Portal\Invoices@confirm')->name('invoices.confirm');
|
||||
Route::resource('invoices', 'Portal\Invoices');
|
||||
|
||||
Route::get('payments/currencies', 'Portal\Payments@currencies')->name('payment.currencies');
|
||||
Route::resource('payments', 'Portal\Payments');
|
||||
|
||||
Route::get('profile/read-invoices', 'Portal\Profile@readOverdueInvoices')->name('invoices.read');
|
||||
|
Loading…
x
Reference in New Issue
Block a user