ranjith-dev #673
@@ -407,49 +407,47 @@ class InvoiceDataTable extends Component
|
|||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1) {
|
|
||||||
|
|
||||||
if ($sm->tube_sticker_motor == 1) {
|
// $sm->tube_sticker_motor == 1 || $sm->tube_sticker_pump == 1 || $sm->tube_sticker_pumpset == 1
|
||||||
|
if (! empty($sm->tube_sticker_motor) || ! empty($sm->tube_sticker_pump) || ! empty($sm->tube_sticker_pumpset)) {
|
||||||
|
|
||||||
|
if (! empty($sm->tube_sticker_motor)) {
|
||||||
$stickCount++;
|
$stickCount++;
|
||||||
if ($record->motor_scanned_status == 1) {
|
if ($record->motor_scanned_status == 1) {
|
||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
// ($sm->tube_sticker_pumpset != 1 && $sm->tube_sticker_pump != 1 && $sm->pack_slip_pump == 1)
|
||||||
$sm->tube_sticker_pump == 1 ||
|
if (! empty($sm->tube_sticker_pump) || (empty($sm->tube_sticker_pumpset) && empty($sm->tube_sticker_pump) && ! empty($sm->pack_slip_pump))) {
|
||||||
($sm->tube_sticker_pumpset != 1 &&
|
|
||||||
$sm->tube_sticker_pump != 1 &&
|
|
||||||
$sm->pack_slip_pump == 1)
|
|
||||||
) {
|
|
||||||
$stickCount++;
|
$stickCount++;
|
||||||
if ($record->pump_scanned_status == 1) {
|
if ($record->pump_scanned_status == 1) {
|
||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sm->tube_sticker_pumpset == 1) {
|
if (! empty($sm->tube_sticker_pumpset)) {
|
||||||
$stickCount++;
|
$stickCount++;
|
||||||
if ($record->scanned_status_set == 1) {
|
if ($record->scanned_status_set == 1) {
|
||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} elseif ($sm->pack_slip_motor == 1 || $sm->pack_slip_pump == 1 || $sm->pack_slip_pumpset == 1) {
|
} elseif (! empty($sm->pack_slip_motor) || ! empty($sm->pack_slip_pump) || ! empty($sm->pack_slip_pumpset)) {
|
||||||
if ($sm->pack_slip_motor == 1) {
|
if (! empty($sm->pack_slip_motor)) {
|
||||||
$stickCount++;
|
$stickCount++;
|
||||||
if ($record->motor_scanned_status == 1) {
|
if ($record->motor_scanned_status == 1) {
|
||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sm->pack_slip_pump == 1) {
|
if (! empty($sm->pack_slip_pump)) {
|
||||||
$stickCount++;
|
$stickCount++;
|
||||||
if ($record->pump_scanned_status == 1) {
|
if ($record->pump_scanned_status == 1) {
|
||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($sm->pack_slip_pumpset == 1) {
|
if (! empty($sm->pack_slip_pumpset)) {
|
||||||
$stickCount++;
|
$stickCount++;
|
||||||
if ($record->scanned_status_set == 1) {
|
if ($record->scanned_status_set == 1) {
|
||||||
$scannedCount++;
|
$scannedCount++;
|
||||||
@@ -597,13 +595,13 @@ class InvoiceDataTable extends Component
|
|||||||
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
|
// $stickerMaster = \App\Models\StickerMaster::with('item')->find($row['sticker_master_id'] ?? null);
|
||||||
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
|
$row['code'] = StickerMaster::with('item')->find($row['sticker_master_id'] ?? null)?->item?->code ?? 'N/A';
|
||||||
$matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? '';
|
$matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? '';
|
||||||
if ($matType === 1) {
|
if ($matType == 1) {
|
||||||
$row['material_type'] = 'Individual';
|
$row['material_type'] = 'Individual';
|
||||||
} elseif ($matType === 2) {
|
} elseif ($matType == 2) {
|
||||||
$row['material_type'] = 'Bundle';
|
$row['material_type'] = 'Bundle';
|
||||||
} elseif ($matType === 3) {
|
} elseif ($matType == 3) {
|
||||||
$row['material_type'] = 'Quantity';
|
$row['material_type'] = 'Quantity';
|
||||||
} elseif ($matType === 4) {
|
} elseif ($matType == 4) {
|
||||||
$row['material_type'] = 'Bundle Individual';
|
$row['material_type'] = 'Bundle Individual';
|
||||||
} else {
|
} else {
|
||||||
$row['material_type'] = 'N/A';
|
$row['material_type'] = 'N/A';
|
||||||
@@ -682,7 +680,7 @@ class InvoiceDataTable extends Component
|
|||||||
|
|
||||||
// foreach ($this->invoiceData as &$row) {
|
// foreach ($this->invoiceData as &$row) {
|
||||||
|
|
||||||
// if (($row['code'] ?? '') === $this->currentItemCode && ($row['serial_number'] ?? '') === $this->currentSerialNumber) {
|
// if (($row['code'] ?? '') == $this->currentItemCode && ($row['serial_number'] ?? '') == $this->currentSerialNumber) {
|
||||||
// $row['panel_box_supplier'] = $supplier;
|
// $row['panel_box_supplier'] = $supplier;
|
||||||
// $row['panel_box_code'] = $itemCode;
|
// $row['panel_box_code'] = $itemCode;
|
||||||
// $row['panel_box_serial_number'] = $serialNumber;
|
// $row['panel_box_serial_number'] = $serialNumber;
|
||||||
@@ -694,7 +692,7 @@ class InvoiceDataTable extends Component
|
|||||||
// ->where('plant_id', $this->plantId)
|
// ->where('plant_id', $this->plantId)
|
||||||
// ->get()
|
// ->get()
|
||||||
// ->first(function ($validation) {
|
// ->first(function ($validation) {
|
||||||
// return $validation->stickerMaster?->item?->code === $this->currentItemCode;
|
// return $validation->stickerMaster?->item?->code == $this->currentItemCode;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// // dd($matchingValidation);
|
// // dd($matchingValidation);
|
||||||
@@ -712,7 +710,7 @@ class InvoiceDataTable extends Component
|
|||||||
|
|
||||||
// $packCnt = 1;
|
// $packCnt = 1;
|
||||||
// $scanCnt = 1;
|
// $scanCnt = 1;
|
||||||
// // if ($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
|
// // if ($hadMotorQr == $hasMotorQr && $hadPumpQr == $hasPumpQr && $hadPumpSetQr == $hasPumpSetQr)
|
||||||
// if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
|
// if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
|
||||||
// $packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
|
// $packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
|
||||||
// $packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
|
// $packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
|
||||||
@@ -722,7 +720,7 @@ class InvoiceDataTable extends Component
|
|||||||
// $scanCnt = $hadPumpQr ? $scanCnt + 1 : $scanCnt;
|
// $scanCnt = $hadPumpQr ? $scanCnt + 1 : $scanCnt;
|
||||||
// $scanCnt = $hadPumpSetQr ? $scanCnt + 1 : $scanCnt;
|
// $scanCnt = $hadPumpSetQr ? $scanCnt + 1 : $scanCnt;
|
||||||
|
|
||||||
// if ($packCnt === $scanCnt) {
|
// if ($packCnt == $scanCnt) {
|
||||||
// $matchingValidation->update([
|
// $matchingValidation->update([
|
||||||
// 'panel_box_supplier' => $supplier,
|
// 'panel_box_supplier' => $supplier,
|
||||||
// 'panel_box_code' => $itemCode,
|
// 'panel_box_code' => $itemCode,
|
||||||
@@ -769,7 +767,7 @@ class InvoiceDataTable extends Component
|
|||||||
// // 'scanned_quantity'=> $scannedQuantity,
|
// // 'scanned_quantity'=> $scannedQuantity,
|
||||||
// // ]);
|
// // ]);
|
||||||
|
|
||||||
// if ($totalQuantity === $scannedQuantity) {
|
// if ($totalQuantity == $scannedQuantity) {
|
||||||
// Notification::make()
|
// Notification::make()
|
||||||
// ->title('Completed: Serial Invoice')
|
// ->title('Completed: Serial Invoice')
|
||||||
// ->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")
|
// ->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")
|
||||||
@@ -848,7 +846,7 @@ class InvoiceDataTable extends Component
|
|||||||
$stickerCode = $row->stickerMasterRelation?->item?->code ?? null;
|
$stickerCode = $row->stickerMasterRelation?->item?->code ?? null;
|
||||||
$serialNo = $row->serial_number ?? null;
|
$serialNo = $row->serial_number ?? null;
|
||||||
|
|
||||||
if ($stickerCode === $this->currentItemCode && $serialNo === $this->currentSerialNumber) {
|
if ($stickerCode == $this->currentItemCode && $serialNo == $this->currentSerialNumber) {
|
||||||
$row['panel_box_supplier'] = $supplier;
|
$row['panel_box_supplier'] = $supplier;
|
||||||
$row['panel_box_code'] = $itemCode;
|
$row['panel_box_code'] = $itemCode;
|
||||||
$row['panel_box_serial_number'] = $serialNumber;
|
$row['panel_box_serial_number'] = $serialNumber;
|
||||||
@@ -860,7 +858,7 @@ class InvoiceDataTable extends Component
|
|||||||
->where('plant_id', $this->plantId)
|
->where('plant_id', $this->plantId)
|
||||||
->get()
|
->get()
|
||||||
->first(function ($validation) {
|
->first(function ($validation) {
|
||||||
return $validation->stickerMaster?->item?->code === $this->currentItemCode;
|
return $validation->stickerMaster?->item?->code == $this->currentItemCode;
|
||||||
});
|
});
|
||||||
|
|
||||||
// dd($matchingValidation);
|
// dd($matchingValidation);
|
||||||
@@ -878,7 +876,7 @@ class InvoiceDataTable extends Component
|
|||||||
|
|
||||||
$packCnt = 1;
|
$packCnt = 1;
|
||||||
$scanCnt = 1;
|
$scanCnt = 1;
|
||||||
// if ($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
|
// if ($hadMotorQr == $hasMotorQr && $hadPumpQr == $hasPumpQr && $hadPumpSetQr == $hasPumpSetQr)
|
||||||
if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
|
if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
|
||||||
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
|
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
|
||||||
$packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
|
$packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
|
||||||
@@ -935,7 +933,7 @@ class InvoiceDataTable extends Component
|
|||||||
// 'scanned_quantity'=> $scannedQuantity,
|
// 'scanned_quantity'=> $scannedQuantity,
|
||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
if ($totalQuantity === $scannedQuantity) {
|
if ($totalQuantity == $scannedQuantity) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title('Completed: Serial Invoice')
|
->title('Completed: Serial Invoice')
|
||||||
->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")
|
->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
// Schema::create('leak_test_readings', function (Blueprint $table) {
|
||||||
|
// $table->id();
|
||||||
|
// $table->timestamps();
|
||||||
|
// });
|
||||||
|
$sql = <<<'SQL'
|
||||||
|
CREATE TABLE leak_test_readings (
|
||||||
|
id BIGINT GENERATED always AS IDENTITY PRIMARY KEY,
|
||||||
|
|
||||||
|
plant_id BIGINT NOT NULL,
|
||||||
|
|
||||||
|
item_code TEXT NOT NULL,
|
||||||
|
serial_number TEXT NOT NULL,
|
||||||
|
test_status TEXT NOT NULL,
|
||||||
|
|
||||||
|
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
updated_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||||||
|
deleted_at TIMESTAMP,
|
||||||
|
|
||||||
|
FOREIGN KEY (plant_id) REFERENCES plants (id)
|
||||||
|
);
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
DB::statement($sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('leak_test_readings');
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user