@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('purchase_invoice_show_logo', '1') === '1'; @endphp {{ trans('messages.purchase_order') }} {{ $purchaseInvoice->invoice_number }}
@if($showLogo && $storeLogo) {{ $storeName }} @else

{{ $storeName }}

@endif

{{ strtoupper(trans('messages.purchase_order')) }}

N°: {{ $purchaseInvoice->invoice_number }}

{{ $isRTL ? 'المشتري' : 'Acheteur' }} / {{ trans('messages.store') }}

{{ trans('messages.name') }}: {{ $storeName }}

@php $storeAddress = \App\Models\Setting::get('store_address'); $storePhone = \App\Models\Setting::get('store_phone'); $storeEmail = \App\Models\Setting::get('store_email'); @endphp @if($storeAddress)

{{ trans('messages.address') }}: {{ $storeAddress }}

@endif @if($storePhone)

{{ trans('messages.phone') }}: {{ $storePhone }}

@endif @if($storeEmail)

{{ trans('messages.email') }}: {{ $storeEmail }}

@endif

{{ $isRTL ? 'المورد' : 'Fournisseur' }} / {{ trans('messages.suppliers') }}

{{ trans('messages.name') }}: {{ $purchaseInvoice->supplier->name }}

@if($purchaseInvoice->supplier->email)

{{ trans('messages.email') }}: {{ $purchaseInvoice->supplier->email }}

@endif @if($purchaseInvoice->supplier->phone)

{{ trans('messages.phone') }}: {{ $purchaseInvoice->supplier->phone }}

@endif @if($purchaseInvoice->supplier->address)

{{ trans('messages.address') }}: {{ $purchaseInvoice->supplier->address }}

@endif
{{ trans('messages.date') }}: {{ $purchaseInvoice->purchase_date->format('d/m/Y') }}
{{ trans('messages.created_by') }}: {{ $purchaseInvoice->user->name }}
@if($purchaseInvoice->status === 'draft')
{{ $isRTL ? 'الحالة' : 'Statut' }}: {{ $isRTL ? 'مسودة' : 'Brouillon' }}
@endif
@foreach($purchaseInvoice->items as $index => $item) @endforeach
# {{ trans('messages.products') }} {{ trans('messages.quantity') }} {{ trans('messages.purchase_price') }} {{ trans('messages.tax') }} {{ trans('messages.total') }}
{{ $index + 1 }} {{ $item->product->name }} @if($item->product->sku)
SKU: {{ $item->product->sku }} @endif
{{ $item->quantity }} {{ $item->product->unit ?? '' }} {{ number_format($item->purchase_price, 2) }} {{ $currency }} {{ number_format($item->tax, 2) }} {{ $currency }} {{ number_format($item->total, 2) }} {{ $currency }}
@if($purchaseInvoice->discount > 0) @endif
{{ trans('messages.subtotal') }} {{ number_format($purchaseInvoice->subtotal, 2) }} {{ $currency }}
{{ trans('messages.discount') }} -{{ number_format($purchaseInvoice->discount, 2) }} {{ $currency }}
{{ trans('messages.tax') }} {{ number_format($purchaseInvoice->tax, 2) }} {{ $currency }}
{{ $isRTL ? 'المجموع الكلي' : 'Total TTC' }} {{ number_format($purchaseInvoice->total_amount, 2) }} {{ $currency }}
@if($purchaseInvoice->notes)
{{ $isRTL ? 'ملاحظات' : 'Notes' }} / {{ trans('messages.notes') }}:

{{ $purchaseInvoice->notes }}

@endif

{{ $isRTL ? 'توقيع المشتري' : 'Signature Acheteur' }}

_________________________

{{ $purchaseInvoice->user->name }}

{{ $purchaseInvoice->purchase_date->format('d/m/Y') }}

{{ $isRTL ? 'توقيع المورد' : 'Signature Fournisseur' }}

_________________________

{{ $purchaseInvoice->supplier->name }}

{{ $isRTL ? 'التاريخ' : 'Date' }}: _______________

@if($footerText)

{{ $footerText }}

@endif