@extends('layouts.dashboard.inface', ['section' => 'developments']) @section('extra-styles') @endsection @section('content') @php $canManageInventory = (bool) ($development['can_manage_inventory'] ?? false); $salesImportReport = $canManageInventory ? session('salesImportReport') : null; $salesImportWarnings = collect($salesImportReport['warnings'] ?? []); $salesImportErrors = collect($salesImportReport['errors'] ?? []); $formatMoney = static fn ($value, string $currency = 'MXN') => $value !== null && $value !== '' ? '$'.number_format((float) $value, 2).' '.$currency : 'No definido'; $formatBool = static fn ($value) => $value === null ? 'No definido' : ($value ? 'Si' : 'No'); $priceModeLabels = [ 'per_sqm' => 'Por m²', 'fixed' => 'Precio fijo', 'range' => 'Rango', ]; $dateText = static fn ($value) => filled($value) ? (string) $value : 'Sin definir'; $isExternal = ($development['availability_source'] ?? 'internal') === 'external'; $promotionId = data_get($development, 'promotion_contexts.0.promotion_id'); @endphp
@if(isset($connectionAsset)) @include('agency-connections.asset', ['connectionType' => 'development']) @endif

{{ $development['name'] }}

{{ $isExternal ? 'Promoción externa' : ($development['status']['name'] ?? 'Estatus sin definir') }}
location_on

{{ $development['address'] }}

@if ($development['isStage'] ?? false) account_tree {{ $development['parentDevelopment']['name'] }} / {{ $development['stage']['name'] }} @endif
@php $networkOrganization = \Illuminate\Support\Facades\Schema::hasTable('organization_developments') ? \Illuminate\Support\Facades\DB::table('organization_developments')->where('development_id', $development['id'])->value('organization_id') : null; @endphp @if($networkOrganization && (app(\App\Application\CommercialNetwork\NetworkAccess::class)->allows(auth()->user(), $networkOrganization, 'commercial') || app(\App\Application\CommercialNetwork\NetworkAccess::class)->allows(auth()->user(), $networkOrganization, 'inventory'))) @can('commercial-network.access') groups Comercialización @endcan @endif @if ($canManageInventory) @can('finance.view') account_balance_wallet Finanzas @endcan @endif @unless ($development['isStage'] ?? false) account_tree Etapas ({{ count($development['stages'] ?? []) }}) @endunless @if ($isExternal && $promotionId && (($development['can_manage_catalog'] ?? false) || ($development['can_manage_promotion'] ?? false))) edit {{ $development['can_manage_catalog'] ?? false ? 'Administrar ficha' : 'Editar promoción' }} @elseif (!$isExternal && ($development['can_manage_inventory'] ?? false)) edit Editar @endif
@if ($isExternal)
sync

Inventario controlado externamente

Los modelos y características son informativos. Confirma precios y disponibilidad con {{ $development['developer']['name'] ?? 'el desarrollador' }} antes de presentar una propuesta.

@if (!empty($development['availability']['url'])) Consultar disponibilidad open_in_new @endif
@endif @if (!($development['isStage'] ?? false) && !empty($development['stages']))
@endif @if (session('success') || $salesImportReport || $errors->has('sales_file'))
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->has('sales_file'))
{{ $errors->first('sales_file') }}
@endif @if ($salesImportReport)

Importacion de ventas

Hoja procesada: {{ $salesImportReport['sheet_name'] ?? 'Resumen' }}

Se detectaron {{ $salesImportReport['rows_detected'] ?? 0 }} filas y se prepararon {{ $salesImportReport['rows_prepared'] ?? 0 }} registros para importar.

Ventas

{{ $salesImportReport['created_sales'] ?? 0 }}

Pagos Hist.

{{ $salesImportReport['created_historical_payments'] ?? 0 }}

Omitidas

{{ $salesImportReport['skipped_rows'] ?? 0 }}

Duplicadas

{{ $salesImportReport['duplicate_rows_collapsed'] ?? 0 }}

@if ($salesImportWarnings->isNotEmpty())

Advertencias

    @foreach ($salesImportWarnings->take(6) as $warning)
  • {{ $warning }}
  • @endforeach @if ($salesImportWarnings->count() > 6)
  • Y {{ $salesImportWarnings->count() - 6 }} advertencias más.
  • @endif
@endif @if ($salesImportErrors->isNotEmpty())

Filas con error

    @foreach ($salesImportErrors->take(8) as $error)
  • {{ $error }}
  • @endforeach @if ($salesImportErrors->count() > 8)
  • Y {{ $salesImportErrors->count() - 8 }} errores más.
  • @endif
@endif
@endif
@endif
@if ($development['frontPage'])
Luxury modern residential complex exterior at sunset

{{ $development['frontPage']['title'] }}

{{ $development['frontPage']['subtitle'] }}

