Merge pull request 'ranjith-dev' (#673) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #673
This commit was merged in pull request #673.
This commit is contained in:
2026-05-29 14:36:28 +00:00
2 changed files with 70 additions and 26 deletions

View File

@@ -407,49 +407,47 @@ class InvoiceDataTable extends Component
$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++;
if ($record->motor_scanned_status == 1) {
$scannedCount++;
}
}
if (
$sm->tube_sticker_pump == 1 ||
($sm->tube_sticker_pumpset != 1 &&
$sm->tube_sticker_pump != 1 &&
$sm->pack_slip_pump == 1)
) {
// ($sm->tube_sticker_pumpset != 1 && $sm->tube_sticker_pump != 1 && $sm->pack_slip_pump == 1)
if (! empty($sm->tube_sticker_pump) || (empty($sm->tube_sticker_pumpset) && empty($sm->tube_sticker_pump) && ! empty($sm->pack_slip_pump))) {
$stickCount++;
if ($record->pump_scanned_status == 1) {
$scannedCount++;
}
}
if ($sm->tube_sticker_pumpset == 1) {
if (! empty($sm->tube_sticker_pumpset)) {
$stickCount++;
if ($record->scanned_status_set == 1) {
$scannedCount++;
}
}
} elseif ($sm->pack_slip_motor == 1 || $sm->pack_slip_pump == 1 || $sm->pack_slip_pumpset == 1) {
if ($sm->pack_slip_motor == 1) {
} elseif (! empty($sm->pack_slip_motor) || ! empty($sm->pack_slip_pump) || ! empty($sm->pack_slip_pumpset)) {
if (! empty($sm->pack_slip_motor)) {
$stickCount++;
if ($record->motor_scanned_status == 1) {
$scannedCount++;
}
}
if ($sm->pack_slip_pump == 1) {
if (! empty($sm->pack_slip_pump)) {
$stickCount++;
if ($record->pump_scanned_status == 1) {
$scannedCount++;
}
}
if ($sm->pack_slip_pumpset == 1) {
if (! empty($sm->pack_slip_pumpset)) {
$stickCount++;
if ($record->scanned_status_set == 1) {
$scannedCount++;
@@ -597,13 +595,13 @@ class InvoiceDataTable extends Component
// $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';
$matType = StickerMaster::where('id', $row['sticker_master_id'] ?? null)->first()->material_type ?? '';
if ($matType === 1) {
if ($matType == 1) {
$row['material_type'] = 'Individual';
} elseif ($matType === 2) {
} elseif ($matType == 2) {
$row['material_type'] = 'Bundle';
} elseif ($matType === 3) {
} elseif ($matType == 3) {
$row['material_type'] = 'Quantity';
} elseif ($matType === 4) {
} elseif ($matType == 4) {
$row['material_type'] = 'Bundle Individual';
} else {
$row['material_type'] = 'N/A';
@@ -682,7 +680,7 @@ class InvoiceDataTable extends Component
// 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_code'] = $itemCode;
// $row['panel_box_serial_number'] = $serialNumber;
@@ -694,7 +692,7 @@ class InvoiceDataTable extends Component
// ->where('plant_id', $this->plantId)
// ->get()
// ->first(function ($validation) {
// return $validation->stickerMaster?->item?->code === $this->currentItemCode;
// return $validation->stickerMaster?->item?->code == $this->currentItemCode;
// });
// // dd($matchingValidation);
@@ -712,7 +710,7 @@ class InvoiceDataTable extends Component
// $packCnt = 1;
// $scanCnt = 1;
// // if ($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
// // if ($hadMotorQr == $hasMotorQr && $hadPumpQr == $hasPumpQr && $hadPumpSetQr == $hasPumpSetQr)
// if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
// $packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
// $packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
@@ -722,7 +720,7 @@ class InvoiceDataTable extends Component
// $scanCnt = $hadPumpQr ? $scanCnt + 1 : $scanCnt;
// $scanCnt = $hadPumpSetQr ? $scanCnt + 1 : $scanCnt;
// if ($packCnt === $scanCnt) {
// if ($packCnt == $scanCnt) {
// $matchingValidation->update([
// 'panel_box_supplier' => $supplier,
// 'panel_box_code' => $itemCode,
@@ -769,7 +767,7 @@ class InvoiceDataTable extends Component
// // 'scanned_quantity'=> $scannedQuantity,
// // ]);
// if ($totalQuantity === $scannedQuantity) {
// if ($totalQuantity == $scannedQuantity) {
// Notification::make()
// ->title('Completed: Serial Invoice')
// ->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;
$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_code'] = $itemCode;
$row['panel_box_serial_number'] = $serialNumber;
@@ -860,7 +858,7 @@ class InvoiceDataTable extends Component
->where('plant_id', $this->plantId)
->get()
->first(function ($validation) {
return $validation->stickerMaster?->item?->code === $this->currentItemCode;
return $validation->stickerMaster?->item?->code == $this->currentItemCode;
});
// dd($matchingValidation);
@@ -878,7 +876,7 @@ class InvoiceDataTable extends Component
$packCnt = 1;
$scanCnt = 1;
// if ($hadMotorQr === $hasMotorQr && $hadPumpQr === $hasPumpQr && $hadPumpSetQr === $hasPumpSetQr)
// if ($hadMotorQr == $hasMotorQr && $hadPumpQr == $hasPumpQr && $hadPumpSetQr == $hasPumpSetQr)
if ($hasMotorQr || $hasPumpQr || $hasPumpSetQr) {
$packCnt = $hasMotorQr ? $packCnt + 1 : $packCnt;
$packCnt = $hasPumpQr ? $packCnt + 1 : $packCnt;
@@ -935,7 +933,7 @@ class InvoiceDataTable extends Component
// 'scanned_quantity'=> $scannedQuantity,
// ]);
if ($totalQuantity === $scannedQuantity) {
if ($totalQuantity == $scannedQuantity) {
Notification::make()
->title('Completed: Serial Invoice')
->body("Serial invoice '$matchingValidation->invoice_number' completed the scanning process.<br>Scan the next 'Serial Invoice' to proceed!")

View File

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