Hello,
I am trying to create a custom print template copying from the default template. However, When i put the
I am checking the controller "Sales\Invoices" and i don't see nowhere this variable is defined. However, if i activate the default template it works and if i activate my custom it doesn't.
Follow my custom blade file:
@extends('layouts.print')
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
@section('content')
FACTURE N° 2020/005
@stack('invoiced_at_input_start')
Date Facturation: @date($invoice->invoiced_at)
@stack('invoiced_at_input_end')
@stack('due_at_input_start')
Date d'écheance: @date($invoice->due_at)
@stack('due_at_input_end')
{{ setting('company.name') }}
{!! nl2br(setting('company.address')) !!}
@if (setting('company.tax_number'))
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
@endif
@if (setting('company.phone'))
{{ setting('company.phone') }}
@endif
{{ setting('company.email') }}
@stack('name_input_start')
{{ $invoice->contact_name }}
@stack('name_input_end')
@stack('address_input_start')
{!! nl2br($invoice->contact_address) !!}
@stack('address_input_end')
@stack('tax_number_input_start')
@if ($invoice->contact_tax_number)
{{ trans('general.tax_number') }}: {{ $invoice->contact_tax_number }}
@endif
@stack('tax_number_input_end')
@stack('phone_input_start')
@if ($invoice->contact_phone)
{{ $invoice->contact_phone }}
@endif
@stack('phone_input_end')
@stack('email_start')
{{ $invoice->contact_email }}
@stack('email_input_end')
@stack('name_th_start')
{{ trans_choice($text_override['items'], 2) }} |
@stack('name_th_end')
@stack('quantity_th_start')
{{ trans($text_override['quantity']) }} |
@stack('quantity_th_end')
Unité |
@stack('price_th_start')
{{ trans($text_override['price']) }} |
@stack('price_th_end')
@stack('total_th_start')
{{ trans('invoices.total') }} |
@stack('total_th_end')
---|
@foreach($invoice->items as $item)
@include('partials.documents.item.print', ['document' => $invoice])
@endforeach
@stack('notes_input_start')
@if ($invoice->notes)
{{ trans_choice('general.notes', 2) }}
{!! nl2br($invoice->notes) !!}
@endif
@stack('notes_input_end')
@foreach ($invoice->totals_sorted as $total)
@if ($total->code != 'total')
@stack($total->code . '_total_tr_start')
{{ trans($total->title) }}: |
@money($total->amount, $invoice->currency_code, true) |
@stack($total->code . '_total_tr_end')
@else
@if ($invoice->paid)
@stack('paid_total_tr_start')
{{ trans('invoices.paid') }}: |
- @money($invoice->paid, $invoice->currency_code, true) |
@stack('paid_total_tr_end')
@endif
@stack('grand_total_tr_start')
{{ trans($total->name) }}: |
@money($total->amount - $invoice->paid, $invoice->currency_code, true) |
@stack('grand_total_tr_end')
@endif
@endforeach
@if ($invoice->footer)
{!! nl2br($invoice->footer) !!}
@endif
@endsection
Thank if someone can hep!