@props([ 'index' => null, 'optimizedSimulation' => null, 'originalSimulation' => null, 'adjustments' => [], 'monthlyGain' => 0, 'isSuccessful' => false, ]) @if($optimizedSimulation)
merge(['class' => 'opportunity-card']) }}>
{{-- Header with status badge --}}
@if($isSuccessful) @else @endif
@if($monthlyGain > 0)
@lang('Gain on monthly') +{{ str()->formatDecimal($monthlyGain, 2) }}€
@endif
{{-- Bank and Product Info --}}
{{ $optimizedSimulation->bank_name }} ! $optimizedSimulation->product])> {{ $optimizedSimulation->product?->name }}
@cf($optimizedSimulation->credit_amount) @dcf($optimizedSimulation->rate)% @cf($optimizedSimulation->monthly) {{ $optimizedSimulation->duration }} @lang('months')
{{-- Info button for financing plan --}} {{-- Expand/collapse --}} {{-- Apply opportunity button --}} @if(! is_null($index)) @endif
{{-- Adjustments summary --}} @if(count($adjustments) > 0)
@lang('Proposed adjustments')
    @foreach($adjustments as $adjustment)
  • {{ $adjustment['description'] ?? '' }}
  • @endforeach
@endif {{-- Expanded details --}}
{{-- Comparison table --}}
@lang('Original') @lang('Optimized') @lang('Difference')
@lang('Duration') {{ $originalSimulation->duration }} mois {{ $optimizedSimulation->duration }} mois @php $durDiff = $optimizedSimulation->duration - $originalSimulation->duration @endphp @if($durDiff != 0) $durDiff < 0, 'text-warning' => $durDiff > 0])> {{ $durDiff > 0 ? '+' : '' }}{{ $durDiff }} mois @else - @endif
@lang('Cashflow') @cf($originalSimulation->cashflow_amount) @cf($optimizedSimulation->cashflow_amount) @php $cashDiff = $optimizedSimulation->cashflow_amount - $originalSimulation->cashflow_amount @endphp @if($cashDiff != 0) $cashDiff > 0, 'text-warning' => $cashDiff < 0])> {{ $cashDiff > 0 ? '+' : '' }}{{ str()->formatDecimal($cashDiff, 0) }}€ @else - @endif
@lang('Mandate') {{ number_format($originalSimulation->mandate, 2) }}% {{ number_format($optimizedSimulation->mandate, 2) }}% @php $mandDiff = $optimizedSimulation->mandate - $originalSimulation->mandate @endphp @if(abs($mandDiff) > 0.01) $mandDiff > 0, 'text-warning' => $mandDiff < 0])> {{ $mandDiff > 0 ? '+' : '' }}{{ number_format($mandDiff, 2) }}% @else - @endif
@lang('Monthly') @cf($originalSimulation->monthly) @cf($optimizedSimulation->monthly) @php $monthDiff = $optimizedSimulation->monthly - $originalSimulation->monthly @endphp @if(abs($monthDiff) > 0.01) $monthDiff < 0, 'text-warning' => $monthDiff > 0])> {{ $monthDiff > 0 ? '+' : '' }}{{ str()->formatDecimal($monthDiff, 2) }}€ @else - @endif
@lang('Operation amount') @cf($originalSimulation->credit_amount) @cf($optimizedSimulation->credit_amount) @php $creditDiff = $optimizedSimulation->credit_amount - $originalSimulation->credit_amount @endphp @if(abs($creditDiff) > 0.01) $creditDiff < 0, 'text-warning' => $creditDiff > 0])> {{ $creditDiff > 0 ? '+' : '' }}{{ str()->formatDecimal($creditDiff, 0) }}€ @else - @endif

@endif