close #642 Fixed: Invoices do not have a euro sign (PDF)

This commit is contained in:
cuneytsenturk 2018-11-29 12:56:49 +03:00
parent e000f55e65
commit 9934ebda30
6 changed files with 31 additions and 16 deletions

View File

@ -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);

View File

@ -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);

View File

@ -125,12 +125,12 @@
<td class="quantity">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="price">@money($item->price, $bill->currency_code, true)</td>
<td class="style-price price">@money($item->price, $bill->currency_code, true)</td>
@stack('price_td_end')
@stack('taxes_td_start')
@stack('taxes_td_end')
@stack('total_td_start')
<td class="total">@money($item->total, $bill->currency_code, true)</td>
<td class="style-price total">@money($item->total, $bill->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
@ -156,20 +156,20 @@
@stack($total->code . '_td_start')
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $bill->currency_code, true)</td>
<td class="style-price text-right">@money($total->amount, $bill->currency_code, true)</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($bill->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">- @money($bill->paid, $bill->currency_code, true)</td>
<td class="style-price text-right">- @money($bill->paid, $bill->currency_code, true)</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
<td class="style-price text-right">@money($total->amount - $bill->paid, $bill->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@endif

View File

@ -125,12 +125,12 @@
<td class="quantity">{{ $item->quantity }}</td>
@stack('quantity_td_end')
@stack('price_td_start')
<td class="price">@money($item->price, $invoice->currency_code, true)</td>
<td class="style-price price">@money($item->price, $invoice->currency_code, true)</td>
@stack('price_td_end')
@stack('taxes_td_start')
@stack('taxes_td_end')
@stack('total_td_start')
<td class="total">@money($item->total, $invoice->currency_code, true)</td>
<td class="style-price total">@money($item->total, $invoice->currency_code, true)</td>
@stack('total_td_end')
</tr>
@endforeach
@ -156,20 +156,20 @@
@stack($total->code . '_td_start')
<tr>
<th>{{ trans($total->title) }}:</th>
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
<td class="style-price text-right">@money($total->amount, $invoice->currency_code, true)</td>
</tr>
@stack($total->code . '_td_end')
@else
@if ($invoice->paid)
<tr class="text-success">
<th>{{ trans('invoices.paid') }}:</th>
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
<td class="style-price text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
</tr>
@endif
@stack('grand_total_td_start')
<tr>
<th>{{ trans($total->name) }}:</th>
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
<td class="style-price text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
</tr>
@stack('grand_total_td_end')
@endif
@ -179,3 +179,14 @@
</div>
</div>
@endsection
@if (isset($currency_style) && $currency_style)
@push('stylesheet')
<style type="text/css">
.style-price {
font-family: sans-serif;
font-size: 15px;
}
</style>
@endpush
@endif

View File

@ -5,14 +5,14 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8; charset=ISO-8859-1"/>
<title>@yield('title') - @setting('general.company_name')</title>
<link rel="stylesheet" href="{{ asset('public/css/invoice.css?v=' . version('short')) }}">
<style type="text/css">
*{
* {
font-family: DejaVu Sans;
}
</style>

View File

@ -5,14 +5,14 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Tell the browser to be responsive to screen width -->
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8; charset=ISO-8859-1"/>
<title>@yield('title') - @setting('general.company_name')</title>
<link rel="stylesheet" href="{{ asset('public/css/invoice.css?v=' . version('short')) }}">
<style type="text/css">
*{
* {
font-family: DejaVu Sans;
}
</style>