diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php index d9b15907d3..7781f99db4 100644 --- a/app/Http/Controllers/AccountController.php +++ b/app/Http/Controllers/AccountController.php @@ -1190,13 +1190,6 @@ class AccountController extends BaseController $account->auto_bill_on_due_date = boolval(Input::get('auto_bill_on_due_date')); $account->gateway_fee_location = Input::get('gateway_fee_location') ?: null; - /* - if ($account->gateway_fee_location) { - $taxField = $account->gateway_fee_location == FEE_LOCATION_CHARGE1 ? 'custom_invoice_taxes1' : 'custom_invoice_taxes1'; - $account->$taxField = false; - } - */ - $account->save(); event(new UserSettingsChanged()); diff --git a/app/Models/Account.php b/app/Models/Account.php index 8925334457..17a040f672 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -396,6 +396,11 @@ class Account extends Eloquent return $this->invoice_number_prefix != $this->quote_number_prefix; } + public function hasGatewayFeeSurcharge() + { + return $this->gateway_fee_location == FEE_LOCATION_CHARGE1 || $this->gateway_fee_location == FEE_LOCATION_CHARGE2; + } + /** * @return mixed */ diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 525ce42d5f..f86bf20dc1 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.
Use \'Line item\' to support partial payments.', + 'gateway_fees_help' => 'Automatically add an online payment surcharge or line item.
Use \'Line item\' to support partial/deposit payments.', 'gateway' => 'Gateway', - 'gateway_fee_change_warning' => 'If there are unpaid invoices with fees applied they need to be removed to prevent duplicate fees.', + 'gateway_fee_change_warning' => 'If there are unpaid invoices with fees they need to be removed to prevent duplicate fees from being charged.', 'fees_surcharge_help' => 'Customize surcharge :link.', 'label_and_taxes' => 'label and taxes' diff --git a/resources/views/accounts/invoice_settings.blade.php b/resources/views/accounts/invoice_settings.blade.php index e7c24d081a..60e863dd23 100644 --- a/resources/views/accounts/invoice_settings.blade.php +++ b/resources/views/accounts/invoice_settings.blade.php @@ -238,20 +238,18 @@ ->label(trans('texts.field_label')) ->placeholder($account->gateway_fee_location == FEE_LOCATION_CHARGE1 ? trans('texts.surcharge') : ' ') ->addGroupClass('pad-checkbox') - ->append($account->gateway_fee_location == FEE_LOCATION_CHARGE1 && false ? false : - Former::checkbox('custom_invoice_taxes1') - ->value(1) - ->raw() . trans('texts.charge_taxes')) !!} + ->append(Former::checkbox('custom_invoice_taxes1') + ->value(1) + ->raw() . trans('texts.charge_taxes')) !!} {!! Former::text('custom_invoice_label2') ->label(trans('texts.field_label')) ->placeholder($account->gateway_fee_location == FEE_LOCATION_CHARGE2 ? trans('texts.surcharge') : ' ') ->addGroupClass('pad-checkbox') - ->append($account->gateway_fee_location == FEE_LOCATION_CHARGE2 && false ? false : - Former::checkbox('custom_invoice_taxes2') - ->value(1) - ->raw() . trans('texts.charge_taxes')) - ->help(trans('texts.custom_invoice_charges_helps')) !!} + ->append(Former::checkbox('custom_invoice_taxes2') + ->value(1) + ->raw() . trans('texts.charge_taxes')) + ->help(trans('texts.custom_invoice_charges_helps')) !!} diff --git a/resources/views/accounts/payments.blade.php b/resources/views/accounts/payments.blade.php index 9f090ff3de..7e62027806 100644 --- a/resources/views/accounts/payments.blade.php +++ b/resources/views/accounts/payments.blade.php @@ -172,7 +172,7 @@ @if ($account->gateway_fee_location == FEE_LOCATION_ITEM && !$account->invoice_item_taxes && $account->invoice_taxes && count($taxRates))
{{ trans('texts.fees_tax_help') }} @endif - @if ($account->gateway_fee_location == FEE_LOCATION_CHARGE1 || $account->gateway_fee_location == 2) + @if ($account->hasGatewayFeeSurcharge())
{!! trans('texts.fees_surcharge_help', ['link' => link_to('/settings/invoice_settings#invoice_surcharges', trans('texts.label_and_taxes'), ['target' => '_blank'])]) !!} @endif diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index d7bfd9badb..88d463da2e 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -158,8 +158,10 @@ ->placeholder($invoice->exists || $invoice->isQuote() ? ' ' : $account->present()->dueDatePlaceholder()) ->data_date_format(Session::get(SESSION_DATE_PICKER_FORMAT, DEFAULT_DATE_PICKER_FORMAT))->appendIcon('calendar')->addGroupClass('due_date') !!} - {!! Former::text('partial')->data_bind("value: partial, valueUpdate: 'afterkeydown'")->onkeyup('onPartialChange()') - ->addGroupClass('partial')!!} + @if (! $account->hasGatewayFeeSurcharge()) + {!! Former::text('partial')->data_bind("value: partial, valueUpdate: 'afterkeydown'")->onkeyup('onPartialChange()') + ->addGroupClass('partial')!!} + @endif @if ($entityType == ENTITY_INVOICE)