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

    <div class="card shadow-sm">
        <div class="card-body">
            <form action="<?php echo e(route('employee-payments.store')); ?>" method="POST">
                <?php echo csrf_field(); ?>
                <?php
                    $selectedCurrencyId = old('currency_id', optional($currencies->first())->id);
                ?>
                <div class="row g-3">
                    <div class="col-md-6">
                        <label class="form-label" for="employee_id"><?php echo e(__('Employee')); ?></label>
                        <select id="employee_id" name="employee_id" class="form-select" required>
                            <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $employee): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($employee->id); ?>"><?php echo e($employee->name); ?></option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label" for="payment_date"><?php echo e(__('Payment Date')); ?></label>
                        <input id="payment_date" type="date" name="payment_date" class="form-control" value="<?php echo e(old('payment_date', now()->format('Y-m-d'))); ?>" required>
                    </div>
                </div>

                <div class="row g-3 mt-3">
                    <div class="col-md-4">
                        <label class="form-label" for="payment_type"><?php echo e(__('Payment Type')); ?> <span class="text-danger">*</span></label>
                        <select id="payment_type" name="payment_type" class="form-select" required>
                            <option value=""><?php echo e(__('Select Type')); ?></option>
                            <option value="salary" <?php echo e(old('payment_type') === 'salary' ? 'selected' : ''); ?>><?php echo e(__('Salary')); ?></option>
                            <option value="advance" <?php echo e(old('payment_type') === 'advance' ? 'selected' : ''); ?>><?php echo e(__('Advance')); ?></option>
                            <option value="adjustment" <?php echo e(old('payment_type') === 'adjustment' ? 'selected' : ''); ?>><?php echo e(__('Adjustment')); ?></option>
                        </select>
                        <?php $__errorArgs = ['payment_type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="text-danger small"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label" for="period"><?php echo e(__('Period')); ?> <span class="text-danger">*</span></label>
                        <select id="period" name="period" class="form-select" required>
                            <option value=""><?php echo e(__('Select Period')); ?></option>
                            <option value="daily" <?php echo e(old('period') === 'daily' ? 'selected' : ''); ?>><?php echo e(__('Daily')); ?></option>
                            <option value="weekly" <?php echo e(old('period') === 'weekly' ? 'selected' : ''); ?>><?php echo e(__('Weekly')); ?></option>
                            <option value="monthly" <?php echo e(old('period') === 'monthly' ? 'selected' : ''); ?>><?php echo e(__('Monthly')); ?></option>
                        </select>
                        <?php $__errorArgs = ['period'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="text-danger small"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="col-md-4">
                        <label class="form-label" for="amount"><?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>

                <div class="row g-3 mt-3">
                    <div class="col-md-6">
                        <label class="form-label" for="method"><?php echo e(__('Method')); ?></label>
                        <select id="method" name="method" class="form-select">
                            <option value="cash"><?php echo e(__('Cash')); ?></option>
                            <option value="card"><?php echo e(__('Card')); ?></option>
                        </select>
                    </div>
                    <div class="col-md-6">
                        <label class="form-label" for="currency_id"><?php echo e(__('Currency')); ?></label>
                        <select id="currency_id" name="currency_id" class="form-select">
                            <?php $__currentLoopData = $currencies; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $currency): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($currency->id); ?>" <?php echo e((string) $selectedCurrencyId === (string) $currency->id ? 'selected' : ''); ?>>
                                    <?php echo e($currency->code); ?> - <?php echo e($currency->name); ?>

                                </option>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </select>
                    </div>
                </div>

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

                <div class="mt-3">
                    <button type="submit" class="btn btn-primary"><?php echo e(__('Save Payment')); ?></button>
                    <a href="<?php echo e(route('employee-payments.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/employee_payments/create.blade.php ENDPATH**/ ?>