@extends('layouts.app') @section('title', 'أسماء المحلات') @section('content')
قائمة محلات فستيفال لاند
@forelse($shops as $shop) @empty @endforelse
رقم المحل اسم المحل المنطقة (التصنيف) الحالة الإجراءات
{{ $shop->shop_number }} {{ $shop->shop_name }} @if($shop->category) {{ $shop->category->name }} @else غير محدد @endif @php $activeContract = clone $shop->contracts; $isRented = $activeContract->where('status', 'active')->filter(function($contract) { return $contract->end_date >= now()->format('Y-m-d'); })->count() > 0; @endphp @if($shop->status == 'inactive') تم إلغائه @elseif($isRented) مؤجر @else متاح للتأجير @endif
@if($isRented) @php $active = $activeContract->where('status', 'active')->first(); $paid = $active->payments->sum('amount'); $remaining = $active->total_amount - $paid; $overdue = $active->installments->where('due_date', '<', now()->format('Y-m-d'))->where('is_paid', false)->sum('amount'); @endphp @endif @if($shop->contracts->count() == 0)
@csrf @method('DELETE')
@endif
لا يوجد محلات مسجلة حتى الآن
@include('shops.modals_setup') @endsection