@extends('layouts.master') @section('css') @endsection @section('title') معاينة طباعة المنتجات @stop @section('content')

{{ Nameen ?? 'Company Name EN' }}

{{ describtionen ?? '' }}

{{ STen ?? '' }}

{{ Taxen ?? '' }}

@php $logo = camplogo ?? 'default.png'; @endphp logo

{{ Namear ?? 'اسم الشركة' }}

{{ describtionar ?? '' }}

{{ STar ?? '' }}

{{ Taxar ?? '' }}

@if(isset($data['invoice']->send_invoice_number) && $data['invoice']->send_invoice_number != null) {{-- الحالة الأولى: الرقم موجود = استلام منتجات --}} {{ __('home.recive_product_from_brance') }} @else {{-- الحالة الثانية: الرقم NULL = إرسال منتجات --}} {{ __('home.send_product_from_brance') }} @endif

{{ __('home.Invoice_no') }} {{ $data['invoice']->id ?? '' }}
{{ __('home.branch_sender') }} {{ $data['invoice']->branchfrom->name ?? '' }}
{{ __('home.employeesender') }} {{ $data['invoice']->userfrom->name ?? '' }}
{{ __('home.branch_reciver') }} {{ $data['invoice']->branchto->name ?? '' }}
{{ __('home.date') }} {{ $data['invoice']->created_at ?? '' }}
@php $totalprice = 0; $totalAddedvalue = 0; // يفضل جلب هذه القيمة من الكنترولر بدلاً من الموديل مباشرة هنا $avtSetting = App\Models\Avt::find(2); $avtRate = ($avtSetting->AVT ?? 0) / 100; // نفترض أنها نسبة مئوية @endphp @foreach ($data['itemsdetails'] as $index => $product) @php $lineTotal = $product->cost_per_each_withoud_tax * $product->quantity; $totalprice += $lineTotal; $totalAddedvalue += $lineTotal * $avtRate; @endphp @endforeach
# {{ __('home.productNo') }} {{ __('home.product') }} {{ __('home.quantity') }} {{ __('home.thecostProduct') }} {{ __('home.total') }}
{{ $index + 1 }} {{ $product->product->Product_Code }} {{ $product->product->product_name }} {{ $product->quantity }} {{ number_format($product->cost_per_each_withoud_tax, 2) }} {{ number_format($lineTotal, 2) }}
{{ __('home.the amount') }} {{ __('home.addedValue') }} {{ __('home.total') }}
{{ number_format($totalprice, 2) }} {{ number_format($totalAddedvalue, 2) }} {{ number_format($totalprice + $totalAddedvalue, 2) }}

{{ __('home.employeereciver') }}: {{ $data['invoice']->userto->name ?? '' }}

{{ __('home.thesignature') }}: ............................

@endsection @section('js') @endsection