chore: initial commit of existing codebase

This commit is contained in:
ghassan committed 2026-05-19 12:40:08 +03:00
commit 11e94889b2
292 files changed
+38586

No files matched your search

@@ -0,0 +1,61 @@
@extends('layouts.app')
@section('title', 'Low Stock Report')
@section('content')
<div class="mb-6">
<h1 class="page-title">Low Stock Report</h1>
<p class="page-subtitle">Items currently below their minimum stock level</p>
</div>
@if(isset($stocks) && $stocks->count() > 0)
<div class="mb-4 px-4 py-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700 font-medium">
{{ $stocks->count() }} item(s) are below minimum stock level. Immediate action may be required.
</div>
@endif
<div class="table-wrapper overflow-x-auto">
<table class="table-base">
<thead>
<tr>
<th>Item Code</th>
<th>Item Name</th>
<th>Category</th>
<th>Warehouse</th>
<th class="text-right">Current Qty</th>
<th class="text-right">Min Stock</th>
<th class="text-right">Shortage</th>
<th>Status</th>
</tr>
</thead>
<tbody>
@forelse($stocks as $stock)
@php $shortage = $stock->item->minimum_stock_level - $stock->quantity; @endphp
<tr class="bg-red-50">
<td class="font-mono text-red-700">{{ $stock->item->item_code ?? '' }}</td>
<td class="font-medium text-red-800">{{ $stock->item->item_name ?? '' }}</td>
<td>
@php
$catLabels = ['raw_material'=>'Raw Material','wip'=>'WIP','finished_good'=>'Finished Good'];
@endphp
<span class="text-gray-600">{{ $catLabels[$stock->item->category ?? ''] ?? ucfirst($stock->item->category ?? '') }}</span>
</td>
<td class="text-gray-600">{{ $stock->warehouse->name ?? '' }}</td>
<td class="text-right font-bold text-red-700">{{ number_format($stock->quantity, 2) }}</td>
<td class="text-right text-gray-600">{{ number_format($stock->item->minimum_stock_level ?? 0, 2) }}</td>
<td class="text-right font-semibold text-red-600">{{ number_format($shortage, 2) }}</td>
<td>
<span class="badge-red">LOW STOCK</span>
</td>
</tr>
@empty
<tr>
<td colspan="8" class="px-4 py-8 text-center text-green-600 font-medium">
All items are above minimum stock levels.
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@endsection
@@ -0,0 +1,80 @@
@extends('layouts.app')
@section('title', 'Movement Report')
@section('content')
<div class="mb-6">
<h1 class="page-title">Movement Report</h1>
<p class="page-subtitle">View stock movements within a date range</p>
</div>
<!-- Date Range Filter -->
<div class="card card-body mb-6">
<form method="GET" action="{{ route('inventory.reports.movement') }}" class="flex flex-wrap items-end gap-4">
<div>
<label class="form-label">From Date</label>
<input type="date" name="from_date" value="{{ request('from_date') }}" class="form-input">
</div>
<div>
<label class="form-label">To Date</label>
<input type="date" name="to_date" value="{{ request('to_date') }}" class="form-input">
</div>
<div>
<label class="form-label">Item (optional)</label>
<select name="item_id" class="form-select">
<option value="">All Items</option>
@foreach($items as $item)
<option value="{{ $item->id }}" {{ request('item_id') == $item->id ? 'selected' : '' }}>
{{ $item->item_code }} - {{ $item->item_name }}
</option>
@endforeach
</select>
</div>
<div>
<button type="submit" class="btn-primary">Filter</button>
</div>
</form>
</div>
<div class="table-wrapper overflow-x-auto">
<table class="table-base">
<thead>
<tr>
<th>Item</th>
<th>Warehouse</th>
<th>Type</th>
<th class="text-right">Quantity</th>
<th>Date</th>
</tr>
</thead>
<tbody>
@forelse($movements as $movement)
<tr>
<td class="text-gray-800">
<span class="font-mono text-xs text-gray-500">{{ $movement->item->item_code ?? '' }}</span>
<span class="ml-1">{{ $movement->item->item_name ?? '' }}</span>
</td>
<td class="text-gray-700">{{ $movement->warehouse->name ?? '' }}</td>
<td>
@if(strtolower($movement->type) === 'in')
<span class="badge-green">IN</span>
@else
<span class="badge-red">OUT</span>
@endif
</td>
<td class="text-right font-medium text-gray-800">{{ number_format($movement->quantity, 2) }}</td>
<td>{{ $movement->created_at ? $movement->created_at->format('d M Y') : '' }}</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-4 py-8 text-center text-gray-400">No movements found for selected filters.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@if(isset($movements) && $movements->hasPages())
<div class="mt-4">{{ $movements->links() }}</div>
@endif
@endsection
@@ -0,0 +1,45 @@
@extends('layouts.app')
@section('title', 'Inventory Summary')
@section('content')
<div class="mb-6">
<h1 class="page-title">Inventory Summary</h1>
<p class="page-subtitle">Current stock levels across all warehouses</p>
</div>
<div class="table-wrapper overflow-x-auto">
<table class="table-base">
<thead>
<tr>
<th>Item Code</th>
<th>Item Name</th>
<th>Warehouse</th>
<th class="text-right">Quantity</th>
<th class="text-right">Min Stock</th>
</tr>
</thead>
<tbody>
@forelse($stocks as $stock)
@php $isLow = $stock->quantity < $stock->item->minimum_stock_level; @endphp
<tr class="{{ $isLow ? 'bg-red-50' : '' }}">
<td class="font-mono {{ $isLow ? 'text-red-700' : 'text-gray-700' }}">{{ $stock->item->item_code ?? '' }}</td>
<td class="font-medium {{ $isLow ? 'text-red-800' : 'text-gray-800' }}">
{{ $stock->item->item_name ?? '' }}
@if($isLow)
<span class="ml-2 px-1.5 py-0.5 text-xs font-bold rounded bg-red-200 text-red-800">LOW</span>
@endif
</td>
<td>{{ $stock->warehouse->name ?? '' }}</td>
<td class="text-right font-semibold {{ $isLow ? 'text-red-700' : 'text-gray-800' }}">{{ number_format($stock->quantity, 2) }}</td>
<td class="text-right text-gray-500">{{ number_format($stock->item->minimum_stock_level ?? 0, 2) }}</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-4 py-8 text-center text-gray-400">No stock data available.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@endsection
@@ -0,0 +1,62 @@
@extends('layouts.app')
@section('title', 'Inventory Valuation')
@section('content')
<div class="mb-6">
<h1 class="page-title">Inventory Valuation</h1>
<p class="page-subtitle">Total value of current stock</p>
</div>
<div class="table-wrapper overflow-x-auto">
<table class="table-base">
<thead>
<tr>
<th>Item Code</th>
<th>Item Name</th>
<th>Category</th>
<th class="text-right">Total Qty</th>
<th class="text-right">Cost Price</th>
<th class="text-right">Total Value</th>
</tr>
</thead>
<tbody>
@forelse($valuations as $row)
<tr>
<td class="font-mono text-gray-700">{{ $row->item_code }}</td>
<td class="font-medium text-gray-800">{{ $row->item_name }}</td>
<td>
@php
$catBadgeClass = match($row->category) {
'raw_material' => 'badge-blue',
'wip' => 'badge-yellow',
'finished_good' => 'badge-green',
default => 'badge-gray',
};
$catLabels = ['raw_material'=>'Raw Material','wip'=>'WIP','finished_good'=>'Finished Good'];
@endphp
<span class="{{ $catBadgeClass }}">
{{ $catLabels[$row->category] ?? ucfirst($row->category) }}
</span>
</td>
<td class="text-right text-gray-700">{{ number_format($row->total_qty, 2) }}</td>
<td class="text-right text-gray-600">{{ number_format($row->cost_price, 2) }}</td>
<td class="text-right font-semibold text-gray-800">{{ number_format($row->total_value, 2) }}</td>
</tr>
@empty
<tr>
<td colspan="6" class="px-4 py-8 text-center text-gray-400">No valuation data available.</td>
</tr>
@endforelse
</tbody>
@if(isset($grandTotal))
<tfoot class="bg-blue-50 border-t-2 border-blue-200">
<tr>
<td colspan="5" class="px-4 py-3 text-right font-bold text-gray-800 text-sm">Grand Total</td>
<td class="px-4 py-3 text-right font-bold text-blue-700 text-base">{{ number_format($grandTotal, 2) }}</td>
</tr>
</tfoot>
@endif
</table>
</div>
@endsection