<?php $__env->startSection('title', 'Invoice Settings'); ?>
<?php $__env->startSection('page-title', 'Settings'); ?>

<?php $__env->startSection('content'); ?>
<?php echo $__env->make('settings.partials.tabs', ['active' => 'invoice'], array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>

<div class="row justify-content-start">
<div class="col-lg-7">
<div class="card table-card p-4">

    <h6 class="fw-700 mb-4" style="color:#1e293b;">Invoice Defaults</h6>

    <?php if(session('success')): ?>
        <div class="alert alert-success rounded-3 small py-2 mb-3">
            <i class="bi bi-check-circle me-1"></i> <?php echo e(session('success')); ?>

        </div>
    <?php endif; ?>

    <form method="POST" action="<?php echo e(route('settings.invoice')); ?>" novalidate>
    <?php echo csrf_field(); ?> <?php echo method_field('PUT'); ?>

    <div class="row g-3">
        <div class="col-sm-4">
            <label class="form-label fw-500">Invoice Prefix</label>
            <input type="text" name="invoice_prefix" class="form-control"
                   value="<?php echo e(old('invoice_prefix', $user->invoice_prefix)); ?>"
                   placeholder="INV" maxlength="10" style="text-transform:uppercase;">
            <div class="form-text">e.g. INV → INV-0001</div>
        </div>
        <div class="col-sm-4">
            <label class="form-label fw-500">Payment Terms (days)</label>
            <input type="number" name="payment_terms" class="form-control"
                   value="<?php echo e(old('payment_terms', $user->payment_terms)); ?>"
                   min="1" max="365" placeholder="14">
            <div class="form-text">Default due date offset</div>
        </div>
        <div class="col-sm-4">
            <label class="form-label fw-500">Current Counter</label>
            <input type="text" class="form-control" value="<?php echo e($user->invoice_counter); ?>" disabled>
            <div class="form-text">Next: <?php echo e($user->invoice_prefix); ?>-<?php echo e(str_pad($user->invoice_counter + 1, 4, '0', STR_PAD_LEFT)); ?></div>
        </div>
        <div class="col-12">
            <label class="form-label fw-500">Default Invoice Notes</label>
            <textarea name="default_invoice_notes" rows="3" class="form-control"
                      placeholder="Thank you for your business! Payment is due within 14 days."><?php echo e(old('default_invoice_notes', $user->default_invoice_notes)); ?></textarea>
            <div class="form-text">Pre-filled on every new invoice. You can override per invoice.</div>
        </div>
    </div>

    <div class="mt-4">
        <button type="submit" class="btn fw-600" style="background:#00a651;color:white;">
            <i class="bi bi-check-lg me-2"></i>Save Settings
        </button>
    </div>
    </form>
</div>
</div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\Users\Bunmi\Desktop\crud\resources\views/settings/invoice.blade.php ENDPATH**/ ?>