
<div class="form-card">
    <div class="fsh">
        <div class="fsh-icon" style="background:#f1f5f9;color:#64748b"><i
                class="fas fa-cog"></i></div>
        <div class="fsh-title">Durum & Atama</div>
    </div>
    <div class="fsb">
        <div class="fl mb-3">
            <div class="fl mb-3"><label>Durum <span class="req">*</span></label>
            <select name="status" class="fi">
                <?php $__currentLoopData = [
                    'potential' => 'Potansiyel',
                    'offer_sent' => 'Teklif Verildi',
                    'revised' => 'Revize Edildi',
                    'confirmed' => 'Satış Tamamlandı',
                    'in_progress' => 'Devam Ediyor',
                    'completed' => 'Kapanan',
                    'cancelled' => 'İptal Edildi',
                    'refunded' => 'İade Edildi'
                ]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v => $l): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($v); ?>" <?php echo e(old('status', $reservation->status) === $v ? 'selected' : ''); ?>><?php echo e($l); ?>

                </option><?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="fl mb-3">
            <label>Ödeme Durumu <span style="color:#ef4444">*</span></label>
            <select name="payment_status" class="field-input">
                <?php $__currentLoopData = ['unpaid' => 'Ödenmedi', 'partial' => 'Kısmi Ödendi', 'paid' => 'Ödendi', 'refunded' => 'İade']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $v => $l): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($v); ?>" <?php echo e(old('payment_status', $reservation->payment_status) === $v ? 'selected' : ''); ?>>
                        <?php echo e($l); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="fl">
            <label>Atanan Temsilci</label>
            <select name="assigned_to" class="field-input">
                <option value="">— Seçin —</option>
                <?php $__currentLoopData = $agents; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $a): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option value="<?php echo e($a->id); ?>" <?php echo e(old('assigned_to', $reservation->assigned_to) == $a->id ? 'selected' : ''); ?>>
                        <?php echo e($a->first_name); ?> <?php echo e($a->last_name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
    </div>
</div>


<div class="form-card" id="customerDetailsCard" style="display:none; margin-bottom:1.5rem">
    <div class="fsh">
        <div class="fsh-icon" style="background:#ede9fe;color:#8b5cf6"><i class="fas fa-user-check"></i></div>
        <div class="fsh-title">Müşteri Bilgileri</div>
    </div>
    <div class="fsb" id="customerSummaryHtml" style="font-size: 0.82rem; color: #475569;">
    </div>
</div>


<div class="form-card">
    <div class="fsh">
        <div class="fsh-icon" style="background:#d1fae5;color:#10b981"><i
                class="fas fa-lira-sign"></i></div>
        <div class="fsh-title">Fiyatlandırma</div>
    </div>
    <div class="fsb">
        <div class="fl mb-3">
            <label>Yetişkin Birim Fiyat</label>
            <input type="number" step="0.01" name="unit_price"
                value="<?php echo e(old('unit_price', $reservation->unit_price)); ?>" class="field-input"
                id="unitPrice" oninput="calcPrice()">
        </div>
        <div class="fg-2 mb-3">
            <div class="fl">
                <label>Çocuk Fiyatı</label>
                <input type="number" step="0.01" name="child_price"
                    value="<?php echo e(old('child_price', $reservation->child_price)); ?>"
                    class="field-input" id="childPrice" oninput="calcPrice()">
            </div>
            <div class="fl">
                <label>Bebek Fiyatı</label>
                <input type="number" step="0.01" name="infant_price"
                    value="<?php echo e(old('infant_price', $reservation->infant_price)); ?>"
                    class="field-input" id="infantPrice" oninput="calcPrice()">
            </div>
        </div>
        <div class="fg-2 mb-3">
            <div class="fl">
                <label>İndirim (%)</label>
                <input type="number" step="0.01" name="discount_rate"
                    value="<?php echo e(old('discount_rate', $reservation->discount_rate)); ?>"
                    class="field-input" id="discountRate" oninput="calcPrice()">
            </div>
            <div class="fl">
                <label>KDV (₺)</label>
                <input type="number" step="0.01" name="tax_amount"
                    value="<?php echo e(old('tax_amount', $reservation->tax_amount)); ?>"
                    class="field-input" id="taxAmount" oninput="calcPrice()">
            </div>
        </div>
        <div class="fl mb-3">
            <label>Tahsil Edilen</label>
            <input type="number" step="0.01" name="paid_amount"
                value="<?php echo e(old('paid_amount', $reservation->paid_amount)); ?>" class="field-input"
                id="paidAmount" oninput="calcPrice()">
        </div>

        <div class="price-panel">
            <div class="pr-row"><span>Ara Toplam</span><span
                    id="displaySubtotal"><?php echo e(number_format($reservation->subtotal ?? 0, 2)); ?></span>
            </div>
            <div class="pr-row" style="color:#fde68a"><span>İndirim</span><span
                    id="displayDiscount">-
                    <?php echo e(number_format($reservation->discount_amount, 2)); ?></span></div>
            <div class="pr-row"><span>KDV</span><span id="displayTax">+
                    <?php echo e(number_format($reservation->tax_amount, 2)); ?></span></div>
            <hr class="pr-div">
            <div class="pr-row pr-total"><span>Toplam</span><span
                    id="displayTotal"><?php echo e(number_format($reservation->total_amount ?? 0, 2)); ?>

                    <?php echo e($reservation->currency); ?></span></div>
            <div class="pr-row" style="color:#fda4af"><span>Kalan</span><span
                    id="displayRemaining"><?php echo e(number_format($reservation->remaining_amount ?? 0, 2)); ?></span>
            </div>

            <input type="hidden" name="total_amount" id="hiddenTotal"
                value="<?php echo e($reservation->total_amount); ?>">
            <input type="hidden" name="remaining_amount" id="hiddenRemaining"
                value="<?php echo e($reservation->remaining_amount); ?>">
            <input type="hidden" name="subtotal" id="hiddenSubtotal"
                value="<?php echo e($reservation->subtotal); ?>">
            <input type="hidden" name="discount_amount" id="hiddenDiscountAmt"
                value="<?php echo e($reservation->discount_amount); ?>">
        </div>

        <div class="fl mt-3">
            <label>Para Birimi</label>
            <select name="currency" class="field-input">
                <option value="TRY" <?php echo e(old('currency', $reservation->currency) === 'TRY' ? 'selected' : ''); ?>>₺ TRY
                </option>
                <option value="USD" <?php echo e(old('currency', $reservation->currency) === 'USD' ? 'selected' : ''); ?>>$ USD
                </option>
                <option value="EUR" <?php echo e(old('currency', $reservation->currency) === 'EUR' ? 'selected' : ''); ?>>€ EUR
                </option>
            </select>
        </div>
    </div>
</div>
<?php /**PATH C:\xampp\htdocs\acente\resources\views/agency/sales/edit/sidebar.blade.php ENDPATH**/ ?>