@extends('admin.layouts.master') @section('content') @php $extraFees = []; $courtFees = []; $feeParts = []; $paidFeeParts = []; $totalContracts = []; $total = []; $downPayments = []; $totalOfficeMoney = []; $remainingAmounts = []; $totalExtraFees = []; $unpaidFeePart = []; $paidFeePart = []; @endphp @push('styles') @endpush
@foreach($fees as $fee) @endforeach
# اسم الموكل الكود قيمة العقد المصاريف الإضافية إجمالي قيمة العقد المقدم نسبة المكتب أتعاب المكتب الدفعات المستحقة بالفترة المحددة المسدد بالفترة الحالية المتبقي
{{$fee->id}} {{$fee->client->name}} @foreach($fee->fee_cases as $fee_case) {{$fee_case->case_id}} {{$loop->count > 1 ? ',' : null}} @endforeach {{$totalContracts[$loop->index] = $fee->total_fee}} @foreach($fee->fee_parts->where('type',\App\Fee::EXTRA_FEES) as $extraFee) @php $extraFees[$loop->index] = $extraFee->money; @endphp @endforeach @foreach(($fee->fee_parts->where('type',\App\Fee::COURT_FEES)) as $courtFee) @php $courtFees[$loop->index] = $courtFee->money; @endphp @endforeach {{$totalExtraFees[$loop->index] = array_sum($extraFees) + array_sum($courtFees)}} {{$total[$loop->index] = $totalExtraFees[$loop->index]+$fee->total_fee}} {{$downPayments[$loop->index] = $fee->down_payment}} {{$fee->office_percentage}}% {{$totalOfficeMoney[$loop->index] = $fee->office_money}} @foreach($fee->fee_parts->where('type',\App\Fee::REQUIRED) as $feePart) @php $feeParts[$loop->index] = $feePart->money; @endphp @endforeach {{$unpaidFeePart[$loop->index] = array_sum($feeParts)}} @foreach($fee->fee_parts->where('type',\App\Fee::REQUIRED) as $feePart) @php if ($feePart->is_paid == 1) $paidFeeParts[$loop->index] = $feePart->money; @endphp @endforeach {{$paidFeePart[$loop->index] = array_sum($paidFeeParts)}} {{$remainingAmounts[$loop->index] = $unpaidFeePart[$loop->index] - $paidFeePart[$loop->index]}}
الإجمالي {{array_sum($totalContracts)}} {{array_sum($totalExtraFees)}} {{array_sum($total)}} {{array_sum($downPayments)}} {{array_sum($totalOfficeMoney)}} {{array_sum($unpaidFeePart)}} {{array_sum($paidFeePart)}} {{array_sum($remainingAmounts)}}
@push('scripts') @endpush @endsection