@php $pdfLocale = app()->getLocale(); $isRtl = $pdfLocale === 'ar'; $rtlLabelSuffix = $isRtl ? '' : ':'; @endphp Inventory Adjustment - {{$adjustment['Ref']}} @php $pdfCssPath = public_path('css/pdf.css'); @endphp @if (is_file($pdfCssPath) && is_readable($pdfCssPath)) @endif
{{ __('pdf.inventory_adjustment') }}
{{$adjustment['Ref']}}
{{ __('pdf.date') }}{{ $isRtl ? '' : ':' }} @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($adjustment['date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); // Check if original date string contains time $hasTime = strpos($adjustment['date'], ' ') !== false && preg_match('/\d{1,2}:\d{2}/', $adjustment['date']); if ($hasTime) { $formattedDate = $dateTime->format($phpDateFormat . ' H:i'); // Preserve seconds if they exist if (preg_match('/:\d{2}:\d{2}/', $adjustment['date'])) { $formattedDate = $dateTime->format($phpDateFormat . ' H:i:s'); } } else { $formattedDate = $dateTime->format($phpDateFormat); } @endphp {{$formattedDate}}
{{ __('pdf.adjustment_no') }}{{ $isRtl ? '' : ':' }} {{$adjustment['Ref']}}
{{ __('pdf.warehouse') }}{{ $isRtl ? '' : ':' }} {{$adjustment['warehouse_name']}}
@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']}}
@if($isRtl) @else @endif
{{$rowIndex}} {{ __('pdf.total_items') }}{!! $rtlLabelSuffix !!}
{{ __('pdf.total_items') }} {{$rowIndex}}