Compare commits

..

1 Commits
main ... basics

Author SHA1 Message Date
Nisse Lommerde dcdad94a61 basics test 3 months ago

@ -4,8 +4,11 @@ namespace App\Enums;
enum OrderStatus: string
{
// case ON_HOLD = 'On hold';
case APPROVED = 'Approved';
case PRODUCTION = 'Production';
// case COMPLETED = 'Completed';
case SHIPPED = 'Shipped';
case INVOICED = 'Invoiced';
// case CANCELLED = 'Cancelled';
}

@ -43,6 +43,7 @@ class RegisterController extends Controller
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
@ -57,6 +58,7 @@ class RegisterController extends Controller
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\Models\User
*/
protected function create(array $data)

@ -9,7 +9,10 @@ use Illuminate\Http\Request;
class ContactController extends Controller
{
public function index() {}
public function index()
{
}
public function create(Request $request)
{
@ -26,11 +29,17 @@ class ContactController extends Controller
return redirect()->route('customers.show', [$contact->customer, 'contacts'])->with('status', 'Contact created successfully');
}
public function show($id) {}
public function show($id)
{
}
public function edit($id) {}
public function edit($id)
{
}
public function update(Request $request, $id) {}
public function update(Request $request, $id)
{
}
public function requestDestroy(Request $request)
{
@ -40,5 +49,11 @@ class ContactController extends Controller
return redirect()->route('customers.show', [$contact->customer->id, 'contacts'])->with('status', 'Contact deleted successfully');
}
public function destroy($id) {}
public function destroy($id)
{
// $contact = Contact::findOrFail($id);
// $contact->delete();
//
// return redirect()->route('customers.show', $contact->customer()->iud)->with('status', 'Contact deleted successfully');
}
}

@ -10,7 +10,9 @@ use Illuminate\Support\Carbon;
class CustomerController extends Controller
{
public function index() {}
public function index()
{
}
public function store(CustomerRequest $request)
{
@ -24,15 +26,24 @@ class CustomerController extends Controller
return view('customers.create');
}
public function show(Customer $customer, ?string $tab = null)
public function show(Customer $customer, string $tab = null)
{
if (!$tab) {
return redirect()->route('customers.show', [$customer, 'tab' => 'details']);
}
$orders = $customer->orders();
$priorities = '"production", "approved", "order"';
return view('customers.show', [
'tab' => $tab,
'customer' => $customer,
'active_orders' => $orders
->where('status', '!=', 'cancelled')
->where('status', '!=', 'completed')
->orderBy('rush', 'desc')
->orderBy('due_date', 'desc')
->paginate(10),
'contacts' => $customer->contacts()->get(),
'packingSlips' => PackingSlip::where('customer_id', $customer->id)->orderByDesc('date_received')->paginate(15),
'shippingEntries' => $customer->shippingEntries()->get(),

@ -2,6 +2,8 @@
namespace App\Http\Controllers;
use App\Enums\OrderStatus;
use App\Models\Order;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
@ -19,6 +21,7 @@ class DashboardController extends Controller
/**
* Show the application dashboard.
*
*/
public function index(Request $request)
{
@ -29,6 +32,12 @@ class DashboardController extends Controller
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()
]);
}
}

@ -3,14 +3,16 @@
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)
public function index(string $tab = null)
{
if (!$tab)
{
if (! $tab) {
return redirect()->route('management.index', ['tab' => $this->defaultTab]);
}

@ -7,10 +7,6 @@ use App\Enums\OrderType;
use App\Http\Requests\OrderRequest;
use App\Models\Customer;
use App\Models\Order;
use App\Models\OrderProduct;
use App\Models\ProductService;
use App\Models\ProductSize;
use App\Models\ServiceFile;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
@ -34,71 +30,13 @@ class OrderController extends Controller
'order_status' => OrderStatus::cases(),
'customers' => Customer::all(),
'today' => Carbon::today()->format('Y-m-d'),
'due_default' => Carbon::today()->addDay(10)->format('Y-m-d'),
'due_default' => Carbon::today()->addDay(10)->format('Y-m-d')
]);
}
public function store(OrderRequest $request)
{
// Create order
$order = Order::create($request->safe()->only([
'customer_id',
'contact_id',
'order_type',
'status',
'customer_po',
'order_date',
'due_date',
'rush',
'new_art',
'digitizing',
'repeat',
'purchased_garments',
'customer_supplied_file',
'notes',
]));
// Create orderProducts
for ($i = 0; $i < count($request->get('productInputCount')) - 1; $i++) {
$orderProduct = OrderProduct::create([
'order_id' => $order->id,
'sku' => $request->get('sku')[$i],
'product_name' => $request->get('product_name')[$i],
'color' => $request->get('product_color')[$i],
]);
// Create productSizes
foreach (['xs', 's', 'm', 'l', 'xl', '2xl', '3xl', 'osfa'] as $size) {
ProductSize::create([
'order_product_id' => $orderProduct->id,
'amount' => $request->get('size_'.$size)[$i],
'size' => $size,
]);
}
}
// Create productServices
for ($i = 0; $i < count($request->get('serviceInputCount')) - 1; $i++) {
$productService = ProductService::create([
'order_id' => $order->id,
'service_type' => $request->get('service_type')[$i],
'placement' => $request->get('placement')[$i],
'setup_amount' => $request->get('setup_amount')[$i],
'amount' => $request->get('amount')[$i],
'amount_price' => $request->get('amount_price')[$i],
]);
ServiceFile::create([
'product_service_id' => $productService,
'code' => $request->get('service_file_name')[$i],
'name' => $request->get('logo_name')[$i],
'width' => $request->get('service_width')[$i],
'height' => $request->get('service_height')[$i],
'unit' => $request->get('service_setup_unit')[$i],
'setup_number' => $request->get('setup_number')[$i],
]);
}
$order = Order::create($request->validated());
return redirect()->route('order-products.create', ['order' => $order->id]);
}
@ -107,13 +45,19 @@ class OrderController extends Controller
{
return view('orders.show', [
'order' => Order::find($id),
'tab' => 'details',
'tab' => 'details'
]);
}
public function edit($id) {}
public function edit($id)
{
}
public function update(Request $request, $id) {}
public function update(Request $request, $id)
{
}
public function destroy($id) {}
public function destroy($id)
{
}
}

