Removed pluck('serial_number')->first() on sNo exist() query checking and Updated 'delete()' method to 'forceDelete()' method
This commit is contained in:
@@ -457,7 +457,7 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->where(function($query) {
|
||||
$query->whereNull('serial_number')->orWhere('serial_number', '');
|
||||
})
|
||||
->delete();
|
||||
->forceDelete(); //->delete();
|
||||
|
||||
$newQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||
}
|
||||
@@ -466,7 +466,7 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->where(function($query) {
|
||||
$query->whereNull('serial_number')->orWhere('serial_number', '');
|
||||
})->whereNotIn('sticker_master_id', $hasQuanTypIds)
|
||||
->delete();
|
||||
->forceDelete(); //->delete();
|
||||
|
||||
$newQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||
}
|
||||
@@ -1105,7 +1105,7 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
->where(function($query) {
|
||||
$query->whereNull('scanned_status')->orWhere('scanned_status', '');
|
||||
})
|
||||
->delete();
|
||||
->forceDelete(); //->delete();
|
||||
|
||||
$newQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||
continue;
|
||||
@@ -1118,7 +1118,7 @@ class CreateInvoiceValidation extends CreateRecord
|
||||
continue;
|
||||
}
|
||||
|
||||
$sNoExist = InvoiceValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->pluck('serial_number')->first()->exists();
|
||||
$sNoExist = InvoiceValidation::where('serial_number', $serialNumber)->where('plant_id', $plantId)->exists(); //->pluck('serial_number')
|
||||
|
||||
if($sNoExist) { continue; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user