diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index cd5417908737..ce5e9cb85050 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2416,9 +2416,9 @@ $LANG = array( 'online_payment_surcharge' => 'Online Payment Surcharge', 'gateway_fees' => 'Gateway Fees', 'fees_disabled' => 'Fees are disabled', - 'gateway_fees_help' => 'Automatically add an online payment surcharge or line item.
Surcharges aren\'t affected by discounts, line items support partial payments.', + 'gateway_fees_help' => 'Automatically add an online payment surcharge.', 'gateway' => 'Gateway', - 'gateway_fee_change_warning' => 'If there are unpaid invoices with fees they need to be removed to prevent duplicate fees from being charged.', + 'gateway_fee_change_warning' => 'If there are unpaid invoices with fees they need to be updated manually.', 'fees_surcharge_help' => 'Customize surcharge :link.', 'label_and_taxes' => 'label and taxes', 'billable' => 'Billable', diff --git a/resources/views/accounts/payments.blade.php b/resources/views/accounts/payments.blade.php index 7e620278067a..9f4b9811095e 100644 --- a/resources/views/accounts/payments.blade.php +++ b/resources/views/accounts/payments.blade.php @@ -25,14 +25,22 @@ trans('texts.on_due_date') => ['value'=>1, 'name'=>'auto_bill_on_due_date'], ])->help(trans('texts.auto_bill_ach_date_help')) !!}
- {!! Former::select('gateway_fee_location') + + {!! Former::checkbox('gateway_fee_location') + ->onchange('onGatewayFeeChange()') + ->help('gateway_fees_help') + ->label('gateway_fees') + ->text('enable') + ->value(FEE_LOCATION_ITEM) !!} + + {{-- Former::select('gateway_fee_location') ->addOption(trans('texts.disabled'), '') ->addOption(trans('texts.location_first_surcharge') . ($account->custom_invoice_label1 ? ' | ' . $account->custom_invoice_label1 : ''), FEE_LOCATION_CHARGE1) ->addOption(trans('texts.location_second_surcharge') . ($account->custom_invoice_label2 ? ' | ' . $account->custom_invoice_label2 : '' ), FEE_LOCATION_CHARGE2) ->addOption(trans('texts.location_line_item'), FEE_LOCATION_ITEM) ->onchange('onGatewayFeeChange()') ->help('gateway_fees_help') - ->label('gateway_fees')!!} + ->label('gateway_fees') --}}
{!! Former::actions( Button::success(trans('texts.save'))->withAttributes(['id' => 'formSave'])->submit()->appendIcon(Icon::create('floppy-disk')) ) !!} @@ -383,10 +391,9 @@ } window.hasShownGatewayFeeWarning = true; - var settingLocation = $('#gateway_fee_location').val(); - var accountLocation = '{{ $account->gateway_fee_location }}'; - - if (accountLocation && settingLocation && accountLocation != settingLocation) { + var accountEnabled = '{{ $account->gateway_fee_location ? 'true' : 'false' }}'; + var formEnabled = $('#gateway_fee_location').is(':checked'); + if (accountEnabled && ! formEnabled) { swal("{!! trans('texts.warning') !!}", "{!! trans('texts.gateway_fee_change_warning') !!}"); } }