From 95436af7da371725fff2cae01ca9c3a0f6e008a1 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Tue, 1 Jul 2025 14:42:55 +0530 Subject: [PATCH] Added locator invoice validation livewire page and table --- app/Livewire/LocatorInvoiceDataTable.php | 56 +++++++++++++ ...reate-locator-invoice-validation.blade.php | 84 +++++++++++++++++++ .../locator-invoice-data-table.blade.php | 45 ++++++++++ 3 files changed, 185 insertions(+) create mode 100644 app/Livewire/LocatorInvoiceDataTable.php create mode 100644 resources/views/filament/resources/pallet-validation-resource/pages/create-locator-invoice-validation.blade.php create mode 100644 resources/views/livewire/locator-invoice-data-table.blade.php diff --git a/app/Livewire/LocatorInvoiceDataTable.php b/app/Livewire/LocatorInvoiceDataTable.php new file mode 100644 index 0000000..543de15 --- /dev/null +++ b/app/Livewire/LocatorInvoiceDataTable.php @@ -0,0 +1,56 @@ + 'loadlocatorInvoiceData', + ]; + + public function loadlocatorInvoiceData($invoiceNumber, $plantId) + { + $this->plantId = $plantId; + $this->invoiceNumber = $invoiceNumber; + + $this->records = LocatorInvoiceValidation::query() + ->where('plant_id', $plantId) + ->where('invoice_number', $invoiceNumber) + ->where(function ($query) { + $query->where('scanned_status', '=', '') + ->orWhereNull('scanned_status'); + }) + ->orderBy('created_at', 'asc') + // ->orderByDesc('created_at') + ->get() + ->map(function ($record) { + return [ + 'created_at' => $record->created_at, + 'created_by' => $record->created_by ?? '', + 'serial_number' => $record->serial_number, + 'pallet_number' => $record->pallet_number, + 'locator_number' => $record->locator_number, + 'scanned_status' => $record->scanned_status, + 'scanned_at' => $record->scanned_at, + 'scanned_by' => $record->scanned_by ?? '', + ]; + }) + ->toArray(); + } + public function render() + { + return view('livewire.locator-invoice-data-table'); + } +} diff --git a/resources/views/filament/resources/pallet-validation-resource/pages/create-locator-invoice-validation.blade.php b/resources/views/filament/resources/pallet-validation-resource/pages/create-locator-invoice-validation.blade.php new file mode 100644 index 0000000..a2eb893 --- /dev/null +++ b/resources/views/filament/resources/pallet-validation-resource/pages/create-locator-invoice-validation.blade.php @@ -0,0 +1,84 @@ +{{-- + +
+ {{-- Form Section --}} + {{--
+ {{ $this->form }} +
--}} + + {{-- Livewire Component (Invoice Table) --}} + {{--
+ +
--}} + + {{-- Heading after Livewire component (optional) --}} + {{--

hello

--}} + + {{-- Actions --}} + {{--
+ + @foreach ($this->getFormActions() as $action) + {{ $action }} + @endforeach + +
+
+ +
--}} + + + + + +
+ {{-- Form Section --}} +
+ {{ $this->form }} +
+ + {{-- Livewire Component (Invoice Table) --}} +
+ +
+ + {{-- Actions --}} +
+ + @foreach ($this->getFormActions() as $action) + {{ $action }} + @endforeach + +
+
+ {{-- Modal for removing matched serials --}} + + +

hello

+ + Remove Matched Serials from Pallet Validation? + + +
+ + MODAL IS OPENED! +
+
+

The following serial numbers exist in both tables and will be removed from Pallet Validation if you proceed:

+
    + @foreach ($matchedSerialNumbersForRemoval as $serial) +
  • {{ $serial }}
  • + @endforeach +
+
+
+ + + Yes, Remove + + + No, Cancel + + +
+
+ diff --git a/resources/views/livewire/locator-invoice-data-table.blade.php b/resources/views/livewire/locator-invoice-data-table.blade.php new file mode 100644 index 0000000..a5e1369 --- /dev/null +++ b/resources/views/livewire/locator-invoice-data-table.blade.php @@ -0,0 +1,45 @@ +
+

+ INVOICE DATA TABLE: +

+
+ + + + + + + + + + + + + + + + @forelse ($records as $index => $record) + + + + + + + + + + + + @empty + + + + @endforelse + +
NoCreated DatetimeCreated BySerial NumberPallet NumberLocator NumberScanned StatusScanned DatetimeScanned By
{{ $index + 1 }}{{ $record['created_at'] ?? '' }}{{ $record['created_by'] ?? '' }}{{ $record['serial_number'] ?? '' }}{{ $record['pallet_number'] ?? '' }}{{ $record['locator_number'] ?? '' }}{{ $record['scanned_status'] ?? '' }}{{ $record['scanned_at'] ?? '' }}{{ $record['scanned_by'] ?? '' }}
+ No records found. +
+
+ +
+