@endif @if ($isExternal)

Disponibilidad

Consultar

Modelos publicados

{{ count($development['unitModels'] ?? []) }}

Fuente

Desarrollador externo

@else
@endif
info

Información general

Tipo

{{ $development['developmentType']['name'] ?? 'No definido' }}

Sucursal

{{ $development['branch']['name'] ?? 'No definida' }}

{{ $development['branch']['agency'] ?? '' }}

Inicio

{{ $dateText($development['startDate'] ?? null) }}

Fin

{{ $dateText($development['endDate'] ?? null) }}

@if ($canManageInventory)

Administración

{{ $development['management']['ownershipLabel'] ?? 'Propio' }}

Comisión por lote vendido

{{ $formatMoney( $development['management']['sellerCommissionAmount'] ?? 0, $development['pricing']['currency'] ?? 'MXN', ) }}

@endif
@if ($canManageInventory && ($development['management']['sellerCommissionRanges'] ?? []) !== [])

Comisiones por periodo

@foreach ($development['management']['sellerCommissionRanges'] as $commissionRange)
{{ $dateText($commissionRange['starts_at'] ?? null) }} – {{ $dateText($commissionRange['ends_at'] ?? null) }} {{ $formatMoney( $commissionRange['amount'] ?? 0, $development['pricing']['currency'] ?? 'MXN', ) }}
@endforeach
@endif @if (!empty($development['description']) || !empty($development['fullDescription']))
@if (!empty($development['description']))

{{ $development['description'] }}

@endif @if (!empty($development['fullDescription']))

{{ $development['fullDescription'] }}

@endif
@endif
quiz

Preguntas frecuentes

{{ collect($development['faqs'] ?? [])->where('is_active', true)->count() }} publicadas de {{ count($development['faqs'] ?? []) }} configuradas

@if (!$isExternal && ($development['can_manage_inventory'] ?? false)) edit Configurar @endif
@forelse ($development['faqs'] ?? [] as $faq)
help

{{ $faq['question'] }}

{{ ($faq['is_active'] ?? false) ? 'Publicada' : 'Oculta' }}
expand_more

{{ $faq['answer'] }}

@empty
question_exchange

No hay preguntas frecuentes configuradas.

@if (!$isExternal && ($development['can_manage_inventory'] ?? false)) Agregar la primera pregunta @endif
@endforelse
@if ($isExternal)
holiday_village

Modelos disponibles

@forelse ($development['unitModels'] ?? [] as $model)

{{ $model['name'] }}

@if ($model['description'])

{{ $model['description'] }}

@endif
@if ($model['bedrooms'] !== null){{ $model['bedrooms'] }} recámaras@endif @if ($model['bathrooms'] !== null){{ $model['bathrooms'] }} baños@endif @if ($model['construction_sqm'] !== null){{ number_format($model['construction_sqm'], 1) }} m²@endif

{{ $model['price'] !== null ? $formatMoney($model['price'], $model['currency'] ?? 'MXN') : 'Precio por consultar' }}

@empty

El desarrollador aún no ha publicado modelos.

@endforelse
@else @endif

{{ $isExternal ? 'Ubicación' : 'Master Plan' }}

sell

Comercial

Moneda {{ $development['pricing']['currency'] ?? 'MXN' }}
Modo de precio {{ $priceModeLabels[$development['pricing']['priceMode'] ?? 'per_sqm'] ?? ($development['pricing']['priceMode'] ?? 'No definido') }}
Precio mínimo {{ $formatMoney($development['pricing']['minPrice'] ?? null, $development['pricing']['currency'] ?? 'MXN') }}
@if (!empty($development['pricing']['pricingNote']))

{{ $development['pricing']['pricingNote'] }}

@endif
gavel

Legal

Régimen {{ $development['legal']['propertyRegime'] ?: 'No definido' }}
Escritura {{ $formatBool($development['legal']['deedAvailable'] ?? null) }}
Contrato {{ $development['legal']['contractType'] ?: 'No definido' }}
Notariado {{ $formatBool($development['legal']['notaryCertified'] ?? null) }}
@if (!empty($development['legal']['notes']))

{{ $development['legal']['notes'] }}

@endif
@if (!empty($development['locationReferences']))
near_me

Referencias

{{ $development['locationReferences'] }}

@endif @if (!$isExternal && $canManageInventory) @include('realEstates.fraccionamientos.details.components.financial_dashboard') @endif @if (!$isExternal && $development['loteTypes']) @include('realEstates.fraccionamientos.details.components.price_rules', [ 'loteTypes' => $development['loteTypes'], ]) @endif @include('realEstates.fraccionamientos.details.components.amenities', [ 'amenities' => $development['amenities'], ])
@if (!$isExternal && $canManageInventory) @endif @endsection @section('extra-scripts') @endsection