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,76 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Add Customer')
|
||||
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="page-title">Add Customer</h1>
|
||||
<p class="page-subtitle"><a href="{{ route('sales.customers.index') }}" class="text-blue-600 hover:underline">Customers</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('sales.customers.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">Customer 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>
|
||||
<label class="form-label">Credit Limit</label>
|
||||
<input type="number" name="credit_limit" value="{{ old('credit_limit', 0) }}" min="0" step="0.01" 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 Customer</button>
|
||||
<a href="{{ route('sales.customers.index') }}" class="btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,77 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Edit Customer')
|
||||
|
||||
@section('content')
|
||||
<div class="mb-6">
|
||||
<h1 class="page-title">Edit Customer</h1>
|
||||
<p class="page-subtitle"><a href="{{ route('sales.customers.index') }}" class="text-blue-600 hover:underline">Customers</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('sales.customers.update', $customer) }}" 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">Customer Name <span class="text-red-500">*</span></label>
|
||||
<input type="text" name="name" value="{{ old('name', $customer->name) }}" required class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Contact Person</label>
|
||||
<input type="text" name="contact_person" value="{{ old('contact_person', $customer->contact_person) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Email</label>
|
||||
<input type="email" name="email" value="{{ old('email', $customer->email) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Phone</label>
|
||||
<input type="text" name="phone" value="{{ old('phone', $customer->phone) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Tax Number</label>
|
||||
<input type="text" name="tax_number" value="{{ old('tax_number', $customer->tax_number) }}" class="form-input">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label class="form-label">Credit Limit</label>
|
||||
<input type="number" name="credit_limit" value="{{ old('credit_limit', $customer->credit_limit) }}" min="0" step="0.01" 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', $customer->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', $customer->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 Customer</button>
|
||||
<a href="{{ route('sales.customers.index') }}" class="btn-secondary">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endsection
|
||||
@@ -0,0 +1,70 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('title', 'Customers')
|
||||
|
||||
@section('content')
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h1 class="page-title">Customers</h1>
|
||||
<p class="page-subtitle">Manage your customer directory</p>
|
||||
</div>
|
||||
<a href="{{ route('sales.customers.create') }}" class="btn-primary">
|
||||
+ Add Customer
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="table-wrapper overflow-x-auto">
|
||||
<table class="table-base">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Contact</th>
|
||||
<th>Email</th>
|
||||
<th class="text-right">Credit Limit</th>
|
||||
<th class="text-right">Outstanding Balance</th>
|
||||
<th>Status</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse($customers as $customer)
|
||||
<tr>
|
||||
<td class="font-medium text-gray-800">{{ $customer->name }}</td>
|
||||
<td>{{ $customer->contact_person }}</td>
|
||||
<td>{{ $customer->email }}</td>
|
||||
<td class="text-right text-gray-700">{{ number_format($customer->credit_limit, 2) }}</td>
|
||||
<td class="text-right {{ ($customer->outstanding_balance ?? 0) > 0 ? 'text-red-600 font-semibold' : 'text-gray-500' }}">
|
||||
{{ number_format($customer->outstanding_balance ?? 0, 2) }}
|
||||
</td>
|
||||
<td>
|
||||
@if($customer->is_active)
|
||||
<span class="badge-green">Active</span>
|
||||
@else
|
||||
<span class="badge-gray">Inactive</span>
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('sales.customers.edit', $customer) }}" class="btn-secondary btn-sm">Edit</a>
|
||||
<form action="{{ route('sales.customers.destroy', $customer) }}" method="POST"
|
||||
onsubmit="confirmDelete(this,'Delete this customer?','This customer record will be permanently removed.'); return false;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn-danger btn-sm">Delete</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-8 text-center text-gray-400">No customers found.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if($customers->hasPages())
|
||||
<div class="mt-4">{{ $customers->links() }}</div>
|
||||
@endif
|
||||
@endsection
|
||||
Reference in new issue
Block a user