@php $locale = app()->getLocale() === 'fa' ? 'fa' : 'en'; $dir = $locale === 'fa' ? 'rtl' : 'ltr'; $company = config('app.company_name', config('app.name')); $titleText = $locale === 'fa' ? 'برگه تولید' : 'Production Sheet'; $labels = $locale === 'fa' ? [ 'print' => 'چاپ', 'close' => 'بستن', 'product' => 'نام محصول', 'quantity' => 'محصول برای تولید', 'dough' => 'مصرف خمیر', 'empty' => 'محصولی برای تولید در حال انجام نیست.', 'serial' => '#', 'date' => 'تاریخ', 'prepared_for' => 'گزارش تولید', 'footer_note' => 'این برگه بر اساس محصولات در حال تولید تهیه شده است.', 'totals' => 'مجموع', 'sign_manager' => 'امضای مدیر سیستم', 'sign_owner' => 'امضای مالک', 'sign_engineer' => 'امضای مهندس', 'sign_hint' => 'نام و امضا', ] : [ 'print' => 'Print', 'close' => 'Close', 'product' => 'Products Name', 'quantity' => 'Product To Produce', 'dough' => 'Dough Consumption', 'empty' => 'No under-process products to produce.', 'serial' => '#', 'date' => 'Date', 'prepared_for' => 'Production report', 'footer_note' => 'This sheet lists products currently under process.', 'totals' => 'Total', 'sign_manager' => 'System Manager Sign', 'sign_owner' => 'Owner Sign', 'sign_engineer' => 'Engineer Sign', 'sign_hint' => 'Name & signature', ]; $logoPath = public_path('images/system-logo.png'); $brandLogoPath = public_path('images/invoice-brand-logo.png'); $logoUrl = file_exists($logoPath) ? asset('images/system-logo.png') : null; $brandLogoUrl = file_exists($brandLogoPath) ? asset('images/invoice-brand-logo.png') : null; $totalDough = 0.0; $totalProduce = 0.0; foreach ($lines as $line) { $totalDough += (float) str_replace(',', '', (string) ($line['dough_consumption'] ?? 0)); $totalProduce += (float) str_replace(',', '', (string) ($line['production_quantity'] ?? 0)); } $totalDoughLabel = \App\Support\NumberFormat::quantity($totalDough); $totalProduceLabel = \App\Support\NumberFormat::quantity($totalProduce); @endphp {{ $titleText }} — {{ $company }}
{{ $labels['close'] }}

{{ $company }}

@if (config('app.company_tagline'))

{{ config('app.company_tagline') }}

@endif
{{ $titleText }}
{{ $labels['prepared_for'] }}
{{ $labels['date'] }}: {{ now()->translatedFormat($locale === 'fa' ? 'Y/m/d H:i' : 'Y-m-d H:i') }}
@if (! empty($startedAt))
{{ $startedAt }}
@endif
@if (count($lines) === 0)
{{ $labels['empty'] }}
@else
@foreach ($lines as $index => $line) @endforeach
{{ $labels['serial'] }} {{ $labels['product'] }} {{ $labels['dough'] }} {{ $labels['quantity'] }}
{{ $index + 1 }} {{ $line['product_name'] }} @if (! empty($line['unit_name'])) ({{ $line['unit_name'] }}) @endif {{ $line['dough_consumption'] }} {{ $line['production_quantity'] }}
{{ $labels['totals'] }} {{ $totalDoughLabel }} {{ $totalProduceLabel }}
@endif
@if (! empty($autoPrint)) @endif