From 2ddc87ba6e4aa5212eff5052ac5f006bc3ad6ba1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 25 Oct 2019 13:26:16 +1100 Subject: [PATCH] Fixes for invoice controlleR (#3019) --- app/Transformers/InvoiceTransformer.php | 2 +- app/Utils/Number.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index 688666f8141d..7cc0b82771ea 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -91,7 +91,7 @@ class InvoiceTransformer extends EntityTransformer 'updated_at' => $invoice->updated_at, 'archived_at' => $invoice->deleted_at, 'invoice_number' => $invoice->invoice_number, - 'discount' => (float) $invoice->discount ?: '', + 'discount' => (float) $invoice->discount, 'po_number' => $invoice->po_number ?: '', 'invoice_date' => $invoice->invoice_date ?: '', 'due_date' => $invoice->due_date ?: '', diff --git a/app/Utils/Number.php b/app/Utils/Number.php index e75fe7553cce..0bce0cb6a1ad 100644 --- a/app/Utils/Number.php +++ b/app/Utils/Number.php @@ -70,13 +70,13 @@ class Number $swapSymbol = $currency->swap_currency_symbol; /* Country settings override client settings */ - if (property_exists($client->country), 'thousand_separator') + if (property_exists($client->country, 'thousand_separator')) $thousand = $client->country->thousand_separator; - if (property_exists($client->country), 'decimal_separator') + if (property_exists($client->country, 'decimal_separator')) $decimal = $client->country->decimal_separator; - if(property_exists($client->country), 'swap_currency_symbol') + if(property_exists($client->country, 'swap_currency_symbol')) $swapSymbol = $client->country->swap_currency_symbol; $value = number_format($value, $precision, $decimal, $thousand);