From 7bb6a7945ac5ffbcfa4a76394019ca832c353ca5 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 24 Mar 2017 16:28:31 +0300 Subject: [PATCH] Hide fee on custom gateway --- .../Datatables/AccountGatewayDatatable.php | 3 --- resources/lang/en/texts.php | 1 + resources/views/accounts/payments.blade.php | 19 ++++++++++++++++--- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/app/Ninja/Datatables/AccountGatewayDatatable.php b/app/Ninja/Datatables/AccountGatewayDatatable.php index 518980ee2a..bbd93e3908 100644 --- a/app/Ninja/Datatables/AccountGatewayDatatable.php +++ b/app/Ninja/Datatables/AccountGatewayDatatable.php @@ -192,9 +192,6 @@ class AccountGatewayDatatable extends EntityDatatable $actions[] = [ trans('texts.set_limits_fees', ['gateway_type' => $gatewayType->name]), function () use ($gatewayType) { - //$accountGatewaySettings = $this->getAccountGatewaySetting($gatewayType->id); - //$min = $accountGatewaySettings && $accountGatewaySettings->min_limit !== null ? $accountGatewaySettings->min_limit : 'null'; - //$max = $accountGatewaySettings && $accountGatewaySettings->max_limit !== null ? $accountGatewaySettings->max_limit : 'null'; return "javascript:showLimitsModal('{$gatewayType->name}', {$gatewayType->id})"; }, function ($model) use ($gatewayType) { diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index ce5e9cb850..a70148f7ba 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2436,6 +2436,7 @@ $LANG = array( 'auto_bill_failed' => 'Auto-billing for invoice :invoice_number failed', 'online_payment_discount' => 'Online Payment Discount', 'created_new_company' => 'Successfully created new company', + 'fees_disabled_for_gateway' => 'Fees are disabled for this gateway.', ); diff --git a/resources/views/accounts/payments.blade.php b/resources/views/accounts/payments.blade.php index 9f4b981109..ce1a0f8393 100644 --- a/resources/views/accounts/payments.blade.php +++ b/resources/views/accounts/payments.blade.php @@ -134,7 +134,12 @@
-
+ +
{!! Former::text('fee_amount') ->label('amount') @@ -262,13 +267,21 @@ setTaxRate(2, '', ''); } - $('#paymentLimitsModal').modal('show'); - updateFeeSample(); @if ($account->gateway_fee_location == FEE_LOCATION_ITEM) $('#taxDiv').show(); @endif + + if (gateway_type_id == {{ GATEWAY_TYPE_CUSTOM }}) { + $('#feesEnabled').hide(); + $('#feesDisabled').show(); + } else { + $('#feesDisabled').hide(); + $('#feesEnabled').show(); + } + + $('#paymentLimitsModal').modal('show'); } var limitsSlider = document.getElementById('payment-limits-slider');