103 lines
5.7 KiB
PHP
103 lines
5.7 KiB
PHP
@extends('layouts.app')
|
|
|
|
@section('title', __('inventory.transactions') . ' #' . $inventoryTransaction->id)
|
|
|
|
@section('content')
|
|
<div class="space-y-6">
|
|
<!-- Page Header -->
|
|
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4">
|
|
<div class="flex items-center gap-3">
|
|
<a href="{{ route('inventory-transactions.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>
|
|
<div>
|
|
<h1 class="text-2xl font-bold text-gray-900">{{ __('inventory.transactions') }} #{{ $inventoryTransaction->id }}</h1>
|
|
</div>
|
|
</div>
|
|
<form method="POST" action="{{ route('inventory-transactions.destroy', $inventoryTransaction) }}" class="inline" onsubmit="return confirm('{{ __('common.confirm_delete') }}')">
|
|
@csrf @method('DELETE')
|
|
<button type="submit" class="px-4 py-2 text-sm font-medium text-red-700 bg-red-50 border border-red-200 rounded-lg hover:bg-red-100 transition-colors">
|
|
{{ __('common.delete') }}
|
|
</button>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
|
<!-- Main Info -->
|
|
<div class="lg:col-span-2">
|
|
<div class="bg-white rounded-xl border border-gray-200 p-6">
|
|
<div class="grid grid-cols-2 gap-4">
|
|
<div>
|
|
<p class="text-xs text-gray-500">{{ __('inventory.transaction_type') }}</p>
|
|
@php
|
|
$ttk = 'inventory.type_' . $inventoryTransaction->type;
|
|
$ttl = __($ttk);
|
|
if ($ttl === $ttk) $ttl = $inventoryTransaction->type;
|
|
@endphp
|
|
<span class="inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium mt-1
|
|
{{ $inventoryTransaction->type === 'in' ? 'bg-emerald-50 text-emerald-700' :
|
|
($inventoryTransaction->type === 'out' ? 'bg-red-50 text-red-700' :
|
|
($inventoryTransaction->type === 'return' ? 'bg-blue-50 text-blue-700' : 'bg-amber-50 text-amber-700')) }}">
|
|
{{ $ttl }}
|
|
</span>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-gray-500">{{ __('inventory.name') }}</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-1">{{ $inventoryTransaction->item?->name ?? '-' }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-gray-500">{{ __('warehouse.warehouses') }}</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-1">{{ $inventoryTransaction->warehouse?->name ?? '-' }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-gray-500">{{ __('inventory.quantity') }}</p>
|
|
<p class="text-lg font-bold text-gray-900 mt-1">{{ $inventoryTransaction->quantity }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-gray-500">{{ __('inventory.unit_price') }}</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-1">{{ $inventoryTransaction->unit_price ? number_format($inventoryTransaction->unit_price) : '-' }}</p>
|
|
</div>
|
|
<div>
|
|
<p class="text-xs text-gray-500">{{ __('inventory.date') }}</p>
|
|
<p class="text-sm font-medium text-gray-900 mt-1">{{ $inventoryTransaction->date ? calendar_date($inventoryTransaction->date) : '-' }}</p>
|
|
</div>
|
|
</div>
|
|
|
|
@if($inventoryTransaction->description)
|
|
<div class="mt-4 pt-4 border-t border-gray-100">
|
|
<p class="text-xs text-gray-500 mb-1">{{ __('common.description') }}</p>
|
|
<p class="text-sm text-gray-700">{{ $inventoryTransaction->description }}</p>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sidebar -->
|
|
<div class="space-y-6">
|
|
@if($inventoryTransaction->project)
|
|
<div class="bg-white rounded-xl border border-gray-200 p-5">
|
|
<h3 class="text-sm font-semibold text-gray-900 mb-2">{{ __('expense.project') }}</h3>
|
|
<a href="{{ route('projects.show', $inventoryTransaction->project) }}" class="text-sm text-teal-600 hover:underline">{{ $inventoryTransaction->project->name }}</a>
|
|
</div>
|
|
@endif
|
|
|
|
@if($inventoryTransaction->reference)
|
|
<div class="bg-white rounded-xl border border-gray-200 p-5">
|
|
<h3 class="text-sm font-semibold text-gray-900 mb-2">{{ __('inventory.reference') }}</h3>
|
|
<p class="text-sm text-gray-700">{{ $inventoryTransaction->reference }}</p>
|
|
</div>
|
|
@endif
|
|
|
|
@if($inventoryTransaction->total_price)
|
|
<div class="bg-white rounded-xl border border-gray-200 p-5">
|
|
<h3 class="text-sm font-semibold text-gray-900 mb-3">{{ __('inventory.total_price') }}</h3>
|
|
<p class="text-lg font-bold text-gray-900">{{ number_format($inventoryTransaction->total_price) }}</p>
|
|
@if($inventoryTransaction->currency)
|
|
<p class="text-xs text-gray-500 mt-1">{{ $inventoryTransaction->currency->code }}</p>
|
|
@endif
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection |