From 34776b2eb2d82394ea5d347c780a8237bf0ceafc Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Thu, 23 Mar 2017 17:17:05 +0200 Subject: [PATCH] =?UTF-8?q?Show=20=E2=80=98Discount=E2=80=99=20for=20negat?= =?UTF-8?q?ive=20online=20payment=20surcharges?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Ninja/Repositories/InvoiceRepository.php | 4 ++-- resources/lang/en/texts.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Ninja/Repositories/InvoiceRepository.php b/app/Ninja/Repositories/InvoiceRepository.php index 7a57a79b56fd..13efd56e7274 100644 --- a/app/Ninja/Repositories/InvoiceRepository.php +++ b/app/Ninja/Repositories/InvoiceRepository.php @@ -1072,8 +1072,8 @@ class InvoiceRepository extends BaseRepository $fee = $invoice->calcGatewayFee($gatewayTypeId); $item = []; - $item['product_key'] = trans('texts.surcharge'); - $item['notes'] = trans('texts.online_payment_surcharge'); + $item['product_key'] = $fee >= 0 ? trans('texts.surcharge') : trans('texts.discount'); + $item['notes'] = $fee >= 0 ? trans('texts.online_payment_surcharge') : trans('texts.online_payment_discount'); $item['qty'] = 1; $item['cost'] = $fee; $item['tax_rate1'] = $settings->fee_tax_rate1; diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index 04ccc4789add..f94a4563ed06 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2434,6 +2434,7 @@ $LANG = array( 'next_reset' => 'Next Reset', 'reset_counter_help' => 'Automatically reset the invoice and quote counters.', 'auto_bill_failed' => 'Auto-billing for invoice :invoice_number failed', + 'online_payment_discount' => 'Online Payment Discount', );