Merge pull request 'Removed updated by column from serial validation' (#703) from ranjith-dev into master
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 15s

Reviewed-on: #703
This commit was merged in pull request #703.
This commit is contained in:
2026-06-04 12:22:07 +00:00

View File

@@ -2922,25 +2922,25 @@ class CreateSerialValidation extends CreateRecord
// }
return;
} else {
$oldQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$oldQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$newQuan = -1;
$inserted = 0;
foreach ($matchedItems as $sticker) {
if ($newQuan == -1 && ! $hasQuanTyp) {
InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->where(function ($query) {
SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->where(function ($query) {
$query->whereNull('serial_number')->orWhere('serial_number', '');
})
->forceDelete(); // ->delete();
$newQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$newQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
} elseif ($newQuan == -1 && $hasQuanTyp) {
InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->where(function ($query) {
SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->where(function ($query) {
$query->whereNull('serial_number')->orWhere('serial_number', '');
})->whereNotIn('sticker_master_id', $hasQuanTypIds)
->forceDelete(); // ->delete();
$newQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
$newQuan = SerialValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
}
$code = $sticker->item->code;
@@ -2980,7 +2980,6 @@ class CreateSerialValidation extends CreateRecord
'quantity' => 1,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -3022,7 +3021,6 @@ class CreateSerialValidation extends CreateRecord
'quantity' => $bundleQty,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -3086,7 +3084,6 @@ class CreateSerialValidation extends CreateRecord
$existEmpRecQty->update([
'quantity' => $newInsQty,
'operator_id' => $operatorName,
'updated_by' => $operatorName,
'updated_at' => now(),
]);
$newQuan--;
@@ -3099,7 +3096,6 @@ class CreateSerialValidation extends CreateRecord
'quantity' => $newInsQty,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -3119,7 +3115,6 @@ class CreateSerialValidation extends CreateRecord
$existEmpRecQty->update([
'quantity' => $newInsQty,
'operator_id' => $operatorName,
'updated_by' => $operatorName,
'updated_at' => now(),
]);
$newQuan--;
@@ -3132,7 +3127,6 @@ class CreateSerialValidation extends CreateRecord
'quantity' => $newInsQty,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -3611,7 +3605,6 @@ class CreateSerialValidation extends CreateRecord
'serial_number' => $serialNumber,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -4153,14 +4146,13 @@ class CreateSerialValidation extends CreateRecord
for ($i = 0; $i < $totalExcelQty; $i++) {
if ($sticker) {
InvoiceValidation::create([
SerialValidation::create([
'sticker_master_id' => $sticker->id,
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'quantity' => 1,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -4188,14 +4180,13 @@ class CreateSerialValidation extends CreateRecord
for ($i = 0; $i < ($totalExcelQty / $bundleQty); $i++) {
if ($sticker) {
InvoiceValidation::create([
SerialValidation::create([
'sticker_master_id' => $sticker->id,
'plant_id' => $plantId,
'invoice_number' => $invoiceNumber,
'quantity' => $bundleQty,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -4228,7 +4219,6 @@ class CreateSerialValidation extends CreateRecord
'quantity' => $totalExcelQty,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}
@@ -4594,7 +4584,6 @@ class CreateSerialValidation extends CreateRecord
'serial_number' => $serialNumber,
'operator_id' => $operatorName,
'created_by' => $operatorName,
'updated_by' => $operatorName,
]);
$inserted++;
}