77 lines
4.9 KiB
PHP
77 lines
4.9 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', 'حواله جدید')
|
|
|
|
@section('content')
|
|
<div class="p-6">
|
|
<div class="mb-6">
|
|
<a href="{{ route('inventory.transactions') }}" class="text-sm text-gray-500 hover:text-gray-700 mb-2 inline-flex items-center gap-1">
|
|
<svg class="w-4 h-4" 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">حواله جدید</h1>
|
|
</div>
|
|
|
|
<div class="bg-white rounded-lg shadow p-6 max-w-2xl">
|
|
<form action="{{ route('inventory.transactions.store') }}" method="POST">
|
|
@csrf
|
|
<div class="space-y-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">نوع حواله <span class="text-red-500">*</span></label>
|
|
<select name="type" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" required>
|
|
<option value="in">ورود به انبار (رسید)</option>
|
|
<option value="out">خروج از انبار (حواله)</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">قلم <span class="text-red-500">*</span></label>
|
|
<select name="item_id" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" required>
|
|
<option value="">انتخاب...</option>
|
|
@foreach($items as $item)
|
|
<option value="{{ $item->id }}" {{ old('item_id') == $item->id ? 'selected' : '' }}>{{ $item->name }} {{ $item->code ? '(' . $item->code . ')' : '' }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">انبار <span class="text-red-500">*</span></label>
|
|
<select name="warehouse_id" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" required>
|
|
<option value="">انتخاب...</option>
|
|
@foreach($warehouses as $warehouse)
|
|
<option value="{{ $warehouse->id }}" {{ old('warehouse_id') == $warehouse->id ? 'selected' : '' }}>{{ $warehouse->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">مقدار <span class="text-red-500">*</span></label>
|
|
<input type="number" name="quantity" value="{{ old('quantity') }}" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500" min="0.01" step="0.01" required>
|
|
</div>
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">پروژه</label>
|
|
<select name="project_id" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">
|
|
<option value="">انتخاب...</option>
|
|
@foreach($projects as $project)
|
|
<option value="{{ $project->id }}" {{ old('project_id') == $project->id ? 'selected' : '' }}>{{ $project->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700 mb-1">توضیحات</label>
|
|
<textarea name="notes" rows="3" class="w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500">{{ old('notes') }}</textarea>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-6 flex gap-3 pt-4 border-t">
|
|
<button type="submit" class="px-6 py-2 bg-emerald-600 text-white text-sm font-medium rounded-lg hover:bg-emerald-700">ذخیره</button>
|
|
<a href="{{ route('inventory.transactions') }}" class="px-6 py-2 bg-gray-100 text-gray-700 text-sm font-medium rounded-lg hover:bg-gray-200">انصراف</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@endsection |