From f039447d8ac92397e479b37ea1ce276cb9f4b2ec Mon Sep 17 00:00:00 2001 From: Brett Whiteman Date: Thu, 11 Oct 2018 05:35:38 +1300 Subject: [PATCH] fix invoice print layout and pdf --- .../views/incomes/invoices/invoice.blade.php | 344 +++++++++++------- resources/views/layouts/invoice.blade.php | 6 +- .../views/partials/invoice/head.blade.php | 38 -- 3 files changed, 212 insertions(+), 176 deletions(-) diff --git a/resources/views/incomes/invoices/invoice.blade.php b/resources/views/incomes/invoices/invoice.blade.php index bdf268463..b30135e96 100644 --- a/resources/views/incomes/invoices/invoice.blade.php +++ b/resources/views/incomes/invoices/invoice.blade.php @@ -2,139 +2,217 @@ @section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number) +@push('css') + +@endpush + @section('content') -
-
-
- @if ($logo) - +
+
+ @if ($logo) + + @endif +
+
+
+ {{ setting('general.company_name') }}
+ {!! nl2br(setting('general.company_address')) !!}
+ @if (setting('general.company_tax_number')) + {{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}
+ @endif +
+ @if (setting('general.company_phone')) + {{ setting('general.company_phone') }}
+ @endif + {{ setting('general.company_email') }} +
+
+
+ +
+
+
+ {{ trans('invoices.bill_to') }}

+ {{ $invoice->customer_name }}
+ {!! nl2br($invoice->customer_address) !!}
+ @if ($invoice->customer_tax_number) + {{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}
+ @endif +
+ @if ($invoice->customer_phone) + {{ $invoice->customer_phone }}
+ @endif + {{ $invoice->customer_email }} +
+
+
+
+ + + + + + + @if ($invoice->order_number) + + + + + @endif + + + + + + + + + +
{{ trans('invoices.invoice_number') }}:{{ $invoice->invoice_number }}
{{ trans('invoices.order_number') }}:{{ $invoice->order_number }}
{{ trans('invoices.invoice_date') }}:{{ Date::parse($invoice->invoiced_at)->format($date_format) }}
{{ trans('invoices.payment_due') }}:{{ Date::parse($invoice->due_at)->format($date_format) }}
+
+
+
+ + + + + + + + + + + + @foreach($invoice->items as $item) + + + + + + + @endforeach + +
{{ trans_choice('general.items', 1) }}{{ trans('invoices.quantity') }}{{ trans('invoices.price') }}{{ trans('invoices.total') }}
+ {{ $item->name }} + @if ($item->sku) +
{{ trans('items.sku') }}: {{ $item->sku }} + @endif +
{{ $item->quantity }}@money($item->price, $invoice->currency_code, true)@money($item->total, $invoice->currency_code, true)
+ +
+
+ @if ($invoice->notes) + + + +
{{ trans_choice('general.notes', 2) }}
{{ $invoice->notes }}
+ @endif +
+
+ + + @foreach ($invoice->totals as $total) + @if ($total->code != 'total') + + + + + @else + @if ($invoice->paid) + + + + + @endif + + + + @endif - -
-
- {{ setting('general.company_name') }}
- {!! nl2br(setting('general.company_address')) !!}
- @if (setting('general.company_tax_number')) - {{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}
- @endif -
- @if (setting('general.company_phone')) - {{ setting('general.company_phone') }}
- @endif - {{ setting('general.company_email') }} -
-
- - -
-
- {{ trans('invoices.bill_to') }} -
- {{ $invoice->customer_name }}
- {!! nl2br($invoice->customer_address) !!}
- @if ($invoice->customer_tax_number) - {{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}
- @endif -
- @if ($invoice->customer_phone) - {{ $invoice->customer_phone }}
- @endif - {{ $invoice->customer_email }} -
-
-
-
-
{{ trans($total->title) }}:@money($total->amount, $invoice->currency_code, true)
{{ trans('invoices.paid') }}:- @money($invoice->paid, $invoice->currency_code, true)
{{ trans($total->name) }}:@money($total->amount - $invoice->paid, $invoice->currency_code, true)
- - - - - - @if ($invoice->order_number) - - - - - @endif - - - - - - - - - -
{{ trans('invoices.invoice_number') }}:{{ $invoice->invoice_number }}
{{ trans('invoices.order_number') }}:{{ $invoice->order_number }}
{{ trans('invoices.invoice_date') }}:{{ Date::parse($invoice->invoiced_at)->format($date_format) }}
{{ trans('invoices.payment_due') }}:{{ Date::parse($invoice->due_at)->format($date_format) }}
-
-
-
- -
-
- - - - - - - - - @foreach($invoice->items as $item) - - - - - - - @endforeach - -
{{ trans_choice('general.items', 1) }}{{ trans('invoices.quantity') }}{{ trans('invoices.price') }}{{ trans('invoices.total') }}
- {{ $item->name }} - @if ($item->sku) -
{{ trans('items.sku') }}: {{ $item->sku }} - @endif -
{{ $item->quantity }}@money($item->price, $invoice->currency_code, true)@money($item->total, $invoice->currency_code, true)
-
-
- -
-
- @if ($invoice->notes) -

{{ trans_choice('general.notes', 2) }}

- -

- {{ $invoice->notes }} -

- @endif -
-
-
- - - @foreach ($invoice->totals as $total) - @if ($total->code != 'total') - - - - - @else - @if ($invoice->paid) - - - - - @endif - - - - - @endif - @endforeach - -
{{ trans($total->title) }}:@money($total->amount, $invoice->currency_code, true)
{{ trans('invoices.paid') }}:- @money($invoice->paid, $invoice->currency_code, true)
{{ trans($total->name) }}:@money($total->amount - $invoice->paid, $invoice->currency_code, true)
-
-
-
-
+ @endforeach + + + + @endsection diff --git a/resources/views/layouts/invoice.blade.php b/resources/views/layouts/invoice.blade.php index 9858a3252..de9e5a0f9 100644 --- a/resources/views/layouts/invoice.blade.php +++ b/resources/views/layouts/invoice.blade.php @@ -4,11 +4,7 @@ @stack('body_start') - -
- @yield('content') -
- + @yield('content') @stack('body_end') diff --git a/resources/views/partials/invoice/head.blade.php b/resources/views/partials/invoice/head.blade.php index e248275c9..295d75c2a 100644 --- a/resources/views/partials/invoice/head.blade.php +++ b/resources/views/partials/invoice/head.blade.php @@ -9,48 +9,10 @@ @yield('title') - @setting('general.company_name') - - - - - - - - - - - - - - - @stack('css') @stack('stylesheet') - - - - - - - - - - - - - - - @stack('js') @stack('scripts')