Customer invoice payment method some fix

This commit is contained in:
cuneytsenturk 2017-11-29 19:37:16 +03:00
parent 1e96c7ef6e
commit f894e15451
2 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ class Payments extends Controller
{
$payments = Payment::with(['account', 'category'])->where('customer_id', '=', Auth::user()->customer->id)->paginate();
$payment_methods = Modules::getPaymentMethods();
$payment_methods = Modules::getPaymentMethods('all');
$categories = collect(Category::enabled()->type('income')->pluck('name', 'id'))
->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), '');

View File

@ -11,14 +11,14 @@ use App\Events\PaymentGatewayListing;
class Modules
{
public static function getPaymentMethods()
public static function getPaymentMethods($type = null)
{
$payment_methods = Cache::get('payment_methods.admin');
$customer = auth()->user()->customer;
if ($customer) {
if ($customer && $type != 'all') {
$payment_methods = Cache::get('payment_methods.customer');
}
@ -38,7 +38,7 @@ class Modules
continue;
}
if ($customer && empty($gateway['customer'])) {
if (($customer && empty($gateway['customer'])) && $type != 'all') {
continue;
}