@if (@isset($data) && !@empty($data) && count($data) >0 ) @php $i=1; @endphp
@foreach ($data as $invoice) @endforeach
{{ __('home.decoumentNo') }} {{ __('home.exportTime') }} {{ __('home.employee_add') }} {{ __('home.employee_update') }} {{ __('home.acount_name') }} طريقة الدفع {{ __('accountes.Theamountpaid') }} ملاحظات {{ __('home.operations') }}
{{ $invoice->sent_abd_count}} {{ $invoice->created_at }} {{ $invoice->user->name }} {{ $invoice->userupdate->name ?? 'لم يتم التعديل'}} {{ $invoice->financial_accounts_data->name }} @if($invoice->type == 'cash' || $invoice->type == 1) نقدي @elseif($invoice->type == 'span' || $invoice->type == 2) شبكة @elseif($invoice->type == 'bank' || $invoice->type == 3) تحويل بنكي @else {{ $invoice->type }} @endif {{ $invoice->recive_amount }} {{ $invoice->note }}
@php $user = Auth::user(); // التأكد من أن المستخدم أدمن أو مدير $isAdminOrManager = !empty(array_intersect(['Admin', 'Manger'], (array)$user->roles_name)); @endphp @php $customerPhone = $invoice->financial_accounts_data->customer->phone ?? ''; // تنظيف رقم الهاتف وإضافة رمز الدولة $phone = "966" . substr($customerPhone, 1); // استخدام اسم الروت لضمان مطابقة الرابط اللي فتح معاك في الصورة $receiptLink = route('generate.receipt', ['id' => $invoice->sent_abd_count]); $message = "عزيزي العميل، تم استلام مبلغكم بنجاح.\n" . "مرفق لكم سند القبض رقم: {$invoice->sent_abd_count}\n" . "لتحميل السند اضغط هنا: {$receiptLink}"; $waLink = "https://web.whatsapp.com/send?phone={$phone}&text=" . urlencode($message); @endphp @if($isAdminOrManager) @endif {{-- --}}
@if($invoice->attachments!=null){{ __('home.show')}} @else @endif

@else
{{__('home.notfounddata')}}
@endif