Updated invoice_quantity value to trace scanned and pending quantity for the item code in livewire and blade file
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 14s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 20s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 19s
Laravel Pint / pint (pull_request) Successful in 2m48s
Laravel Larastan / larastan (pull_request) Failing after 3m58s

This commit is contained in:
dhanabalan
2026-06-18 21:18:53 +05:30
parent f82c3fe390
commit 16e4ce43bb
2 changed files with 27 additions and 3 deletions

View File

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

View File

@@ -229,7 +229,9 @@
<th class="border px-4 py-2">No</th>
<th class="border px-4 py-2">Material Code</th>
<th class="border px-4 py-2">Material Type</th>
<th class="border px-4 py-2">Material Quantity</th>
<th class="border px-4 py-2">Invoice Quantity</th>
<th class="border px-4 py-2">To Be Scanned</th>
<th class="border px-4 py-2">Scanned Quantity</th>
<th class="border px-4 py-2">Serial Number</th>
<th class="border px-4 py-2">Batch Number</th>
<th class="border px-4 py-2">TimeStamp</th>
@@ -244,9 +246,23 @@
<td class="border px-4 py-2">{{ $row['material_type'] ?? 'N/A' }}</td>
<td class="border px-4 py-2">
@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
</td>
<td class="border px-4 py-2">
@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
</td>
<td class="border px-4 py-2">
@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
</td>
<td class="border px-4 py-2">{{ $row['serial_number'] ?? 'N/A' }}</td>