@ -6,20 +6,33 @@ use Illuminate\Http\Request;
class OrderProductController extends Controller
{
public function index() {}
public function index()
{
}
public function create()
{
return view('order-products.create');
}
public function store(Request $request) {}
public function store(Request $request)
{
}
public function show($id) {}
public function show($id)
{
}
public function edit($id) {}
public function edit($id)
{
}
public function update(Request $request, $id) {}
public function update(Request $request, $id)
{
}
public function destroy($id) {}
public function destroy($id)
{
}
}

@ -9,29 +9,43 @@ use Illuminate\Http\Request;
class PackingSlipController extends Controller
{
public function index() {}
public function index()
{
public function create() {}
}
public function create()
{
}
public function store(PackingSlipRequest $request)
{
PackingSlip::create($request->validated());
if ($request->get('from_customer')) {
if ($request->get('from_customer'))
{
return redirect()->route('customers.show', [
Customer::find($request->get('customer_id')),
'tab' => 'packing',
'tab' => 'packing'
]);
}
return redirect()->back(); //todo: change to packing slips page
}
public function show($id) {}
public function show($id)
{
}
public function edit($id) {}
public function edit($id)
{
}
public function update(Request $request, $id) {}
public function update(Request $request, $id)
{
}
public function destroy($id) {}
public function destroy($id)
{
}
}

@ -8,9 +8,14 @@ use Illuminate\Http\Request;
class ShippingEntryController extends Controller
{
public function index() {}
public function index()
{
public function create() {}
}
public function create()
{
}
public function store(ShippingEntryRequest $request)
{
@ -19,11 +24,19 @@ class ShippingEntryController extends Controller
return redirect()->route('customers.show', [$entry->customer, 'tab' => 'shipping']);
}
public function show($id) {}
public function show($id)
{
}
public function edit($id) {}
public function edit($id)
{
}
public function update(Request $request, $id) {}
public function update(Request $request, $id)
{
}
public function destroy($id) {}
public function destroy($id)
{
}
}

@ -16,7 +16,7 @@ class ContactRequest extends FormRequest
'last_name' => 'string',
'email' => 'string',
'phone' => 'string',
'notes' => 'string',
'notes' => 'string'
];
}

@ -11,6 +11,7 @@ class OrderRequest extends FormRequest
return [
'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'],

@ -14,7 +14,7 @@ class PackingSlipRequest extends FormRequest
'order_id' => 'string|nullable',
'amount' => 'required|string',
'contents' => 'required|string',
'from_customer' => 'required|bool',
'from_customer' => 'required|bool'
];
}

@ -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');
}
}

@ -12,9 +12,7 @@ use Livewire\Component;
class CreateOrder extends Component
{
public Collection $customers;
public string $selectedCustomer;
public $contacts;
public function mount( Collection $customers)
@ -36,7 +34,7 @@ class CreateOrder extends Component
'order_status' => OrderStatus::cases(),
'customers' => $this->customers,
'today' => Carbon::today()->format('Y-m-d'),
'due_default' => Carbon::today()->addDay(10)->format('Y-m-d'),
'due_default' => Carbon::today()->addDay(10)->format('Y-m-d')
]);
}
}

