@extends('layouts.app') @section('title', 'أسماء المحلات') @section('content')
| رقم المحل | اسم المحل | المنطقة (التصنيف) | الحالة | الإجراءات | |
|---|---|---|---|---|---|
| {{ $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)
@endif
|
|
لا يوجد محلات مسجلة حتى الآن |
|||||