@php $storeName = \App\Models\Setting::get('store_name', 'Gestock Pro'); $storeLogo = \App\Models\Setting::get('store_logo'); $currency = currency_symbol(); $footerText = \App\Models\Setting::get('invoice_footer_text', ''); $locale = app()->getLocale(); $isRTL = $locale === 'ar'; $dir = $isRTL ? 'rtl' : 'ltr'; $showLogo = \App\Models\Setting::get('invoice_show_logo', '1') === '1'; $autoPrintFromUrl = request()->get('auto_print') === '1' || request()->get('auto_print') === 'true'; @endphp {{ trans('messages.invoices') }} {{ $invoice->invoice_number }}
@if($showLogo && $storeLogo) {{ $storeName }} @else

{{ $storeName }}

@endif

{{ trans('messages.invoices') }} #{{ $invoice->invoice_number }}

{{ trans('messages.date') }}: {{ $invoice->created_at->format('Y-m-d') }}

{{ trans('messages.status') }}: {{ trans('messages.' . $invoice->status) }}

{{ trans('messages.customer') }}

{{ trans('messages.name') }}: {{ $invoice->customer?->name ?? $invoice->customer_name }}

@if($invoice->customer) @if($invoice->customer->email)

{{ trans('messages.email') }}: {{ $invoice->customer->email }}

@endif @if($invoice->customer->phone)

{{ trans('messages.phone') }}: {{ $invoice->customer->phone }}

@endif @if($invoice->customer->address)

{{ trans('messages.address') }}: {{ $invoice->customer->address }}

@endif @endif

{{ trans('messages.invoice_details') }}

{{ trans('messages.created_by') }}: {{ $invoice->user->name }}

{{ trans('messages.invoice_number') }}: {{ $invoice->invoice_number }}

@foreach($invoice->items as $item) @endforeach
{{ trans('messages.products') }} {{ trans('messages.quantity') }} {{ trans('messages.unit_price') }} {{ trans('messages.tax') }} {{ trans('messages.discount') }} {{ trans('messages.total') }}
{{ $item->product->name }} {{ $item->quantity }} {{ number_format($item->unit_price, 2) }} {{ $currency }} {{ $item->tax_rate }}% {{ number_format($item->discount, 2) }} {{ $currency }} {{ number_format($item->total, 2) }} {{ $currency }}
@if($invoice->discount > 0) @endif
{{ trans('messages.subtotal') }} {{ number_format($invoice->subtotal, 2) }} {{ $currency }}
{{ trans('messages.discount') }} -{{ number_format($invoice->discount, 2) }} {{ $currency }}
{{ trans('messages.tax') }} {{ number_format($invoice->tax, 2) }} {{ $currency }}
{{ trans('messages.total') }} {{ number_format($invoice->total, 2) }} {{ $currency }}
{{ trans('messages.paid') }} {{ number_format($invoice->paid_amount, 2) }} {{ $currency }}
{{ trans('messages.due') }} {{ number_format($invoice->due_amount, 2) }} {{ $currency }}
@if($invoice->notes)
{{ trans('messages.notes') }}:

{{ $invoice->notes }}

@endif @if($footerText) @endif