From 16e4ce43bbe58e6b96ca62bfe5e4a8337349f91d Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 18 Jun 2026 21:18:53 +0530 Subject: [PATCH] Updated invoice_quantity value to trace scanned and pending quantity for the item code in livewire and blade file --- app/Livewire/InvoiceDataTable.php | 8 +++++++ .../livewire/invoice-data-table.blade.php | 22 ++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/app/Livewire/InvoiceDataTable.php b/app/Livewire/InvoiceDataTable.php index 87f1342..bbe239b 100644 --- a/app/Livewire/InvoiceDataTable.php +++ b/app/Livewire/InvoiceDataTable.php @@ -581,6 +581,9 @@ class InvoiceDataTable extends Component return [ 'sticker_master_id' => $record->sticker_master_id, // 'material_type' => StickerMaster::where('id', $record->sticker_master_id)->first()->material_type ?? '', + 'invoice_quantity' => $record->invoice_quantity ?? 0, + 'scanned_quantity' => ($record->invoice_quantity == null) ? 0 : ($record->invoice_quantity - $record->quantity) ?? 0, + // 'scanned_quantity' => number_format(($record->invoice_quantity == null ? 0 : ($record->invoice_quantity - $record->quantity)), 3, '.', ''), 'quantity' => $record->quantity ?? '', 'serial_number' => $record->serial_number ?? '', 'batch_number' => $record->batch_number ?? '', @@ -597,12 +600,17 @@ class InvoiceDataTable extends Component $matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? ''; if ($matType == 1) { $row['material_type'] = 'Individual'; + $row['invoice_quantity'] = $row['quantity']; } elseif ($matType == 2) { $row['material_type'] = 'Bundle'; + $row['invoice_quantity'] = $row['quantity']; } elseif ($matType == 3) { $row['material_type'] = 'Quantity'; + $row['invoice_quantity'] = number_format($row['invoice_quantity'], 3, '.', ''); + $row['scanned_quantity'] = number_format($row['scanned_quantity'], 3, '.', ''); } elseif ($matType == 4) { $row['material_type'] = 'Bundle Individual'; + $row['invoice_quantity'] = $row['quantity']; } else { $row['material_type'] = 'N/A'; } diff --git a/resources/views/livewire/invoice-data-table.blade.php b/resources/views/livewire/invoice-data-table.blade.php index b29619f..2d19bcc 100644 --- a/resources/views/livewire/invoice-data-table.blade.php +++ b/resources/views/livewire/invoice-data-table.blade.php @@ -229,7 +229,9 @@ No Material Code Material Type - Material Quantity + Invoice Quantity + To Be Scanned + Scanned Quantity Serial Number Batch Number TimeStamp @@ -244,9 +246,23 @@ {{ $row['material_type'] ?? 'N/A' }} @if(($row['material_type'] ?? '') == 'Individual' || ($row['material_type'] ?? '') == 'Bundle' || ($row['material_type'] ?? '') == 'Bundle Individual') - {{ number_format((float)($row['quantity'] ?? 0), 0) }} + {{ number_format((float)($row['invoice_quantity'] ?? 0), 0) }} @else - {{ $row['quantity'] ?? 'N/A' }} + {{ $row['invoice_quantity'] ?? 'N/A' }} + @endif + + + @if(($row['material_type'] ?? '') == 'Individual' || ($row['material_type'] ?? '') == 'Bundle' || ($row['material_type'] ?? '') == 'Bundle Individual') + {{ number_format((float)($row['quantity'] ?? 0), 0) }} + @else + {{ $row['quantity'] ?? 'N/A' }} + @endif + + + @if(($row['material_type'] ?? '') == 'Individual' || ($row['material_type'] ?? '') == 'Bundle' || ($row['material_type'] ?? '') == 'Bundle Individual') + {{ number_format((float)($row['scanned_quantity'] ?? 0), 0) }} + @else + {{ $row['scanned_quantity'] ?? 'N/A' }} @endif {{ $row['serial_number'] ?? 'N/A' }}