@extends('layouts.app') @section('title', 'مكافأة و خصومات الموظفين') @section('content')
| # | المستفيد | الكنيسة | نوع العملية | المبلغ | التاريخ | البند / الملاحظات | @canany(['staff_transaction.edit', 'staff_transaction.delete'])إجراءات | @endcanany
|---|---|---|---|---|---|---|---|
| {{ $loop->iteration + ($transactions->currentPage() - 1) * $transactions->perPage() }} | {{-- 2. اسم الشخص (مع التحقق من الوجود) --}}
{{ $transaction->transactionable->name ?? 'غير محدد' }}
{{ $transaction->transactionable->job_title ?? 'مدرس' }} |
{{-- 3. الكنيسة (استخدام الـ Optional chaining لمنع الـ Error) --}}
@foreach($transaction->assigned_churches as $church) {{ $church->name }} {{ $church->address ? ' (' . $church->address . ')' : ')' }} @endforeach | {{-- 4. نوع العملية (تلوين النوع) --}}@if($transaction->type == 'bonus') مكافأة @else خصم @endif | {{-- 5. المبلغ --}}{{ number_format($transaction->amount, 2) }} ج.م | {{-- 6. التاريخ --}}{{ $transaction->transaction_date }} | {{-- 7. الوصف --}}{{ $transaction->description ?: '---' }} | {{-- 8. الإجراءات --}} @canany(['staff_transaction.edit', 'staff_transaction.delete'])@if(!$transaction->is_locked) @else مغلق @endif | @endcanany
| لا يوجد بيانات | |||||||