<?php if (isset($component)) { $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54 = $attributes; } ?>
<?php $component = App\View\Components\AppLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
<?php $component->withName('app-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
<?php $attributes = $attributes->except(\App\View\Components\AppLayout::ignoredParameterNames()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('header', null, []); ?> <?php echo e(__('Add Sale')); ?> <?php $__env->endSlot(); ?>

    <div class="card shadow-sm">
        <div class="card-body">
            <form action="<?php echo e(route('sales.store')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <div class="row g-3 mb-3">
                    <div class="col-md-4">
                        <label class="form-label fw-semibold"><?php echo e(__('Invoice No')); ?></label>
                        <input type="text" name="invoice_no" class="form-control" value="<?php echo e(old('invoice_no', $nextInvoice)); ?>">
                    </div>
                </div>
                <div class="mb-3">
                    <label for="customer_id" class="form-label"><?php echo e(__('Customer')); ?></label>
                    <select id="customer_id" name="customer_id" class="form-select">
                        <option value=""><?php echo e(__('Select a customer')); ?></option>
                        <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $customer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($customer->id); ?>"><?php echo e($customer->name); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="row g-3">
                    <div class="col-md-4">
                        <label for="sale_date" class="form-label"><?php echo e(__('Date')); ?></label>
                        <input id="sale_date" type="date" name="sale_date" class="form-control" value="<?php echo e(old('sale_date', now()->format('Y-m-d'))); ?>" required>
                    </div>
                    <div class="col-md-4">
                        <label for="payment_method" class="form-label"><?php echo e(__('Payment Method')); ?></label>
                        <select id="payment_method" name="payment_method" class="form-select" required>
                            <option value="cash"><?php echo e(__('Cash')); ?></option>
                            <option value="card"><?php echo e(__('Card')); ?></option>
                            <option value="other"><?php echo e(__('Other')); ?></option>
                        </select>
                    </div>
                    <div class="col-md-4">
                        <label for="sale_source_id" class="form-label"><?php echo e(__('Source')); ?></label>
                        <select id="sale_source_id" name="sale_source_id" class="form-select">
                            <option value=""><?php echo e(__('-- Select Source --')); ?></option>
                            <?php $__currentLoopData = $saleSources; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $src): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($src->id); ?>" <?php echo e(old('sale_source_id') == $src->id ? 'selected' : ''); ?>><?php echo e($src->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                </div>
                <div class="mb-3 mt-3">
                    <label for="amount" class="form-label"><?php echo e(__('Amount')); ?></label>
                    <input id="amount" type="number" step="0.01" name="amount" class="form-control" value="<?php echo e(old('amount')); ?>" required>
                </div>
                <div class="mb-3">
                    <label for="reference" class="form-label"><?php echo e(__('Reference')); ?></label>
                    <input id="reference" type="text" name="reference" class="form-control" value="<?php echo e(old('reference')); ?>">
                </div>
                <div class="mb-3">
                    <label for="notes" class="form-label"><?php echo e(__('Notes')); ?></label>
                    <textarea id="notes" name="notes" class="form-control" rows="3"><?php echo e(old('notes')); ?></textarea>
                </div>
                <button type="submit" class="btn btn-primary"><?php echo e(__('Save Sale')); ?></button>
                <a href="<?php echo e(route('sales.index')); ?>" class="btn btn-secondary"><?php echo e(__('Cancel')); ?></a>
            </form>
        </div>
    </div>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $attributes = $__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__attributesOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54)): ?>
<?php $component = $__componentOriginal9ac128a9029c0e4701924bd2d73d7f54; ?>
<?php unset($__componentOriginal9ac128a9029c0e4701924bd2d73d7f54); ?>
<?php endif; ?>
<?php /**PATH C:\Users\anwar\OneDrive\Desktop\Babu KSA\software\restaurant-management\resources\views/sales/create.blade.php ENDPATH**/ ?>