@extends('layouts.admin') @section('page-title', 'تخصیص ماهانه') @section('content')

تخصیص‌های ماهانه مشترکان

@php $monthNames = ['فروردین','اردیبهشت','خرداد','تیر','مرداد','شهریور','مهر','آبان','آذر','دی','بهمن','اسفند']; //Define current variables for use in scripts and displays //assume $month and $year come from the controller $currentMonth = $month ?? \Morilog\Jalali\Jalalian::now()->getMonth(); $currentYear = $year ?? \Morilog\Jalali\Jalalian::now()->getYear(); $displayMonth = $monthNames[$currentMonth - 1]; $displayYear = $currentYear; $years = collect(range(1404, 1410)); $defaultYear = $currentYear; @endphp در حال نمایش تخصیص‌های ماه: {{ $displayMonth }} {{ $displayYear }} — تعداد: {{ $allocations->count() }} مشترک

افزودن تخصیص جدید
@foreach($allocations as $alloc)
{{ Str::limit($alloc->customer->company_name, 20) }}

مالک شبکه: {{ Str::limit($alloc->customer->subscription?->networkOwner?->name ?? '-', 15) }}

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

دیماند: {{ $alloc->customer->subscription?->contract_power ?? '-' }}

بار پایه: {{ $alloc->base_load }} میان‌باری: {{ $alloc->mid_load }} اوج‌بار: {{ $alloc->peak_load }} کم‌باری: {{ $alloc->low_load }}
نرخ: {{ number_format($alloc->rate) }} برق سبز: {{ $alloc->green_power }} نرخ برق سبز: {{ $alloc->green_rate }}

هزینه کل: {{ number_format($alloc->calculateTotalCost() ?? 0) }}

پیگیری‌کننده: {{ $alloc->customer->admin?->name ?? 'تعیین نشده' }}

@endforeach

جمع کل تخصیص‌های ماه {{ $displayMonth }} {{ $displayYear }}

بار پایه

{{ number_format($totals['base_load']) }} کیلووات

اوج‌بار

{{ number_format($totals['peak_load']) }} کیلووات

میان‌بار

{{ number_format($totals['mid_load']) }} کیلووات

کم‌بار

{{ number_format($totals['low_load']) }} کیلووات

برق سبز

{{ number_format($totals['green_power']) }} کیلووات

جمع کل توان

{{ number_format($totals['total_power']) }} کیلووات

@if(method_exists($allocations, 'links'))
{{ $allocations->appends(request()->query())->links('pagination::tailwind') }}
@endif
@endsection