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