From 9934ebda30a232be03227f69b0b6daf6965fc14d Mon Sep 17 00:00:00 2001 From: cuneytsenturk Date: Thu, 29 Nov 2018 12:56:49 +0300 Subject: [PATCH] close #642 Fixed: Invoices do not have a euro sign (PDF) --- app/Http/Controllers/Expenses/Bills.php | 4 +++- app/Http/Controllers/Incomes/Invoices.php | 4 +++- resources/views/expenses/bills/bill.blade.php | 10 ++++----- .../views/incomes/invoices/invoice.blade.php | 21 ++++++++++++++----- resources/views/partials/bill/head.blade.php | 4 ++-- .../views/partials/invoice/head.blade.php | 4 ++-- 6 files changed, 31 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Expenses/Bills.php b/app/Http/Controllers/Expenses/Bills.php index 43e239934..cbd5c5ef6 100644 --- a/app/Http/Controllers/Expenses/Bills.php +++ b/app/Http/Controllers/Expenses/Bills.php @@ -337,7 +337,9 @@ class Bills extends Controller { $bill = $this->prepareBill($bill); - $html = view($bill->template_path, compact('bill'))->render(); + $currency_style = true; + + $html = view($bill->template_path, compact('bill', 'currency_style'))->render(); $pdf = \App::make('dompdf.wrapper'); $pdf->loadHTML($html); diff --git a/app/Http/Controllers/Incomes/Invoices.php b/app/Http/Controllers/Incomes/Invoices.php index 903d8acd0..020c9874d 100644 --- a/app/Http/Controllers/Incomes/Invoices.php +++ b/app/Http/Controllers/Incomes/Invoices.php @@ -418,7 +418,9 @@ class Invoices extends Controller { $invoice = $this->prepareInvoice($invoice); - $html = view($invoice->template_path, compact('invoice'))->render(); + $currency_style = true; + + $html = view($invoice->template_path, compact('invoice', 'currency_style'))->render(); $pdf = app('dompdf.wrapper'); $pdf->loadHTML($html); diff --git a/resources/views/expenses/bills/bill.blade.php b/resources/views/expenses/bills/bill.blade.php index e7ab40aa2..171c75c53 100644 --- a/resources/views/expenses/bills/bill.blade.php +++ b/resources/views/expenses/bills/bill.blade.php @@ -125,12 +125,12 @@ {{ $item->quantity }} @stack('quantity_td_end') @stack('price_td_start') - @money($item->price, $bill->currency_code, true) + @money($item->price, $bill->currency_code, true) @stack('price_td_end') @stack('taxes_td_start') @stack('taxes_td_end') @stack('total_td_start') - @money($item->total, $bill->currency_code, true) + @money($item->total, $bill->currency_code, true) @stack('total_td_end') @endforeach @@ -156,20 +156,20 @@ @stack($total->code . '_td_start') {{ trans($total->title) }}: - @money($total->amount, $bill->currency_code, true) + @money($total->amount, $bill->currency_code, true) @stack($total->code . '_td_end') @else @if ($bill->paid) {{ trans('invoices.paid') }}: - - @money($bill->paid, $bill->currency_code, true) + - @money($bill->paid, $bill->currency_code, true) @endif @stack('grand_total_td_start') {{ trans($total->name) }}: - @money($total->amount - $bill->paid, $bill->currency_code, true) + @money($total->amount - $bill->paid, $bill->currency_code, true) @stack('grand_total_td_end') @endif diff --git a/resources/views/incomes/invoices/invoice.blade.php b/resources/views/incomes/invoices/invoice.blade.php index 0f5c1d44d..4ee30611c 100644 --- a/resources/views/incomes/invoices/invoice.blade.php +++ b/resources/views/incomes/invoices/invoice.blade.php @@ -125,12 +125,12 @@ {{ $item->quantity }} @stack('quantity_td_end') @stack('price_td_start') - @money($item->price, $invoice->currency_code, true) + @money($item->price, $invoice->currency_code, true) @stack('price_td_end') @stack('taxes_td_start') @stack('taxes_td_end') @stack('total_td_start') - @money($item->total, $invoice->currency_code, true) + @money($item->total, $invoice->currency_code, true) @stack('total_td_end') @endforeach @@ -156,20 +156,20 @@ @stack($total->code . '_td_start') {{ trans($total->title) }}: - @money($total->amount, $invoice->currency_code, true) + @money($total->amount, $invoice->currency_code, true) @stack($total->code . '_td_end') @else @if ($invoice->paid) {{ trans('invoices.paid') }}: - - @money($invoice->paid, $invoice->currency_code, true) + - @money($invoice->paid, $invoice->currency_code, true) @endif @stack('grand_total_td_start') {{ trans($total->name) }}: - @money($total->amount - $invoice->paid, $invoice->currency_code, true) + @money($total->amount - $invoice->paid, $invoice->currency_code, true) @stack('grand_total_td_end') @endif @@ -179,3 +179,14 @@ @endsection + +@if (isset($currency_style) && $currency_style) +@push('stylesheet') + +@endpush +@endif \ No newline at end of file diff --git a/resources/views/partials/bill/head.blade.php b/resources/views/partials/bill/head.blade.php index 0dc84ebf8..e0354ce3b 100644 --- a/resources/views/partials/bill/head.blade.php +++ b/resources/views/partials/bill/head.blade.php @@ -5,14 +5,14 @@ - + @yield('title') - @setting('general.company_name') diff --git a/resources/views/partials/invoice/head.blade.php b/resources/views/partials/invoice/head.blade.php index 0dc84ebf8..e0354ce3b 100644 --- a/resources/views/partials/invoice/head.blade.php +++ b/resources/views/partials/invoice/head.blade.php @@ -5,14 +5,14 @@ - + @yield('title') - @setting('general.company_name')