chore: initial commit of existing codebase
This commit is contained in:
commit
11e94889b2
292 files changed
+38586
No files matched your search
@@ -0,0 +1,71 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Add Supplier')
|
||||
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="page-title">Add Supplier</h1>
|
||||
<p class="page-subtitle"><a href="{{ route('purchase.suppliers.index') }}" class="text-blue-600 hover:underline">Suppliers</a> / New</p>
|
||||
</div>
|
||||
|
||||
@if($errors->any())
|
||||
<div class="mb-4 px-4 py-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700">
|
||||
<ul class="list-disc list-inside space-y-1">
|
||||
@foreach($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card card-body max-w-2xl">
|
||||
<form action="{{ route('purchase.suppliers.store') }}" method="POST">
|
||||
@csrf
|
||||
<div class="grid grid-cols-1 gap-5 sm:grid-cols-2">
|
||||
|
||||
<div class="sm:col-span-2">
|
||||
<label class="form-label">Supplier Name <span class="text-red-500">*</span></label>
|
||||
<input type="text" name="name" value="{{ old('name') }}" required class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Contact Person</label>
|
||||
<input type="text" name="contact_person" value="{{ old('contact_person') }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Email</label>
|
||||
<input type="email" name="email" value="{{ old('email') }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Phone</label>
|
||||
<input type="text" name="phone" value="{{ old('phone') }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Tax Number</label>
|
||||
<input type="text" name="tax_number" value="{{ old('tax_number') }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div class="sm:col-span-2">
|
||||
<label class="form-label">Address</label>
|
||||
<textarea name="address" rows="3" class="form-textarea">{{ old('address') }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="sm:col-span-2 flex items-center gap-2">
|
||||
<input type="checkbox" name="is_active" id="is_active" value="1"
|
||||
{{ old('is_active', '1') ? 'checked' : '' }}
|
||||
class="h-4 w-4 text-blue-600 border-gray-300 rounded">
|
||||
<label for="is_active" class="form-label mb-0">Active</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex items-center gap-3">
|
||||
<button type="submit" class="btn-primary">Save Supplier</button>
|
||||
<a href="{{ route('purchase.suppliers.index') }}" class="btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,72 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Supplier')
|
||||
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="page-title">Edit Supplier</h1>
|
||||
<p class="page-subtitle"><a href="{{ route('purchase.suppliers.index') }}" class="text-blue-600 hover:underline">Suppliers</a> / Edit</p>
|
||||
</div>
|
||||
|
||||
@if($errors->any())
|
||||
<div class="mb-4 px-4 py-3 bg-red-50 border border-red-200 rounded-lg text-sm text-red-700">
|
||||
<ul class="list-disc list-inside space-y-1">
|
||||
@foreach($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="card card-body max-w-2xl">
|
||||
<form action="{{ route('purchase.suppliers.update', $supplier) }}" method="POST">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<div class="grid grid-cols-1 gap-5 sm:grid-cols-2">
|
||||
|
||||
<div class="sm:col-span-2">
|
||||
<label class="form-label">Supplier Name <span class="text-red-500">*</span></label>
|
||||
<input type="text" name="name" value="{{ old('name', $supplier->name) }}" required class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Contact Person</label>
|
||||
<input type="text" name="contact_person" value="{{ old('contact_person', $supplier->contact_person) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Email</label>
|
||||
<input type="email" name="email" value="{{ old('email', $supplier->email) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Phone</label>
|
||||
<input type="text" name="phone" value="{{ old('phone', $supplier->phone) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Tax Number</label>
|
||||
<input type="text" name="tax_number" value="{{ old('tax_number', $supplier->tax_number) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div class="sm:col-span-2">
|
||||
<label class="form-label">Address</label>
|
||||
<textarea name="address" rows="3" class="form-textarea">{{ old('address', $supplier->address) }}</textarea>
|
||||
</div>
|
||||
|
||||
<div class="sm:col-span-2 flex items-center gap-2">
|
||||
<input type="checkbox" name="is_active" id="is_active" value="1"
|
||||
{{ old('is_active', $supplier->is_active) ? 'checked' : '' }}
|
||||
class="h-4 w-4 text-blue-600 border-gray-300 rounded">
|
||||
<label for="is_active" class="form-label mb-0">Active</label>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex items-center gap-3">
|
||||
<button type="submit" class="btn-primary">Update Supplier</button>
|
||||
<a href="{{ route('purchase.suppliers.index') }}" class="btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,198 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Suppliers List</title>
|
||||
<style>
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
font-family: 'DejaVu Sans', 'Arial', sans-serif;
|
||||
font-size: 11px;
|
||||
color: #1e293b;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
/* ── Header ── */
|
||||
.header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: flex-start;
|
||||
padding: 24px 28px 16px;
|
||||
border-bottom: 2px solid #2563eb;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.brand { display: flex; align-items: center; gap: 10px; }
|
||||
.brand-box {
|
||||
width: 36px; height: 36px; border-radius: 8px;
|
||||
background: #2563eb;
|
||||
display: flex; align-items: center; justify-content: center;
|
||||
}
|
||||
.brand-name { font-size: 17px; font-weight: 700; color: #0f172a; }
|
||||
.brand-sub { font-size: 9px; color: #64748b; margin-top: 1px; }
|
||||
|
||||
.report-info { text-align: right; }
|
||||
.report-title { font-size: 15px; font-weight: 700; color: #1e293b; }
|
||||
.report-meta { font-size: 9px; color: #64748b; margin-top: 3px; }
|
||||
|
||||
/* ── Summary strip ── */
|
||||
.summary {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin: 0 28px 16px;
|
||||
}
|
||||
.summary-card {
|
||||
flex: 1;
|
||||
padding: 10px 14px;
|
||||
background: #f1f5f9;
|
||||
border-radius: 8px;
|
||||
border-left: 3px solid #2563eb;
|
||||
}
|
||||
.summary-card .val { font-size: 20px; font-weight: 700; color: #2563eb; }
|
||||
.summary-card .lbl { font-size: 9px; color: #64748b; margin-top: 2px; }
|
||||
.summary-card.green { border-color: #10b981; }
|
||||
.summary-card.green .val { color: #10b981; }
|
||||
.summary-card.gray { border-color: #94a3b8; }
|
||||
.summary-card.gray .val { color: #94a3b8; }
|
||||
|
||||
/* ── Table ── */
|
||||
.table-wrap { padding: 0 28px; }
|
||||
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
font-size: 10.5px;
|
||||
}
|
||||
thead th {
|
||||
background: #1e293b;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
font-size: 9px;
|
||||
letter-spacing: .06em;
|
||||
text-transform: uppercase;
|
||||
padding: 8px 10px;
|
||||
text-align: left;
|
||||
}
|
||||
tbody tr:nth-child(even) { background: #f8fafc; }
|
||||
tbody tr:nth-child(odd) { background: #ffffff; }
|
||||
tbody td {
|
||||
padding: 7px 10px;
|
||||
color: #334155;
|
||||
border-bottom: 1px solid #e2e8f0;
|
||||
vertical-align: middle;
|
||||
}
|
||||
tbody td:first-child { font-weight: 600; color: #0f172a; }
|
||||
|
||||
.badge {
|
||||
display: inline-block;
|
||||
padding: 2px 7px;
|
||||
border-radius: 20px;
|
||||
font-size: 8.5px;
|
||||
font-weight: 700;
|
||||
letter-spacing: .04em;
|
||||
}
|
||||
.badge-active { background: #d1fae5; color: #065f46; }
|
||||
.badge-inactive { background: #f1f5f9; color: #64748b; }
|
||||
|
||||
/* ── Footer ── */
|
||||
.footer {
|
||||
margin-top: 24px;
|
||||
padding: 12px 28px 0;
|
||||
border-top: 1px solid #e2e8f0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-size: 9px;
|
||||
color: #94a3b8;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<div class="brand">
|
||||
<div class="brand-box">
|
||||
<svg width="18" height="18" fill="none" stroke="#fff" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"/>
|
||||
</svg>
|
||||
</div>
|
||||
<div>
|
||||
<div class="brand-name">SteelERP</div>
|
||||
<div class="brand-sub">Manufacturing & Trading</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="report-info">
|
||||
<div class="report-title">Supplier Directory</div>
|
||||
<div class="report-meta">Generated: {{ now()->format('d M Y, H:i') }}</div>
|
||||
<div class="report-meta">Total Records: {{ $suppliers->count() }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@php
|
||||
$active = $suppliers->where('is_active', true)->count();
|
||||
$inactive = $suppliers->where('is_active', false)->count();
|
||||
@endphp
|
||||
|
||||
<div class="summary">
|
||||
<div class="summary-card">
|
||||
<div class="val">{{ $suppliers->count() }}</div>
|
||||
<div class="lbl">Total Suppliers</div>
|
||||
</div>
|
||||
<div class="summary-card green">
|
||||
<div class="val">{{ $active }}</div>
|
||||
<div class="lbl">Active</div>
|
||||
</div>
|
||||
<div class="summary-card gray">
|
||||
<div class="val">{{ $inactive }}</div>
|
||||
<div class="lbl">Inactive</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:4%">#</th>
|
||||
<th style="width:22%">Supplier Name</th>
|
||||
<th style="width:17%">Contact Person</th>
|
||||
<th style="width:20%">Email</th>
|
||||
<th style="width:14%">Phone</th>
|
||||
<th style="width:15%">Tax Number</th>
|
||||
<th style="width:8%">Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($suppliers as $i => $supplier)
|
||||
<tr>
|
||||
<td style="color:#94a3b8;">{{ $i + 1 }}</td>
|
||||
<td>{{ $supplier->name }}</td>
|
||||
<td>{{ $supplier->contact_person ?: '—' }}</td>
|
||||
<td>{{ $supplier->email ?: '—' }}</td>
|
||||
<td>{{ $supplier->phone ?: '—' }}</td>
|
||||
<td>{{ $supplier->tax_number ?: '—' }}</td>
|
||||
<td>
|
||||
@if($supplier->is_active)
|
||||
<span class="badge badge-active">Active</span>
|
||||
@else
|
||||
<span class="badge badge-inactive">Inactive</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" style="text-align:center;padding:20px;color:#94a3b8;">
|
||||
No suppliers found.
|
||||
</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="footer">
|
||||
<span>SteelERP — Confidential</span>
|
||||
<span>Exported by: {{ Auth::user()->name ?? '—' }}</span>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,135 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', $supplier->name)
|
||||
|
||||
@section('content')
|
||||
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1 class="page-title">{{ $supplier->name }}</h1>
|
||||
<p class="page-subtitle">
|
||||
<a href="{{ route('purchase.suppliers.index') }}" style="color:#2563eb;text-decoration:none;">Suppliers</a>
|
||||
/ View Details
|
||||
</p>
|
||||
</div>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('purchase.suppliers.edit', $supplier) }}" class="btn btn-secondary">Edit Supplier</a>
|
||||
<a href="{{ route('purchase.suppliers.index') }}" class="btn btn-secondary">Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display:grid;grid-template-columns:1fr 1fr;gap:20px;max-width:900px;">
|
||||
|
||||
{{-- Identity --}}
|
||||
<div style="background:#fff;border-radius:14px;border:1px solid #e2e8f0;padding:22px;grid-column:1/-1;">
|
||||
<div style="display:flex;align-items:center;justify-content:space-between;margin-bottom:18px;">
|
||||
<h3 style="font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8;">Company</h3>
|
||||
@if($supplier->is_active)
|
||||
<span class="badge-green">Active</span>
|
||||
@else
|
||||
<span class="badge-gray">Inactive</span>
|
||||
@endif
|
||||
</div>
|
||||
<div style="font-size:22px;font-weight:700;color:#0f172a;margin-bottom:6px;">{{ $supplier->name }}</div>
|
||||
@if($supplier->supplier_code)
|
||||
<div style="font-family:monospace;font-size:12px;color:#94a3b8;margin-bottom:4px;">{{ $supplier->supplier_code }}</div>
|
||||
@endif
|
||||
@if($supplier->category)
|
||||
<span style="display:inline-block;padding:3px 12px;border-radius:20px;font-size:12px;font-weight:600;background:#f1f5f9;color:#475569;margin-top:4px;">
|
||||
{{ $supplier->category }}
|
||||
</span>
|
||||
@endif
|
||||
@if($supplier->website)
|
||||
<div style="margin-top:10px;">
|
||||
<a href="{{ $supplier->website }}" target="_blank"
|
||||
style="font-size:13px;color:#2563eb;text-decoration:none;">
|
||||
{{ $supplier->website }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Contact --}}
|
||||
<div style="background:#fff;border-radius:14px;border:1px solid #e2e8f0;padding:22px;">
|
||||
<h3 style="font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8;margin-bottom:16px;">Contact</h3>
|
||||
@if($supplier->contact_person)
|
||||
<div style="margin-bottom:12px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Contact Person</div>
|
||||
<div style="font-size:14px;font-weight:600;color:#1e293b;">{{ $supplier->contact_person }}</div>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->email)
|
||||
<div style="margin-bottom:10px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Primary Email</div>
|
||||
<a href="mailto:{{ $supplier->email }}" style="font-size:13px;color:#2563eb;text-decoration:none;">{{ $supplier->email }}</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->secondary_email)
|
||||
<div style="margin-bottom:10px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Secondary Email</div>
|
||||
<a href="mailto:{{ $supplier->secondary_email }}" style="font-size:13px;color:#64748b;text-decoration:none;">{{ $supplier->secondary_email }}</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->phone)
|
||||
<div style="margin-bottom:10px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Phone 1</div>
|
||||
<a href="tel:{{ $supplier->phone }}" style="font-size:13px;color:#334155;text-decoration:none;">{{ $supplier->phone }}</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->phone2)
|
||||
<div style="margin-bottom:10px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Phone 2</div>
|
||||
<a href="tel:{{ $supplier->phone2 }}" style="font-size:13px;color:#334155;text-decoration:none;">{{ $supplier->phone2 }}</a>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->whatsapp)
|
||||
<div>
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">WhatsApp</div>
|
||||
<a href="https://wa.me/{{ ltrim($supplier->whatsapp, '+') }}" target="_blank"
|
||||
style="display:inline-flex;align-items:center;gap:5px;font-size:13px;color:#16a34a;text-decoration:none;">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="#16a34a">
|
||||
<path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413Z"/>
|
||||
</svg>
|
||||
{{ $supplier->whatsapp }}
|
||||
</a>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Financial --}}
|
||||
<div style="background:#fff;border-radius:14px;border:1px solid #e2e8f0;padding:22px;">
|
||||
<h3 style="font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#94a3b8;margin-bottom:16px;">Financial & Address</h3>
|
||||
@if($supplier->address)
|
||||
<div style="margin-bottom:12px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Address</div>
|
||||
<div style="font-size:13px;color:#334155;line-height:1.5;">{{ $supplier->address }}</div>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->tax_number)
|
||||
<div style="margin-bottom:12px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Tax / VAT Number</div>
|
||||
<div style="font-family:monospace;font-size:13px;color:#334155;">{{ $supplier->tax_number }}</div>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->credit_terms)
|
||||
<div style="margin-bottom:12px;">
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Credit Terms</div>
|
||||
<div style="font-size:13px;color:#16a34a;font-weight:600;">
|
||||
{{ strtolower($supplier->credit_terms) === 'y' ? 'Yes' : $supplier->credit_terms }}
|
||||
@if($supplier->credit_days)
|
||||
· {{ $supplier->credit_days }} days
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@if($supplier->remarks)
|
||||
<div>
|
||||
<div style="font-size:11px;color:#94a3b8;margin-bottom:2px;">Remarks</div>
|
||||
<div style="font-size:13px;color:#475569;line-height:1.5;">{{ $supplier->remarks }}</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
Reference in new issue
Block a user