From 7e7afeb4e543e8065ce344448fbb699b29eb58c9 Mon Sep 17 00:00:00 2001 From: Nisse <nisselommerde@gmail.com> Date: Mon, 9 Sep 2024 15:29:31 -0700 Subject: [PATCH] basics test --- app/Enums/OrderStatus.php | 8 +- app/Http/Controllers/CustomerController.php | 13 +- app/Http/Controllers/DashboardController.php | 43 +++ app/Http/Controllers/HomeController.php | 28 -- app/Http/Controllers/ManagementController.php | 24 ++ app/Http/Controllers/OrderController.php | 19 +- .../Controllers/OrderProductController.php | 38 ++ app/Http/Requests/OrderProductRequest.php | 23 ++ app/Http/Requests/OrderRequest.php | 22 +- app/Http/Requests/ProductServiceRequest.php | 26 ++ app/Http/Requests/ProductSizeRequest.php | 22 ++ app/Http/Requests/ServiceFileRequest.php | 24 ++ app/Livewire/Counter.php | 25 ++ app/Livewire/CreateOrder.php | 40 +++ app/Livewire/CustomerAndContactSelect.php | 41 +++ app/Livewire/OrderProductsCreate.php | 133 +++++++ app/Livewire/OrdersTable.php | 55 +++ app/Models/Contact.php | 5 + app/Models/Order.php | 41 ++- app/Models/OrderProduct.php | 42 +++ app/Models/ProductService.php | 33 ++ app/Models/ProductSize.php | 24 ++ app/Models/ServiceFile.php | 28 ++ composer.json | 3 +- composer.lock | 78 +++- database/factories/OrderFactory.php | 11 +- database/factories/OrderProductFactory.php | 24 ++ database/factories/ProductServiceFactory.php | 27 ++ database/factories/ProductSizeFactory.php | 23 ++ database/factories/ServiceFileFactory.php | 25 ++ .../2024_09_09_194631_create_orders_table.php | 11 +- ..._10_224439_create_order_products_table.php | 25 ++ ...0_224947_create_product_services_table.php | 27 ++ ...9_10_225029_create_service_files_table.php | 29 ++ ...9_10_230904_create_product_sizes_table.php | 24 ++ database/seeders/CustomerSeeder.php | 93 +++++ database/seeders/DatabaseSeeder.php | 69 +--- resources/views/customers/index.blade.php | 144 -------- resources/views/customers/show.blade.php | 12 +- resources/views/dashboard.blade.php | 57 +++ resources/views/home.blade.php | 23 -- resources/views/layouts/app.blade.php | 60 +--- resources/views/layouts/nav.blade.php | 97 +++++ resources/views/livewire/counter.blade.php | 7 + .../views/livewire/create-order.blade.php | 3 + .../customer-and-contact-select.blade.php | 44 +++ .../livewire/order-products-create.blade.php | 279 +++++++++++++++ .../views/livewire/orders-table.blade.php | 111 ++++++ resources/views/management/index.blade.php | 27 ++ .../views/order-products/create.blade.php | 39 ++ resources/views/orders/create.blade.php | 334 +++++++++++------- resources/views/orders/index.blade.php | 91 +++++ resources/views/orders/show.blade.php | 71 ++++ .../partials/customers/edit-modal.blade.php | 110 ------ .../{ => index}/create-modal.blade.php | 0 .../{ => index}/delete-all-modal.blade.php | 0 .../contacts-tab.blade.php} | 8 +- .../overview-tab.blade.php} | 10 +- .../packing-slips-tab.blade.php} | 10 +- .../shipping-info-tab.blade.php} | 0 .../management/index/customers.blade.php | 76 ++++ .../index/management-tabs.blade.php | 43 +++ .../management/index/packing-slips.blade.php | 5 + .../management/index/service-files.blade.php | 5 + .../vendor/pagination/bootstrap-4.blade.php | 46 --- .../vendor/pagination/bootstrap-5.blade.php | 88 ----- .../views/vendor/pagination/default.blade.php | 46 --- .../vendor/pagination/semantic-ui.blade.php | 36 -- .../pagination/simple-bootstrap-4.blade.php | 27 -- .../pagination/simple-bootstrap-5.blade.php | 29 -- .../pagination/simple-default.blade.php | 19 - .../pagination/simple-tailwind.blade.php | 25 -- .../vendor/pagination/tailwind.blade.php | 106 ------ routes/web.php | 17 +- 74 files changed, 2294 insertions(+), 1037 deletions(-) create mode 100644 app/Http/Controllers/DashboardController.php delete mode 100644 app/Http/Controllers/HomeController.php create mode 100644 app/Http/Controllers/ManagementController.php create mode 100644 app/Http/Controllers/OrderProductController.php create mode 100644 app/Http/Requests/OrderProductRequest.php create mode 100644 app/Http/Requests/ProductServiceRequest.php create mode 100644 app/Http/Requests/ProductSizeRequest.php create mode 100644 app/Http/Requests/ServiceFileRequest.php create mode 100644 app/Livewire/Counter.php create mode 100644 app/Livewire/CreateOrder.php create mode 100644 app/Livewire/CustomerAndContactSelect.php create mode 100644 app/Livewire/OrderProductsCreate.php create mode 100644 app/Livewire/OrdersTable.php create mode 100644 app/Models/OrderProduct.php create mode 100644 app/Models/ProductService.php create mode 100644 app/Models/ProductSize.php create mode 100644 app/Models/ServiceFile.php create mode 100644 database/factories/OrderProductFactory.php create mode 100644 database/factories/ProductServiceFactory.php create mode 100644 database/factories/ProductSizeFactory.php create mode 100644 database/factories/ServiceFileFactory.php create mode 100644 database/migrations/2024_09_10_224439_create_order_products_table.php create mode 100644 database/migrations/2024_09_10_224947_create_product_services_table.php create mode 100644 database/migrations/2024_09_10_225029_create_service_files_table.php create mode 100644 database/migrations/2024_09_10_230904_create_product_sizes_table.php create mode 100644 database/seeders/CustomerSeeder.php delete mode 100644 resources/views/customers/index.blade.php create mode 100644 resources/views/dashboard.blade.php delete mode 100644 resources/views/home.blade.php create mode 100644 resources/views/layouts/nav.blade.php create mode 100644 resources/views/livewire/counter.blade.php create mode 100644 resources/views/livewire/create-order.blade.php create mode 100644 resources/views/livewire/customer-and-contact-select.blade.php create mode 100644 resources/views/livewire/order-products-create.blade.php create mode 100644 resources/views/livewire/orders-table.blade.php create mode 100644 resources/views/management/index.blade.php create mode 100644 resources/views/order-products/create.blade.php create mode 100644 resources/views/orders/index.blade.php create mode 100644 resources/views/orders/show.blade.php delete mode 100644 resources/views/partials/customers/edit-modal.blade.php rename resources/views/partials/customers/{ => index}/create-modal.blade.php (100%) rename resources/views/partials/customers/{ => index}/delete-all-modal.blade.php (100%) rename resources/views/partials/customers/{show-contacts.blade.php => show/contacts-tab.blade.php} (83%) rename resources/views/partials/customers/{show-overview.blade.php => show/overview-tab.blade.php} (88%) rename resources/views/partials/customers/{show-packing-slips.blade.php => show/packing-slips-tab.blade.php} (86%) rename resources/views/partials/customers/{show-shipping-info.blade.php => show/shipping-info-tab.blade.php} (100%) create mode 100644 resources/views/partials/management/index/customers.blade.php create mode 100644 resources/views/partials/management/index/management-tabs.blade.php create mode 100644 resources/views/partials/management/index/packing-slips.blade.php create mode 100644 resources/views/partials/management/index/service-files.blade.php delete mode 100644 resources/views/vendor/pagination/bootstrap-4.blade.php delete mode 100644 resources/views/vendor/pagination/bootstrap-5.blade.php delete mode 100644 resources/views/vendor/pagination/default.blade.php delete mode 100644 resources/views/vendor/pagination/semantic-ui.blade.php delete mode 100644 resources/views/vendor/pagination/simple-bootstrap-4.blade.php delete mode 100644 resources/views/vendor/pagination/simple-bootstrap-5.blade.php delete mode 100644 resources/views/vendor/pagination/simple-default.blade.php delete mode 100644 resources/views/vendor/pagination/simple-tailwind.blade.php delete mode 100644 resources/views/vendor/pagination/tailwind.blade.php diff --git a/app/Enums/OrderStatus.php b/app/Enums/OrderStatus.php index 77ae5cd..90ebf2a 100644 --- a/app/Enums/OrderStatus.php +++ b/app/Enums/OrderStatus.php @@ -4,9 +4,11 @@ enum OrderStatus: string { - case ORDER = 'Order'; +// case ON_HOLD = 'On hold'; case APPROVED = 'Approved'; case PRODUCTION = 'Production'; - case COMPLETED = 'Completed'; - case CANCELLED = 'Cancelled'; +// case COMPLETED = 'Completed'; + case SHIPPED = 'Shipped'; + case INVOICED = 'Invoiced'; +// case CANCELLED = 'Cancelled'; } diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index 0bc5ee0..5151b87 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -5,25 +5,20 @@ use App\Http\Requests\CustomerRequest; use App\Models\Customer; use App\Models\PackingSlip; -use App\Models\ShippingEntry; use Illuminate\Http\Request; use Illuminate\Support\Carbon; class CustomerController extends Controller { - public function index(Request $request) + public function index() { - return view('customers.index', [ - 'customers' => Customer::all(), - 'tab' => $request->tab, - ]); } public function store(CustomerRequest $request) { Customer::create($request->validated()); - return redirect()->route('customers.index')->with('status', 'Customer created successfully.'); + return redirect()->route('management.index')->with('status', 'Customer created successfully.'); } public function create() @@ -68,13 +63,13 @@ public function requestDestroy(Request $request) $customer = Customer::find($request->id); $customer->delete(); - return redirect()->route('customers.index')->with('status', 'Customer deleted successfully.'); + return redirect()->route('management.index')->with('status', 'Customer deleted successfully.'); } public function destroy(Customer $customer) { $customer->delete(); - return redirect()->route('customers.index')->with('status', 'Customer deleted successfully.'); + return redirect()->route('management.index')->with('status', 'Customer deleted successfully.'); } } diff --git a/app/Http/Controllers/DashboardController.php b/app/Http/Controllers/DashboardController.php new file mode 100644 index 0000000..a132753 --- /dev/null +++ b/app/Http/Controllers/DashboardController.php @@ -0,0 +1,43 @@ +<?php + +namespace App\Http\Controllers; + +use App\Enums\OrderStatus; +use App\Models\Order; +use Illuminate\Http\Request; +use Illuminate\Support\Carbon; + +class DashboardController extends Controller +{ + /** + * Create a new controller instance. + * + * @return void + */ + public function __construct() + { + $this->middleware('auth'); + } + + /** + * Show the application dashboard. + * + */ + public function index(Request $request) + { + if (!$request->get('tab')) { + return redirect()->route('dashboard', ['tab' => 'active_orders']); + } + + return view('dashboard', [ + 'today' => Carbon::today(), + 'tab' => $request->get('tab'), + 'active_orders' => Order::where('status', '!=', 'cancelled') + ->where('status', '!=', 'completed') + ->orderByDesc('rush') + ->orderBy('due_date') + ->paginate(15) + ->withQueryString() + ]); + } +} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php deleted file mode 100644 index 7cbc2c3..0000000 --- a/app/Http/Controllers/HomeController.php +++ /dev/null @@ -1,28 +0,0 @@ -<?php - -namespace App\Http\Controllers; - -use Illuminate\Http\Request; - -class HomeController extends Controller -{ - /** - * Create a new controller instance. - * - * @return void - */ - public function __construct() - { - $this->middleware('auth'); - } - - /** - * Show the application dashboard. - * - * @return \Illuminate\Contracts\Support\Renderable - */ - public function index() - { - return view('home'); - } -} diff --git a/app/Http/Controllers/ManagementController.php b/app/Http/Controllers/ManagementController.php new file mode 100644 index 0000000..60fc9c2 --- /dev/null +++ b/app/Http/Controllers/ManagementController.php @@ -0,0 +1,24 @@ +<?php + +namespace App\Http\Controllers; + +use App\Models\Customer; +use Illuminate\Http\Request; + +class ManagementController extends Controller +{ + protected string $defaultTab = 'customers'; + + public function index(string $tab = null) + { + if (!$tab) + { + return redirect()->route('management.index', ['tab' => $this->defaultTab]); + } + + return view('management.index', [ + 'customers' => Customer::all(), + 'tab' => $tab, + ]); + } +} diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index 5148ec7..064d164 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -4,15 +4,23 @@ use App\Enums\OrderStatus; use App\Enums\OrderType; +use App\Http\Requests\OrderRequest; use App\Models\Customer; +use App\Models\Order; use Illuminate\Http\Request; use Illuminate\Support\Carbon; class OrderController extends Controller { - public function index() + public function index(Request $request) { + if (!$request->get('tab')) { + return redirect()->route('orders.index', ['tab' => 'all']); + } + return view('orders.index', [ + 'tab' => $request->get('tab'), + ]); } public function create() @@ -26,12 +34,19 @@ public function create() ]); } - public function store(Request $request) + public function store(OrderRequest $request) { + $order = Order::create($request->validated()); + + return redirect()->route('order-products.create', ['order' => $order->id]); } public function show($id) { + return view('orders.show', [ + 'order' => Order::find($id), + 'tab' => 'details' + ]); } public function edit($id) diff --git a/app/Http/Controllers/OrderProductController.php b/app/Http/Controllers/OrderProductController.php new file mode 100644 index 0000000..56791a8 --- /dev/null +++ b/app/Http/Controllers/OrderProductController.php @@ -0,0 +1,38 @@ +<?php + +namespace App\Http\Controllers; + +use Illuminate\Http\Request; + +class OrderProductController extends Controller +{ + public function index() + { + + } + + public function create() + { + return view('order-products.create'); + } + + public function store(Request $request) + { + } + + public function show($id) + { + } + + public function edit($id) + { + } + + public function update(Request $request, $id) + { + } + + public function destroy($id) + { + } +} diff --git a/app/Http/Requests/OrderProductRequest.php b/app/Http/Requests/OrderProductRequest.php new file mode 100644 index 0000000..2382143 --- /dev/null +++ b/app/Http/Requests/OrderProductRequest.php @@ -0,0 +1,23 @@ +<?php + +namespace App\Http\Requests; + +use Illuminate\Foundation\Http\FormRequest; + +class OrderProductRequest extends FormRequest +{ + public function rules(): array + { + return [ + 'order_id' => ['required', 'exists:orders'], + 'sku' => ['string', 'nullable'], + 'product_name' => ['required'], + 'color' => ['string', 'nullable'], + ]; + } + + public function authorize(): bool + { + return true; + } +} diff --git a/app/Http/Requests/OrderRequest.php b/app/Http/Requests/OrderRequest.php index 8da7f60..ce491a0 100644 --- a/app/Http/Requests/OrderRequest.php +++ b/app/Http/Requests/OrderRequest.php @@ -9,19 +9,21 @@ class OrderRequest extends FormRequest public function rules(): array { return [ - 'customer_id' => ['required', 'exists:customers'], - 'internal_po' => ['required'], - 'customer_po' => ['required'], + 'customer_id' => ['required', 'exists:customers,id'], + 'contact_id' => ['nullable', 'exists:contacts,id'], +// 'internal_po' => ['required'], + 'customer_po' => ['required', 'string'], + 'order_type' => ['required', 'string'], 'order_date' => ['required', 'date'], 'due_date' => ['required', 'date'], 'status' => ['required'], - 'rush' => ['boolean'], - 'new_art' => ['boolean'], - 'digitizing' => ['boolean'], - 'repeat' => ['boolean'], - 'purchased_garments' => ['boolean'], - 'customer_supplied_file' => ['boolean'], - 'notes' => ['required'], + 'rush' => ['nullable'], + 'new_art' => ['nullable'], + 'digitizing' => ['nullable'], + 'repeat' => ['nullable'], + 'purchased_garments' => ['nullable'], + 'customer_supplied_file' => ['nullable'], + 'notes' => ['nullable'], ]; } diff --git a/app/Http/Requests/ProductServiceRequest.php b/app/Http/Requests/ProductServiceRequest.php new file mode 100644 index 0000000..0b743db --- /dev/null +++ b/app/Http/Requests/ProductServiceRequest.php @@ -0,0 +1,26 @@ +<?php + +namespace App\Http\Requests; + +use Illuminate\Foundation\Http\FormRequest; + +class ProductServiceRequest extends FormRequest +{ + public function rules(): array + { + return [ + 'order_product_id' => ['required', 'exists:order_products'], + 'service_file_id' => ['nullable', 'exists:service_files'], + 'service_type' => ['required'], + 'placement' => ['required'], + 'setup_amount' => ['required'], + 'amount' => ['nullable'], + 'amount_price' => ['nullable'], + ]; + } + + public function authorize(): bool + { + return true; + } +} diff --git a/app/Http/Requests/ProductSizeRequest.php b/app/Http/Requests/ProductSizeRequest.php new file mode 100644 index 0000000..272716f --- /dev/null +++ b/app/Http/Requests/ProductSizeRequest.php @@ -0,0 +1,22 @@ +<?php + +namespace App\Http\Requests; + +use Illuminate\Foundation\Http\FormRequest; + +class ProductSizeRequest extends FormRequest +{ + public function rules(): array + { + return [ + 'order_product_id' => ['required', 'exists:order_products'], + 'size' => ['required'], + 'amount' => ['required'], + ]; + } + + public function authorize(): bool + { + return true; + } +} diff --git a/app/Http/Requests/ServiceFileRequest.php b/app/Http/Requests/ServiceFileRequest.php new file mode 100644 index 0000000..f66ae36 --- /dev/null +++ b/app/Http/Requests/ServiceFileRequest.php @@ -0,0 +1,24 @@ +<?php + +namespace App\Http\Requests; + +use Illuminate\Foundation\Http\FormRequest; + +class ServiceFileRequest extends FormRequest +{ + public function rules(): array + { + return [ + 'code' => ['required'], + 'name' => ['required'], + 'width' => ['required', 'numeric'], + 'height' => ['required', 'numeric'], + 'unit' => ['required'], + ]; + } + + public function authorize(): bool + { + return true; + } +} diff --git a/app/Livewire/Counter.php b/app/Livewire/Counter.php new file mode 100644 index 0000000..b4ee99c --- /dev/null +++ b/app/Livewire/Counter.php @@ -0,0 +1,25 @@ +<?php + +namespace App\Livewire; + +use Livewire\Component; + +class Counter extends Component +{ + public $count = 1; + + public function increment() + { + $this->count++; + } + + public function decrement() + { + $this->count--; + } + + public function render() + { + return view('livewire.counter'); + } +} diff --git a/app/Livewire/CreateOrder.php b/app/Livewire/CreateOrder.php new file mode 100644 index 0000000..1ce2e9c --- /dev/null +++ b/app/Livewire/CreateOrder.php @@ -0,0 +1,40 @@ +<?php + +namespace App\Livewire; + +use App\Enums\OrderStatus; +use App\Enums\OrderType; +use App\Models\Customer; +use Illuminate\Database\Eloquent\Collection; +use Illuminate\Support\Carbon; +use Livewire\Component; + +class CreateOrder extends Component +{ + public Collection $customers; + public string $selectedCustomer; + public $contacts; + + public function mount( Collection $customers) + { + $this->customers = $customers; + $this->contacts = $customers->first()->contacts; + } + + public function getContacts() + { + $this->contacts = Customer::find($this->selectedCustomer)->contacts; + } + + public function render() + { + return view('livewire.create-order', [ + 'contacts' => $this->contacts, + 'order_types' => OrderType::cases(), + 'order_status' => OrderStatus::cases(), + 'customers' => $this->customers, + 'today' => Carbon::today()->format('Y-m-d'), + 'due_default' => Carbon::today()->addDay(10)->format('Y-m-d') + ]); + } +} diff --git a/app/Livewire/CustomerAndContactSelect.php b/app/Livewire/CustomerAndContactSelect.php new file mode 100644 index 0000000..2938dba --- /dev/null +++ b/app/Livewire/CustomerAndContactSelect.php @@ -0,0 +1,41 @@ +<?php + +namespace App\Livewire; + +use App\Models\Customer; +use Illuminate\Support\Collection; +use Livewire\Component; + +class CustomerAndContactSelect extends Component +{ + public Collection $customers; + public Collection $contacts; + public string $selectedCustomer; + + public function mount(Collection $customers) + { + $this->customers = $customers; + + if (isset($this->selectedCustomer)) + { + $this->contacts = Customer::find($this->selectedCustomer)->contacts; + } + else { + $this->contacts = $customers->first()->contacts; + } + + } + + public function updateContactList() + { + $this->contacts = Customer::find($this->selectedCustomer)->contacts; + } + + public function render() + { + return view('livewire.customer-and-contact-select', [ + 'customers' => $this->customers, + 'contacts' => $this->contacts, + ]); + } +} diff --git a/app/Livewire/OrderProductsCreate.php b/app/Livewire/OrderProductsCreate.php new file mode 100644 index 0000000..8b08e72 --- /dev/null +++ b/app/Livewire/OrderProductsCreate.php @@ -0,0 +1,133 @@ +<?php + +namespace App\Livewire; + +use Illuminate\Support\Collection; +use Livewire\Component; + +class OrderProductsCreate extends Component +{ + public Collection $productInputs; + public Collection $serviceInputs; + + public function addProductInput() + { + $index = $this->productInputs->count(); + $this->productInputs->push([ + $index => [ + 'sku' => '', + 'product_name' => '', + 'product_color' => '', + 'size_xs' => '', + 'size_s' => '', + 'size_m' => '', + 'size_l' => '', + 'size_xl' => '', + 'size_2xl' => '', + 'size_3xl' => '', + 'size_osfa' => '', + 'product_total' => '', + ] + ]); + } + + public function calculateProductTotal($key) + { + $this->productInputs[$key]['product_total'] = +// intval($this->productInputs[$key]['size_xs']) + +// intval($this->productInputs[$key]['size_s']) + +// intval($this->productInputs[$key]['size_m']) + +// intval($this->productInputs[$key]['size_l']) + +// intval($this->productInputs[$key]['size_xl']) + +// intval($this->productInputs[$key]['size_2xl']) + + intval($this->productInputs[$key]['size_3xl']) + + intval($this->productInputs[$key]['size_osfa']); + } + + public function determineAddProductRow($index) + { + if ($index == $this->productInputs->count() - 1) { + $this->addProductInput(); + } + } + + public function determineAddServiceProductRow($index) + { + if ($index == $this->serviceInputs->count() - 1) { + $this->addServiceInput(); + } + } + + public function removeProductInput($key) + { + if ($this->productInputs->count() > 1) { + $this->productInputs->pull($key); + } + } + + public function addServiceInput() + { + $this->serviceInputs->push([ + $this->serviceInputs->count() => [ + 'sku' => '', + 'product_name' => '', + 'product_color' => '', + 'logo_name' => '', + 'setup_number' => '', + 'service_width' => '', + 'service_height' => '', + 'service_setup_unit' => '', + 'service_setup_price' => '', + 'service_total' => '', + ] + ]); + } + + public function removeServiceInput($key) + { + if ($this->serviceInputs->count() > 1) { + $this->serviceInputs->pull($key); + } + } + + public function mount() + { + $this->fill([ + 'productInputs' => collect([ + [ + 'sku' => '', + 'product_name' => '', + 'product_color' => '', + 'size_xs' => '', + 'size_s' => '', + 'size_m' => '', + 'size_l' => '', + 'size_xl' => '', + 'size_2xl' => '', + 'size_3xl' => '', + 'size_osfa' => '', + 'product_total' => '0', + ] + ]), + 'serviceInputs' => collect([ + [ + 'sku' => '', + 'product_name' => '', + 'product_color' => '', + 'logo_name' => '', + 'setup_number' => '', + 'service_width' => '', + 'service_height' => '', + 'service_setup_unit' => '', + 'service_setup_price' => '', + 'service_total' => '', + ] + ]), + ]); + } + + public function render() + { + return view('livewire.order-products-create'); + } +} diff --git a/app/Livewire/OrdersTable.php b/app/Livewire/OrdersTable.php new file mode 100644 index 0000000..47429b0 --- /dev/null +++ b/app/Livewire/OrdersTable.php @@ -0,0 +1,55 @@ +<?php + +namespace App\Livewire; + +use App\Models\Customer; +use App\Models\Order; +use Illuminate\Database\Query\Builder; +use Illuminate\Support\Carbon; +use Livewire\Component; +use Livewire\WithPagination; + +class OrdersTable extends Component +{ + use WithPagination; + + protected $paginationTheme = 'bootstrap'; + + public bool $showCustomerColumn; + public string $orderType = "active"; + public string $search = ""; + public string $title = ""; + public Carbon $today; + + public function mount(bool $showCustomerColumn, string $orderType, string $title) + { + $this->today = Carbon::today(); + $this->showCustomerColumn = $showCustomerColumn; + $this->orderType = $orderType; + $this->title = $title; + } + + public function render() + { + return view('livewire.orders-table', [ + 'orders' => Order::with('customer') + ->when($this->orderType === 'active', fn($q) => $q->active()) + ->when($this->orderType === 'invoiced', fn($q) => $q->invoiced()) + ->when($this->orderType === 'finished', fn($q) => $q->finished()) + ->when($this->search !== '', function ($query) { + $query->whereHas('customer', function ($query) { + $query->where('company_name', 'like', '%' . $this->search . '%'); + })->orWhere('customer_po', 'like', '%' . $this->search . '%') + ->orWhere('internal_po', 'like', '%' . $this->search . '%') + ->orWhere('order_date', 'like', '%' . $this->search . '%') + ->orWhere('due_date', 'like', '%' . $this->search . '%') + ->orWhere('status', 'like', '%' . $this->search . '%'); + }) + ->orderByDesc('rush') + ->orderBy('due_date') + ->paginate(15) + ->withQueryString(), + 'today' => $this->today, + ]); + } +} diff --git a/app/Models/Contact.php b/app/Models/Contact.php index 2ae4319..dd92d68 100644 --- a/app/Models/Contact.php +++ b/app/Models/Contact.php @@ -20,6 +20,11 @@ class Contact extends Model 'notes', ]; + public function getFullNameAttribute(): string + { + return $this->first_name . ' ' . $this->last_name; + } + public function customer(): BelongsTo { return $this->belongsTo(Customer::class); diff --git a/app/Models/Order.php b/app/Models/Order.php index cb8ec44..8f12ada 100644 --- a/app/Models/Order.php +++ b/app/Models/Order.php @@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; use Illuminate\Database\Eloquent\SoftDeletes; class Order extends Model @@ -15,9 +16,11 @@ class Order extends Model protected $fillable = [ 'customer_id', + 'contact_id', 'internal_po', 'customer_po', 'order_date', + 'order_type', 'due_date', 'status', 'rush', @@ -30,16 +33,39 @@ class Order extends Model ]; protected $appends = [ - 'active_status' + 'active' ]; - public function getActiveStatus(): bool + public function active(): bool { - if ($this->status === OrderStatus::COMPLETED || $this->status === OrderStatus::CANCELLED) { - return false; + if ($this->status == OrderStatus::APPROVED + || $this->status == OrderStatus::PRODUCTION) { + return true; } - return true; + return false; + } + + public function scopeActive($query) + { + return $query->where('status', 'approved') + ->orWhere('status', 'production'); + } + + public function scopeFinished($query) + { + return $query->where('status', 'shipped') + ->orWhere('status', 'completed'); + } + + public function scopeInvoiced($query) + { + return $query->where('status', 'invoiced'); + } + + public function scopeRush($query) + { + return $query->where('rush', true); } public function customer(): BelongsTo @@ -47,6 +73,11 @@ public function customer(): BelongsTo return $this->belongsTo(Customer::class); } + public function orderProduct(): HasMany + { + return $this->hasMany(OrderProduct::class); + } + protected function serializeDate(DateTimeInterface $date): string { return $date->format('Y-m-d'); diff --git a/app/Models/OrderProduct.php b/app/Models/OrderProduct.php new file mode 100644 index 0000000..745ac50 --- /dev/null +++ b/app/Models/OrderProduct.php @@ -0,0 +1,42 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\SoftDeletes; + +class OrderProduct extends Model +{ + use SoftDeletes, HasFactory; + + protected $fillable = [ + 'order_id', + 'sku', + 'product_name', + 'color', + ]; + + public function order(): BelongsTo + { + return $this->belongsTo(Order::class); + } + + public function productService(): HasOne + { + return $this->hasOne(ProductService::class); + } + + public function serviceFile(): HasOne + { + return $this->hasOne(ServiceFile::class); + } + + public function productSize(): HasMany + { + return $this->hasMany(ProductSize::class); + } +} diff --git a/app/Models/ProductService.php b/app/Models/ProductService.php new file mode 100644 index 0000000..c351bcf --- /dev/null +++ b/app/Models/ProductService.php @@ -0,0 +1,33 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\Relations\HasOne; +use Illuminate\Database\Eloquent\SoftDeletes; + +class ProductService extends Model +{ + use SoftDeletes, HasFactory; + + protected $fillable = [ + 'order_product_id', + 'service_type', + 'placement', + 'setup_amount', + 'amount', + 'amount_price', + ]; + + public function orderProduct(): BelongsTo + { + return $this->belongsTo(OrderProduct::class); + } + + public function serviceFile(): HasOne + { + return $this->hasOne(ServiceFile::class); + } +} diff --git a/app/Models/ProductSize.php b/app/Models/ProductSize.php new file mode 100644 index 0000000..51150fa --- /dev/null +++ b/app/Models/ProductSize.php @@ -0,0 +1,24 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\SoftDeletes; + +class ProductSize extends Model +{ + use SoftDeletes, HasFactory; + + protected $fillable = [ + 'order_product_id', + 'size', + 'amount', + ]; + + public function orderProduct(): BelongsTo + { + return $this->belongsTo(OrderProduct::class); + } +} diff --git a/app/Models/ServiceFile.php b/app/Models/ServiceFile.php new file mode 100644 index 0000000..436a6f2 --- /dev/null +++ b/app/Models/ServiceFile.php @@ -0,0 +1,28 @@ +<?php + +namespace App\Models; + +use Illuminate\Database\Eloquent\Factories\HasFactory; +use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\BelongsTo; +use Illuminate\Database\Eloquent\SoftDeletes; + +class ServiceFile extends Model +{ + use SoftDeletes, HasFactory; + + protected $fillable = [ + 'code', + 'product_service_id', + 'name', + 'width', + 'height', + 'unit', + 'setup_number' + ]; + + public function productService(): BelongsTo + { + return $this->belongsTo(ProductService::class); + } +} diff --git a/composer.json b/composer.json index 7f6cb1b..3b608c3 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,8 @@ "php": "^8.2", "davidhsianturi/blade-bootstrap-icons": "^1.5", "laravel/framework": "^11.9", - "laravel/tinker": "^2.9" + "laravel/tinker": "^2.9", + "livewire/livewire": "^3.5" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/composer.lock b/composer.lock index da623a1..363f653 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ecf358f6808ee41e24a7136c4c0cd543", + "content-hash": "cf385c78ac1f239d7823feaf6668a15b", "packages": [ { "name": "blade-ui-kit/blade-icons", @@ -1959,6 +1959,82 @@ ], "time": "2024-01-28T23:22:08+00:00" }, + { + "name": "livewire/livewire", + "version": "v3.5.6", + "source": { + "type": "git", + "url": "https://github.com/livewire/livewire.git", + "reference": "597a2808d8d3001cc3ed5ce89a6ebab00f83b80f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/livewire/livewire/zipball/597a2808d8d3001cc3ed5ce89a6ebab00f83b80f", + "reference": "597a2808d8d3001cc3ed5ce89a6ebab00f83b80f", + "shasum": "" + }, + "require": { + "illuminate/database": "^10.0|^11.0", + "illuminate/routing": "^10.0|^11.0", + "illuminate/support": "^10.0|^11.0", + "illuminate/validation": "^10.0|^11.0", + "laravel/prompts": "^0.1.24", + "league/mime-type-detection": "^1.9", + "php": "^8.1", + "symfony/console": "^6.0|^7.0", + "symfony/http-kernel": "^6.2|^7.0" + }, + "require-dev": { + "calebporzio/sushi": "^2.1", + "laravel/framework": "^10.15.0|^11.0", + "mockery/mockery": "^1.3.1", + "orchestra/testbench": "^8.21.0|^9.0", + "orchestra/testbench-dusk": "^8.24|^9.1", + "phpunit/phpunit": "^10.4", + "psy/psysh": "^0.11.22|^0.12" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Livewire\\LivewireServiceProvider" + ], + "aliases": { + "Livewire": "Livewire\\Livewire" + } + } + }, + "autoload": { + "files": [ + "src/helpers.php" + ], + "psr-4": { + "Livewire\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Caleb Porzio", + "email": "calebporzio@gmail.com" + } + ], + "description": "A front-end framework for Laravel.", + "support": { + "issues": "https://github.com/livewire/livewire/issues", + "source": "https://github.com/livewire/livewire/tree/v3.5.6" + }, + "funding": [ + { + "url": "https://github.com/livewire", + "type": "github" + } + ], + "time": "2024-08-19T11:52:18+00:00" + }, { "name": "monolog/monolog", "version": "3.7.0", diff --git a/database/factories/OrderFactory.php b/database/factories/OrderFactory.php index 35d8502..b4093ed 100644 --- a/database/factories/OrderFactory.php +++ b/database/factories/OrderFactory.php @@ -3,6 +3,7 @@ namespace Database\Factories; use App\Enums\OrderStatus; +use App\Enums\OrderType; use App\Models\Customer; use App\Models\Order; use Illuminate\Database\Eloquent\Factories\Factory; @@ -14,17 +15,19 @@ class OrderFactory extends Factory public function definition(): array { - $order_date = Carbon::today()->subDays(rand(0, 30)); + $order_date = Carbon::today()->subDays(rand(0, 10)); + $due_date = $order_date->copy()->addDays(rand(9,15)); return [ 'created_at' => Carbon::now(), 'updated_at' => Carbon::now(), 'internal_po' => 'TN' . $this->faker->randomNumber(4, true), 'customer_po' => $this->faker->randomNumber(6, true), + 'order_type' => $this->faker->randomElement(OrderType::cases())->value, 'order_date' => $order_date, - 'due_date' => $order_date->addDays(rand(8, 12)), - 'status' => $this->faker->randomELement(OrderStatus::cases())->value, //todo: setup order status enum - 'rush' => $this->faker->boolean(), + 'due_date' => $due_date, + 'status' => $this->faker->randomELement(OrderStatus::cases())->value, + 'rush' => $this->faker->boolean(10), 'new_art' => $this->faker->boolean(), 'digitizing' => $this->faker->boolean(), 'repeat' => $this->faker->boolean(), diff --git a/database/factories/OrderProductFactory.php b/database/factories/OrderProductFactory.php new file mode 100644 index 0000000..c395073 --- /dev/null +++ b/database/factories/OrderProductFactory.php @@ -0,0 +1,24 @@ +<?php + +namespace Database\Factories; + +use App\Models\Order; +use App\Models\OrderProduct; +use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Carbon; + +class OrderProductFactory extends Factory +{ + protected $model = OrderProduct::class; + + public function definition(): array + { + return [ + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'sku' => $this->faker->randomElement([$this->faker->randomNumber(4, true), null]), + 'product_name' => $this->faker->randomElement(['shirts', 'hats', 'jackets', 'pants', 'tote bags', 'backpacks']), + 'color' => $this->faker->randomElement(['black', 'white', 'navy', 'red', 'gold', 'charcoal']), + ]; + } +} diff --git a/database/factories/ProductServiceFactory.php b/database/factories/ProductServiceFactory.php new file mode 100644 index 0000000..ad7917e --- /dev/null +++ b/database/factories/ProductServiceFactory.php @@ -0,0 +1,27 @@ +<?php + +namespace Database\Factories; + +use App\Models\OrderProduct; +use App\Models\ProductService; +use App\Models\ServiceFile; +use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Carbon; + +class ProductServiceFactory extends Factory +{ + protected $model = ProductService::class; + + public function definition(): array + { + return [ + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'service_type' => $this->faker->randomElement(['embroidery', 'screen printing', 'dtg', 'vinyl']), + 'placement' => $this->faker->randomElement(['l/c', 'c/f', 'f/b', 'r/c']), + 'setup_amount' => 0, + 'amount' => $this->faker->randomNumber(1), + 'amount_price' => 0, + ]; + } +} diff --git a/database/factories/ProductSizeFactory.php b/database/factories/ProductSizeFactory.php new file mode 100644 index 0000000..621b3b3 --- /dev/null +++ b/database/factories/ProductSizeFactory.php @@ -0,0 +1,23 @@ +<?php + +namespace Database\Factories; + +use App\Models\OrderProduct; +use App\Models\ProductSize; +use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Carbon; + +class ProductSizeFactory extends Factory +{ + protected $model = ProductSize::class; + + public function definition(): array + { + return [ + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'size' => $this->faker->randomElement(['xs', 's', 'm', 'l', 'xl', '2xl', '3xl']), + 'amount' => $this->faker->randomNumber(2, false), + ]; + } +} diff --git a/database/factories/ServiceFileFactory.php b/database/factories/ServiceFileFactory.php new file mode 100644 index 0000000..8e464ff --- /dev/null +++ b/database/factories/ServiceFileFactory.php @@ -0,0 +1,25 @@ +<?php + +namespace Database\Factories; + +use App\Models\ServiceFile; +use Illuminate\Database\Eloquent\Factories\Factory; +use Illuminate\Support\Carbon; + +class ServiceFileFactory extends Factory +{ + protected $model = ServiceFile::class; + + public function definition(): array + { + return [ + 'created_at' => Carbon::now(), + 'updated_at' => Carbon::now(), + 'code' => $this->faker->randomElement(['A', 'B']) . $this->faker->randomNumber(4, true), + 'name' => $this->faker->word(), + 'width' => round($this->faker->randomFloat(2, 0, 10), 1), + 'height' => round($this->faker->randomFloat(2, 0, 10), 1), + 'unit' => 'inch', + ]; + } +} diff --git a/database/migrations/2024_09_09_194631_create_orders_table.php b/database/migrations/2024_09_09_194631_create_orders_table.php index c36c202..402d283 100644 --- a/database/migrations/2024_09_09_194631_create_orders_table.php +++ b/database/migrations/2024_09_09_194631_create_orders_table.php @@ -11,20 +11,21 @@ public function up(): void { Schema::create('orders', function (Blueprint $table) { $table->id(); - $table->foreignId('customer_id'); - $table->string('internal_po'); + $table->foreignId('customer_id')->constrained(); + $table->foreignId('contact_id')->nullable()->constrained(); + $table->string('internal_po')->nullable(); $table->string('customer_po'); - $table->enum('order_type', OrderType::cases()); + $table->string('order_type'); $table->date('order_date'); $table->date('due_date'); - $table->enum('status', OrderStatus::cases()); + $table->string('status'); $table->boolean('rush')->default(0); $table->boolean('new_art')->default(0); $table->boolean('digitizing')->default(0); $table->boolean('repeat')->default(0); $table->boolean('purchased_garments')->default(0); $table->boolean('customer_supplied_file')->default(0); - $table->longText('notes'); + $table->longText('notes')->nullable(); $table->softDeletes(); $table->timestamps(); }); diff --git a/database/migrations/2024_09_10_224439_create_order_products_table.php b/database/migrations/2024_09_10_224439_create_order_products_table.php new file mode 100644 index 0000000..8edaf9a --- /dev/null +++ b/database/migrations/2024_09_10_224439_create_order_products_table.php @@ -0,0 +1,25 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +return new class extends Migration { + public function up(): void + { + Schema::create('order_products', function (Blueprint $table) { + $table->id(); + $table->foreignId('order_id')->constrained(); + $table->string('sku')->nullable(); + $table->string('product_name'); + $table->string('color')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('order_products'); + } +}; diff --git a/database/migrations/2024_09_10_224947_create_product_services_table.php b/database/migrations/2024_09_10_224947_create_product_services_table.php new file mode 100644 index 0000000..a9d44d6 --- /dev/null +++ b/database/migrations/2024_09_10_224947_create_product_services_table.php @@ -0,0 +1,27 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +return new class extends Migration { + public function up(): void + { + Schema::create('product_services', function (Blueprint $table) { + $table->id(); + $table->foreignId('order_product_id'); + $table->string('service_type'); + $table->string('placement'); + $table->string('setup_amount'); + $table->string('amount')->nullable(); + $table->string('amount_price')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('product_services'); + } +}; diff --git a/database/migrations/2024_09_10_225029_create_service_files_table.php b/database/migrations/2024_09_10_225029_create_service_files_table.php new file mode 100644 index 0000000..e4ea7f0 --- /dev/null +++ b/database/migrations/2024_09_10_225029_create_service_files_table.php @@ -0,0 +1,29 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +return new class extends Migration { + public function up(): void + { + Schema::create('service_files', function (Blueprint $table) { + $table->id(); + $table->foreignId('product_service_id')->constrained(); + $table->string('code'); + $table->string('name'); + $table->string('placement'); + $table->decimal('width')->nullable(); + $table->decimal('height')->nullable(); + $table->string('unit')->default("inch"); + $table->integer('setup_number')->nullable(); + $table->softDeletes(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('service_files'); + } +}; diff --git a/database/migrations/2024_09_10_230904_create_product_sizes_table.php b/database/migrations/2024_09_10_230904_create_product_sizes_table.php new file mode 100644 index 0000000..00e3e99 --- /dev/null +++ b/database/migrations/2024_09_10_230904_create_product_sizes_table.php @@ -0,0 +1,24 @@ +<?php + +use Illuminate\Database\Migrations\Migration; +use Illuminate\Database\Schema\Blueprint; +use Illuminate\Support\Facades\Schema; + +return new class extends Migration { + public function up(): void + { + Schema::create('product_sizes', function (Blueprint $table) { + $table->id(); + $table->foreignId('order_product_id'); + $table->string('size'); + $table->string('amount'); + $table->softDeletes(); + $table->timestamps(); + }); + } + + public function down(): void + { + Schema::dropIfExists('product_sizes'); + } +}; diff --git a/database/seeders/CustomerSeeder.php b/database/seeders/CustomerSeeder.php new file mode 100644 index 0000000..5e5aa92 --- /dev/null +++ b/database/seeders/CustomerSeeder.php @@ -0,0 +1,93 @@ +<?php + +namespace Database\Seeders; + +use App\Models\Contact; +use App\Models\Customer; +use App\Models\Order; +use App\Models\OrderProduct; +use App\Models\PackingSlip; +use App\Models\ProductService; +use App\Models\ProductSize; +use App\Models\ServiceFile; +use App\Models\ShippingEntry; +use Illuminate\Database\Seeder; + +class CustomerSeeder extends Seeder +{ + public function run(): void + { + Customer::factory(9) + ->has(Contact::factory(5)) + ->has(PackingSlip::factory(30)) + ->has(ShippingEntry::factory(2)) + ->has(Order::factory(10) + ->has(OrderProduct::factory(2) + ->has(ProductSize::factory(3)) + ->has(ProductService::factory(3) + ->has(ServiceFile::factory(1))))) + ->create(); + + Customer::factory([ + 'company_name' => 'Genumark', + 'internal_name' => 'genumark', + 'shipping_address' => '', + 'billing_address' => '', + ]) + ->has(Contact::factory([ + 'first_name' => 'Tammy', + 'last_name' => 'Bookbinder', + 'email' => 'tbookbinder@genumark.com', + 'phone' => '+1 778 229 5668' + ])) + ->has(Contact::factory([ + 'first_name' => 'Kathlyn', + 'last_name' => 'Wood', + 'email' => 'kwood@genumark.com', + 'phone' => '+1 604 294 2376', + 'notes' => 'Always CC, unless SOF order' + ])) + ->has(Contact::factory([ + 'first_name' => 'Jane', + 'last_name' => 'Wellman', + 'email' => 'jwellman@genumark.com', + 'phone' => '+1 604 742 5584', + 'notes' => 'Deals with SOF orders' + ])) + ->has(Contact::factory([ + 'first_name' => 'Trisha', + 'last_name' => 'Miller', + 'email' => 'tmiller@genumark.com', + 'phone' => '+1 604 802 8486' + ])) + ->has(Contact::factory([ + 'first_name' => 'Brenda', + 'last_name' => 'Kuepfer', + 'email' => 'bkuepfer@genumark.com', + 'phone' => '+1 604 305 5002' + ])) + ->has(PackingSlip::factory(20)) + ->has(ShippingEntry::factory([ + 'account_title' => 'Genumark', + 'courier' => 'UPS CampusShip', + 'contact' => 'https://www.ups.com/lasso/login', + 'account_username' => 'GenumarkTopNotch', + 'account_password' => 'TopNotch@13579', + 'info_needed' => 'Put PO on box', + 'notify' => 'Various reps, CC Kathlyn Wood', + 'notes' => 'For Save On Foods orders, see Genumark SOF' + ])) + ->has(ShippingEntry::factory([ + 'account_title' => 'Genumark Save-On-Foods', + 'courier' => 'UPS CampusShip', + 'contact' => 'https://www.ups.com/lasso/login', + 'account_username' => 'GenumarkTopNotch', + 'account_password' => 'TopNotch@13579', + 'info_needed' => 'Put PO on box', + 'notify' => 'Jane Wellman', + 'notes' => 'Don\'t CC Kathlyn for SOF orders' + ])) + ->has(Order::factory(10)) + ->create(); + } +} diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 3293b57..0fa984e 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -21,73 +21,10 @@ class DatabaseSeeder extends Seeder */ public function run(): void { - Customer::factory(9) - ->has(Contact::factory(5)) - ->has(PackingSlip::factory(30)) - ->has(ShippingEntry::factory(2)) - ->create(); + $this->call([ + CustomerSeeder::class, + ]); - Customer::factory([ - 'company_name' => 'Genumark', - 'internal_name' => 'genumark', - 'shipping_address' => '', - 'billing_address' => '', - ]) - ->has(Contact::factory([ - 'first_name' => 'Tammy', - 'last_name' => 'Bookbinder', - 'email' => 'tbookbinder@genumark.com', - 'phone' => '+1 778 229 5668' - ])) - ->has(Contact::factory([ - 'first_name' => 'Kathlyn', - 'last_name' => 'Wood', - 'email' => 'kwood@genumark.com', - 'phone' => '+1 604 294 2376', - 'notes' => 'Always CC, unless SOF order' - ])) - ->has(Contact::factory([ - 'first_name' => 'Jane', - 'last_name' => 'Wellman', - 'email' => 'jwellman@genumark.com', - 'phone' => '+1 604 742 5584', - 'notes' => 'Deals with SOF orders' - ])) - ->has(Contact::factory([ - 'first_name' => 'Trisha', - 'last_name' => 'Miller', - 'email' => 'tmiller@genumark.com', - 'phone' => '+1 604 802 8486' - ])) - ->has(Contact::factory([ - 'first_name' => 'Brenda', - 'last_name' => 'Kuepfer', - 'email' => 'bkuepfer@genumark.com', - 'phone' => '+1 604 305 5002' - ])) - ->has(PackingSlip::factory(20)) - ->has(ShippingEntry::factory([ - 'account_title' => 'Genumark', - 'courier' => 'UPS CampusShip', - 'contact' => 'https://www.ups.com/lasso/login', - 'account_username' => 'GenumarkTopNotch', - 'account_password' => 'TopNotch@13579', - 'info_needed' => 'Put PO on box', - 'notify' => 'Various reps, CC Kathlyn Wood', - 'notes' => 'For Save On Foods orders, see Genumark SOF' - ])) - ->has(ShippingEntry::factory([ - 'account_title' => 'Genumark Save-On-Foods', - 'courier' => 'UPS CampusShip', - 'contact' => 'https://www.ups.com/lasso/login', - 'account_username' => 'GenumarkTopNotch', - 'account_password' => 'TopNotch@13579', - 'info_needed' => 'Put PO on box', - 'notify' => 'Jane Wellman', - 'notes' => 'Don\'t CC Kathlyn for SOF orders' - ])) - ->has(Order::factory(10)) - ->create(); User::factory()->create([ 'name' => 'Test User', diff --git a/resources/views/customers/index.blade.php b/resources/views/customers/index.blade.php deleted file mode 100644 index a9f0430..0000000 --- a/resources/views/customers/index.blade.php +++ /dev/null @@ -1,144 +0,0 @@ -@extends('layouts.app') - -@section('header') - <div class="container-fluid bg-light pt-3"> - - <!-- Customer company name row --> - <div class="row justify-content-center pb-2"> - <div class="col-3"></div> - <div class="col"> - <h2></h2> - </div> - </div> - - <!-- Tabs row --> - <div class="row justify-content-center mb-3"> - <div class="col-3 border-bottom"></div> - <div class="col-6 p-0"> - - <ul class="nav nav-fill nav-tabs" id="customer-tabs" role="tablist"> - <li class="nav-item" role="presentation"> - <button class="nav-link link-dark {{$tab == null ? 'active' : ''}}" id="details-tab" - data-bs-toggle="tab" data-bs-target="#details" type="button" role="tab" - aria-controls="details" aria-selected="{{$tab == null ? 'true' : 'false'}}"> - <x-bi-list-ul/> - Customers - </button> - </li> - <li class="nav-item" role="presentation"> - <button class="nav-link link-dark {{$tab == 'shipping' ? 'active' : ''}}" id="shipping-tab" - data-bs-toggle="tab" data-bs-target="#shipping" type="button" role="tab" - aria-controls="shipping" aria-selected="{{$tab == 'shipping' ? 'true' : 'false'}}"> - <x-bi-box-fill/> - Orders - </button> - </li> - <li class="nav-item" role="presentation"> - <button class="nav-link link-dark {{$tab == 'packing' ? 'active' : ''}}" id="packing-tab" - data-bs-toggle="tab" data-bs-target="#packing" type="button" role="tab" - aria-controls="packing" aria-selected="{{$tab == 'packing' ? 'true' : 'false'}}"> - <x-bi-card-text/> - Packing Slips - </button> - </li> - {{-- <li class="nav-item" role="presentation">--}} - {{-- <button class="nav-link link-dark {{$tab == 'contacts' ? 'active' : ''}}" id="contacts-tab"--}} - {{-- data-bs-toggle="tab" data-bs-target="#contacts" type="button" role="tab"--}} - {{-- aria-controls="contacts" aria-selected="{{$tab == 'contacts' ? 'true' : 'false'}}">--}} - {{-- <x-bi-people-fill/>--}} - {{-- Contacts--}} - {{-- </button>--}} - {{-- </li>--}} - </ul> - - </div> - <div class="col border-bottom"></div> - </div> - - </div> -@endsection() - -@section('content') - <div class="container"> - <div class="row justify-content-center mb-3"> - <div class="col"> - <div class="d-flex flex-row gap-2"> - <button class="btn btn-primary" title="Create new customer..." - data-bs-toggle="modal" - data-bs-target="#createCustomerModal"> - <x-bi-person-plus-fill/> - Create entry - </button> - - <div class="vr"></div> - - <div class="d-inline-flex gap-2"> - <input type="text" class="form-control" placeholder="Search..." - name="" id=""> - <button class="btn btn-outline-primary"> - <x-bi-search/> - </button> - </div> - - <div class="mx-auto"></div> - - <button class="btn btn-danger" title="Delete customer..." - data-bs-toggle="modal" - data-bs-target="#deleteCustomerModal"> - <x-bi-trash-fill/> - Delete entry - </button> - </div> - </div> - </div> - - <div class="row mb-3"> - <div class="col"> - @if(sizeof($customers) !== 0) - <table class="table table-striped table-hover"> - <thead> - <tr class="border-bottom border-black"> - <th scope="col">Company Name</th> - <th scope="col">Internal Name</th> - <th scope="col">Shipping Address</th> - <th scope="col">Billing Address</th> - <th scope="col">Phone</th> - <th scope="col">View</th> - </tr> - </thead> - - <tbody> - - @foreach($customers as $customer) - <tr> - <td> {{$customer->company_name}} </td> - <td><code>{{$customer->internal_name}}</code></td> - <td> {{$customer->shipping_address}} </td> - <td> {{$customer->billing_address}} </td> - <td class="text-nowrap"> {{$customer->phone}} </td> - <td class="align-top"> - <a class="btn btn-sm btn-outline-secondary" - href="{{route('customers.show', [$customer->id, 'tab'=>'details'])}}"> - <x-bi-arrow-right/> - </a> - </td> - </tr> - @endforeach - - </tbody> - </table> - - @else() - No customer data. - @endif - </div> - </div> - </div> - - <!-- Create Customer Modal --> - @include('partials.customers.create-modal') - - <!-- Delete Customer Modal --> - @include('partials.customers.delete-all-modal') - -@endsection diff --git a/resources/views/customers/show.blade.php b/resources/views/customers/show.blade.php index 2cc702b..6f3f989 100644 --- a/resources/views/customers/show.blade.php +++ b/resources/views/customers/show.blade.php @@ -65,28 +65,24 @@ @section('content') <div class="container"> <div class="row justify-content-center my-3"> - <div class="tab-content"> <!-- Overview tab --> - @include('partials.customers.show-overview') + @include('partials.customers.show.overview-tab') <!-- Shipping Info tab --> - @include('partials.customers.show-shipping-info') + @include('partials.customers.show.shipping-info-tab') <!-- Packing Slips tab --> - @include('partials.customers.show-packing-slips') + @include('partials.customers.show.packing-slips-tab') <!-- Contacts tab --> - @include('partials.customers.show-contacts') + @include('partials.customers.show.contacts-tab') </div> </div> </div> - <!-- Edit Customer Modal --> - @include('partials.customers.edit-modal') - <!-- Delete Customer Modal --> @include('partials.customers.delete-single-modal') diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php new file mode 100644 index 0000000..8fff6b1 --- /dev/null +++ b/resources/views/dashboard.blade.php @@ -0,0 +1,57 @@ +@extends('layouts.app') + +@section('header') + <div class="container-fluid bg-light pt-3"> + + <!-- Customer company name row --> + <div class="row justify-content-center pb-2"> + <div class="col-3"></div> + <div class="col"> + {{-- <h2>Overview</h2>--}} + </div> + </div> + + <!-- Tabs row --> + <div class="row justify-content-center"> + <div class="col-3 border-bottom"></div> + <div class="col-6 p-0"> + + <ul class="nav nav-fill nav-tabs" id="home-tabs" role="tablist"> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders-tab" + href="{{route('dashboard', ['tab' => 'active_orders'])}}" type="button" role="tab" + aria-controls="active_orders" aria-selected="{{$tab == 'active_orders' ? 'true' : 'false'}}"> + <x-bi-arrow-clockwise/> + Active Orders + </a> + </li> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'packing_slips' ? 'active' : ''}}" id="packing-tab" + href="{{route('dashboard', ['tab' => 'packing_slips'])}}" type="button" role="tab" + aria-controls="packing_slips" aria-selected="{{$tab == 'packing_slips' ? 'true' : 'false'}}"> + <x-bi-list-ul/> + Packing Slips + </a> + </li> + </ul> + + </div> + <div class="col border-bottom"></div> + </div> + + </div> +@endsection + +@section('content') + <div class="container"> + <div class="row justify-content-center my-3"> + <div class="tab-content"> + <div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel" + aria-labelledby="active_orders-tab"> + + <livewire:orders-table :order-type="'active'" :show-customer-column="true" title="Active Orders"/> + </div> + </div> + </div> + </div> +@endsection diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php deleted file mode 100644 index 1f34466..0000000 --- a/resources/views/home.blade.php +++ /dev/null @@ -1,23 +0,0 @@ -@extends('layouts.app') - -@section('content') -<div class="container"> - <div class="row justify-content-center"> - <div class="col-md-8"> - <div class="card"> - <div class="card-header">{{ __('Dashboard') }}</div> - - <div class="card-body"> - @if (session('status')) - <div class="alert alert-success" role="alert"> - {{ session('status') }} - </div> - @endif - - {{ __('You are logged in!') }} - </div> - </div> - </div> - </div> -</div> -@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 1593400..9ef0aae 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -15,65 +15,12 @@ <!-- Scripts --> @vite(['resources/sass/app.scss', 'resources/js/app.js']) + +{{-- @livewireStyles--}} </head> <body> <div id="app"> - <nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm"> - <div class="container"> - <a class="navbar-brand" href="{{ url('/') }}"> - {{ config('app.name', 'Laravel') }} - </a> - <button class="navbar-toggler" type="button" data-bs-toggle="collapse" - data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" - aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"> - <span class="navbar-toggler-icon"></span> - </button> - - <div class="collapse navbar-collapse" id="navbarSupportedContent"> - <!-- Left Side Of Navbar --> - <ul class="navbar-nav me-auto"> - - </ul> - - <!-- Right Side Of Navbar --> - <ul class="navbar-nav ms-auto"> - <!-- Authentication Links --> - @guest - @if (Route::has('login')) - <li class="nav-item"> - <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a> - </li> - @endif - - @if (Route::has('register')) - <li class="nav-item"> - <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a> - </li> - @endif - @else - <li class="nav-item dropdown"> - <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" - data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre> - {{ Auth::user()->name }} - </a> - - <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown"> - <a class="dropdown-item" href="{{ route('logout') }}" - onclick="event.preventDefault(); - document.getElementById('logout-form').submit();"> - {{ __('Logout') }} - </a> - - <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none"> - @csrf - </form> - </div> - </li> - @endguest - </ul> - </div> - </div> - </nav> + @include('layouts.nav') <main> @yield('header') @@ -81,5 +28,6 @@ </main> </div> +{{--@livewireScripts--}} </body> </html> diff --git a/resources/views/layouts/nav.blade.php b/resources/views/layouts/nav.blade.php new file mode 100644 index 0000000..8472126 --- /dev/null +++ b/resources/views/layouts/nav.blade.php @@ -0,0 +1,97 @@ +<nav class="navbar navbar-expand-md navbar-light bg-white border-bottom"> + <div class="container"> + <a class="navbar-brand" href="{{ url('/') }}"> + {{ config('app.name', 'Laravel') }} + </a> + <button class="navbar-toggler" type="button" data-bs-toggle="collapse" + data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" + aria-expanded="false" aria-label="{{ __('Toggle navigation') }}"> + <span class="navbar-toggler-icon"></span> + </button> + + <div class="collapse navbar-collapse" id="navbarSupportedContent"> + <!-- Left Side Of Navbar --> + <ul class="navbar-nav me-auto"> + <li class="nav-item px-2"> + <a class="nav-link @if(request()->routeIs('dashboard')) active @endif " + href="{{route('dashboard')}}"> + <x-bi-activity/> + Dashboard</a> + </li> + <li class="nav-item"> + <a class="nav-link @if(request()->routeIs('search')) active @endif disabled" + href=""> + <x-bi-search/> + Search</a> + </li> + <li class="nav-item px-2"> + <a class="nav-link @if(request()->routeIs('orders.*')) active @endif" + href="{{route('orders.index')}}"> + <x-bi-box/> + Orders</a> + </li> + <li class="nav-item px-2"> + <a class="nav-link @if(request()->routeIs('quotes')) active @endif disabled" + href=""> + <x-bi-file-text/> + Quotes</a> + </li> + <li class="nav-item px-2"> + <a class="nav-link @if(request()->routeIs('invoices')) active @endif disabled" + href=""> + <x-bi-envelope/> + Invoices</a> + </li> + <li class="nav-item dropdown px-2"> + <a class="nav-link dropdown-toggle @if(request()->routeIs('management.index') || request()->routeIs('customer.*')) active @endif" href="#" + role="button" data-bs-toggle="dropdown" aria-expanded="false"> + <x-bi-pencil-square/> + Management + </a> + <ul class="dropdown-menu"> + <li><a class="dropdown-item @if(request()->routeIs('customers.*')) fw-bold @endif" href="{{route('management.index')}}">Customers</a></li> + <li><a class="dropdown-item @if(request()->routeIs('packing-slips.*')) fw bold @endif" href="{{route('management.index', 'packing')}}">Packing Slips</a></li> + <li><a class="dropdown-item @if(request()->routeIs('service-files.*')) fw bold @endif" href="{{route('management.index', 'files')}}">Service Files</a></li> + </ul> + </li> + </ul> + + <!-- Right Side Of Navbar --> + <ul class="navbar-nav ms-auto"> + <!-- Authentication Links --> + @guest + @if (Route::has('login')) + <li class="nav-item"> + <a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a> + </li> + @endif + + @if (Route::has('register')) + <li class="nav-item"> + <a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a> + </li> + @endif + @else + <li class="nav-item dropdown"> + <a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" + data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre> + {{ Auth::user()->name }} + </a> + + <div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown"> + <a class="dropdown-item" href="{{ route('logout') }}" + onclick="event.preventDefault(); + document.getElementById('logout-form').submit();"> + {{ __('Logout') }} + </a> + + <form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none"> + @csrf + </form> + </div> + </li> + @endguest + </ul> + </div> + </div> +</nav> \ No newline at end of file diff --git a/resources/views/livewire/counter.blade.php b/resources/views/livewire/counter.blade.php new file mode 100644 index 0000000..2107cc7 --- /dev/null +++ b/resources/views/livewire/counter.blade.php @@ -0,0 +1,7 @@ +<div> + <h1>{{ $count }}</h1> + + <button wire:click="increment">+</button> + + <button wire:click="decrement">-</button> +</div> diff --git a/resources/views/livewire/create-order.blade.php b/resources/views/livewire/create-order.blade.php new file mode 100644 index 0000000..b80e6e0 --- /dev/null +++ b/resources/views/livewire/create-order.blade.php @@ -0,0 +1,3 @@ +<div> + +</div> diff --git a/resources/views/livewire/customer-and-contact-select.blade.php b/resources/views/livewire/customer-and-contact-select.blade.php new file mode 100644 index 0000000..5888c11 --- /dev/null +++ b/resources/views/livewire/customer-and-contact-select.blade.php @@ -0,0 +1,44 @@ +<div> + <div class="row mb-2"> + <label for="customer_id" class="col-md-4 col-form-label text-md-end">Customer</label> + <div class="col-md-6"> + <select wire:change="updateContactList" wire:model="selectedCustomer" name="customer_id" + class="form-select form-select-sm" id="customer_id" autofocus required> + @foreach($customers as $customer) + <option value="{{$customer->id}}" {{ old('customer_id') == $customer->id ? "selected" : "" }}> + {{$customer->company_name}} + </option> + @endforeach() + </select> + + @error('customer_id') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + <div class="row mb-2"> + <label for="contact_id" class="col-md-4 col-form-label text-md-end">Contact</label> + <div class="col-md-6"> + @if(isset($contacts)) + <select wire:model="contacts" wire:key="{{$customer}}" name="contact_id" + class="form-select form-select-sm" id="contact_id"> + <option value=""></option> + @foreach($contacts as $contact) + <option value="{{$contact->id}}" {{ old('contact_id') == $contact->id ? "selected" : "" }}> + {{$contact->full_name}} + </option> + @endforeach + </select> + + @error('contact_id') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + @endif + </div> + </div> +</div> diff --git a/resources/views/livewire/order-products-create.blade.php b/resources/views/livewire/order-products-create.blade.php new file mode 100644 index 0000000..f8be805 --- /dev/null +++ b/resources/views/livewire/order-products-create.blade.php @@ -0,0 +1,279 @@ +<div> + + <div class="overflow-x-hidden overflow-y-visible" style="max-height: 730px"> + <table class="table table-striped table-sm"> + <thead> + <tr> + <th scope="col">#</th> + <th scope="col">SKU</th> + <th scope="col">Product Name</th> + <th scope="col">Color</th> + <th scope="col">XS</th> + <th scope="col">S</th> + <th scope="col">M</th> + <th scope="col">L</th> + <th scope="col">XL</th> + <th scope="col">2XL</th> + <th scope="col">3XL</th> + <th scope="col">OSFA</th> + <th scope="col">Total</th> + <th scope="col"></th> + </tr> + </thead> + <tbody> + + @foreach($productInputs as $key => $value) + + <tr wire:key="productRow.{{$key}}"> + <th scope="row" class="align-middle">{{$loop->index+1}}</th> + <td class="col-1"> + <!-- SKU --> + + <input id="sku" type="text" + class="form-control form-control-sm @error('sku') is-invalid @enderror" + name="sku" value="{{@old('sku')}}" autofocus + wire:change="determineAddProductRow({{$loop->index}})"> + + @error('sku') + <span class="invalid-feedback" role="alert"> + <strong> + {{ $message }} + </strong> + </span> + @enderror + </td> + <td class="col-3"> + <!-- product_name --> + + <input id="product_name[]" type="text" + class="form-control form-control-sm @error('product_name') is-invalid @enderror" + name="product_name" value="{{@old('product_name')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="col-1"> + <!-- product_color --> + + <input id="product_color[]" type="text" + class="form-control form-control-sm @error('product_color') is-invalid @enderror" + name="product_color" value="{{@old('product_color')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + + @error('product_color') + <span class="invalid-feedback" role="alert"> + <strong> + {{ $message }} + </strong> + </span> + @enderror + </td> + <td class="" style="width: 55px"> + <!-- size_xs --> + + <input id="size_xs" type="text" + class="form-control form-control-sm @error('size_xs') is-invalid @enderror" + name="size_xs" value="{{@old('size_xs')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="" style="width: 55px"> + <!-- size_s --> + + <input id="size_s" type="text" + class="form-control form-control-sm @error('size_s') is-invalid @enderror" + name="size_s" value="{{@old('size_s')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="" style="width: 55px"> + <!-- size_m --> + + <input id="size_m" type="text" + class="form-control form-control-sm @error('size_m') is-invalid @enderror" + name="size_m" value="{{@old('size_m')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="" style="width: 55px"> + <!-- size_l --> + + <input id="size_l" type="text" + class="form-control form-control-sm @error('size_l') is-invalid @enderror" + name="size_l" value="{{@old('size_l')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="" style="width: 55px"> + <!-- size_xl --> + + <input id="size_xl" type="text" + class="form-control form-control-sm @error('size_xl') is-invalid @enderror" + name="size_xl" value="{{@old('size_xl')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="" style="width: 55px"> + <!-- size_2xl --> + + <input id="size_2xl" type="text" + class="form-control form-control-sm @error('size_2xl') is-invalid @enderror" + name="size_2xl" value="{{@old('size_2xl')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + + </td> + <td class="" style="width: 55px"> + <!-- size_3xl --> + + <input id="size_3xl" type="text" + class="form-control form-control-sm @error('size_3xl') is-invalid @enderror" + name="size_3xl" value="{{@old('size_3xl')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td style="width: 55px"> + <!-- size_osfa --> + + <input id="size_osfa" type="number" + class="form-control form-control-sm @error('size_osfa') is-invalid @enderror" + name="size_osfa" value="{{@old('size_osfa')}}" + wire:change="determineAddProductRow({{$loop->index}})"> + </td> + <td class="col" style="width: 55px"> + <input id="product_total" type="text" + class="form-control form-control-sm @error('product_total') is-invalid @enderror" + name="product_total" readonly + wire:model="productInputs.{{$loop->index}}.product_total"> + </td> + <td class="col" style="width: 40px"> + @if($key > 0) + <button class="btn btn-sm" wire:click="removeProductInput({{$key}})"> + <x-bi-trash3/> + </button> + @endif + </td> + </tr> + + {{-- @endfor--}} + @endforeach + + </tbody> + </table> + + {{-- <hr class="border-secondary-subtle">--}} + + <!-- Title --> + <div class="row px-2 border-bottom mt-4"> + <div class="row fw-bold"> + <div class="col-1 px-1 text-end" style="width: 40px;">#</div> + <div class="col-1 px-1">Service</div> + <div class="col-2 px-1">Placement</div> + <div class="col-3 px-1">Logo Name</div> + + <div class="col-5"> + <div class="row"> + <div class="col px-1">Setup</div> + <div class="col px-1">Width</div> + <div class="col px-1">Height</div> + <div class="col px-1">Unit</div> + <div class="col px-1">Price</div> + <div class="col px-1">Total</div> + <div class="col px-1"></div> + </div> + </div> + </div> + </div> + + <!-- Row --> + + @foreach($serviceInputs as $key => $value) + <div class="row"> + <div class="@if($loop->index % 2 == 1) bg-body-tertiary @endif border-bottom py-2"> + <div class="row mb-1"> + <div class="row mb-2"> + <div class="col-1 px-1 fw-bold text-end" style="width: 40px;">{{$loop->index+1}}</div> + <div class="col-1 px-1"> + <input id="service_name" type="text" + class="form-control form-control-sm m-0 @error('service_name') is-invalid @enderror" + name="service_name" value="{{@old('service_name')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col-2 px-1"> + <input id="placement" type="text" + class="form-control form-control-sm @error('placement') is-invalid @enderror" + name="placement" value="{{@old('placement')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col-3 px-1"> + <input id="logo_name" type="text" + class="form-control form-control-sm @error('logo_name') is-invalid @enderror" + name="logo_name" value="{{@old('logo_name')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col-5"> + + <div class="row"> + <div class="col px-1"> + <input id="setup_number" type="text" + class="form-control form-control-sm @error('setup_number') is-invalid @enderror" + name="setup_number" value="{{@old('setup_number')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col px-1"> + <input id="service_width" type="text" + class="form-control form-control-sm @error('service_width') is-invalid @enderror" + name="service_width" value="{{@old('service_width')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col px-1"> + <input id="service_height" type="text" + class="form-control form-control-sm @error('service_height') is-invalid @enderror" + name="service_height" value="{{@old('service_height')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col px-1"> + <input id="service_setup_unit" type="text" + class="form-control form-control-sm @error('service_setup_unit') is-invalid @enderror" + name="service_setup_unit" + value="{{@old('service_setup_unit')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col px-1"> + <input id="service_setup_price" type="text" + class="form-control form-control-sm @error('service_setup_price') is-invalid @enderror" + name="service_setup_price" + value="{{@old('service_setup_price')}}" + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + <div class="col px-1"> + <input id="service_total" type="text" + class="form-control form-control-sm @error('service_total') is-invalid @enderror" + name="service_total" value="{{@old('service_total')}}" readonly> + </div> + <div class="col px-1 text-end" style="width: 40px;"> + @if($key > 0) + <button class="btn btn-sm" wire:click="removeServiceInput({{$key}})"> + <x-bi-trash3/> + </button> + @endif + </div> + </div> + </div> + </div> + <div class="row mx-0 px-0"> + <div class="col-1" style="width: 40px;"></div> + <div class="col-1 px-1"> + <input id="service_file_name" type="text" + class="form-control form-control-sm @error('service_file_name') is-invalid @enderror" + name="service_file_name" value="{{@old('service_file_name')}}" + placeholder=A1234 + wire:change="determineAddServiceProductRow({{$loop->index}})"> + </div> + + <div class="col-9 px-1"> + <textarea name="contents" id="contents" style="resize: none" rows="2" + class="form-control form-control-sm" + autocomplete="contents" placeholder="Thread colors" + wire:change="determineAddServiceProductRow({{$loop->index}})" + required>{{ old('contents') }}</textarea> + </div> + </div> + </div> + </div> + </div> + @endforeach + </div> + +</div> diff --git a/resources/views/livewire/orders-table.blade.php b/resources/views/livewire/orders-table.blade.php new file mode 100644 index 0000000..93bb7c4 --- /dev/null +++ b/resources/views/livewire/orders-table.blade.php @@ -0,0 +1,111 @@ +<div> + + <div class="row justify-content-center mb-3"> + <div class="col-9"> + <div class="d-flex flex-row gap-2"> + <div class="d-inline-flex"> + <h4 class="my-auto">{{$this->title}}</h4> + </div> + <div class="mx-auto"></div> + <a href="{{route('orders.create')}}" + class="btn btn-sm btn-primary" title="Create new order..."> + <x-bi-plus-circle-fill/> + Create entry + </a> + <div class="vr"></div> + + <div class="d-inline-flex"> + <select name="" id="" class="form-select form-select-sm"> + <option value="">Sort by...</option> + <option value="">Customer</option> + <option value="">Internal PO</option> + <option value="">Customer PO</option> + <option value="">Order Date</option> + <option value="">Due Date</option> + <option value="">Status</option> + <option value="">Rush</option> + </select> + </div> + + <div class="d-inline-flex"> + <div class="btn-group" role="group"> + <button class="btn btn-sm btn-secondary">Asc</button> + <button class="btn btn-sm btn-outline-secondary">Desc</button> + </div> + </div> + + <div class="vr"></div> + + <div class="d-inline-flex gap-2"> + <input wire:model.live.debounce.50ms="search" type="text" class="form-control form-control-sm" + placeholder="Search..." + name="" id="searchText"> + <button class="btn btn-sm btn-outline-primary" id="searchButton"> + <x-bi-search/> + </button> + </div> + </div> + </div> + </div> + + <div class="row justify-content-center"> + <div class="col-9"> + <table class="table table-striped table-sm table-hover"> + <thead> + <tr class="border-bottom border-black"> + {{-- @if($this->showCustomerColumn)--}} + <th scope="col">Customer</th> + {{-- @endif()--}} + <th scope="col">Internal PO</th> + <th scope="col">Customer PO</th> + <th scope="col">Order Date</th> + <th scope="col">Due Date</th> + <th scope="col">Status</th> + <th scope="col">Rush</th> + <th scope="col">View</th> + </tr> + </thead> + <tbody> + @foreach($orders as $order) + <tr class="@if($today > $order->due_date && $order->active()) table-danger @elseif($order->rush && $order->active()) table-warning @endif"> + <td><a class="text-reset text-decoration-none" + href="{{route('customers.show', [$order->customer, 'details'])}}">{{$order->customer->company_name}}</a> + </td> + <td class="fw-bold"><code>{{$order->internal_po}}</code></td> + <td class=""><code>{{$order->customer_po}}</code></td> + <td class="text-nowrap">{{$order->order_date}}</td> + + <td class="text-nowrap "> + {{$order->due_date}} + @if($order->due_date < $today && $order->active()) + <x-bi-exclamation-triangle/> + @endif </td> + + <td>{{$order->status->value}}</td> + <td> + @if($order->rush) + <x-bi-check-lg class="text-danger"></x-bi-check-lg> + @endif + </td> + <td class="align-top"> + <a class="btn btn-sm btn-outline-secondary px-1 py-0 m-0" + href=""> + <x-bi-arrow-right/> + </a> + </td> + </tr> + @endforeach + </tbody> + </table> + </div> + </div> + + <div class="row"> + <div class="col"></div> + <div class="col-9"> + {{$orders->links()}} + </div> + <div class="col"></div> + </div> + +</div> diff --git a/resources/views/management/index.blade.php b/resources/views/management/index.blade.php new file mode 100644 index 0000000..7e0a606 --- /dev/null +++ b/resources/views/management/index.blade.php @@ -0,0 +1,27 @@ +@extends('layouts.app') + +@section('header') + @include('partials.management.index.management-tabs') + +@endsection() + +@section('content') + <div class="container"> + <div class="tab-content"> + + @include('partials.management.index.customers') + + @include('partials.management.index.packing-slips') + + @include('partials.management.index.service-files') + + </div> + </div> + + <!-- Create Customer Modal --> + @include('partials.customers.index.create-modal') + + <!-- Delete Customer Modal --> + @include('partials.customers.index.delete-all-modal') + +@endsection diff --git a/resources/views/order-products/create.blade.php b/resources/views/order-products/create.blade.php new file mode 100644 index 0000000..a76e9ad --- /dev/null +++ b/resources/views/order-products/create.blade.php @@ -0,0 +1,39 @@ +@extends('layouts.app') + + +@section('header') + <div class="container-fluid bg-light pt-3"> + + <!-- name row --> + <div class="row justify-content-center pb-2"> + </div> + + <!-- Tabs row --> + <div class="row justify-content-center mb-3"> + <div class="col-3 border-bottom"></div> + <div class="col-6 p-0"> + <ul class="nav nav-fill nav-tabs" id="management-tabs" role="tablist"> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark active" id="order-tab" + href="#" type="button" role="tab" aria-controls="order" aria-selected="true"> + <x-bi-box/> + Add Products To Order + </a> + </li> + </ul> + </div> + <div class="col border-bottom"></div> + </div> + </div> +@endsection + +@section('content') + <div class="container"> + <div class="row justify-content-center"> + <div class="col-10 pt-3"> + <livewire:order-products-create/> + </div> + </div> + </div> + +@endsection diff --git a/resources/views/orders/create.blade.php b/resources/views/orders/create.blade.php index 5c1db42..247dfb1 100644 --- a/resources/views/orders/create.blade.php +++ b/resources/views/orders/create.blade.php @@ -1,130 +1,222 @@ @extends('layouts.app') -@section('content') - <div class="container"> - <div class="row justify-content-center"> - <div class="col-8 pt-4"> - <h4>Create Order</h4> - <div class="row mb-3"> - <label for="customer_id" class="col-md-4 col-form-label text-md-end">Customer</label> - <div class="col-md-6"> - <select name="customer_id" class="form-select" id="customer_id" autofocus> - @foreach($customers as $customer) - <option value="{{$customer->id}}">{{$customer->company_name}}</option> - @endforeach() - </select> - </div> - </div> +@section('header') + <div class="container-fluid bg-light pt-3"> - <div class="row mb-3"> - <label for="order_type" class="col-md-4 col-form-label text-md-end">Order Type</label> - <div class="col-md-6"> - <select name="order_type" class="form-select" id="order_type" autofocus> - @foreach($order_types as $case) - <option value="{{$case->name}}">{{$case->value}}</option> - @endforeach() - </select> - </div> - </div> - - <div class="row mb-3"> - <label for="order_status" class="col-md-4 col-form-label text-md-end">Order Status</label> - <div class="col-md-6"> - <select name="order_status" class="form-select" id="order_status" autofocus> - @foreach($order_status as $case) - <option value="{{$case->name}}">{{$case->value}}</option> - @endforeach() - </select> - </div> - </div> - - <hr class="border-secondary-subtle mx-4 px-0"> - - <div class="row mb-3"> - <label class="col-md-4 col-form-label text-md-end">Attributes</label> - <div class="col-md-3"> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="new_art"> - <label class="form-check-label" for="new_art">New art</label> - </div> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="rush"> - <label class="form-check-label" for="rush">Rush</label> - </div> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="digitizing"> - <label class="form-check-label" for="digitizing">Digitizing</label> - </div> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="supplied_file"> - <label class="form-check-label" for="supplied_file">Customer Supplied File</label> - </div> - </div> - <div class="col-md-3"> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="repeat"> - <label class="form-check-label" for="repeat">Repeat</label> - </div> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="event"> - <label class="form-check-label" for="event">Event</label> - </div> - <div class="form-check "> - <input class="form-check-input" type="checkbox" value="" id="purchased_garments"> - <label class="form-check-label" for="purchased_garments">Purchased garments</label> - </div> - </div> - </div> - - <hr class="border-secondary-subtle mx-4 px-0"> - - <div class="row mb-3"> - <label for="order_date" class="col-md-4 col-form-label text-md-end">Order date</label> - - <div class="col-md-6"> - <input id="order_date" type="date" - class="form-control @error('order_date') is-invalid @enderror" - name="order_date" value="{{ old('order_date') ?? $today }}" required - autocomplete="order_date"> - - @error('order_date') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - - <div class="row mb-3"> - <label for="due_date" class="col-md-4 col-form-label text-md-end">Due date</label> - - <div class="col-md-6"> - <input id="due_date" type="date" - class="form-control @error('due_date') is-invalid @enderror" - name="due_date" value="{{ old('due_date') ?? $due_default }}" required - autocomplete="due_date"> - - @error('due_date') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - - <hr class="border-secondary-subtle mx-4 px-0"> - - <div class="row mb-3"> - <label for="contact_id" class="col-md-4 col-form-label text-md-end">Contact</label> - <div class="col-md-6"> - <select name="contact_id" class="form-select" id="contact_id" autofocus> - <option value=""></option> - </select> - </div> - </div> + <!-- name row --> + <div class="row justify-content-center pb-2"> + </div> + <!-- Tabs row --> + <div class="row justify-content-center mb-2"> + <div class="col-3 border-bottom"></div> + <div class="col-6 p-0"> + <ul class="nav nav-fill nav-tabs" id="management-tabs" role="tablist"> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark active" id="order-tab" + href="#" type="button" role="tab" + aria-controls="order" aria-selected="true"> + <x-bi-box/> + Create Order + </a> + </li> + </ul> </div> + <div class="col border-bottom"></div> </div> </div> @endsection + +@section('content') + <div class="container-fluid mt-3" style="max-width: 1800px"> + + <form action="{{route('orders.store') }}" method="post"> + @csrf + + <div class="row justify-content-center"> + <div class="col-11 col-xl-5 border-end" style="height: 730px"> +{{-- <div class="row mb-3 mt-2">--}} +{{-- <div class="col-4">--}} +{{-- </div>--}} +{{-- <div class="col-6">--}} +{{-- <h5>Order Details</h5>--}} +{{-- </div>--}} +{{-- </div>--}} + + <livewire:customer-and-contact-select :customers="$customers"/> + + <hr class="border-secondary-subtle px-0"> + + <div class="row mb-2"> + <label for="order_type" class="col-md-4 col-form-label text-md-end">Order Type</label> + <div class="col-md-6"> + <select name="order_type" class="form-select form-select-sm" id="order_type"> + @foreach($order_types as $case) + <option value="{{$case->name}}">{{$case->value}}</option> + @endforeach() + </select> + + @error('order_type') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + <div class="row mb-2"> + <label for="order_status" class="col-md-4 col-form-label text-md-end">Order + Status</label> + <div class="col-md-6"> + <select name="status" class="form-select form-select-sm" id="order_status"> + @foreach($order_status as $case) + <option value="{{$case->value}}" {{ $case->name === 'APPROVED' ? 'selected' : '' }}> + {{$case->value}} + </option> + @endforeach() + </select> + + @error('status') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + <hr class="border-secondary-subtle px-0"> + + <div class="row mb-2"> + <label class="col-md-4 col-form-label text-md-end">Customer PO</label> + <div class="col-md-6"> + <input id="customer_po" type="text" + class="form-control form-control-sm @error('customer_po') is-invalid @enderror" + name="customer_po" value="{{@old('customer_po')}}" required> + + @error('customer_po') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + <hr class="border-secondary-subtle px-0"> + + <div class="row mb-2"> + <label class="col-md-4 col-form-label text-md-end">Attributes</label> + <div class="col-md-3"> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="new_art" name="new_art" + value="1"> + <label class="form-check-label" for="new_art">New art</label> + </div> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="rush" name="rush" value="1"> + <label class="form-check-label" for="rush">Rush</label> + </div> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="digitizing" + name="digitizing" value="1"> + <label class="form-check-label" for="digitizing">Digitizing</label> + </div> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="supplied_file" + name="customer_supplied_file" value="1"> + <label class="form-check-label" for="supplied_file">Customer Supplied + File</label> + </div> + </div> + <div class="col-md-3"> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="repeat" name="repeat" + value="1"> + <label class="form-check-label" for="repeat">Repeat</label> + </div> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="event" name="event" + value="1"> + <label class="form-check-label" for="event">Event</label> + </div> + <div class="form-check "> + <input class="form-check-input" type="checkbox" id="purchased_garments" + value="1" + name="purchased_garment"> + <label class="form-check-label" for="purchased_garments">Purchased + garments</label> + </div> + </div> + </div> + + <hr class="border-secondary-subtle px-0"> + + <div class="row mb-2"> + <label for="order_date" class="col-md-4 col-form-label text-md-end">Order date</label> + + <div class="col-md-6"> + <input id="order_date" type="date" + class="form-control form-control-sm @error('order_date') is-invalid @enderror" + name="order_date" value="{{ old('order_date') ?? $today }}" required + autocomplete="order_date"> + + @error('order_date') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + <div class="row mb-2"> + <label for="due_date" class="col-md-4 col-form-label text-md-end">Due date</label> + + <div class="col-md-6"> + <input id="due_date" type="date" + class="form-control form-control-sm @error('due_date') is-invalid @enderror" + name="due_date" value="{{ old('due_date') ?? $due_default }}" required + autocomplete="due_date"> + + @error('due_date') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + + <hr class="border-secondary-subtle px-0"> + + <div class="row mb-2"> + <label for="notes" class="col-md-4 col-form-label text-md-end">Notes</label> + + <div class="col-md-6"> + <textarea name="notes" id="notes" cols="30" rows="4" class="form-control form-control-sm" + autocomplete="notes">{{ old('notes') }}</textarea> + + @error('notes') + <span class="invalid-feedback" role="alert"> + <strong>{{ $message }}</strong> + </span> + @enderror + </div> + </div> + </div> + + <div class="col-11 col-xl-7"> + <livewire:order-products-create/> + </div> + + <hr class="border-secondary-subtle px-0"> + + <div class="row"> + <div class="col text-end"> + <button type="submit" class="btn btn-primary"> + Save Order + </button> + </div> + </div> + </div> + </form> + </div> +@endsection diff --git a/resources/views/orders/index.blade.php b/resources/views/orders/index.blade.php new file mode 100644 index 0000000..625655d --- /dev/null +++ b/resources/views/orders/index.blade.php @@ -0,0 +1,91 @@ +@extends('layouts.app') + +@section('header') + <div class="container-fluid bg-light pt-3"> + + <!-- Customer company name row --> + <div class="row justify-content-center pb-2"> + <div class="col-3"></div> + <div class="col"> + {{-- <h2>Overview</h2>--}} + </div> + </div> + + <!-- Tabs row --> + <div class="row justify-content-center mb-3"> + <div class="col-3 border-bottom"></div> + <div class="col-6 p-0"> + + <ul class="nav nav-fill nav-tabs" id="home-tabs" role="tablist"> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'all' ? 'active' : ''}}" id="all-tab" + href="{{route('orders.index', ['tab' => 'all'])}}" type="button" role="tab" + aria-controls="all" aria-selected="{{$tab == 'all' ? 'true' : 'false'}}"> + <x-bi-journals/> + All Orders + </a> + </li> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'active_orders' ? 'active' : ''}}" id="active-orders-tab" + href="{{route('orders.index', ['tab' => 'active_orders'])}}" type="button" role="tab" + aria-controls="active_orders" + aria-selected="{{$tab == 'active_orders' ? 'true' : 'false'}}"> + <x-bi-arrow-clockwise/> + Active Orders + </a> + </li> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'finished_orders' ? 'active' : ''}}" + id="finished-orders-tab" + href="{{route('orders.index', ['tab' => 'finished_orders'])}}" type="button" role="tab" + aria-controls="finished_orders" + aria-selected="{{$tab == 'finished_orders' ? 'true' : 'false'}}"> + <x-bi-check-all/> + Finished Orders + </a> + </li> + + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-tab" + href="{{route('orders.index', ['tab' => 'invoice'])}}" type="button" role="tab" + aria-controls="invoice" aria-selected="{{$tab == 'invoice' ? 'true' : 'false'}}"> + <x-bi-envelope/> + Invoiced Orders + </a> + </li> + </ul> + </div> + <div class="col border-bottom"></div> + </div> + </div> +@endsection + +@section('content') + <div class="container"> + <div class="row justify-content-center my-3"> + <div class="tab-content"> + + <div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel" + aria-labelledby="active-orders-tab"> + <livewire:orders-table order-type="active" :show-customer-column='true' :title="'Active Orders'"/> + </div> + + <div class="tab-pane {{$tab == 'finished_orders' ? 'active' : ''}}" id="finished-orders" role="tabpanel" + aria-labelledby="finished-orders-tab"> + <livewire:orders-table order-type="finished" :show-customer-column='true' title="Finished Orders"/> + </div> + + <div class="tab-pane {{$tab == 'all' ? 'active' : ''}}" id="all-orders" role="tabpanel" + aria-labelledby="all-orders-tab"> + <livewire:orders-table order-type="all" :show-customer-column='true' title="All Orders"/> + </div> + + <div class="tab-pane {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-orders" role="tabpanel" + aria-labelledby="invoice-orders-tab"> + <livewire:orders-table order-type="invoiced" :show-customer-column='true' title="Invoiced Orders"/> + </div> + + </div> + </div> + </div> +@endsection diff --git a/resources/views/orders/show.blade.php b/resources/views/orders/show.blade.php new file mode 100644 index 0000000..964d174 --- /dev/null +++ b/resources/views/orders/show.blade.php @@ -0,0 +1,71 @@ +@extends('layouts.app') + +@section('header') + <div class="container-fluid bg-light pt-3"> + + <!-- Customer company name row --> + <div class="row justify-content-center pb-2"> + <div class="col-3"></div> + <div class="col"> + {{-- <h2>Overview</h2>--}} + </div> + </div> + + <!-- Tabs row --> + <div class="row justify-content-center mb-3"> + <div class="col-3 border-bottom"></div> + <div class="col-6 p-0"> + + <ul class="nav nav-fill nav-tabs" id="home-tabs" role="tablist"> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'details' ? 'active' : ''}}" id="details-tab" + href="{{route('orders.index', ['tab' => 'details'])}}" type="button" role="tab" + aria-controls="details" aria-selected="{{$tab == 'details' ? 'true' : 'false'}}"> + <x-bi-list-ul/> + Order Details + </a> + </li> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'timeline' ? 'active' : ''}}" id="timeline-tab" + href="{{route('orders.index', ['tab' => 'timeline'])}}" type="button" role="tab" + aria-controls="timeline" aria-selected="{{$tab == 'timeline' ? 'true' : 'false'}}"> + <x-bi-calendar-range/> + Timeline + </a> + </li> + </ul> + </div> + <div class="col border-bottom"></div> + </div> + </div> +@endsection + +@section('content') + <div class="container"> + <div class="row justify-content-center my-3"> + <div class="tab-content"> + + <div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel" + aria-labelledby="active-orders-tab"> + <livewire:orders-table order-type="active" :show-customer-column='true' :title="'Active Orders'"/> + </div> + + <div class="tab-pane {{$tab == 'finished_orders' ? 'active' : ''}}" id="finished-orders" role="tabpanel" + aria-labelledby="finished-orders-tab"> + <livewire:orders-table order-type="finished" :show-customer-column='true' title="Finished Orders"/> + </div> + + <div class="tab-pane {{$tab == 'all' ? 'active' : ''}}" id="all-orders" role="tabpanel" + aria-labelledby="all-orders-tab"> + <livewire:orders-table order-type="all" :show-customer-column='true' title="All Orders"/> + </div> + + <div class="tab-pane {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-orders" role="tabpanel" + aria-labelledby="invoice-orders-tab"> + <livewire:orders-table order-type="invoiced" :show-customer-column='true' title="Invoiced Orders"/> + </div> + + </div> + </div> + </div> +@endsection diff --git a/resources/views/partials/customers/edit-modal.blade.php b/resources/views/partials/customers/edit-modal.blade.php deleted file mode 100644 index 60a9a00..0000000 --- a/resources/views/partials/customers/edit-modal.blade.php +++ /dev/null @@ -1,110 +0,0 @@ -<div class="modal modal-lg fade" id="editCustomerModal" tabindex="-1" aria-labelledby="editCustomerModalLabel" - aria-hidden="true"> - <div class="modal-dialog"> - <div class="modal-content"> - <div class="modal-header"> - <h1 class="modal-title fs-5" id="editCustomerModalLabel">Edit Customer</h1> - <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> - </div> - - <form action="{{route('customers.update', $customer)}}" method="post"> - @csrf - @method('PATCH') - - <div class="modal-body"> - - <div class="row mb-3"> - <label for="company_name" class="col-md-4 col-form-label text-md-end">Company Name</label> - - <div class="col-md-6"> - <input id="company_name" type="text" - class="form-control @error('company_name') is-invalid @enderror" - name="company_name" value="{{$customer->company_name}}" required - autocomplete="company_name" autofocus> - - @error('company_name') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - - <div class="row mb-3"> - <label for="internal_name" class="col-md-4 col-form-label text-md-end">Internal Name</label> - - <div class="col-md-6"> - <input id="internal_name" type="text" - class="form-control @error('internal_name') is-invalid @enderror" - name="internal_name" value="{{ $customer->internal_name }}" required - autocomplete="internal_name" - > - - @error('internal_name') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - - <div class="row mb-3"> - <label for="shipping_address" class="col-md-4 col-form-label text-md-end"> - Shipping Address - </label> - - <div class="col-md-6"> - <input id="shipping_address" type="text" - class="form-control @error('shipping_address') is-invalid @enderror" - name="shipping_address" value="{{ $customer->shipping_address }}" required - autocomplete="shipping_address"> - - @error('shipping_address') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - - <div class="row mb-3"> - <label for="billing_address" class="col-md-4 col-form-label text-md-end">Billing Address</label> - - <div class="col-md-6"> - <input id="billing_address" type="text" - class="form-control @error('billing_address') is-invalid @enderror" - name="billing_address" value="{{ $customer->billing_address }}" required - autocomplete="billing_address" > - - @error('billing_address') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - - <div class="row mb-3"> - <label for="phone" class="col-md-4 col-form-label text-md-end">Phone number</label> - - <div class="col-md-6"> - <input id="phone" type="text" class="form-control @error('phone') is-invalid @enderror" - name="phone" value="{{ $customer->phone }}" required autocomplete="phone"> - - @error('phone') - <span class="invalid-feedback" role="alert"> - <strong>{{ $message }}</strong> - </span> - @enderror - </div> - </div> - </div> - - <div class="modal-footer"> - <button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">Cancel</button> - <button type="submit" class="btn btn-primary">Edit customer</button> - </div> - </form> - </div> - </div> -</div> diff --git a/resources/views/partials/customers/create-modal.blade.php b/resources/views/partials/customers/index/create-modal.blade.php similarity index 100% rename from resources/views/partials/customers/create-modal.blade.php rename to resources/views/partials/customers/index/create-modal.blade.php diff --git a/resources/views/partials/customers/delete-all-modal.blade.php b/resources/views/partials/customers/index/delete-all-modal.blade.php similarity index 100% rename from resources/views/partials/customers/delete-all-modal.blade.php rename to resources/views/partials/customers/index/delete-all-modal.blade.php diff --git a/resources/views/partials/customers/show-contacts.blade.php b/resources/views/partials/customers/show/contacts-tab.blade.php similarity index 83% rename from resources/views/partials/customers/show-contacts.blade.php rename to resources/views/partials/customers/show/contacts-tab.blade.php index 60e0ea9..14ab6bb 100644 --- a/resources/views/partials/customers/show-contacts.blade.php +++ b/resources/views/partials/customers/show/contacts-tab.blade.php @@ -36,10 +36,10 @@ @foreach ($contacts as $contact) <tr> - <td>{{ $contact->first_name . ' ' . $contact->last_name }}</td> - <td><a href="mailto:{{$contact->email}}">{{ $contact->email }}</a></td> - <td>{{ $contact->phone }}</td> - <td>{{ $contact->notes }}</td> + <td class="text-nowrap">{{ $contact->first_name . ' ' . $contact->last_name }}</td> + <td class="text-nowrap"><a href="mailto:{{$contact->email}}">{{ $contact->email }}</a></td> + <td class="text-nowrap">{{ $contact->phone }}</td> + <td class="w-100">{{ $contact->notes }}</td> </tr> @endforeach </tbody> diff --git a/resources/views/partials/customers/show-overview.blade.php b/resources/views/partials/customers/show/overview-tab.blade.php similarity index 88% rename from resources/views/partials/customers/show-overview.blade.php rename to resources/views/partials/customers/show/overview-tab.blade.php index ab9d2aa..eb4dac2 100644 --- a/resources/views/partials/customers/show-overview.blade.php +++ b/resources/views/partials/customers/show/overview-tab.blade.php @@ -8,11 +8,11 @@ <h4 class="my-auto">Active orders</h4> </div> <div class="mx-auto"></div> - <button class="btn btn-sm btn-primary" title="Create new shipping entry..." - data-bs-toggle="modal" data-bs-target="#createShippingEntryModal"> + <a href="{{route('orders.create')}}" + class="btn btn-sm btn-primary" title="Create new order..." <x-bi-plus-circle-fill/> Create entry - </button> + </a> <div class="vr"></div> <div class="d-inline-flex gap-2"> @@ -41,12 +41,12 @@ </thead> <tbody> @foreach($active_orders as $order) - <tr> + <tr class="@if($today > $order->due_date) table-danger @elseif($order->rush) table-warning @endif"> <td class="fw-bold"><code>{{$order->internal_po}}</code></td> <td class=""><code>{{$order->customer_po}}</code></td> <td class="text-nowrap">{{$order->order_date}}</td> <td class="text-nowrap">{{$order->due_date}}</td> - <td>{{$order->status->value}}</td> + <td class="w-25">{{$order->status->value}}</td> <td> @if($order->rush) <x-bi-check-lg class="text-danger"></x-bi-check-lg> diff --git a/resources/views/partials/customers/show-packing-slips.blade.php b/resources/views/partials/customers/show/packing-slips-tab.blade.php similarity index 86% rename from resources/views/partials/customers/show-packing-slips.blade.php rename to resources/views/partials/customers/show/packing-slips-tab.blade.php index 396876c..4ea63a4 100644 --- a/resources/views/partials/customers/show-packing-slips.blade.php +++ b/resources/views/partials/customers/show/packing-slips-tab.blade.php @@ -31,7 +31,7 @@ </div> <div class="row justify-content-center mb-3"> - <div class="col-9"> + <div class="col-7"> <table class="table table-striped table-sm table-hover"> <thead> <tr class="border-bottom border-black"> @@ -44,10 +44,10 @@ <tbody> @foreach($packingSlips as $packingSlip) <tr> - <td>{{$packingSlip->date_received}}</td> - <td><a href="">{{$packingSlip->order_id}}</a></td> - <td>{{$packingSlip->amount}}</td> - <td>{{$packingSlip->contents}}</td> + <td class="text-nowrap">{{$packingSlip->date_received}}</td> + <td class="text-nowrap"><a href="">{{$packingSlip->order_id}}</a></td> + <td class="text-nowrap">{{$packingSlip->amount}}</td> + <td class="w-50">{{$packingSlip->contents}}</td> </tr> @endforeach </tbody> diff --git a/resources/views/partials/customers/show-shipping-info.blade.php b/resources/views/partials/customers/show/shipping-info-tab.blade.php similarity index 100% rename from resources/views/partials/customers/show-shipping-info.blade.php rename to resources/views/partials/customers/show/shipping-info-tab.blade.php diff --git a/resources/views/partials/management/index/customers.blade.php b/resources/views/partials/management/index/customers.blade.php new file mode 100644 index 0000000..bfb7b13 --- /dev/null +++ b/resources/views/partials/management/index/customers.blade.php @@ -0,0 +1,76 @@ +<div class="tab-pane {{$tab == 'customers' ? 'active' : ''}}" id="customers" role="tabpanel" + aria-labelledby="customers-tab"> + <div class="row justify-content-center mb-3"> + <div class="col"> + <div class="d-flex flex-row gap-2"> + <button class="btn btn-primary" title="Create new customer..." + data-bs-toggle="modal" + data-bs-target="#createCustomerModal"> + <x-bi-person-plus-fill/> + Create entry + </button> + + <div class="vr"></div> + + <div class="d-inline-flex gap-2"> + <input type="text" class="form-control" placeholder="Search..." + name="" id=""> + <button class="btn btn-outline-primary"> + <x-bi-search/> + </button> + </div> + + <div class="mx-auto"></div> + + <button class="btn btn-danger" title="Delete customer..." + data-bs-toggle="modal" + data-bs-target="#deleteCustomerModal"> + <x-bi-trash-fill/> + Delete entry + </button> + </div> + </div> + </div> + + <div class="row mb-3"> + <div class="col"> + @if(sizeof($customers) !== 0) + <table class="table table-striped table-hover"> + <thead> + <tr class="border-bottom border-black"> + <th scope="col">Company Name</th> + <th scope="col">Internal Name</th> + <th scope="col">Shipping Address</th> + <th scope="col">Billing Address</th> + <th scope="col">Phone</th> + <th scope="col">View</th> + </tr> + </thead> + + <tbody> + + @foreach($customers as $customer) + <tr> + <td> {{$customer->company_name}} </td> + <td><code>{{$customer->internal_name}}</code></td> + <td> {{$customer->shipping_address}} </td> + <td> {{$customer->billing_address}} </td> + <td class="text-nowrap"> {{$customer->phone}} </td> + <td class="align-top"> + <a class="btn btn-sm btn-outline-secondary" + href="{{route('customers.show', [$customer->id, 'tab'=>'details'])}}"> + <x-bi-arrow-right/> + </a> + </td> + </tr> + @endforeach + + </tbody> + </table> + + @else() + No customer data. + @endif + </div> + </div> +</div> \ No newline at end of file diff --git a/resources/views/partials/management/index/management-tabs.blade.php b/resources/views/partials/management/index/management-tabs.blade.php new file mode 100644 index 0000000..82d87a7 --- /dev/null +++ b/resources/views/partials/management/index/management-tabs.blade.php @@ -0,0 +1,43 @@ +<div class="container-fluid bg-light pt-3"> + + <!-- Customer company name row --> + <div class="row justify-content-center pb-2"> + <div class="col-3"></div> + <div class="col"> + </div> + </div> + + <!-- Tabs row --> + <div class="row justify-content-center mb-3"> + <div class="col-3 border-bottom"></div> + <div class="col-6 p-0"> + <ul class="nav nav-fill nav-tabs" id="management-tabs" role="tablist"> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'customers' ? 'active' : ''}}" id="customers-tab" + href="{{route('management.index', 'customers')}}" type="button" role="tab" + aria-controls="customers" aria-selected="{{$tab == 'customers' ? 'true' : 'false'}}"> + <x-bi-list-ul/> + Customers + </a> + </li> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'packing' ? 'active' : ''}}" id="packing-tab" + href="{{route('management.index', 'packing')}}" type="button" role="tab" + aria-controls="packing" aria-selected="{{$tab == 'packing' ? 'true' : 'false'}}"> + <x-bi-card-text/> + Packing Slips + </a> + </li> + <li class="nav-item" role="presentation"> + <a class="nav-link link-dark {{$tab == 'files' ? 'active' : ''}}" id="files-tab" + href="{{route('management.index', 'files')}}" type="button" role="tab" + aria-controls="files" aria-selected="{{$tab == 'files' ? 'true' : 'false'}}"> + <x-bi-file-earmark/> + Service Files + </a> + </li> + </ul> + </div> + <div class="col border-bottom"></div> + </div> +</div> diff --git a/resources/views/partials/management/index/packing-slips.blade.php b/resources/views/partials/management/index/packing-slips.blade.php new file mode 100644 index 0000000..a249f32 --- /dev/null +++ b/resources/views/partials/management/index/packing-slips.blade.php @@ -0,0 +1,5 @@ +<div class="tab-pane {{$tab == 'packing' ? 'active' : ''}}" id="packing" role="tabpanel" + aria-labelledby="packing-tab"> + + packing slips +</div> \ No newline at end of file diff --git a/resources/views/partials/management/index/service-files.blade.php b/resources/views/partials/management/index/service-files.blade.php new file mode 100644 index 0000000..c5da197 --- /dev/null +++ b/resources/views/partials/management/index/service-files.blade.php @@ -0,0 +1,5 @@ +<div class="tab-pane {{$tab == 'files' ? 'active' : ''}}" id="files" role="tabpanel" + aria-labelledby="files-tab"> + + Files +</div> diff --git a/resources/views/vendor/pagination/bootstrap-4.blade.php b/resources/views/vendor/pagination/bootstrap-4.blade.php deleted file mode 100644 index 63c6f56..0000000 --- a/resources/views/vendor/pagination/bootstrap-4.blade.php +++ /dev/null @@ -1,46 +0,0 @@ -@if ($paginator->hasPages()) - <nav> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> - <span class="page-link" aria-hidden="true">‹</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a> - </li> - @endif - - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) - <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li> - @endif - - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) - <li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li> - @else - <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li> - @endif - @endforeach - @endif - @endforeach - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> - <span class="page-link" aria-hidden="true">›</span> - </li> - @endif - </ul> - </nav> -@endif diff --git a/resources/views/vendor/pagination/bootstrap-5.blade.php b/resources/views/vendor/pagination/bootstrap-5.blade.php deleted file mode 100644 index a1795a4..0000000 --- a/resources/views/vendor/pagination/bootstrap-5.blade.php +++ /dev/null @@ -1,88 +0,0 @@ -@if ($paginator->hasPages()) - <nav class="d-flex justify-items-center justify-content-between"> - <div class="d-flex justify-content-between flex-fill d-sm-none"> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">@lang('pagination.previous')</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a> - </li> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">@lang('pagination.next')</span> - </li> - @endif - </ul> - </div> - - <div class="d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between"> - <div> - <p class="small text-muted"> - {!! __('Showing') !!} - <span class="fw-semibold">{{ $paginator->firstItem() }}</span> - {!! __('to') !!} - <span class="fw-semibold">{{ $paginator->lastItem() }}</span> - {!! __('of') !!} - <span class="fw-semibold">{{ $paginator->total() }}</span> - {!! __('results') !!} - </p> - </div> - - <div> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> - <span class="page-link" aria-hidden="true">‹</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a> - </li> - @endif - - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) - <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li> - @endif - - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) - <li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li> - @else - <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li> - @endif - @endforeach - @endif - @endforeach - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> - <span class="page-link" aria-hidden="true">›</span> - </li> - @endif - </ul> - </div> - </div> - </nav> -@endif diff --git a/resources/views/vendor/pagination/default.blade.php b/resources/views/vendor/pagination/default.blade.php deleted file mode 100644 index 0db70b5..0000000 --- a/resources/views/vendor/pagination/default.blade.php +++ /dev/null @@ -1,46 +0,0 @@ -@if ($paginator->hasPages()) - <nav> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> - <span aria-hidden="true">‹</span> - </li> - @else - <li> - <a href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a> - </li> - @endif - - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) - <li class="disabled" aria-disabled="true"><span>{{ $element }}</span></li> - @endif - - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) - <li class="active" aria-current="page"><span>{{ $page }}</span></li> - @else - <li><a href="{{ $url }}">{{ $page }}</a></li> - @endif - @endforeach - @endif - @endforeach - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li> - <a href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a> - </li> - @else - <li class="disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> - <span aria-hidden="true">›</span> - </li> - @endif - </ul> - </nav> -@endif diff --git a/resources/views/vendor/pagination/semantic-ui.blade.php b/resources/views/vendor/pagination/semantic-ui.blade.php deleted file mode 100644 index ef0dbb1..0000000 --- a/resources/views/vendor/pagination/semantic-ui.blade.php +++ /dev/null @@ -1,36 +0,0 @@ -@if ($paginator->hasPages()) - <div class="ui pagination menu" role="navigation"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a> - @else - <a class="icon item" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')"> <i class="left chevron icon"></i> </a> - @endif - - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) - <a class="icon item disabled" aria-disabled="true">{{ $element }}</a> - @endif - - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) - <a class="item active" href="{{ $url }}" aria-current="page">{{ $page }}</a> - @else - <a class="item" href="{{ $url }}">{{ $page }}</a> - @endif - @endforeach - @endif - @endforeach - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <a class="icon item" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a> - @else - <a class="icon item disabled" aria-disabled="true" aria-label="@lang('pagination.next')"> <i class="right chevron icon"></i> </a> - @endif - </div> -@endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php b/resources/views/vendor/pagination/simple-bootstrap-4.blade.php deleted file mode 100644 index 4bb4917..0000000 --- a/resources/views/vendor/pagination/simple-bootstrap-4.blade.php +++ /dev/null @@ -1,27 +0,0 @@ -@if ($paginator->hasPages()) - <nav> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">@lang('pagination.previous')</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a> - </li> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">@lang('pagination.next')</span> - </li> - @endif - </ul> - </nav> -@endif diff --git a/resources/views/vendor/pagination/simple-bootstrap-5.blade.php b/resources/views/vendor/pagination/simple-bootstrap-5.blade.php deleted file mode 100644 index a89005e..0000000 --- a/resources/views/vendor/pagination/simple-bootstrap-5.blade.php +++ /dev/null @@ -1,29 +0,0 @@ -@if ($paginator->hasPages()) - <nav role="navigation" aria-label="Pagination Navigation"> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">{!! __('pagination.previous') !!}</span> - </li> - @else - <li class="page-item"> - <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev"> - {!! __('pagination.previous') !!} - </a> - </li> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li class="page-item"> - <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">{!! __('pagination.next') !!}</a> - </li> - @else - <li class="page-item disabled" aria-disabled="true"> - <span class="page-link">{!! __('pagination.next') !!}</span> - </li> - @endif - </ul> - </nav> -@endif diff --git a/resources/views/vendor/pagination/simple-default.blade.php b/resources/views/vendor/pagination/simple-default.blade.php deleted file mode 100644 index 36bdbc1..0000000 --- a/resources/views/vendor/pagination/simple-default.blade.php +++ /dev/null @@ -1,19 +0,0 @@ -@if ($paginator->hasPages()) - <nav> - <ul class="pagination"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <li class="disabled" aria-disabled="true"><span>@lang('pagination.previous')</span></li> - @else - <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a></li> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a></li> - @else - <li class="disabled" aria-disabled="true"><span>@lang('pagination.next')</span></li> - @endif - </ul> - </nav> -@endif diff --git a/resources/views/vendor/pagination/simple-tailwind.blade.php b/resources/views/vendor/pagination/simple-tailwind.blade.php deleted file mode 100644 index ea02400..0000000 --- a/resources/views/vendor/pagination/simple-tailwind.blade.php +++ /dev/null @@ -1,25 +0,0 @@ -@if ($paginator->hasPages()) - <nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600"> - {!! __('pagination.previous') !!} - </span> - @else - <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300"> - {!! __('pagination.previous') !!} - </a> - @endif - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300"> - {!! __('pagination.next') !!} - </a> - @else - <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600"> - {!! __('pagination.next') !!} - </span> - @endif - </nav> -@endif diff --git a/resources/views/vendor/pagination/tailwind.blade.php b/resources/views/vendor/pagination/tailwind.blade.php deleted file mode 100644 index aee2ad2..0000000 --- a/resources/views/vendor/pagination/tailwind.blade.php +++ /dev/null @@ -1,106 +0,0 @@ -@if ($paginator->hasPages()) - <nav role="navigation" aria-label="{{ __('Pagination Navigation') }}" class="flex items-center justify-between"> - <div class="flex justify-between flex-1 sm:hidden"> - @if ($paginator->onFirstPage()) - <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600"> - {!! __('pagination.previous') !!} - </span> - @else - <a href="{{ $paginator->previousPageUrl() }}" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300"> - {!! __('pagination.previous') !!} - </a> - @endif - - @if ($paginator->hasMorePages()) - <a href="{{ $paginator->nextPageUrl() }}" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300"> - {!! __('pagination.next') !!} - </a> - @else - <span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:text-gray-600 dark:bg-gray-800 dark:border-gray-600"> - {!! __('pagination.next') !!} - </span> - @endif - </div> - - <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between"> - <div> - <p class="text-sm text-gray-700 leading-5 dark:text-gray-400"> - {!! __('Showing') !!} - @if ($paginator->firstItem()) - <span class="font-medium">{{ $paginator->firstItem() }}</span> - {!! __('to') !!} - <span class="font-medium">{{ $paginator->lastItem() }}</span> - @else - {{ $paginator->count() }} - @endif - {!! __('of') !!} - <span class="font-medium">{{ $paginator->total() }}</span> - {!! __('results') !!} - </p> - </div> - - <div> - <span class="relative z-0 inline-flex rtl:flex-row-reverse shadow-sm rounded-md"> - {{-- Previous Page Link --}} - @if ($paginator->onFirstPage()) - <span aria-disabled="true" aria-label="{{ __('pagination.previous') }}"> - <span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5 dark:bg-gray-800 dark:border-gray-600" aria-hidden="true"> - <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> - <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" /> - </svg> - </span> - </span> - @else - <a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('pagination.previous') }}"> - <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> - <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" /> - </svg> - </a> - @endif - - {{-- Pagination Elements --}} - @foreach ($elements as $element) - {{-- "Three Dots" Separator --}} - @if (is_string($element)) - <span aria-disabled="true"> - <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-800 dark:border-gray-600">{{ $element }}</span> - </span> - @endif - - {{-- Array Of Links --}} - @if (is_array($element)) - @foreach ($element as $page => $url) - @if ($page == $paginator->currentPage()) - <span aria-current="page"> - <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-800 dark:border-gray-600">{{ $page }}</span> - </span> - @else - <a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400 dark:hover:text-gray-300 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('Go to page :page', ['page' => $page]) }}"> - {{ $page }} - </a> - @endif - @endforeach - @endif - @endforeach - - {{-- Next Page Link --}} - @if ($paginator->hasMorePages()) - <a href="{{ $paginator->nextPageUrl() }}" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:ring ring-gray-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('pagination.next') }}"> - <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> - <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" /> - </svg> - </a> - @else - <span aria-disabled="true" aria-label="{{ __('pagination.next') }}"> - <span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5 dark:bg-gray-800 dark:border-gray-600" aria-hidden="true"> - <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> - <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" /> - </svg> - </span> - </span> - @endif - </span> - </div> - </div> - </nav> -@endif diff --git a/routes/web.php b/routes/web.php index c3f8633..a9f6ab6 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,26 +2,33 @@ use App\Http\Controllers\ContactController; use App\Http\Controllers\CustomerController; +use App\Http\Controllers\DashboardController; +use App\Http\Controllers\ManagementController; use App\Http\Controllers\OrderController; +use App\Http\Controllers\OrderProductController; use App\Http\Controllers\PackingSlipController; use App\Http\Controllers\ShippingEntryController; -use App\Models\ShippingEntry; use Illuminate\Support\Facades\Route; Route::get('/', function () { - return view('welcome'); + return redirect()->route('dashboard'); }); Auth::routes(); -Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); +Route::get('/dashboard', [DashboardController::class, 'index'])->name('dashboard'); +Route::get('/management/{tab?}', [ManagementController::class, 'index'])->name('management.index'); + +// Customers Route::resource('customers', CustomerController::class); - Route::get('/customers/{customer}/{tab}', [CustomerController::class, 'show'])->name('customers.show'); -Route::get('/customers/', [CustomerController::class, 'index'])->name('customers.index'); Route::post('/customers/request-destroy', [CustomerController::class, 'requestDestroy'])->name('customers.requestDestroy'); +// OrderProducts +Route::resource('order-products', OrderProductController::class); + +// Contacts Route::resource('contacts', ContactController::class); Route::post('/contacts/request-destroy', [ContactController::class, 'requestDestroy'])->name('contacts.requestDestroy');