131 lines
9.8 KiB
PHP
131 lines
9.8 KiB
PHP
<?php $__env->startSection('content'); ?>
|
|
<div class="max-w-3xl mx-auto space-y-6">
|
|
<!-- Page Header -->
|
|
<div class="flex items-center gap-4">
|
|
<a href="<?php echo e(isset($pettyCash) ? route('petty-cashes.show', $pettyCash) : route('petty-cashes.index')); ?>" class="p-2 text-gray-500 hover:text-gray-900 hover:bg-gray-100 rounded-lg transition-colors">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/></svg>
|
|
</a>
|
|
<h1 class="text-2xl font-bold text-gray-900">
|
|
<?php echo e(isset($pettyCash) ? __('pettyCash.edit') : __('pettyCash.create')); ?>
|
|
|
|
</h1>
|
|
</div>
|
|
|
|
<!-- Form -->
|
|
<form method="POST" action="<?php echo e(isset($pettyCash) ? route('petty-cashes.update', $pettyCash) : route('petty-cashes.store')); ?>" enctype="multipart/form-data" class="bg-white rounded-xl border border-gray-200 p-6 space-y-5">
|
|
<?php echo csrf_field(); ?>
|
|
<?php if(isset($pettyCash)): ?>
|
|
<?php echo method_field('PUT'); ?>
|
|
<?php endif; ?>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-5">
|
|
<!-- Title -->
|
|
<div class="md:col-span-2">
|
|
<label for="title" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('pettyCash.title')); ?> <span class="text-red-500">*</span></label>
|
|
<input type="text" id="title" name="title" value="<?php echo e(old('title', $pettyCash?->title ?? '')); ?>"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500 focus:border-teal-500" required>
|
|
</div>
|
|
|
|
<!-- Project -->
|
|
<div>
|
|
<label for="project_id" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('pettyCash.project')); ?> <span class="text-red-500">*</span></label>
|
|
<select id="project_id" name="project_id" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500" required>
|
|
<option value=""><?php echo e(__('common.all')); ?></option>
|
|
<?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
|
|
<option value="<?php echo e($project->id); ?>" <?php echo e(old('project_id', $pettyCash?->project_id ?? '') == $project->id ? 'selected' : ''); ?>><?php echo e($project->name); ?></option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
</div>
|
|
|
|
<!-- Amount -->
|
|
<div>
|
|
<label for="amount" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('pettyCash.amount')); ?> <span class="text-red-500">*</span></label>
|
|
<input type="number" id="amount" name="amount" value="<?php echo e(old('amount', $pettyCash?->original_amount ?? $pettyCash?->amount ?? '')); ?>" step="0.01" min="0"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500" required>
|
|
</div>
|
|
|
|
<!-- Currency -->
|
|
<div>
|
|
<label for="currency_id" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('pettyCash.currency')); ?> <span class="text-red-500">*</span></label>
|
|
<select id="currency_id" name="currency_id" class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500" required>
|
|
<?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(old('currency_id', $pettyCash?->currency_id ?? $baseCurrency?->id ?? '') == $currency->id ? 'selected' : ''); ?>>
|
|
<?php echo e($currency->code); ?> - <?php echo e($currency->name); ?>
|
|
|
|
<?php if($currency->id === $baseCurrency?->id): ?> (<?php echo e(__('pettyCash.base_currency')); ?>)<?php endif; ?>
|
|
</option>
|
|
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
|
|
</select>
|
|
<p class="mt-1 text-xs text-gray-400"><?php echo e(__('pettyCash.currency_conversion_note')); ?></p>
|
|
</div>
|
|
|
|
<!-- Request Date -->
|
|
<div>
|
|
<?php if (isset($component)) { $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $component; } ?>
|
|
<?php if (isset($attributes)) { $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1 = $attributes; } ?>
|
|
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.date-input','data' => ['name' => 'request_date','value' => old('request_date', $pettyCash?->request_date?->format('Y-m-d')),'required' => 'true']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? $attributes->all() : [])); ?>
|
|
<?php $component->withName('date-input'); ?>
|
|
<?php if ($component->shouldRender()): ?>
|
|
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
|
|
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag): ?>
|
|
<?php $attributes = $attributes->except(\Illuminate\View\AnonymousComponent::ignoredParameterNames()); ?>
|
|
<?php endif; ?>
|
|
<?php $component->withAttributes(['name' => 'request_date','value' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute(old('request_date', $pettyCash?->request_date?->format('Y-m-d'))),'required' => 'true']); ?>
|
|
<?php echo $__env->renderComponent(); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
|
|
<?php $attributes = $__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
|
|
<?php unset($__attributesOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
|
|
<?php endif; ?>
|
|
<?php if (isset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1)): ?>
|
|
<?php $component = $__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1; ?>
|
|
<?php unset($__componentOriginal2c7cd37e2e80199b9dbc9a9aa91b96b1); ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
|
|
<!-- Description -->
|
|
<div class="md:col-span-2">
|
|
<label for="description" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('pettyCash.description')); ?></label>
|
|
<textarea id="description" name="description" rows="3"
|
|
class="w-full px-3 py-2 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-teal-500"><?php echo e(old('description', $pettyCash?->description ?? '')); ?></textarea>
|
|
</div>
|
|
|
|
<!-- Receipt Upload -->
|
|
<div class="md:col-span-2">
|
|
<label for="receipt" class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('pettyCash.receipt')); ?></label>
|
|
<?php if(isset($pettyCash) && $pettyCash?->receipt_path): ?>
|
|
<div class="mb-2 flex items-center gap-2">
|
|
<svg class="w-4 h-4 text-teal-600" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"/></svg>
|
|
<a href="<?php echo e(Storage::url($pettyCash->receipt_path)); ?>" target="_blank" class="text-sm text-teal-600 hover:text-teal-800 underline"><?php echo e(__('pettyCash.current_receipt')); ?></a>
|
|
</div>
|
|
<?php endif; ?>
|
|
<input type="file" id="receipt" name="receipt" accept="jpg,jpeg,png,pdf,doc,docx"
|
|
class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-teal-50 file:text-teal-700 hover:file:bg-teal-100">
|
|
<p class="mt-1 text-xs text-gray-400"><?php echo e(__('pettyCash.receipt_help')); ?></p>
|
|
</div>
|
|
|
|
<!-- Additional Attachments -->
|
|
<div class="md:col-span-2">
|
|
<label class="block text-sm font-medium text-gray-700 mb-1"><?php echo e(__('attachment.additional_files')); ?></label>
|
|
<input type="file" name="attachments[]" multiple accept=".jpg,.jpeg,.png,.pdf,.doc,.docx"
|
|
class="w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-gray-50 file:text-gray-700 hover:file:bg-gray-100">
|
|
<p class="mt-1 text-xs text-gray-400"><?php echo e(__('attachment.max_files_help')); ?></p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Actions -->
|
|
<div class="flex items-center justify-end gap-3 pt-4 border-t border-gray-200">
|
|
<a href="<?php echo e(isset($pettyCash) ? route('petty-cashes.show', $pettyCash) : route('petty-cashes.index')); ?>" class="px-4 py-2 text-sm font-medium text-gray-700 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors">
|
|
<?php echo e(__('common.cancel')); ?>
|
|
|
|
</a>
|
|
<button type="submit" class="px-6 py-2 text-sm font-medium text-white bg-teal-600 rounded-lg hover:bg-teal-700 transition-colors">
|
|
<?php echo e(isset($pettyCash) ? __('common.save') : __('common.create')); ?>
|
|
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<?php $__env->stopSection(); ?>
|
|
|
|
<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\xampp\htdocs\projectra\resources\views/petty-cashes/form.blade.php ENDPATH**/ ?>
|