<?php $__template->layout('Layout.main'); ?>

<?php $__template->section('title'); ?>مطابقة بنكية جديدة<?php $__template->endSection(); ?>

<?php $__template->section('content'); ?>
<div class="card">
    <div style="padding:15px 20px;border-bottom:1px solid #E5E7EB;">
        <h3 style="margin:0;">إنشاء مطابقة بنكية</h3>
    </div>
    <div style="padding:20px;">
        <form method="POST" action="/accounting/bank-reconciliation">
            <?= csrf_field() ?>
            <div style="display:grid;grid-template-columns:1fr 1fr;gap:15px;">
                <div>
                    <label class="form-label">الحساب البنكي <span style="color:#DC2626;">*</span></label>
                    <select name="bank_account_id" class="form-select" required>
                        <option value="">— اختر —</option>
                        <?php foreach ($bank_accounts as $ba): ?>
                            <option value="<?= (int)$ba['id'] ?>"><?= e($ba['account_name_ar']) ?> — <?= e($ba['bank_name_ar']) ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div>
                    <label class="form-label">رصيد كشف البنك <span style="color:#DC2626;">*</span></label>
                    <input type="number" name="statement_balance" class="form-input" step="0.01" required dir="ltr">
                </div>
                <div>
                    <label class="form-label">تاريخ كشف البنك <span style="color:#DC2626;">*</span></label>
                    <input type="date" name="statement_date" class="form-input" value="<?= date('Y-m-d') ?>" required>
                </div>
                <div>
                    <label class="form-label">تاريخ المطابقة</label>
                    <input type="date" name="reconciliation_date" class="form-input" value="<?= date('Y-m-d') ?>">
                </div>
                <div style="grid-column:1/-1;">
                    <label class="form-label">ملاحظات</label>
                    <textarea name="notes" class="form-textarea" rows="2"></textarea>
                </div>
            </div>
            <div style="margin-top:20px;display:flex;gap:8px;">
                <button type="submit" class="btn btn-primary">إنشاء المطابقة</button>
                <a href="/accounting/bank-reconciliation" class="btn btn-outline">إلغاء</a>
            </div>
        </form>
    </div>
</div>
<?php $__template->endSection(); ?>