@ -9,18 +9,18 @@ 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)) {
if (isset($this->selectedCustomer))
{
$this->contacts = Customer::find($this->selectedCustomer)->contacts;
} else {
}
else {
$this->contacts = $customers->first()->contacts;
}

@ -1,158 +0,0 @@
<?php
namespace App\Livewire;
use Exception;
use Illuminate\Support\Collection;
use Livewire\Component;
class OrderProductsCreate extends Component
{
public Collection $productInputs;
public Collection $serviceInputs;
public array $sizes = [];
public array $totals = [];
public array $units = [];
public array $prices = [];
public array $priceTotals = [];
public int $totalQuantity = 0;
public string $totalPrice = '$0.00';
public function updated()
{
try {
foreach ($this->sizes as $index => $size) {
$this->totals[$index] = array_sum($size);
}
} catch (Exception $e) {
}
try {
foreach ($this->units as $index => $unit) {
$this->priceTotals[$index] = $unit * $this->prices[$index];
}
} catch (Exception $e) {
}
$this->totalQuantity = array_sum($this->totals);
$this->totalPrice = '$'.number_format(round(array_sum($this->priceTotals), 2), 2);
}
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 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() => [
'service_name' => '',
'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');
}
}

@ -2,7 +2,9 @@
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;
@ -14,31 +16,23 @@ class OrdersTable extends Component
protected $paginationTheme = 'bootstrap';
public bool $showCustomerColumn;
public string $orderType = 'active';
public string $search = '';
public string $title = '';
public string $customer_id = '';
public string $orderType = "active";
public string $search = "";
public string $title = "";
public Carbon $today;
public function mount(bool $showCustomerColumn, string $orderType, string $title, ?string $customer_id = null)
public function mount(bool $showCustomerColumn, string $orderType, string $title)
{
$this->today = Carbon::today();
$this->showCustomerColumn = $showCustomerColumn;
$this->orderType = $orderType;
$this->title = $title;
$this->customer_id = $customer_id ?? '';
}
public function render()
{
return view('livewire.orders-table', [
'orders' => Order::with('customer')
->when($this->customer_id != null, fn ($q) => $q->where('customer_id', $this->customer_id))
->when($this->orderType === 'active', fn($q) => $q->active())
->when($this->orderType === 'invoiced', fn($q) => $q->invoiced())
->when($this->orderType === 'finished', fn($q) => $q->finished())

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Contact extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'customer_id',

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Customer extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'company_name',

@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class Order extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'customer_id',
@ -21,8 +21,8 @@ class Order extends Model
'customer_po',
'order_date',
'order_type',
'status',
'due_date',
'status',
'rush',
'new_art',
'digitizing',
@ -33,27 +33,9 @@ class Order extends Model
];
protected $appends = [
'active',
'active'
];
public static function boot()
{
parent::boot();
static::created(function ($model) {
$model->attributes['internal_po'] = $model->generateInternalPo($model->id);
$model->save();
});
}
public function generateInternalPo($id): string
{
$po = str_pad($id, 4, '0', STR_PAD_LEFT);
$year = date('y');
return 'TN'.$year.'-'.$po;
}
public function active(): bool
{
if ($this->status == OrderStatus::APPROVED
@ -91,22 +73,17 @@ class Order extends Model
return $this->belongsTo(Customer::class);
}
public function orderProducts(): HasMany
public function orderProduct(): HasMany
{
return $this->hasMany(OrderProduct::class);
}
public function productServices(): HasMany
{
return $this->hasMany(ProductService::class);
}
protected function serializeDate(DateTimeInterface $date): string
{
return $date->format('Y-m-d');
}
protected $casts = [
'status' => OrderStatus::class,
'status' => OrderStatus::class
];
}

@ -11,7 +11,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class OrderProduct extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'order_id',
@ -25,6 +25,11 @@ class OrderProduct extends Model
return $this->belongsTo(Order::class);
}
public function productService(): HasOne
{
return $this->hasOne(ProductService::class);
}
public function serviceFile(): HasOne
{
return $this->hasOne(ServiceFile::class);

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class PackingSlip extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'order_id',
@ -19,8 +19,7 @@ class PackingSlip extends Model
'contents',
];
public function customer(): BelongsTo
{
public function customer(): BelongsTo {
return $this->belongsTo(Customer::class);
}
}

@ -10,10 +10,10 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class ProductService extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'order_id',
'order_product_id',
'service_type',
'placement',
'setup_amount',
@ -21,9 +21,9 @@ class ProductService extends Model
'amount_price',
];
public function order(): BelongsTo
public function orderProduct(): BelongsTo
{
return $this->belongsTo(Order::class);
return $this->belongsTo(OrderProduct::class);
}
public function serviceFile(): HasOne

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class ProductSize extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'order_product_id',

@ -9,7 +9,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class ServiceFile extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $fillable = [
'code',
@ -18,7 +18,7 @@ class ServiceFile extends Model
'width',
'height',
'unit',
'setup_number',
'setup_number'
];
public function productService(): BelongsTo

