From f9b8603d093f0761a51c1c775cd7d312abc6d576 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Mar 2017 20:10:40 +0200 Subject: [PATCH] Working on gateway fees --- app/Models/Traits/ChargesFees.php | 3 ++- resources/lang/en/texts.php | 1 + resources/views/accounts/payments.blade.php | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Models/Traits/ChargesFees.php b/app/Models/Traits/ChargesFees.php index 7fd8c9f464..c40bf86b52 100644 --- a/app/Models/Traits/ChargesFees.php +++ b/app/Models/Traits/ChargesFees.php @@ -2,6 +2,7 @@ namespace App\Models\Traits; +use App\Models\GatewayType; use App\Models\InvoiceItem; use App\Models\AccountGatewaySettings; @@ -87,7 +88,7 @@ trait ChargesFees $item = $item ?: InvoiceItem::createNew($this); $item->invoice_item_type_id = INVOICE_ITEM_TYPE_GATEWAY_FEE; $item->product_key = trans('texts.fee'); - $item->notes = ''; + $item->notes = trans('texts.' . GatewayType::getAliasFromId($gatewayTypeId)); $item->cost = $feePreTax; $item->qty = 1; $item->tax_rate1 = $settings->fee_tax_rate1; diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 05525d8fe3..5b909bdb8b 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2407,6 +2407,7 @@ $LANG = array( 'fees_tax_help' => 'Enable line item taxes to set fee tax rates.', 'fees_sample' => 'The fee for a :amount invoice would be :total.', 'no_fees' => 'No Fees', + 'gateway_fees_disclaimer' => 'Warning: not all payment gateways allow adding fees, please review their terms of service.', ); diff --git a/resources/views/accounts/payments.blade.php b/resources/views/accounts/payments.blade.php index ab5aabce29..1bab0d61e6 100644 --- a/resources/views/accounts/payments.blade.php +++ b/resources/views/accounts/payments.blade.php @@ -159,6 +159,8 @@
+
{{ trans('texts.gateway_fees_disclaimer') }} + @if (!$account->invoice_item_taxes && $account->invoice_taxes && count($taxRates))
{{ trans('texts.fees_tax_help') }}
@endif