@php $pdfLocale = app()->getLocale(); $isRtl = $pdfLocale === 'ar'; $rtlLabelSuffix = $isRtl ? '' : ':'; $statusKey = strtolower($transfer['statut'] ?? ''); $transferStatusClass = [ 'completed' => 'trf-status--completed', 'sent' => 'trf-status--sent', 'pending' => 'trf-status--pending', ][$statusKey] ?? 'trf-status--default'; @endphp Stock Transfer - {{$transfer['Ref']}} @php $transferPdfCssPath = public_path('css/transfer_pdf.css'); @endphp @if (is_file($transferPdfCssPath) && is_readable($transferPdfCssPath)) @endif
{{ __('pdf.stock_transfer') }}
{{$transfer['Ref']}}
{{ __('pdf.date') }}{{ $isRtl ? '' : ':' }} @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($transfer['date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $hasTime = strpos($transfer['date'], ' ') !== false && preg_match('/\d{1,2}:\d{2}/', $transfer['date']); if ($hasTime) { $formattedDate = $dateTime->format($phpDateFormat . ' H:i'); if (preg_match('/:\d{2}:\d{2}/', $transfer['date'])) { $formattedDate = $dateTime->format($phpDateFormat . ' H:i:s'); } } else { $formattedDate = $dateTime->format($phpDateFormat); } @endphp {{$formattedDate}}
{{ __('pdf.transfer_no') }}{{ $isRtl ? '' : ':' }} {{$transfer['Ref']}}
{{ __('pdf.status') }}{{ $isRtl ? '' : ':' }} {{$transfer['statut']}}
{{ __('pdf.from_warehouse') }}
{{$transfer['from_warehouse']}}
{{ __('pdf.to_warehouse') }}
{{$transfer['to_warehouse']}}
@php $rowIndex = 0; $totalQty = 0; @endphp @foreach ($details as $detail) @php $rowIndex++; $totalQty += (int)$detail['quantity']; @endphp @endforeach
{{ __('pdf.product') }} {{ __('pdf.quantity') }}
{{$detail['name']}}
{{ __('pdf.code') }} {{$detail['code']}}
{{$detail['quantity']}} {{$detail['unit_purchase']}}
@if($isRtl) @else @endif
{{$rowIndex}} {{ __('pdf.total_items') }}{!! $rtlLabelSuffix !!}
{{$totalQty}} {{ __('pdf.total_quantity') }}{!! $rtlLabelSuffix !!}
{{ __('pdf.total_items') }} {{$rowIndex}}
{{ __('pdf.total_quantity') }} {{$totalQty}}