@ -10,10 +10,10 @@ use Illuminate\Database\Eloquent\SoftDeletes;
class ShippingEntry extends Model
{
use HasFactory, SoftDeletes;
use SoftDeletes, HasFactory;
protected $casts = [
'shipping_type' => ShippingType::class,
'shipping_type' => ShippingType::class
];
protected $fillable = [

@ -13,7 +13,7 @@
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.17",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"laravel/ui": "^4.5",
"mockery/mockery": "^1.6",

18
composer.lock generated

@ -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": "ffc721fe90178089f9fb639d3d24a0b4",
"content-hash": "cf385c78ac1f239d7823feaf6668a15b",
"packages": [
{
"name": "blade-ui-kit/blade-icons",
@ -6085,16 +6085,16 @@
},
{
"name": "laravel/pint",
"version": "v1.17.3",
"version": "v1.17.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "9d77be916e145864f10788bb94531d03e1f7b482"
"reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/9d77be916e145864f10788bb94531d03e1f7b482",
"reference": "9d77be916e145864f10788bb94531d03e1f7b482",
"url": "https://api.github.com/repos/laravel/pint/zipball/e8a88130a25e3f9d4d5785e6a1afca98268ab110",
"reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110",
"shasum": ""
},
"require": {
@ -6105,13 +6105,13 @@
"php": "^8.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.64.0",
"illuminate/view": "^10.48.20",
"friendsofphp/php-cs-fixer": "^3.61.1",
"illuminate/view": "^10.48.18",
"larastan/larastan": "^2.9.8",
"laravel-zero/framework": "^10.4.0",
"mockery/mockery": "^1.6.12",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.35.1"
"pestphp/pest": "^2.35.0"
},
"bin": [
"builds/pint"
@ -6147,7 +6147,7 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2024-09-03T15:00:28+00:00"
"time": "2024-08-06T15:11:54+00:00"
},
{
"name": "laravel/sail",

@ -13,7 +13,7 @@ class CustomerFactory extends Factory
public function definition()
{
$company_name = $this->faker->company();
$internal_name = explode(',', $company_name);
$internal_name = explode(",", $company_name);
$address = $this->faker->address();
return [
@ -22,6 +22,7 @@ class CustomerFactory extends Factory
'shipping_address' => $address,
'billing_address' => $address,
'phone' => $this->faker->phoneNumber(),
'created_at' => Carbon::now(),
'updated_at' => Carbon::now(),
];

@ -4,6 +4,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;
use Illuminate\Support\Carbon;
@ -20,6 +21,7 @@ class OrderFactory extends Factory
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,

@ -2,6 +2,7 @@
namespace Database\Factories;
use App\Models\Order;
use App\Models\OrderProduct;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;

@ -2,7 +2,9 @@
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;

@ -2,6 +2,7 @@
namespace Database\Factories;
use App\Models\OrderProduct;
use App\Models\ProductSize;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;

@ -2,6 +2,7 @@
namespace Database\Factories;
use App\Models\Customer;
use App\Models\ShippingEntry;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Carbon;

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up()
{
Schema::create('customers', function (Blueprint $table) {

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('contacts', function (Blueprint $table) {

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('packing_slips', function (Blueprint $table) {

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('shipping_entries', function (Blueprint $table) {

@ -1,11 +1,12 @@
<?php
use App\Enums\OrderStatus;
use App\Enums\OrderType;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('orders', function (Blueprint $table) {

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('order_products', function (Blueprint $table) {

@ -4,13 +4,12 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('product_services', function (Blueprint $table) {
$table->id();
$table->foreignId('order_id');
$table->foreignId('order_product_id');
$table->string('service_type');
$table->string('placement');
$table->string('setup_amount');

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('service_files', function (Blueprint $table) {
@ -16,7 +15,7 @@ return new class extends Migration
$table->string('placement');
$table->decimal('width')->nullable();
$table->decimal('height')->nullable();
$table->string('unit')->default('inch');
$table->string('unit')->default("inch");
$table->integer('setup_number')->nullable();
$table->softDeletes();
$table->timestamps();

@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
public function up(): void
{
Schema::create('product_sizes', function (Blueprint $table) {

@ -9,6 +9,7 @@ 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;
@ -16,15 +17,15 @@ class CustomerSeeder extends Seeder
{
public function run(): void
{
Customer::factory(3)
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))))
->has(ProductSize::factory(3))
->has(ProductService::factory(3)
->has(ServiceFile::factory(1)))))
->create();
Customer::factory([
@ -37,33 +38,33 @@ class CustomerSeeder extends Seeder
'first_name' => 'Tammy',
'last_name' => 'Bookbinder',
'email' => 'tbookbinder@genumark.com',
'phone' => '+1 778 229 5668',
'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',
'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',
'notes' => 'Deals with SOF orders'
]))
->has(Contact::factory([
'first_name' => 'Trisha',
'last_name' => 'Miller',
'email' => 'tmiller@genumark.com',
'phone' => '+1 604 802 8486',
'phone' => '+1 604 802 8486'
]))
->has(Contact::factory([
'first_name' => 'Brenda',
'last_name' => 'Kuepfer',
'email' => 'bkuepfer@genumark.com',
'phone' => '+1 604 305 5002',
'phone' => '+1 604 305 5002'
]))
->has(PackingSlip::factory(20))
->has(ShippingEntry::factory([
@ -74,7 +75,7 @@ class CustomerSeeder extends Seeder
'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',
'notes' => 'For Save On Foods orders, see Genumark SOF'
]))
->has(ShippingEntry::factory([
'account_title' => 'Genumark Save-On-Foods',
@ -84,7 +85,7 @@ class CustomerSeeder extends Seeder
'account_password' => 'TopNotch@13579',
'info_needed' => 'Put PO on box',
'notify' => 'Jane Wellman',
'notes' => 'Don\'t CC Kathlyn for SOF orders',
'notes' => 'Don\'t CC Kathlyn for SOF orders'
]))
->has(Order::factory(10))
->create();

@ -2,8 +2,16 @@
namespace Database\Seeders;
use App\Models\Contact;
use App\Models\Customer;
use App\Models\Order;
use App\Models\PackingSlip;
use App\Models\ShippingEntry;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Database\Factories\ShippingEntryFactory;
use http\Client;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
@ -17,6 +25,7 @@ class DatabaseSeeder extends Seeder
CustomerSeeder::class,
]);
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',

@ -1,12 +0,0 @@
{
"preset": "laravel",
"rules": {
"binary_operator_spaces": {
"default": "single_space",
"operators": {
"=>": "align_single_space_minimal",
"=": "align_single_space_minimal"
}
}
}
}

@ -12,14 +12,3 @@ $table-striped-bg: #fafafa;
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons.css';
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
display: none;
-webkit-appearance: none;
margin: 0; /* <-- Apparently some margin are still there even though it's hidden */
}
input[type=number] {
-moz-appearance: textfield; /* Firefox */
}

@ -20,8 +20,7 @@
<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'}}">
aria-controls="active_orders" aria-selected="{{$tab == 'active_orders' ? 'true' : 'false'}}">
<x-bi-arrow-clockwise/>
Active Orders
</a>
@ -29,8 +28,7 @@
<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'}}">
aria-controls="packing_slips" aria-selected="{{$tab == 'packing_slips' ? 'true' : 'false'}}">
<x-bi-list-ul/>
Packing Slips
</a>

@ -0,0 +1,7 @@
<div>
<h1>{{ $count }}</h1>
<button wire:click="increment">+</button>
<button wire:click="decrement">-</button>
</div>

@ -1,9 +1,9 @@
<div>
<div class="row mb-2">
<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 wire:change="updateContactList" wire:model="selectedCustomer" name="customer_id"
class="form-select form-select-sm" id="customer_id" autofocus required>
class="form-select" id="customer_id" autofocus required>
@foreach($customers as $customer)
<option value="{{$customer->id}}" {{ old('customer_id') == $customer->id ? "selected" : "" }}>
{{$customer->company_name}}
@ -19,12 +19,11 @@
</div>
</div>
<div class="row mb-2">
<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">
@if(isset($contacts))
<select wire:model="contacts" wire:key="{{$customer}}" name="contact_id"
class="form-select form-select-sm" id="contact_id">
<select wire:model="contacts" name="contact_id" class="form-select" id="contact_id">
<option value=""></option>
@foreach($contacts as $contact)
<option value="{{$contact->id}}" {{ old('contact_id') == $contact->id ? "selected" : "" }}>

@ -1,299 +0,0 @@
<div>
<div class="overflow-x-hidden overflow-y-visible" style="max-height: 730px">
<table class="table table-striped table-sm mb-1 ms-0">
<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}}">
<input type="hidden" name="productInputCount[]" value="1">
<th scope="row" class="align-middle">{{$loop->index+1}}</th>
<td class="col-1">
<!-- SKU -->
<input id="sku_{{$key}}" type="text"
class="form-control form-control-sm @error('sku') is-invalid @enderror"
name="sku[]" value="{{@old('sku')}}" autofocus
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="col-3">
<!-- product_name -->
<input id="product_name_{{$key}}" 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_{{$key}}" type="text" min="0"
class="form-control form-control-sm @error('product_color') is-invalid @enderror"
name="product_color[]" value="{{@old('product_color')}}"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_xs -->
<input id="size_xs_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_xs') is-invalid @enderror"
name="size_xs[]" value="{{@old('size_xs')}}"
wire:model.live="sizes.{{$key}}.xs"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_s -->
<input id="size_s_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_s') is-invalid @enderror"
name="size_s[]" value="{{@old('size_s')}}"
wire:model.live="sizes.{{$key}}.s"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_m -->
<input id="size_m_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_m') is-invalid @enderror"
name="size_m[]" value="{{@old('size_m')}}"
wire:model.live="sizes.{{$key}}.m"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_l -->
<input id="size_l_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_l') is-invalid @enderror"
name="size_l[]" value="{{@old('size_l')}}"
wire:model.live="sizes.{{$key}}.l"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_xl -->
<input id="size_xl_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_xl') is-invalid @enderror"
name="size_xl[]" value="{{@old('size_xl')}}"
wire:model.live="sizes.{{$key}}.xl"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_2xl -->
<input id="size_2xl_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_2xl') is-invalid @enderror"
name="size_2xl[]" value="{{@old('size_2xl')}}"
wire:model.live="sizes.{{$key}}.2xl"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td class="" style="width: 55px">
<!-- size_3xl -->
<input id="size_3xl_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_3xl') is-invalid @enderror"
name="size_3xl[]"
wire:model.live="sizes.{{$key}}.3xl"
wire:change="determineAddProductRow({{$loop->index}})">
</td>
<td style="width: 55px">
<!-- size_osfa -->
<input id="size_osfa_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('size_osfa') is-invalid @enderror"
name="size_osfa[]" value="{{@old('size_osfa')}}"
wire:model.live="sizes.{{$key}}.osfa"
wire:change="determineAddProductRow({{$loop->index}})"
>
</td>
<td class="col" style="width: 55px">
<input id="product_total_{{$key}}" type="number"
class="form-control form-control-sm @error('product_total') is-invalid @enderror"
name="product_total[]" readonly
wire:model.live="totals.{{$key}}"
>
</td>
<td class="col" style="width: 40px">
@if($key > 0)
<button class="btn btn-sm" type="button" wire:click="removeProductInput({{$key}})">
<x-bi-trash3/>
</button>
@endif
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="d-flex gap-2">
<label for="total-quantity" class="text-nowrap col-form-label">Total Quantity:</label>
<input type="number" name="total-quantity" id="" class="form-control-plaintext" readonly
wire:model.live="totalQuantity">
</div>
</div>
<!-- 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">
<input type="hidden" name="serviceInputCount[]" value="1">
<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_{{$key}}" type="text"
class="form-control form-control-sm m-0 @error('service_name') is-invalid @enderror"
name="service_type[]" value="{{@old('service_name')}}" placeholder="Service"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col-2 px-1">
<input id="placement_{{$key}}" 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_{{$key}}" 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_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('setup_number') is-invalid @enderror"
name="setup_amount[]" value="{{@old('setup_number')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col px-1">
<input id="service_width_{{$key}}" type="number" min="0"
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_{{$key}}" type="number" min="0"
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_{{$key}}" type="number" min="0"
class="form-control form-control-sm @error('service_setup_unit') is-invalid @enderror"
name="amount[]"
value="{{@old('service_setup_unit')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})"
wire:model.live="units.{{$key}}"
>
</div>
<div class="col px-1">
<input id="service_setup_price_{{$key}}" type="text"
class="form-control form-control-sm @error('service_setup_price') is-invalid @enderror"
name="amount_price[]"
value="{{@old('service_setup_price')}}"
wire:change="determineAddServiceProductRow({{$loop->index}})"
wire:model.live="prices.{{$key}}"
>
</div>
<div class="col px-1">
<input id="service_total_{{$key}}" type="number" precision="2"
class="form-control form-control-sm px-1 @error('service_total') is-invalid @enderror"
name="service_total" readonly
wire:model.live="priceTotals.{{$key}}">
</div>
<div class="col px-1 text-end" style="width: 40px;">
@if($key > 0)
<button class="btn btn-sm" type="button"
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_{{$key}}" 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="File"
wire:change="determineAddServiceProductRow({{$loop->index}})">
</div>
<div class="col-9 px-1">
<textarea name="contents[]" id="contents_{{$key}}" style="resize: none" rows="2"
class="form-control form-control-sm"
placeholder="Thread colors"
wire:change="determineAddServiceProductRow({{$loop->index}})"
>{{ old('contents') }}</textarea>
</div>
</div>
</div>
</div>
</div>
@endforeach
{{-- <div class="row">--}}
<div class="d-flex flex-row gap-2 ">
<label for="total-price" class="col-form-label text-nowrap">Total Price:</label>
<input type="text" name="total-price" id="" class="col-1 form-control-plaintext" readonly
wire:model.live="totalPrice">
</div>
{{-- </div>--}}
</div>
</div>

@ -30,10 +30,325 @@
@section('content')
<div class="container">
<div class="row justify-content-center">
<div class="col-10 pt-3">
<livewire:order-products-create/>
<div class="col-9 pt-3">
<form action="{{route('order-products.store') }}" method="post">
@csrf
<div class="row mb-3">
<label class="col-md-4 col-form-label text-md-end">SKU</label>
<div class="col-md-2">
<input id="sku" type="text"
class="form-control @error('sku') is-invalid @enderror"
name="sku" value="{{@old('sku')}}" autofocus>
@error('sku')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<label class="col-1 col-form-label text-md-end">Color</label>
<div class="col-3">
<input id="color" type="text"
class="form-control @error('color') is-invalid @enderror"
name="color" value="{{@old('color')}}">
@error('color')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label class="col-md-4 col-form-label text-md-end">Product Name</label>
<div class="col-md-6">
<input id="product_name" type="text"
class="form-control @error('product_name') is-invalid @enderror"
name="product_name" value="{{@old('product_name')}}" required>
@error('product_name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label class="col-md-4 col-form-label text-md-end">Sizes</label>
<div class="col-6">
<div class="row mb-1 text-center fw-bold">
<div class="col px-1">XS</div>
<div class="col px-1">S</div>
<div class="col px-1">M</div>
<div class="col px-1">L</div>
<div class="col px-1">XL</div>
<div class="col px-1">2XL</div>
<div class="col px-1">Other</div>
<div class="col px-1">Total</div>
</div>
<div class="row">
<div class="col px-1">
<input id="size-xs" type="text"
class="form-control px-1 text-center @error('size-xs') is-invalid @enderror"
name="size-xs"
value="{{@old('size-xs')}}">
@error('size-xs') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<input id="size-s" type="text"
class="form-control px-1 text-center @error('size-s') is-invalid @enderror"
name="size-s"
value="{{@old('size-s')}}">
@error('size-s') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<input id="size-m" type="text"
class="form-control px-1 text-center @error('size-m') is-invalid @enderror"
name="size-m"
value="{{@old('size-m')}}">
@error('size-m') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<input id="size-l" type="text"
class="form-control px-1 text-center @error('size-l') is-invalid @enderror"
name="size-l"
value="{{@old('size-l')}}">
@error('size-l') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<input id="size-xl" type="text"
class="form-control px-1 text-center @error('size-xl') is-invalid @enderror"
name="size-xl"
value="{{@old('size-xl')}}">
@error('size-xl') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<input id="size-2xl" type="text"
class="form-control px-1 text-center @error('size-2xl') is-invalid @enderror"
name="size-2xl"
value="{{@old('size-2xl')}}">
@error('size-2xl') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<input id="size-other" type="text"
class="form-control px-1 text-center @error('size-other') is-invalid @enderror"
name="size-other"
value="{{@old('size-other')}}">
@error('size-other') <span class="invalid-feedback"
role="alert"> <strong>{{ $message }}</strong> </span> @enderror
</div>
<div class="col px-1">
<span name="total" id="total"></span>
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-4"></div>
<div class="col text-end">
<button class="btn btn-sm btn-primary w-25" type="">Add</button>
</div>
<div class="col-2"></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">Name</label>
<div class="col-md-6">
<input id="service_file_name" type="text"
class="form-control @error('service_file_name') is-invalid @enderror"
name="service_file_name" value="{{@old('service_file_name')}}" required>
@error('service_file_name')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row mb-3">
<label class="col-md-4 col-form-label text-md-end">Placement</label>
<div class="col-md-6">
<input id="service_file_placement" type="text"
class="form-control @error('service_file_placement') is-invalid @enderror"
name="service_file_placement" value="{{@old('service_file_placement')}}" required>
@error('service_file_placement')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
</div>
<div class="row">
<label class="col-md-4 col-form-label text-md-end">File Details</label>
<div class="col">
<label class="col-form-label text-md-end">Code</label>
</div>
<div class="col">
<label class="col-form-label text-md-end">Width</label>
</div>
<div class="col">
<label class="col-form-label text-md-end">Height</label>
</div>
<div class="col">
<label class="col-form-label text-md-end">Amount</label>
</div>
<div class="col-2"></div>
</div>
<div class="row mb-2">
<div class="col-4">
</div>
<div class="col">
<input id="service_file_code"
class="form-control @error('service_file_code') is-invalid @enderror"
name="service_file_code" value="{{@old('service_file_code')}}" placeholder="A1111"
required>
@error('service_file_code')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col">
<input id="service_file_width" type="number" step="0.05" min="0"
class="form-control @error('service_file_width') is-invalid @enderror"
name="service_file_width" value="{{@old('service_file_width')}}" required>
@error('service_file_width')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col">
<input id="service_file_height" type="number" step="0.05" min="0"
class="form-control @error('service_file_height') is-invalid @enderror"
name="service_file_height" value="{{@old('service_file_height')}}" required>
@error('service_file_height')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col">
<input id="service_file_amount" type="number" step="1" min="0"
class="form-control @error('service_file_amount') is-invalid @enderror"
amount="service_file_amount" value="{{@old('service_file_amount')}}" required>
@error('service_file_amount')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-2"></div>
</div>
<div class="row">
<div class="col-4"></div>
<div class="col">
<label class="col-form-label text-md-end">Unit Price</label>
</div>
<div class="col">
<label class="col-form-label text-md-end">Number of Setup</label>
</div>
<div class="col">
<label class="col-form-label text-md-end">Total</label>
</div>
<div class="col-2"></div>
</div>
<div class="row mb-3">
<div class="col-4"></div>
<div class="col">
<input id="service_file_setup_amount" type="text"
class="form-control @error('service_file_setup_amount') is-invalid @enderror"
name="service_file_setup_amount" value="{{@old('service_file_setup_amount')}}"
required>
@error('service_file_setup_amount')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col">
<input id="service_file_price" type="text"
class="form-control @error('service_file_price') is-invalid @enderror"
name="service_file_price" value="{{@old('service_file_price')}}" required>
@error('service_file_price')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col">
<input id="service_file_price" type="text"
class="form-control @error('service_file_price') is-invalid @enderror"
name="service_file_price" value="{{@old('service_file_price')}}" required>
@error('service_file_price')
<span class="invalid-feedback" role="alert">
<strong>{{ $message }}</strong>
</span>
@enderror
</div>
<div class="col-2"></div>
</div>
<div class="row mb-3">
<label class="col-md-4 col-form-label text-md-end">Notes</label>
<div class="col-6">
<textarea name="contents" id="contents" cols="30" rows="2" class="form-control"
autocomplete="contents" placeholder=""
required>{{ old('contents') }}</textarea>
@error('contents')
<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">
<div class="col-4">
</div>
<div class="col-1">
<a class="btn btn-secondary" type="">Back</a>
</div>
<div class="col-5 text-end">
<button class="btn btn-primary w-25" type="submit">Save</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

@ -9,7 +9,7 @@
</div>
<!-- Tabs row -->
<div class="row justify-content-center mb-2">
<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">
@ -29,22 +29,20 @@
@endsection
@section('content')
<div class="container-fluid mt-3" style="max-width: 1800px">
<div class="container">
<div class="row justify-content-center">
<div class="col-8 pt-3">
<form action="{{route('orders.store') }}" method="post">
@csrf
<div class="row justify-content-center">
<div class="col-11 col-xl-4 border-end" style="height: 730px">
<livewire:customer-and-contact-select :customers="$customers"/>
<hr class="border-secondary-subtle px-0">
<hr class="border-secondary-subtle mx-4 px-0">
<div class="row mb-2">
<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 form-select-sm" id="order_type">
<select name="order_type" class="form-select" id="order_type">
@foreach($order_types as $case)
<option value="{{$case->name}}">{{$case->value}}</option>
@endforeach()
@ -58,11 +56,10 @@
</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="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="status" class="form-select form-select-sm" id="order_status">
<select name="status" class="form-select" id="order_status">
@foreach($order_status as $case)
<option value="{{$case->value}}" {{ $case->name === 'APPROVED' ? 'selected' : '' }}>
{{$case->value}}
@ -78,13 +75,13 @@
</div>
</div>
<hr class="border-secondary-subtle px-0">
<hr class="border-secondary-subtle mx-4 px-0">
<div class="row mb-2">
<div class="row mb-3">
<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"
class="form-control @error('customer_po') is-invalid @enderror"
name="customer_po" value="{{@old('customer_po')}}" required>
@error('customer_po')
@ -95,14 +92,13 @@
</div>
</div>
<hr class="border-secondary-subtle px-0">
<hr class="border-secondary-subtle mx-4 px-0">
<div class="row mb-2">
<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" id="new_art" name="new_art"
value="1">
<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 ">
@ -117,43 +113,36 @@
<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>
<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">
<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">
<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"
<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>
<label class="form-check-label" for="purchased_garments">Purchased garments</label>
</div>
</div>
</div>
<hr class="border-secondary-subtle px-0">
<hr class="border-secondary-subtle mx-4 px-0">
<div class="row mb-2">
<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 form-control-sm @error('order_date') is-invalid @enderror"
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">
@ -163,14 +152,14 @@
</div>
</div>
<div class="row mb-2">
<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 form-control-sm @error('due_date') is-invalid @enderror"
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">
@ -180,14 +169,14 @@
</div>
</div>
<hr class="border-secondary-subtle px-0">
<hr class="border-secondary-subtle mx-4 px-0">
<div class="row mb-2">
<div class="row mb-3">
<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"
>{{ old('notes') }}</textarea>
<textarea name="notes" id="notes" cols="30" rows="3" class="form-control"
autocomplete="notes">{{ old('notes') }}</textarea>
@error('notes')
<span class="invalid-feedback" role="alert">
@ -196,22 +185,17 @@
@enderror
</div>
</div>
</div>
<div class="col-11 col-xl-7">
<livewire:order-products-create/>
</div>
<hr class="border-secondary-subtle px-0">
<hr class="border-secondary-subtle mx-4 px-0">
<div class="row">
<div class="col text-end">
<button type="submit" class="btn btn-primary">
Save Order
</button>
</div>
<div class="row mb-3">
<div class="col-4"></div>
<div class="col-6">
<button class="btn btn-primary" type="submit">Continue</button>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection

@ -1,6 +1,76 @@
<div class="tab-pane {{$tab == 'details' ? 'active' : ''}}" id="details" role="tabpanel"
aria-labelledby="details-tab">
<livewire:orders-table :show-customer-column="false" order-type="active" title="Active orders"
:customer_id="$customer->id"/>
<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">Active orders</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 gap-2">
<input 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">
<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($active_orders as $order)
<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 class="w-25">{{$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"
href="">
<x-bi-arrow-right/>
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col"></div>
<div class="col-4">
{{$active_orders->links()}}
</div>
<div class="col"></div>
</div>
</div>

Loading…
Cancel
Save