Order Show page
This commit is contained in:
parent
7074596cb7
commit
8e80ba9480
@ -5,13 +5,15 @@
|
|||||||
use App\Http\Requests\ContactRequest;
|
use App\Http\Requests\ContactRequest;
|
||||||
use App\Models\Contact;
|
use App\Models\Contact;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class ContactController extends Controller
|
class ContactController extends Controller
|
||||||
{
|
{
|
||||||
public function index() {}
|
public function index(): void {}
|
||||||
|
|
||||||
public function create(Request $request)
|
public function create(Request $request): View
|
||||||
{
|
{
|
||||||
return view('contacts.create', [
|
return view('contacts.create', [
|
||||||
'customers' => Customer::all(),
|
'customers' => Customer::all(),
|
||||||
@ -19,20 +21,20 @@ public function create(Request $request)
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(ContactRequest $request)
|
public function store(ContactRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$contact = Contact::create($request->validated());
|
$contact = Contact::create($request->validated());
|
||||||
|
|
||||||
return redirect()->route('customers.show', [$contact->customer, 'contacts'])->with('status', 'Contact created successfully');
|
return redirect()->route('customers.show', [$contact->customer, 'contacts'])->with('status', 'Contact created successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id) {}
|
public function show(int $id): void {}
|
||||||
|
|
||||||
public function edit($id) {}
|
public function edit(int $id): void {}
|
||||||
|
|
||||||
public function update(Request $request, $id) {}
|
public function update(Request $request, int $id): void {}
|
||||||
|
|
||||||
public function requestDestroy(Request $request)
|
public function requestDestroy(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$contact = Contact::find($request->get('contact'));
|
$contact = Contact::find($request->get('contact'));
|
||||||
$contact->delete();
|
$contact->delete();
|
||||||
@ -40,5 +42,5 @@ public function requestDestroy(Request $request)
|
|||||||
return redirect()->route('customers.show', [$contact->customer->id, 'contacts'])->with('status', 'Contact deleted successfully');
|
return redirect()->route('customers.show', [$contact->customer->id, 'contacts'])->with('status', 'Contact deleted successfully');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy($id) {}
|
public function destroy(int $id): void {}
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,16 @@
|
|||||||
use App\Http\Requests\CustomerRequest;
|
use App\Http\Requests\CustomerRequest;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
use App\Models\PackingSlip;
|
use App\Models\PackingSlip;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
class CustomerController extends Controller
|
class CustomerController extends Controller
|
||||||
{
|
{
|
||||||
public function index() {}
|
public function index(): void {}
|
||||||
|
|
||||||
public function store(CustomerRequest $request)
|
public function store(CustomerRequest $request)
|
||||||
{
|
{
|
||||||
@ -19,12 +23,12 @@ public function store(CustomerRequest $request)
|
|||||||
return redirect()->route('management.index')->with('status', 'Customer created successfully.');
|
return redirect()->route('management.index')->with('status', 'Customer created successfully.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create()
|
public function create(): Factory|View|Application|\Illuminate\View\View
|
||||||
{
|
{
|
||||||
return view('customers.create');
|
return view('customers.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show(Customer $customer, ?string $tab = null)
|
public function show(Customer $customer, ?string $tab = null): RedirectResponse|View
|
||||||
{
|
{
|
||||||
if (! $tab) {
|
if (! $tab) {
|
||||||
return redirect()->route('customers.show', [$customer, 'tab' => 'details']);
|
return redirect()->route('customers.show', [$customer, 'tab' => 'details']);
|
||||||
@ -40,14 +44,14 @@ public function show(Customer $customer, ?string $tab = null)
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function update(CustomerRequest $request, Customer $customer)
|
public function update(CustomerRequest $request, Customer $customer): RedirectResponse
|
||||||
{
|
{
|
||||||
$customer->update($request->validated());
|
$customer->update($request->validated());
|
||||||
|
|
||||||
return redirect()->route('customers.show', $customer)->with('status', 'Customer updated successfully.');
|
return redirect()->route('customers.show', $customer)->with('status', 'Customer updated successfully.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function requestDestroy(Request $request)
|
public function requestDestroy(Request $request): RedirectResponse
|
||||||
{
|
{
|
||||||
$customer = Customer::find($request->id);
|
$customer = Customer::find($request->id);
|
||||||
$customer->delete();
|
$customer->delete();
|
||||||
@ -55,7 +59,7 @@ public function requestDestroy(Request $request)
|
|||||||
return redirect()->route('management.index')->with('status', 'Customer deleted successfully.');
|
return redirect()->route('management.index')->with('status', 'Customer deleted successfully.');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function destroy(Customer $customer)
|
public function destroy(Customer $customer): RedirectResponse
|
||||||
{
|
{
|
||||||
$customer->delete();
|
$customer->delete();
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
|
use App\Models\ServiceFile;
|
||||||
|
|
||||||
class ManagementController extends Controller
|
class ManagementController extends Controller
|
||||||
{
|
{
|
||||||
@ -15,8 +16,9 @@ public function index(?string $tab = null)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return view('management.index', [
|
return view('management.index', [
|
||||||
'customers' => Customer::all(),
|
'customers' => Customer::all(),
|
||||||
'tab' => $tab,
|
'serviceFiles' => ServiceFile::paginate(15),
|
||||||
|
'tab' => $tab,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -80,30 +83,28 @@ public function store(OrderRequest $request)
|
|||||||
|
|
||||||
// Create productServices
|
// Create productServices
|
||||||
for ($i = 0; $i < count($request->get('serviceInputCount')) - 1; $i++) {
|
for ($i = 0; $i < count($request->get('serviceInputCount')) - 1; $i++) {
|
||||||
$productService = ProductService::create([
|
$serviceFile = ServiceFile::create([
|
||||||
'order_id' => $order->id,
|
'code' => $request->get('service_file_name')[$i],
|
||||||
'service_type' => $request->get('service_type')[$i],
|
'name' => $request->get('logo_name')[$i],
|
||||||
'placement' => $request->get('placement')[$i],
|
'width' => $request->get('service_width')[$i],
|
||||||
'setup_amount' => $request->get('setup_amount')[$i],
|
'height' => $request->get('service_height')[$i],
|
||||||
'amount' => $request->get('amount')[$i],
|
'setup_number' => $request->get('setup_amount')[$i],
|
||||||
'amount_price' => $request->get('amount_price')[$i],
|
]);
|
||||||
|
ProductService::create([
|
||||||
|
'order_id' => $order->id,
|
||||||
|
'service_file_id' => $serviceFile->id,
|
||||||
|
'service_type' => $request->get('service_type')[$i],
|
||||||
|
'placement' => $request->get('placement')[$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],
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return redirect()->route('order-products.create', ['order' => $order->id]);
|
return redirect()->route('orders.show', $order);
|
||||||
}
|
}
|
||||||
|
|
||||||
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 +112,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) {}
|
||||||
|
|
||||||
|
@ -2,24 +2,27 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Foundation\Application;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class OrderProductController extends Controller
|
class OrderProductController extends Controller
|
||||||
{
|
{
|
||||||
public function index() {}
|
public function index(): void {}
|
||||||
|
|
||||||
public function create()
|
public function create(): Factory|\Illuminate\Contracts\View\View|Application|View
|
||||||
{
|
{
|
||||||
return view('order-products.create');
|
return view('order-products.create');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function store(Request $request) {}
|
public function store(Request $request): void {}
|
||||||
|
|
||||||
public function show($id) {}
|
public function show($id): void {}
|
||||||
|
|
||||||
public function edit($id) {}
|
public function edit($id): void {}
|
||||||
|
|
||||||
public function update(Request $request, $id) {}
|
public function update(Request $request, $id): void {}
|
||||||
|
|
||||||
public function destroy($id) {}
|
public function destroy($id): void {}
|
||||||
}
|
}
|
||||||
|
@ -5,15 +5,16 @@
|
|||||||
use App\Http\Requests\PackingSlipRequest;
|
use App\Http\Requests\PackingSlipRequest;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
use App\Models\PackingSlip;
|
use App\Models\PackingSlip;
|
||||||
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class PackingSlipController extends Controller
|
class PackingSlipController extends Controller
|
||||||
{
|
{
|
||||||
public function index() {}
|
public function index(): void {}
|
||||||
|
|
||||||
public function create() {}
|
public function create(): void {}
|
||||||
|
|
||||||
public function store(PackingSlipRequest $request)
|
public function store(PackingSlipRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
PackingSlip::create($request->validated());
|
PackingSlip::create($request->validated());
|
||||||
|
|
||||||
@ -27,11 +28,11 @@ public function store(PackingSlipRequest $request)
|
|||||||
return redirect()->back(); //todo: change to packing slips page
|
return redirect()->back(); //todo: change to packing slips page
|
||||||
}
|
}
|
||||||
|
|
||||||
public function show($id) {}
|
public function show($id): void {}
|
||||||
|
|
||||||
public function edit($id) {}
|
public function edit($id): void {}
|
||||||
|
|
||||||
public function update(Request $request, $id) {}
|
public function update(Request $request, $id): void {}
|
||||||
|
|
||||||
public function destroy($id) {}
|
public function destroy($id): void {}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
use App\Enums\OrderStatus;
|
use App\Enums\OrderStatus;
|
||||||
use App\Enums\OrderType;
|
use App\Enums\OrderType;
|
||||||
use App\Models\Customer;
|
use App\Models\Customer;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
@ -17,18 +18,18 @@ class CreateOrder extends Component
|
|||||||
|
|
||||||
public $contacts;
|
public $contacts;
|
||||||
|
|
||||||
public function mount(Collection $customers)
|
public function mount(Collection $customers): void
|
||||||
{
|
{
|
||||||
$this->customers = $customers;
|
$this->customers = $customers;
|
||||||
$this->contacts = $customers->first()->contacts;
|
$this->contacts = $customers->first()->contacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getContacts()
|
public function getContacts(): void
|
||||||
{
|
{
|
||||||
$this->contacts = Customer::find($this->selectedCustomer)->contacts;
|
$this->contacts = Customer::find($this->selectedCustomer)->contacts;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render()
|
public function render(): View
|
||||||
{
|
{
|
||||||
return view('livewire.create-order', [
|
return view('livewire.create-order', [
|
||||||
'contacts' => $this->contacts,
|
'contacts' => $this->contacts,
|
||||||
|
@ -11,17 +11,19 @@
|
|||||||
|
|
||||||
class OrderProductsCreate extends Component
|
class OrderProductsCreate extends Component
|
||||||
{
|
{
|
||||||
|
/** @var Collection<string, int> */
|
||||||
public Collection $productInputs;
|
public Collection $productInputs;
|
||||||
|
|
||||||
|
/** @var Collection<string, int> */
|
||||||
public Collection $serviceInputs;
|
public Collection $serviceInputs;
|
||||||
|
|
||||||
/**
|
/** @var array<int> */
|
||||||
* @var array<int>
|
|
||||||
*/
|
|
||||||
public array $sizes = [];
|
public array $sizes = [];
|
||||||
|
|
||||||
|
/** @var array<int> */
|
||||||
public array $totals = [];
|
public array $totals = [];
|
||||||
|
|
||||||
|
/** @var array<int> */
|
||||||
public array $units = [];
|
public array $units = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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(): string
|
||||||
|
{
|
||||||
|
$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);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class ProductService extends Model
|
class ProductService extends Model
|
||||||
@ -16,9 +15,9 @@ class ProductService extends Model
|
|||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'order_id',
|
'order_id',
|
||||||
|
'service_file_id',
|
||||||
'service_type',
|
'service_type',
|
||||||
'placement',
|
'placement',
|
||||||
'setup_amount',
|
|
||||||
'amount',
|
'amount',
|
||||||
'amount_price',
|
'amount_price',
|
||||||
];
|
];
|
||||||
@ -32,10 +31,10 @@ public function order(): BelongsTo
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return HasOne<ServiceFile>
|
* @return BelongsTo<ServiceFile, self>
|
||||||
*/
|
*/
|
||||||
public function serviceFile(): HasOne
|
public function serviceFile(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->hasOne(ServiceFile::class);
|
return $this->BelongsTo(ServiceFile::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
use Database\Factories\ServiceFileFactory;
|
use Database\Factories\ServiceFileFactory;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class ServiceFile extends Model
|
class ServiceFile extends Model
|
||||||
@ -15,19 +15,17 @@ class ServiceFile extends Model
|
|||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'code',
|
'code',
|
||||||
'product_service_id',
|
|
||||||
'name',
|
'name',
|
||||||
'width',
|
'width',
|
||||||
'height',
|
'height',
|
||||||
'unit',
|
|
||||||
'setup_number',
|
'setup_number',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return BelongsTo<ProductService, self>
|
* @return HasMany<ProductService>
|
||||||
*/
|
*/
|
||||||
public function productService(): BelongsTo
|
public function productService(): HasMany
|
||||||
{
|
{
|
||||||
return $this->belongsTo(ProductService::class);
|
return $this->HasMany(ProductService::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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']),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,9 @@ public function up(): void
|
|||||||
Schema::create('product_services', function (Blueprint $table) {
|
Schema::create('product_services', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->foreignId('order_id');
|
$table->foreignId('order_id');
|
||||||
|
$table->foreignId('service_file_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();
|
||||||
|
@ -10,14 +10,13 @@ public function up(): void
|
|||||||
{
|
{
|
||||||
Schema::create('service_files', function (Blueprint $table) {
|
Schema::create('service_files', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$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')->nullable();
|
||||||
$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();
|
->for(ServiceFile::factory())))
|
||||||
|
->create();
|
||||||
|
}
|
||||||
|
|
||||||
Customer::factory([
|
Customer::factory([
|
||||||
'company_name' => 'Genumark',
|
'company_name' => 'Genumark',
|
||||||
@ -86,7 +89,11 @@ public function run(): void
|
|||||||
'notify' => 'Jane Wellman',
|
'notify' => 'Jane Wellman',
|
||||||
'notes' => 'Don\'t CC Kathlyn for SOF orders',
|
'notes' => 'Don\'t CC Kathlyn for SOF orders',
|
||||||
]))
|
]))
|
||||||
->has(Order::factory(10))
|
->has(Order::factory(10)
|
||||||
|
->has(OrderProduct::factory(rand(1, 10))
|
||||||
|
->has(productSize::factory(rand(1, 8))))
|
||||||
|
->has(ProductService::factory(rand(1, 10))
|
||||||
|
->for(ServiceFile::factory())))
|
||||||
->create();
|
->create();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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_amount_{{$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_amount') is-invalid @enderror"
|
||||||
name="setup_amount[]" value="{{@old('setup_number')}}"
|
name="setup_amount[]" value="{{@old('setup_amount')}}"
|
||||||
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 ">
|
||||||
|
@ -88,8 +88,7 @@ class="btn btn-sm btn-primary" title="Create new order...">
|
|||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
<td class="align-top">
|
<td class="align-top">
|
||||||
<a class="btn btn-sm btn-outline-secondary px-1 py-0 m-0"
|
<a class="" href="{{route('orders.show', $order)}}">
|
||||||
href="">
|
|
||||||
<x-bi-arrow-right/>
|
<x-bi-arrow-right/>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -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>
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
|
|
||||||
<!-- Tabs row -->
|
<!-- Tabs row -->
|
||||||
<div class="row justify-content-center mb-3">
|
<div class="row justify-content-center mb-3">
|
||||||
<div class="col-3 border-bottom"></div>
|
<div class="col-2 border-bottom"></div>
|
||||||
<div class="col-6 p-0">
|
<div class="col-8 p-0">
|
||||||
|
|
||||||
<ul class="nav nav-fill nav-tabs" id="home-tabs" role="tablist">
|
<ul class="nav nav-fill nav-tabs" id="home-tabs" role="tablist">
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
@ -25,6 +25,15 @@
|
|||||||
Order Details
|
Order Details
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item" role="presentation">
|
||||||
|
<a class="nav-link link-dark {{$tab == 'packing-slips' ? 'active' : ''}}" id="packing-slips-tab"
|
||||||
|
href="{{route('orders.index', ['tab' => 'packing-slips'])}}" type="button" role="tab"
|
||||||
|
aria-controls="packing-slips"
|
||||||
|
aria-selected="{{$tab == 'packing-slips' ? 'true' : 'false'}}">
|
||||||
|
<x-bi-calendar-range/>
|
||||||
|
Packing Slips
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item" role="presentation">
|
<li class="nav-item" role="presentation">
|
||||||
<a class="nav-link link-dark {{$tab == 'timeline' ? 'active' : ''}}" id="timeline-tab"
|
<a class="nav-link link-dark {{$tab == 'timeline' ? 'active' : ''}}" id="timeline-tab"
|
||||||
href="{{route('orders.index', ['tab' => 'timeline'])}}" type="button" role="tab"
|
href="{{route('orders.index', ['tab' => 'timeline'])}}" type="button" role="tab"
|
||||||
@ -33,6 +42,23 @@
|
|||||||
Timeline
|
Timeline
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item" role="presentation">
|
||||||
|
<a class="nav-link link-dark {{$tab == 'quote' ? 'active' : ''}}" id="quote-tab"
|
||||||
|
href="{{route('orders.index', ['tab' => 'quote'])}}" type="button" role="tab"
|
||||||
|
aria-controls="quote" aria-selected="{{$tab == 'quote' ? 'true' : 'false'}}">
|
||||||
|
<x-bi-calendar-range/>
|
||||||
|
Quote
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li class="nav-item" role="presentation">
|
||||||
|
<a class="nav-link link-dark {{$tab == 'invoice' ? 'active' : ''}}" id="invoice-tab"
|
||||||
|
href="{{route('orders.index', ['tab' => 'invoice'])}}" type="button" role="tab"
|
||||||
|
aria-controls="invoice" aria-selected="{{$tab == 'invoice' ? 'true' : 'false'}}">
|
||||||
|
<x-bi-calendar-range/>
|
||||||
|
Invoice
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="col border-bottom"></div>
|
<div class="col border-bottom"></div>
|
||||||
@ -41,28 +67,331 @@
|
|||||||
@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-4 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-5 py-0 col-form-label text-md-end">Customer</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<a class="fw-bold text-body text-decoration-none"
|
||||||
|
href="{{route('customers.show', [$order->customer, 'details'])}}">{{$order->customer->company_name}}</a>
|
||||||
|
</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-5 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-5 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-5 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-5 py-0 col-form-label text-md-end">Internal PO</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<code class="fw-bold">{{$order->internal_po}}</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row py-0 ">
|
||||||
|
<label for="customer_po" class="col-5 py-0 col-form-label text-md-end">Customer PO</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<code>{{$order->customer_po}}</code>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr class="border-secondary-subtle px-0">
|
||||||
|
|
||||||
|
<div class="row mb-2">
|
||||||
|
<label class="col-5 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-5 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-5 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-5 py-0 col-form-label text-md-end">Notes</label>
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
{{$order->notes}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-xl-7">
|
||||||
|
<table class="table table-striped table-hover 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', 's')->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 ps-2">
|
||||||
|
<code class="fs-6">
|
||||||
|
{{$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>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@if(sizeof($customers) !== 0)
|
@if(sizeof($customers) !== 0)
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-sm table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr class="border-bottom border-black">
|
<tr class="border-bottom border-black">
|
||||||
<th scope="col">Company Name</th>
|
<th scope="col">Company Name</th>
|
||||||
@ -57,8 +57,7 @@
|
|||||||
<td> {{$customer->billing_address}} </td>
|
<td> {{$customer->billing_address}} </td>
|
||||||
<td class="text-nowrap"> {{$customer->phone}} </td>
|
<td class="text-nowrap"> {{$customer->phone}} </td>
|
||||||
<td class="align-top">
|
<td class="align-top">
|
||||||
<a class="btn btn-sm btn-outline-secondary"
|
<a class="" href="{{route('customers.show', [$customer->id, 'tab'=>'details'])}}">
|
||||||
href="{{route('customers.show', [$customer->id, 'tab'=>'details'])}}">
|
|
||||||
<x-bi-arrow-right/>
|
<x-bi-arrow-right/>
|
||||||
</a>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
|
@ -1,5 +1,31 @@
|
|||||||
<div class="tab-pane {{$tab == 'files' ? 'active' : ''}}" id="files" role="tabpanel"
|
<div class="tab-pane {{$tab == 'files' ? 'active' : ''}}" id="files" role="tabpanel"
|
||||||
aria-labelledby="files-tab">
|
aria-labelledby="files-tab">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-8">
|
||||||
|
<table class="table table-sm table-striped table-hover">
|
||||||
|
<thead>
|
||||||
|
<th>Code</th>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Width</th>
|
||||||
|
<th>Height</th>
|
||||||
|
<th>Setup Number</th>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($serviceFiles as $file)
|
||||||
|
<tr>
|
||||||
|
<td>{{$file->code}}</td>
|
||||||
|
<td>{{$file->name}}</td>
|
||||||
|
<td>{{$file->width}}</td>
|
||||||
|
<td>{{$file->height}}</td>
|
||||||
|
<td>{{$file->setup_number}}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{{$serviceFiles->links()}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
Files
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user