@extends('layouts.app')
@php
$isEdit = isset($offer);
// Normalize field values for both modes
$personValue = $isEdit ? ($offer->person ?? '') : ($opportunity->contact ?? '');
$titleValue = $isEdit ? ($offer->title ?? '') : '';
$phoneValue = $isEdit ? ($offer->phone ?? '') : '';
$addressValue = $isEdit ? ($offer->address ?? '') : '';
$dateValue = $isEdit ? ($offer->date ?? $today) : $today;
$dueDateValue = $isEdit ? ($offer->due_date ?? '') : \Carbon\Carbon::now()->addDays(15)->format('Y-m-d');
$selectedCurrencyInit = $isEdit ? ($offer->currency ?? 'TRL') : 'TRL';
$exchangeRateInit = $isEdit ? ($offer->ex_rate ?? '1.00') : '1.00';
$rowsJson = $isEdit ? json_encode($offer_lines ?? []) : '[]';
$noteContent = $isEdit ? ($offer->note ?? '') : "Fiyatlara vergiler dahil değildir.
\nTeklif düzenleme tarihinden itibaren 15 gün süreyle geçerlidir.";
@endphp
@section('content')