@php use App\Models\Contract; @endphp @extends('layouts.customer') @section('page-title', 'داشبورد مشترک') @section('content')
@php $customer = auth('customer')->user(); $profileCompleted = $customer->profile_completed ?? false; // Active or ongoing contract $activeContract = Contract::where('customer_id', $customer->id) ->whereIn('status', ['rate_assigned', 'confirmed']) ->where('end_date', '>=', now()) ->first(); @endphp @if(!$profileCompleted)

خوش آمدید به تیوان!

برای استفاده از تمام امکانات سامانه (خرید برق، مشاهده قرارداد، محاسبه قبض و ...) لطفاً اطلاعات خود را تکمیل کنید.

تکمیل اطلاعات
@else

خوش آمدید، {{ $customer->company_name ?? 'مشترک عزیز' }}

شناسه قبض: {{ $customer->bill_id ?? '—' }}

{{ $customer->type === 'legal' ? 'حقوقی' : 'حقیقی' }} فعال

{{ now()->setTimezone('Asia/Tehran')->translatedFormat('l d F') }}

{{ now()->setTimezone('Asia/Tehran')->format('H:i') }}

@if($activeContract)

قرارداد فعال

از {{ \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($activeContract->start_date))->format('j F Y') }} تا {{ \Morilog\Jalali\Jalalian::fromCarbon(\Carbon\Carbon::parse($activeContract->end_date))->format('j F Y') }}

نرخ توافق شده: {{ number_format($activeContract->base_rate) }} ریال/kwh

✓ فعال
@endif {{--
--}} {{--
--}} {{--

قبض پرداخت نشده

--}} {{--

۱۲

--}} {{-- ۲ تاخیر--}} {{--
--}} {{--
--}} {{--

مصرف این ماه

--}} {{--

۸.۵M

--}} {{-- +۱۲٪--}} {{--
--}} {{--
--}} {{--

کیلووات ساعت

--}} {{--

۲۱۵

--}} {{-- پیک--}} {{--
--}} {{--
--}} {{--

اعتبار

--}} {{--

۳.۲M

--}} {{-- باقی‌مانده--}} {{--
--}} {{--
--}}

نرخ‌های این ماه (ریال/kWh)

@endif
@endsection