feat: Implement order and invoice management, enhance addon features, and remove the 'Type' module.

This commit is contained in:
pbao9
2026-02-11 17:02:07 +07:00
parent 58a9aa685b
commit 556b2c02e6
47 changed files with 1367 additions and 497 deletions
@@ -1,59 +1,49 @@
@extends("administrator.layout.master")
@section("content")
<div class="card card-primary card-outline">
<div class="card-header">
<a href="{{ route('addon.create') }}" class="btn btn-outline-secondary">
<i class="fas fa-plus"></i> Add New Addon
</a>
</div>
<div class="card-body">
<table class="table table-invoice table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Price</th>
<th>Type</th>
<th style="width:40px"></th>
<th style="width: 40px"></th>
</tr>
</thead>
<tbody>
@if(count($addOns) > 0)
@foreach($addOns->all() as $item)
<tr>
<td class="text-center">
{{ $item->name }}
</td>
<td class="text-center">
{{ number_format($item->price,0,',','.') }} vnđ
</td>
<td class="text-center">
{{ $item->Type->name }}
</td>
<td>
<a class="btn btn-warning btn-sm" href="{{ route('addon.edit',['id' => $item->id]) }}">
<i class="fas fa-user-edit"></i>
</a>
</td>
<td>
<form method="post" class="d-inline"
action="{{ route('addon.destroy',['id' => $item->id]) }}">
@csrf
@method('delete')
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
class="btn btn-sm btn-danger" data-original-title="Xoá">
<i class="fas fa-trash"></i>
</button>
</form>
</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="card-footer">
{{ $addOns->withQueryString()->links() }}
</div>
</div>
@extends('administrator.layout.master')
@push('plugin-styles')
@foreach (config('assets.datatable.css') as $datatable)
<link href="{{ asset($datatable) }}" rel="stylesheet" />
@endforeach
@endpush
@section('breadcrumb')
@php
$breadcrumbItems = [
['label' => 'Product'],
['label' => 'Product Addons'],
['label' => 'Product Addons List', 'active' => true],
];
@endphp
<x-admin-breadcrumb :items="$breadcrumbItems" />
@endsection
@section("content")
@if (auth()->guard('admins')->user()->can('manager product'))
<div class="card card-primary card-outline">
<div class="card-header d-flex justify-content-end gap-2">
@include('administrator.pages.block.addon.btn')
</div>
<div class="card-body">
<x-datatable id="addonTable" ajax="{{ route('addon.datatable') }}" :columns="[
['key' => 'name', 'label' => 'Addon Name'],
['key' => 'prefix', 'label' => 'Prefix'],
['key' => 'min', 'label' => 'Min'],
['key' => 'max', 'label' => 'Max'],
['key' => 'step', 'label' => 'Step'],
['key' => 'price', 'label' => 'Price'],
['key' => 'status', 'label' => 'Status'],
['key' => 'action', 'label' => 'Action'],
]" />
</div>
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Product
management department</h5>
</div>
@endif
@endsection
@push('plugin-scripts')
@foreach (config('assets.datatable.js') as $datatable)
<script src="{{ asset($datatable) }}"></script>
@endforeach
@endpush