Only support line item gateway fees

This commit is contained in:
Hillel Coren 2017-03-24 16:21:35 +03:00
parent 91563b6346
commit d208e54a24
2 changed files with 15 additions and 8 deletions

View File

@ -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.<br/>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',

View File

@ -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')) !!}
<br/>
{!! 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') --}}
<br/>
{!! Former::actions( Button::success(trans('texts.save'))->withAttributes(['id' => 'formSave'])->submit()->appendIcon(Icon::create('floppy-disk')) ) !!}
</div>
@ -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') !!}");
}
}