@if(App::isLocale('ar')) @else @endif
{{ __('messages.Return to the main page') }}
شركة النعم لتسويق المواد الغذائية
ALNEAM CO. FOR MARKETING FOOD STUFF
{{ __('messages.Order bill') }}
# {{ \Carbon\Carbon::parse($data->date_time)->year }} - {{ $data->id }}
{{__('messages.Serial number')}}: {{ $data->serial_number }}
{{ __('messages.Date Of Creation:') }}: {{ Carbon\Carbon::parse($data->date_time) }}
{{ __('messages.Gentlemen asked for') }}: @php $customerCount = $uniqueCustomers->count(); @endphp @foreach($uniqueCustomers as $k => $customer) {{ $customer->name }}@if($k < $customerCount - 1)،@endif @endforeach
@php $totalQuantity = 0; $totalWeight = 0; $totalPriceForAll = 0; @endphp @foreach($data->purchaseItems as $index => $item) @php $calcWeight = (float) ($item->meat_weight ?? 0) + (float) ($item->sum_return_weight_item ?? 0); $calcQty = (float) ($item->quantity ?? 0); $unitPrice = (float) ($item->item_price_after_discount ?? 0); // meat_weight is stored as 0 (not NULL) for non-meat rows (e.g. rows created by inventory transfers), // so a row is weight-based only when it really has weight. $isWeightRow = $calcWeight > 0; $rowBase = $isWeightRow ? $calcWeight : $calcQty; $rowTotal = $rowBase * $unitPrice; $totalQuantity += $isWeightRow ? $calcQty + (float) ($item->sum_return_quantities_item ?? 0) : $calcQty; $totalWeight += $calcWeight; $totalPriceForAll += $rowTotal; @endphp @endforeach
ت {{ __('messages.Item') }} {{ __('messages.Unit') }} {{ __('messages.weight') }} {{ __('messages.Quantity') }} {{ __('messages.price') }} {{ __('messages.Total alajmaliu') }}
{{ $index + 1 }} {{ $item->item->name }} {{ $item->item->unit_type }} {{ number_format($calcWeight, 3) }} {{ number_format($calcQty, 3) }} {{ number_format($unitPrice, 3) }} {{ number_format($rowTotal, 3) }}
{{ __('messages.Total alajmaliu') }} {{ number_format($totalPriceForAll, 3) }}
{{-- @if(!empty($data->note))
{{ __('messages.note') }}
{{ $data->note }}
@endif --}} @if($data->itemsDescription->count() > 0)
{{ __('Items Description') }}
@foreach($data->itemsDescription as $item) @endforeach
{{ __('Item Name') }} {{ __('Quantity') }} {{ __('Weight') }} {{ __('Price') }}
{{ $item->name }} {{ is_numeric($item->quantity) ? number_format($item->quantity, 3) : $item->quantity }} {{ is_numeric($item->weight) ? number_format($item->weight, 3) : $item->weight }} {{ is_numeric($item->price) ? number_format($item->price, 3) : $item->price }}
@endif