<?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 Ledger Entry')); ?> <?php $__env->endSlot(); ?>

    <div class="card shadow-sm">
        <div class="card-body">
            <form action="<?php echo e(route('customer-ledgers.store')); ?>" method="POST">
                <?php echo csrf_field(); ?>

                <div class="row g-3">
                    <div class="col-md-6">
                        <label class="form-label" for="customer_id"><?php echo e(__('Customer')); ?></label>
                        <select id="customer_id" name="customer_id" class="form-select" required>
                            <option value="">-- <?php echo e(__('Select Customer')); ?> --</option>
                            <?php $__currentLoopData = $customers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $c): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($c->id); ?>" <?php echo e(old('customer_id') == $c->id ? 'selected' : ''); ?>>
                                    <?php echo e($c->name); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label" for="transaction_date"><?php echo e(__('Date')); ?></label>
                        <input id="transaction_date" type="date" name="transaction_date" class="form-control"
                               value="<?php echo e(old('transaction_date', now()->format('Y-m-d'))); ?>" required>
                    </div>
                </div>

                <div class="row g-3 mt-1">
                    <div class="col-md-6">
                        <label class="form-label" for="type"><?php echo e(__('Type')); ?></label>
                        <select id="type" name="type" class="form-select" required>
                            <option value="credit" <?php echo e(old('type') == 'credit' ? 'selected' : ''); ?>><?php echo e(__('Credit (Sale / Due)')); ?></option>
                            <option value="payment" <?php echo e(old('type') == 'payment' ? 'selected' : ''); ?>><?php echo e(__('Payment (Received)')); ?></option>
                            <option value="adjustment" <?php echo e(old('type') == 'adjustment' ? 'selected' : ''); ?>><?php echo e(__('Adjustment')); ?></option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label" for="amount"><?php echo e(__('Amount')); ?></label>
                        <input id="amount" type="number" step="0.01" min="0" name="amount"
                               class="form-control" value="<?php echo e(old('amount')); ?>" required>
                    </div>
                </div>

                <div class="mt-3">
                    <label class="form-label" for="description"><?php echo e(__('Description')); ?></label>
                    <textarea id="description" name="description" class="form-control" rows="3"><?php echo e(old('description')); ?></textarea>
                </div>

                <div class="mt-3">
                    <button type="submit" class="btn btn-primary"><?php echo e(__('Save Entry')); ?></button>
                    <a href="<?php echo e(route('customer-ledgers.index')); ?>" class="btn btn-secondary"><?php echo e(__('Cancel')); ?></a>
                </div>
            </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/customer_ledgers/create.blade.php ENDPATH**/ ?>