Order Show page
This commit is contained in:
parent
7074596cb7
commit
b21684df65
@ -11,8 +11,11 @@
|
|||||||
use App\Models\ProductService;
|
use App\Models\ProductService;
|
||||||
use App\Models\ProductSize;
|
use App\Models\ProductSize;
|
||||||
use App\Models\ServiceFile;
|
use App\Models\ServiceFile;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class OrderController extends Controller
|
class OrderController extends Controller
|
||||||
{
|
{
|
||||||
@ -103,7 +106,7 @@ public function store(OrderRequest $request)
|
|||||||
return redirect()->route('order-products.create', ['order' => $order->id]);
|
return redirect()->route('order-products.create', ['order' => $order->id]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id)
|
public function show(int $id): Factory|\Illuminate\Contracts\View\View|Application|View
|
||||||
{
|
{
|
||||||
return view('orders.show', [
|
return view('orders.show', [
|
||||||
'order' => Order::find($id),
|
'order' => Order::find($id),
|
||||||
@ -111,7 +114,7 @@ public function show($id)
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function edit($id) {}
|
public function edit(int $id) {}
|
||||||
|
|
||||||
public function update(Request $request, $id) {}
|
public function update(Request $request, $id) {}
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@ class OrderRequest extends FormRequest
|
|||||||
public function rules(): array
|
public function rules(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
// Order
|
||||||
'customer_id' => ['required', 'exists:customers,id'],
|
'customer_id' => ['required', 'exists:customers,id'],
|
||||||
'contact_id' => ['nullable', 'exists:contacts,id'],
|
'contact_id' => ['nullable', 'exists:contacts,id'],
|
||||||
'customer_po' => ['required', 'string'],
|
'customer_po' => ['required', 'string'],
|
||||||
@ -26,6 +27,14 @@ public function rules(): array
|
|||||||
'purchased_garments' => ['nullable'],
|
'purchased_garments' => ['nullable'],
|
||||||
'customer_supplied_file' => ['nullable'],
|
'customer_supplied_file' => ['nullable'],
|
||||||
'notes' => ['nullable'],
|
'notes' => ['nullable'],
|
||||||
|
|
||||||
|
// Order Products
|
||||||
|
|
||||||
|
// Product Sizes
|
||||||
|
|
||||||
|
// Product Services
|
||||||
|
|
||||||
|
// Service Files
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -57,6 +57,28 @@ public function generateInternalPo(int $id): string
|
|||||||
return 'TN'.$year.'-'.$po;
|
return 'TN'.$year.'-'.$po;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function totalProductQuantity(): int
|
||||||
|
{
|
||||||
|
$total = 0;
|
||||||
|
|
||||||
|
foreach ($this->orderProducts as $product) {
|
||||||
|
$total += $product->totalQuantity();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function totalServicePrice(): float
|
||||||
|
{
|
||||||
|
$total = 0;
|
||||||
|
|
||||||
|
foreach ($this->productServices as $service) {
|
||||||
|
$total += $service->amount * $service->amount_price;
|
||||||
|
}
|
||||||
|
|
||||||
|
return number_format($total, 2);
|
||||||
|
}
|
||||||
|
|
||||||
public function active(): bool
|
public function active(): bool
|
||||||
{
|
{
|
||||||
if ($this->status == OrderStatus::APPROVED
|
if ($this->status == OrderStatus::APPROVED
|
||||||
@ -113,6 +135,14 @@ public function customer(): BelongsTo
|
|||||||
return $this->belongsTo(Customer::class);
|
return $this->belongsTo(Customer::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return BelongsTo<Contact, self>
|
||||||
|
*/
|
||||||
|
public function contact(): BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Contact::class);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HasMany<OrderProduct>
|
* @return HasMany<OrderProduct>
|
||||||
*/
|
*/
|
||||||
|
@ -22,6 +22,11 @@ class OrderProduct extends Model
|
|||||||
'color',
|
'color',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function totalQuantity(): int
|
||||||
|
{
|
||||||
|
return array_sum($this->productSizes()->pluck('amount')->toArray());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return BelongsTo<Order, self>
|
* @return BelongsTo<Order, self>
|
||||||
*/
|
*/
|
||||||
@ -41,7 +46,7 @@ public function serviceFile(): HasOne
|
|||||||
/**
|
/**
|
||||||
* @return HasMany<ProductSize>
|
* @return HasMany<ProductSize>
|
||||||
*/
|
*/
|
||||||
public function productSize(): HasMany
|
public function productSizes(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(ProductSize::class);
|
return $this->hasMany(ProductSize::class);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,6 @@ class ServiceFile extends Model
|
|||||||
'name',
|
'name',
|
||||||
'width',
|
'width',
|
||||||
'height',
|
'height',
|
||||||
'unit',
|
|
||||||
'setup_number',
|
'setup_number',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -15,9 +15,8 @@ public function definition(): array
|
|||||||
return [
|
return [
|
||||||
'created_at' => Carbon::now(),
|
'created_at' => Carbon::now(),
|
||||||
'updated_at' => Carbon::now(),
|
'updated_at' => Carbon::now(),
|
||||||
'service_type' => $this->faker->randomElement(['embroidery', 'screen printing', 'dtg', 'vinyl']),
|
'service_type' => $this->faker->randomElement(['emb', 'scp', 'dtg', 'vinyl']),
|
||||||
'placement' => $this->faker->randomElement(['l/c', 'c/f', 'f/b', 'r/c']),
|
'placement' => $this->faker->randomElement(['l/c', 'c/f', 'f/b', 'r/c']),
|
||||||
'setup_amount' => 0,
|
|
||||||
'amount' => $this->faker->randomNumber(1),
|
'amount' => $this->faker->randomNumber(1),
|
||||||
'amount_price' => 0,
|
'amount_price' => 0,
|
||||||
];
|
];
|
||||||
|
@ -20,6 +20,7 @@ public function definition(): array
|
|||||||
'width' => round($this->faker->randomFloat(2, 0, 10), 1),
|
'width' => round($this->faker->randomFloat(2, 0, 10), 1),
|
||||||
'height' => round($this->faker->randomFloat(2, 0, 10), 1),
|
'height' => round($this->faker->randomFloat(2, 0, 10), 1),
|
||||||
'unit' => 'inch',
|
'unit' => 'inch',
|
||||||
|
'notes' => $this->faker->randomElement(['1) 1149 2) grey 3) white', '1) white', '1) black 2) white']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,6 @@ public function up(): void
|
|||||||
$table->foreignId('order_id');
|
$table->foreignId('order_id');
|
||||||
$table->string('service_type');
|
$table->string('service_type');
|
||||||
$table->string('placement');
|
$table->string('placement');
|
||||||
$table->string('setup_amount');
|
|
||||||
$table->string('amount')->nullable();
|
$table->string('amount')->nullable();
|
||||||
$table->string('amount_price')->nullable();
|
$table->string('amount_price')->nullable();
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
|
@ -13,11 +13,11 @@ public function up(): void
|
|||||||
$table->foreignId('product_service_id')->constrained();
|
$table->foreignId('product_service_id')->constrained();
|
||||||
$table->string('code');
|
$table->string('code');
|
||||||
$table->string('name');
|
$table->string('name');
|
||||||
$table->string('placement');
|
|
||||||
$table->decimal('width')->nullable();
|
$table->decimal('width')->nullable();
|
||||||
$table->decimal('height')->nullable();
|
$table->decimal('height')->nullable();
|
||||||
$table->string('unit')->default('inch');
|
$table->string('unit')->default('inch');
|
||||||
$table->integer('setup_number')->nullable();
|
$table->integer('setup_number')->nullable();
|
||||||
|
$table->string('notes');
|
||||||
$table->softDeletes();
|
$table->softDeletes();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
use App\Models\PackingSlip;
|
use App\Models\PackingSlip;
|
||||||
use App\Models\ProductService;
|
use App\Models\ProductService;
|
||||||
use App\Models\ProductSize;
|
use App\Models\ProductSize;
|
||||||
|
use App\Models\ServiceFile;
|
||||||
use App\Models\ShippingEntry;
|
use App\Models\ShippingEntry;
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
|
|
||||||
@ -16,16 +17,18 @@ class CustomerSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
Customer::factory(3)
|
for ($i = 0; $i < 10; $i++) {
|
||||||
->has(Contact::factory(5))
|
Customer::factory()
|
||||||
->has(PackingSlip::factory(30))
|
->has(Contact::factory(rand(1, 5)))
|
||||||
->has(ShippingEntry::factory(2))
|
->has(PackingSlip::factory(rand(1, 10)))
|
||||||
->has(Order::factory(10)
|
->has(ShippingEntry::factory(rand(1, 3)))
|
||||||
->has(OrderProduct::factory(2)
|
->has(Order::factory(rand(2, 10))
|
||||||
->has(ProductSize::factory(3)))
|
->has(OrderProduct::factory(rand(1, 10))
|
||||||
->has(ProductService::factory(3)))
|
->has(productSize::factory(rand(1, 8))))
|
||||||
// ->has(ServiceFile::factory(1))))
|
->has(ProductService::factory(rand(1, 10))
|
||||||
->create();
|
->has(ServiceFile::factory())))
|
||||||
|
->create();
|
||||||
|
}
|
||||||
|
|
||||||
Customer::factory([
|
Customer::factory([
|
||||||
'company_name' => 'Genumark',
|
'company_name' => 'Genumark',
|
||||||
|
@ -157,135 +157,138 @@ class="form-control form-control-sm @error('product_total') is-invalid @enderror
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Title -->
|
<div class="ms-2">
|
||||||
<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">
|
<!-- Title -->
|
||||||
<div class="row">
|
<div class="row px-2 border-bottom mt-4">
|
||||||
<div class="col px-1">Setup</div>
|
<div class="row fw-bold">
|
||||||
<div class="col px-1">Width</div>
|
<div class="col-1 px-0 " style="width: 40px;">#</div>
|
||||||
<div class="col px-1">Height</div>
|
<div class="col-1 px-1">Service</div>
|
||||||
<div class="col px-1">Unit</div>
|
<div class="col-2 px-1">Placement</div>
|
||||||
<div class="col px-1">Price</div>
|
<div class="col-3 px-1">Logo Name</div>
|
||||||
<div class="col px-1">Total</div>
|
|
||||||
<div class="col px-1"></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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Row -->
|
<!-- Row -->
|
||||||
|
|
||||||
@foreach($serviceInputs as $key => $value)
|
@foreach($serviceInputs as $key => $value)
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<input type="hidden" name="serviceInputCount[]" value="1">
|
<input type="hidden" name="serviceInputCount[]" value="1">
|
||||||
|
|
||||||
<div class="@if($loop->index % 2 != 1) bg-body-tertiary @endif border-bottom py-2">
|
<div class="@if($loop->index % 2 != 1) bg-body-tertiary @endif border-bottom py-2">
|
||||||
<div class="row mb-1">
|
<div class="row mb-1">
|
||||||
<div class="row mb-2">
|
<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 fw-bold" style="width: 40px;">{{$loop->index+1}}</div>
|
||||||
<div class="col-1 px-1">
|
<div class="col-1 px-1">
|
||||||
<input id="service_name_{{$key}}" type="text"
|
<input id="service_name_{{$key}}" type="text"
|
||||||
class="form-control form-control-sm m-0 @error('service_name') is-invalid @enderror"
|
class="form-control form-control-sm m-0 @error('service_name') is-invalid @enderror"
|
||||||
name="service_type[]" value="{{@old('service_name')}}" placeholder="Service"
|
name="service_type[]" value="{{@old('service_name')}}" placeholder="Service"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-2 px-1">
|
<div class="col-2 px-1">
|
||||||
<input id="placement_{{$key}}" type="text"
|
<input id="placement_{{$key}}" type="text"
|
||||||
class="form-control form-control-sm @error('placement') is-invalid @enderror"
|
class="form-control form-control-sm @error('placement') is-invalid @enderror"
|
||||||
name="placement[]" value="{{@old('placement')}}"
|
name="placement[]" value="{{@old('placement')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3 px-1">
|
<div class="col-3 px-1">
|
||||||
<input id="logo_name_{{$key}}" type="text"
|
<input id="logo_name_{{$key}}" type="text"
|
||||||
class="form-control form-control-sm @error('logo_name') is-invalid @enderror"
|
class="form-control form-control-sm @error('logo_name') is-invalid @enderror"
|
||||||
name="logo_name[]" value="{{@old('logo_name')}}"
|
name="logo_name[]" value="{{@old('logo_name')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5">
|
<div class="col-5">
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col px-1">
|
<div class="col px-1">
|
||||||
<input id="setup_number_{{$key}}" type="number" min="0"
|
<input id="setup_number_{{$key}}" type="number" min="0"
|
||||||
class="form-control form-control-sm @error('setup_number') is-invalid @enderror"
|
class="form-control form-control-sm @error('setup_number') is-invalid @enderror"
|
||||||
name="setup_amount[]" value="{{@old('setup_number')}}"
|
name="setup_amount[]" value="{{@old('setup_number')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
</div>
|
</div>
|
||||||
<div class="col px-1">
|
<div class="col px-1">
|
||||||
<input id="service_width_{{$key}}" type="number" min="0"
|
<input id="service_width_{{$key}}" type="number" min="0"
|
||||||
class="form-control form-control-sm @error('service_width') is-invalid @enderror"
|
class="form-control form-control-sm @error('service_width') is-invalid @enderror"
|
||||||
name="service_width[]" value="{{@old('service_width')}}"
|
name="service_width[]" value="{{@old('service_width')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
</div>
|
</div>
|
||||||
<div class="col px-1">
|
<div class="col px-1">
|
||||||
<input id="service_height_{{$key}}" type="number" min="0"
|
<input id="service_height_{{$key}}" type="number" min="0"
|
||||||
class="form-control form-control-sm @error('service_height') is-invalid @enderror"
|
class="form-control form-control-sm @error('service_height') is-invalid @enderror"
|
||||||
name="service_height[]" value="{{@old('service_height')}}"
|
name="service_height[]" value="{{@old('service_height')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
</div>
|
</div>
|
||||||
<div class="col px-1">
|
<div class="col px-1">
|
||||||
<input id="service_setup_unit_{{$key}}" type="number" min="0"
|
<input id="service_setup_unit_{{$key}}" type="number" min="0"
|
||||||
class="form-control form-control-sm @error('service_setup_unit') is-invalid @enderror"
|
class="form-control form-control-sm @error('service_setup_unit') is-invalid @enderror"
|
||||||
name="amount[]"
|
name="amount[]"
|
||||||
value="{{@old('service_setup_unit')}}"
|
value="{{@old('service_setup_unit')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})"
|
wire:change="determineAddServiceProductRow({{$loop->index}})"
|
||||||
wire:model.live="units.{{$key}}"
|
wire:model.live="units.{{$key}}"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col px-1">
|
<div class="col px-1">
|
||||||
<input id="service_setup_price_{{$key}}" type="text"
|
<input id="service_setup_price_{{$key}}" type="text"
|
||||||
class="form-control form-control-sm @error('service_setup_price') is-invalid @enderror"
|
class="form-control form-control-sm @error('service_setup_price') is-invalid @enderror"
|
||||||
name="amount_price[]"
|
name="amount_price[]"
|
||||||
value="{{@old('service_setup_price')}}"
|
value="{{@old('service_setup_price')}}"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})"
|
wire:change="determineAddServiceProductRow({{$loop->index}})"
|
||||||
wire:model.live="prices.{{$key}}"
|
wire:model.live="prices.{{$key}}"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
<div class="col px-1">
|
<div class="col px-1">
|
||||||
<input id="service_total_{{$key}}" type="number" precision="2"
|
<input id="service_total_{{$key}}" type="number" precision="2"
|
||||||
class="form-control form-control-sm px-1 @error('service_total') is-invalid @enderror"
|
class="form-control form-control-sm px-1 @error('service_total') is-invalid @enderror"
|
||||||
name="service_total" readonly
|
name="service_total" readonly
|
||||||
wire:model.live="priceTotals.{{$key}}">
|
wire:model.live="priceTotals.{{$key}}">
|
||||||
</div>
|
</div>
|
||||||
<div class="col px-1 text-end" style="width: 40px;">
|
<div class="col px-1 text-end" style="width: 40px;">
|
||||||
@if($key > 0)
|
@if($key > 0)
|
||||||
<button class="btn btn-sm" type="button"
|
<button class="btn btn-sm" type="button"
|
||||||
wire:click="removeServiceInput({{$key}})">
|
wire:click="removeServiceInput({{$key}})">
|
||||||
<x-bi-trash3/>
|
<x-bi-trash3/>
|
||||||
</button>
|
</button>
|
||||||
@endif
|
@endif
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="row mx-0 px-0">
|
||||||
<div class="row mx-0 px-0">
|
<div class="col-1" style="width: 40px;"></div>
|
||||||
<div class="col-1" style="width: 40px;"></div>
|
<div class="col-1 px-1">
|
||||||
<div class="col-1 px-1">
|
<input id="service_file_name_{{$key}}" type="text"
|
||||||
<input id="service_file_name_{{$key}}" type="text"
|
class="form-control form-control-sm @error('service_file_name') is-invalid @enderror"
|
||||||
class="form-control form-control-sm @error('service_file_name') is-invalid @enderror"
|
name="service_file_name[]" value="{{@old('service_file_name')}}"
|
||||||
name="service_file_name[]" value="{{@old('service_file_name')}}"
|
placeholder="File"
|
||||||
placeholder="File"
|
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})">
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-9 px-1">
|
<div class="col-9 px-1">
|
||||||
<textarea name="contents[]" id="contents_{{$key}}" style="resize: none" rows="2"
|
<textarea name="contents[]" id="contents_{{$key}}" style="resize: none" rows="2"
|
||||||
class="form-control form-control-sm"
|
class="form-control form-control-sm"
|
||||||
placeholder="Thread colors"
|
placeholder="Thread colors"
|
||||||
wire:change="determineAddServiceProductRow({{$loop->index}})"
|
wire:change="determineAddServiceProductRow({{$loop->index}})"
|
||||||
>{{ old('contents') }}</textarea>
|
>{{ old('contents') }}</textarea>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@endforeach
|
||||||
@endforeach
|
</div>
|
||||||
|
|
||||||
{{-- <div class="row">--}}
|
{{-- <div class="row">--}}
|
||||||
<div class="d-flex flex-row gap-2 ">
|
<div class="d-flex flex-row gap-2 ">
|
||||||
|
@ -59,8 +59,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
<label for="order_status" class="col-md-4 col-form-label text-md-end">Order
|
<label for="order_status" class="col-md-4 col-form-label text-md-end">Order Status</label>
|
||||||
Status</label>
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="status" class="form-select form-select-sm" id="order_status">
|
<select name="status" class="form-select form-select-sm" id="order_status">
|
||||||
@foreach($order_status as $case)
|
@foreach($order_status as $case)
|
||||||
@ -139,7 +138,7 @@ class="form-control form-control-sm @error('customer_po') is-invalid @enderror"
|
|||||||
name="purchased_garment">
|
name="purchased_garment">
|
||||||
<label class="form-check-label" for="purchased_garments">
|
<label class="form-check-label" for="purchased_garments">
|
||||||
Purchased
|
Purchased
|
||||||
garments</label>
|
garments</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -41,28 +41,336 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container-fluid" style="max-width: 1800px">
|
||||||
<div class="row justify-content-center my-3">
|
<div class="row justify-content-center my-3 pt-3 ">
|
||||||
<div class="tab-content">
|
|
||||||
|
|
||||||
<div class="tab-pane {{$tab == 'active_orders' ? 'active' : ''}}" id="active_orders" role="tabpanel"
|
<div class="col-11 col-xl-5 border-end">
|
||||||
aria-labelledby="active-orders-tab">
|
|
||||||
<livewire:orders-table order-type="active" :show-customer-column='true' :title="'Active Orders'"/>
|
<div class="row ">
|
||||||
|
<label for="company_name" class="col-4 py-0 col-form-label text-md-end">Customer</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="company_name" id="" class="py-0 form-control-plaintext" readonly
|
||||||
|
value="{{$order->customer->company_name}}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane {{$tab == 'finished_orders' ? 'active' : ''}}" id="finished-orders" role="tabpanel"
|
<div class="row">
|
||||||
aria-labelledby="finished-orders-tab">
|
<label for="contact_name" class="col-4 py-0 col-form-label text-md-end">Contact</label>
|
||||||
<livewire:orders-table order-type="finished" :show-customer-column='true' title="Finished Orders"/>
|
<div class="col-md-6">
|
||||||
|
@if(isset($order->contact))
|
||||||
|
<input type="text" name="contact_name" id="" class="py-0 form-control-plaintext" readonly
|
||||||
|
value="{{$order->contact->full_name}}">
|
||||||
|
@else
|
||||||
|
<input type="text" name="contact_name" id=""
|
||||||
|
class="py-0 form-control-plaintext text-secondary"
|
||||||
|
readonly value="No contact set">
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane {{$tab == 'all' ? 'active' : ''}}" id="all-orders" role="tabpanel"
|
<hr class="border-secondary-subtle px-0">
|
||||||
aria-labelledby="all-orders-tab">
|
|
||||||
<livewire:orders-table order-type="all" :show-customer-column='true' title="All Orders"/>
|
<div class="row">
|
||||||
|
<label for="order_type" class="col-4 py-0 col-form-label text-md-end">Order Type</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="order_type" id="" class="py-0 form-control-plaintext" readonly
|
||||||
|
value="{{$order->order_type}}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="tab-pane {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-orders" role="tabpanel"
|
<div class="row">
|
||||||
aria-labelledby="invoice-orders-tab">
|
<label for="order_status" class="col-4 py-0 col-form-label text-md-end">Order Status</label>
|
||||||
<livewire:orders-table order-type="invoiced" :show-customer-column='true' title="Invoiced Orders"/>
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="order_status" id="" class="py-0 form-control-plaintext" readonly
|
||||||
|
value="{{$order->status}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="border-secondary-subtle px-0">
|
||||||
|
|
||||||
|
<div class="row ">
|
||||||
|
<label for="internal_po" class="col-4 py-0 col-form-label text-md-end">Internal PO</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="internal_po" id="" class="py-0 form-control-plaintext font-monospace"
|
||||||
|
readonly value="{{$order->internal_po}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row py-0 ">
|
||||||
|
<label for="customer_po" class="col-4 py-0 col-form-label text-md-end">Customer PO</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="customer_po" id="" class="py-0 form-control-plaintext font-monospace"
|
||||||
|
readonly value="{{$order->customer_po}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="border-secondary-subtle px-0">
|
||||||
|
|
||||||
|
<div class="row mb-2">
|
||||||
|
<label class="col-4 py-0 col-form-label text-md-end">Attributes</label>
|
||||||
|
<div class="col">
|
||||||
|
@if($order->new_art)
|
||||||
|
<div class="form-check">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="new_art">New art</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if($order->rush)
|
||||||
|
<div class="form-check ">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="new_art">Rush</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if($order->digitizing)
|
||||||
|
<div class="form-check ">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="digitizing">Digitizing</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($order->customer_supplied_file)
|
||||||
|
<div class="form-check ">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="customer_supplied_file">
|
||||||
|
Customer Supplied File
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($order->repeat)
|
||||||
|
<div class="form-check ">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="repeat">Repeat</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@if($order->event)
|
||||||
|
<div class="form-check ">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="event">Event</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if($order->purchased_garments)
|
||||||
|
<div class="form-check ">
|
||||||
|
<x-bi-check/>
|
||||||
|
<label class="form-check-label" for="purchased_garments">Purchased Garments</label>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="border-secondary-subtle px-0">
|
||||||
|
|
||||||
|
<div class="row py-0 ">
|
||||||
|
<label for="order_date" class="col-4 py-0 col-form-label text-md-end">Order Date</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="order_date" id="" class="py-0 form-control-plaintext"
|
||||||
|
readonly value="{{$order->order_date}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="row py-0 ">
|
||||||
|
<label for="due_date" class="col-4 py-0 col-form-label text-md-end">Due Date</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input type="text" name="due_date" id="" class="py-0 form-control-plaintext"
|
||||||
|
readonly value="{{$order->due_date}}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<hr class="border-secondary-subtle px-0">
|
||||||
|
|
||||||
|
<div class="row mb-2">
|
||||||
|
<label for="notes" class="col-4 py-0 col-form-label text-md-end">Notes</label>
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
<textarea name="notes" style="resize: none" id="notes" cols="30" rows="5"
|
||||||
|
class="form-control form-control-sm" readonly>{{ $order->notes }}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xl-7">
|
||||||
|
<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($order->orderProducts as $key => $product)
|
||||||
|
<input type="hidden" name="productInputCount[]" value="1">
|
||||||
|
|
||||||
|
<th scope="row" class="align-middle">{{$loop->index+1}}</th>
|
||||||
|
<td class="col-1">
|
||||||
|
<!-- SKU -->
|
||||||
|
{{$product->sku}}
|
||||||
|
</td>
|
||||||
|
<td class="col-3">
|
||||||
|
<!-- product_name -->
|
||||||
|
{{$product->product_name}}
|
||||||
|
</td>
|
||||||
|
<td class="col-1">
|
||||||
|
<!-- product_color -->
|
||||||
|
{{$product->color}}
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_xs -->
|
||||||
|
{{$product->productSizes()->get()->where('size', 'xs')->first()->amount ?? ''}}
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_s -->
|
||||||
|
{{$product->productSizes()->get()->where('size', 'xs')->first()->amount ?? ''}}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_m -->
|
||||||
|
{{$product->productSizes()->get()->where('size', 'm')->first()->amount ?? ''}}
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_l -->
|
||||||
|
{{$product->productSizes()->get()->where('size', 'l')->first()->amount ?? ''}}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_xl -->
|
||||||
|
{{$product->productSizes()->get()->where('size', 'xl')->first()->amount ?? ''}}
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_2xl -->
|
||||||
|
{{$product->productSizes()->get()->where('size', '2xl')->first()->amount ?? ''}}
|
||||||
|
</td>
|
||||||
|
<td class="" style="width: 55px">
|
||||||
|
<!-- size_3xl -->
|
||||||
|
{{$product->productSizes()->get()->where('size', '3xl')->first()->amount ?? ''}}
|
||||||
|
</td>
|
||||||
|
<td style="width: 55px">
|
||||||
|
<!-- size_osfa -->
|
||||||
|
{{$product->productSizes()->get()->where('size', 'osfa')->first()->amount ?? ''}}
|
||||||
|
</td>
|
||||||
|
<td class="col" style="width: 55px">
|
||||||
|
{{$product->totalQuantity()}}
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td class="col" style="width: 40px">
|
||||||
|
</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
|
||||||
|
value="{{$order->totalProductQuantity()}}">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Product Services -->
|
||||||
|
<div class="ms-2">
|
||||||
|
|
||||||
|
<!-- Title -->
|
||||||
|
<div class="row px-2 border-bottom mt-4">
|
||||||
|
<div class="row fw-bold">
|
||||||
|
<div class="col-1 px-0" 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>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Row -->
|
||||||
|
|
||||||
|
@foreach($order->productServices as $key => $service)
|
||||||
|
<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" style="width: 40px;">{{$loop->index+1}}</div>
|
||||||
|
<div class="col-1 px-2 fw-bold text-uppercase">
|
||||||
|
<!-- Service type -->
|
||||||
|
{{$service->service_type}}
|
||||||
|
</div>
|
||||||
|
<div class="col-2 px-1 text-uppercase">
|
||||||
|
{{$service->placement}}
|
||||||
|
</div>
|
||||||
|
<div class="col-3 px-1 text-uppercase">
|
||||||
|
{{$service->serviceFile->name }}
|
||||||
|
</div>
|
||||||
|
<div class="col-5">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col px-1">
|
||||||
|
{{$service->serviceFile->setup_number}}
|
||||||
|
</div>
|
||||||
|
<div class="col px-1">
|
||||||
|
{{$service->serviceFile->width}}
|
||||||
|
</div>
|
||||||
|
<div class="col px-1">
|
||||||
|
{{$service->serviceFile->height}}
|
||||||
|
</div>
|
||||||
|
<div class="col px-1">
|
||||||
|
{{$service->amount}}
|
||||||
|
</div>
|
||||||
|
<div class="col px-1">
|
||||||
|
{{$service->amount_price != 0 ? $service->amount_price : ''}}
|
||||||
|
</div>
|
||||||
|
<div class="col px-1">
|
||||||
|
{{$service->amount_price != 0 ? '$' . number_format($service->amount_price*$service->amount, 2) : ''}}
|
||||||
|
</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">
|
||||||
|
<code>
|
||||||
|
{{$service->serviceFile->code}}
|
||||||
|
</code>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-9 px-1">
|
||||||
|
{{$service->serviceFile->notes}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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
|
||||||
|
value="{{'$'.$order->totalServicePrice()}}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user