Updated clear panel box QR if cancel button clicked and Added panel_box_code update logic on livewire page
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled
This commit is contained in:
@@ -6,17 +6,17 @@ use App\Models\InvoiceValidation;
|
||||
use App\Models\StickerMaster;
|
||||
use Filament\Facades\Filament;
|
||||
use Filament\Notifications\Notification;
|
||||
use Livewire\Component;
|
||||
use Str;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Component;
|
||||
use Livewire\WithPagination;
|
||||
use Str;
|
||||
|
||||
class InvoiceDataTable extends Component
|
||||
{
|
||||
|
||||
use WithPagination;
|
||||
|
||||
protected $paginationTheme = 'tailwind';
|
||||
|
||||
public $invoiceData = [];
|
||||
|
||||
// public $invoiceRecords;
|
||||
@@ -25,7 +25,6 @@ class InvoiceDataTable extends Component
|
||||
|
||||
public $package = [];
|
||||
|
||||
|
||||
public $packageCount = 0;
|
||||
|
||||
public string $invoiceNumber = '';
|
||||
@@ -58,7 +57,7 @@ class InvoiceDataTable extends Component
|
||||
|
||||
public $panel_box_supplier;
|
||||
|
||||
public $panel_box_item_code;
|
||||
public $panel_box_code;
|
||||
|
||||
public $panel_box_serial_number;
|
||||
|
||||
@@ -303,10 +302,8 @@ class InvoiceDataTable extends Component
|
||||
// $this->dispatch($onCapFocus ? 'focus-capacitor-input' : 'focus-serial-number');
|
||||
// }
|
||||
|
||||
|
||||
// #[On('refreshInvoiceData')]
|
||||
|
||||
|
||||
// public function loadData($invoiceNumber, $plantId, $onCapFocus = false)
|
||||
// {
|
||||
// $this->invoiceNumber = $invoiceNumber;
|
||||
@@ -371,7 +368,6 @@ class InvoiceDataTable extends Component
|
||||
// $this->dispatch($onCapFocus ? 'focus-capacitor-input' : 'focus-serial-number');
|
||||
// }
|
||||
|
||||
|
||||
public function loadData($invoiceNumber, $plantId, $onCapFocus = false)
|
||||
{
|
||||
$this->invoiceNumber = $invoiceNumber;
|
||||
@@ -412,8 +408,7 @@ class InvoiceDataTable extends Component
|
||||
}
|
||||
if ($sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1) {
|
||||
|
||||
if ($sm->tube_sticker_motor == 1)
|
||||
{
|
||||
if ($sm->tube_sticker_motor == 1) {
|
||||
$stickCount++;
|
||||
if ($record->motor_scanned_status == 1) {
|
||||
$scannedCount++;
|
||||
@@ -438,9 +433,7 @@ class InvoiceDataTable extends Component
|
||||
$scannedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($sm->pack_slip_motor == 1 || $sm->pack_slip_pump == 1 || $sm->pack_slip_pumpset == 1)
|
||||
{
|
||||
} elseif ($sm->pack_slip_motor == 1 || $sm->pack_slip_pump == 1 || $sm->pack_slip_pumpset == 1) {
|
||||
if ($sm->pack_slip_motor == 1) {
|
||||
$stickCount++;
|
||||
if ($record->motor_scanned_status == 1) {
|
||||
@@ -488,7 +481,6 @@ class InvoiceDataTable extends Component
|
||||
->paginate(6);
|
||||
}
|
||||
|
||||
|
||||
// public function loadData($invoiceNumber, $plantId, $onCapFocus = false)
|
||||
// {
|
||||
// $this->plantId = $plantId;
|
||||
@@ -571,7 +563,6 @@ class InvoiceDataTable extends Component
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
public function loadMaterialData($invoiceNumber, $plantId)
|
||||
{
|
||||
$this->plantId = $plantId;
|
||||
@@ -636,6 +627,7 @@ class InvoiceDataTable extends Component
|
||||
|
||||
public function cancelCapacitorInput()
|
||||
{
|
||||
$this->capacitorInput = null;
|
||||
$this->showCapacitorInput = false;
|
||||
$this->dispatch('focus-serial-number');
|
||||
}
|
||||
@@ -689,7 +681,7 @@ class InvoiceDataTable extends Component
|
||||
|
||||
// if (($row['code'] ?? '') === $this->currentItemCode && ($row['serial_number'] ?? '') === $this->currentSerialNumber) {
|
||||
// $row['panel_box_supplier'] = $supplier;
|
||||
// $row['panel_box_item_code'] = $itemCode;
|
||||
// $row['panel_box_code'] = $itemCode;
|
||||
// $row['panel_box_serial_number'] = $serialNumber;
|
||||
// $row['capacitor_scanned_status'] = 1;
|
||||
// // $row['scanned_status_set'] = true;
|
||||
@@ -730,7 +722,7 @@ class InvoiceDataTable extends Component
|
||||
// if ($packCnt === $scanCnt) {
|
||||
// $matchingValidation->update([
|
||||
// 'panel_box_supplier' => $supplier,
|
||||
// 'panel_box_item_code' => $itemCode,
|
||||
// 'panel_box_code' => $itemCode,
|
||||
// 'panel_box_serial_number' => $serialNumber,
|
||||
// 'capacitor_scanned_status' => 1,
|
||||
// 'scanned_status' => 'Scanned',
|
||||
@@ -739,7 +731,7 @@ class InvoiceDataTable extends Component
|
||||
// } else {
|
||||
// $matchingValidation->update([
|
||||
// 'panel_box_supplier' => $supplier,
|
||||
// 'panel_box_item_code' => $itemCode,
|
||||
// 'panel_box_code' => $itemCode,
|
||||
// 'panel_box_serial_number' => $serialNumber,
|
||||
// 'capacitor_scanned_status' => 1,
|
||||
// 'operator_id' => $operatorName,
|
||||
@@ -748,7 +740,7 @@ class InvoiceDataTable extends Component
|
||||
// } else {
|
||||
// $matchingValidation->update([
|
||||
// 'panel_box_supplier' => $supplier,
|
||||
// 'panel_box_item_code' => $itemCode,
|
||||
// 'panel_box_code' => $itemCode,
|
||||
// 'panel_box_serial_number' => $serialNumber,
|
||||
// 'capacitor_scanned_status' => 1,
|
||||
// 'scanned_status' => 'Scanned',
|
||||
@@ -797,8 +789,6 @@ class InvoiceDataTable extends Component
|
||||
// $this->dispatch('focus-serial-number');
|
||||
// }
|
||||
|
||||
|
||||
|
||||
public function processCapacitorInput()
|
||||
{
|
||||
$user = Filament::auth()->user();
|
||||
@@ -818,6 +808,7 @@ class InvoiceDataTable extends Component
|
||||
->send();
|
||||
|
||||
$this->capacitorInput = '';
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -856,7 +847,7 @@ class InvoiceDataTable extends Component
|
||||
|
||||
if ($stickerCode === $this->currentItemCode && $serialNo === $this->currentSerialNumber) {
|
||||
$row['panel_box_supplier'] = $supplier;
|
||||
$row['panel_box_item_code'] = $itemCode;
|
||||
$row['panel_box_code'] = $itemCode;
|
||||
$row['panel_box_serial_number'] = $serialNumber;
|
||||
$row['capacitor_scanned_status'] = 1;
|
||||
// $row['scanned_status_set'] = true;
|
||||
@@ -897,7 +888,7 @@ class InvoiceDataTable extends Component
|
||||
if ($packCnt === $scanCnt) {
|
||||
$matchingValidation->update([
|
||||
'panel_box_supplier' => $supplier,
|
||||
'panel_box_item_code' => $itemCode,
|
||||
'panel_box_code' => $itemCode,
|
||||
'panel_box_serial_number' => $serialNumber,
|
||||
'capacitor_scanned_status' => 1,
|
||||
'scanned_status' => 'Scanned',
|
||||
@@ -906,7 +897,7 @@ class InvoiceDataTable extends Component
|
||||
} else {
|
||||
$matchingValidation->update([
|
||||
'panel_box_supplier' => $supplier,
|
||||
'panel_box_item_code' => $itemCode,
|
||||
'panel_box_code' => $itemCode,
|
||||
'panel_box_serial_number' => $serialNumber,
|
||||
'capacitor_scanned_status' => 1,
|
||||
'operator_id' => $operatorName,
|
||||
@@ -915,7 +906,7 @@ class InvoiceDataTable extends Component
|
||||
} else {
|
||||
$matchingValidation->update([
|
||||
'panel_box_supplier' => $supplier,
|
||||
'panel_box_item_code' => $itemCode,
|
||||
'panel_box_code' => $itemCode,
|
||||
'panel_box_serial_number' => $serialNumber,
|
||||
'capacitor_scanned_status' => 1,
|
||||
'scanned_status' => 'Scanned',
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
<th class="border px-4 py-2">Scanned Status</th>
|
||||
<th class="border px-4 py-2 w-[300px] whitespace-nowrap">Time Stamp</th>
|
||||
<th class="border px-4 py-2">Operator ID</th>
|
||||
<th class="border px-4 py-2">Panel Box Code</th>
|
||||
<th class="border px-4 py-2">Panel Box Supplier</th>
|
||||
<th class="border px-4 py-2">Panel Box Serial Number</th>
|
||||
</tr>
|
||||
@@ -98,6 +99,7 @@
|
||||
<td class="border px-4 py-2">{{ $row['scanned_status'] ?? '' }}</td>
|
||||
<td class="border px-4 py-2">{{ $row['created_at'] ?? '' }}</td>
|
||||
<td class="border px-4 py-2">{{ $row['operator_id'] ?? '' }}</td>
|
||||
<td class="border px-4 py-2">{{ $row['panel_box_code'] ?? '' }}</td>
|
||||
<td class="border px-4 py-2">{{ $row['panel_box_supplier'] ?? '' }}</td>
|
||||
<td class="border px-4 py-2">{{ $row['panel_box_serial_number'] ?? '' }}</td>
|
||||
</tr>
|
||||
@@ -130,6 +132,7 @@
|
||||
<th class="border px-4 py-2">Scanned Status</th>
|
||||
<th class="border px-4 py-2 w-[300px] whitespace-nowrap">Time Stamp</th>
|
||||
<th class="border px-4 py-2">Operator ID</th>
|
||||
<th class="border px-4 py-2">Panel Box Code</th>
|
||||
<th class="border px-4 py-2">Panel Box Supplier</th>
|
||||
<th class="border px-4 py-2">Panel Box Serial Number</th>
|
||||
</tr>
|
||||
@@ -148,6 +151,7 @@
|
||||
<td class="border px-2 py-2">{{ $record->scanned_status ?? '' }}</td>
|
||||
<td class="border px-2 py-2 whitespace-nowrap">{{ optional($record->created_at)->format('d-m-Y H:i:s') }}</td>
|
||||
<td class="border px-2 py-2">{{ $record->operator_id ?? '' }}</td>
|
||||
<td class="border px-2 py-2">{{ $record->panel_box_code ?? '' }}</td>
|
||||
<td class="border px-2 py-2">{{ $record->panel_box_supplier ?? '' }}</td>
|
||||
<td class="border px-2 py-2">{{ $record->panel_box_serial_number ?? '' }}</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user