@extends('layouts.customer') @section('page-title', 'ویرایش اطلاعات') @section('content')

ویرایش اطلاعات مشترک

لطفاً اطلاعات را با دقت تکمیل کنید.

@if($errors->any())
{{ $errors->first() }}
@endif
@csrf @method('PATCH')
{{-- 💡 تفکیک نام فیلد کد ملی --}} {{-- 💡 تفکیک نام فیلدهای استان و شهر --}} {{-- فیلد آدرس مشترک است --}}
@php // Type of industrial consumption $industrialId = \App\Models\ConsumptionType::where('code', 'INDUSTRIAL')->first()?->id ?? 0; $baseTypeId = \App\Models\PurchaseType::where('slug', 'base')->first()?->id ?? 0; $sub = $customer->subscription; $contractPower = old('contract_power', $sub?->contract_power) ?? 0; // Fixed tariff codes $tariffCodes = \App\Models\TariffCode::where('consumption_type_id', $industrialId) ->orderBy('sort_order') ->get(); // Proposed tariff code based on power $suggestedTariff = null; if ($industrialId && $contractPower > 0 && old('consumption_type_id', $sub?->consumption_type_id) == $industrialId) { $suggestedTariff = \App\Models\TariffCode::where('consumption_type_id', $industrialId) ->where(function($q) use ($contractPower) { $q->whereNull('min_power_kw')->orWhere('min_power_kw', '<=', $contractPower); }) ->where(function($q) use ($contractPower) { $q->whereNull('max_power_kw')->orWhere('max_power_kw', '>=', $contractPower); }) ->orderBy('sort_order') ->first(); } @endphp

مشخصات انشعاب مشترک

@include('customer.profile.guarantees')
انصراف
@include('customer.profile.scripts') @endsection