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 @@