Updated total_quantity and scanned_quantity display query logic against material invoice for various types
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 10m33s
Laravel Larastan / larastan (pull_request) Failing after 12m24s
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 11s
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (pull_request) Successful in 12s
Gemini PR Review / Gemini PR Review (pull_request) Failing after 18s
Laravel Pint / pint (pull_request) Successful in 10m33s
Laravel Larastan / larastan (pull_request) Failing after 12m24s
This commit is contained in:
@@ -216,8 +216,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
if ($totMQuan > 0) {
|
if ($totMQuan > 0) {
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0; // ->where('quantity', '!=', '')
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totMQuan;
|
||||||
|
$scanMatQuan = $scanMQuan;
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -834,8 +845,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||||
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totalQuantity;
|
||||||
|
$scanMatQuan = $scannedQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -870,8 +892,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||||
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totalQuantity;
|
||||||
|
$scanMatQuan = $scannedQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -1931,8 +1964,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||||
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totalQuantity;
|
||||||
|
$scanMatQuan = $scannedQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -1968,8 +2012,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
$totalQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||||
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scannedQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totalQuantity;
|
||||||
|
$scanMatQuan = $scannedQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -2468,8 +2523,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if ($totMQuan > 0) {
|
if ($totMQuan > 0) {
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totQuan;
|
||||||
|
$scanMatQuan = $scanMQuan;
|
||||||
|
}
|
||||||
|
|
||||||
if ($totQuan == $scanMQuan) {
|
if ($totQuan == $scanMQuan) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
@@ -3142,8 +3208,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$totQuan = InvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count();
|
$totQuan = InvoiceValidation::where('plant_id', $plantId)->where('invoice_number', $invoiceNumber)->count();
|
||||||
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totQuan;
|
||||||
|
$scanMatQuan = $scanMQuan;
|
||||||
|
}
|
||||||
|
|
||||||
$this->form->fill([
|
$this->form->fill([
|
||||||
'plant_id' => $plantId,
|
'plant_id' => $plantId,
|
||||||
@@ -3516,8 +3593,19 @@ class CreateInvoiceValidation extends CreateRecord
|
|||||||
$totQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
$totQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->count();
|
||||||
$scannedMQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
$scannedMQuantity = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $plantId)->count();
|
||||||
|
|
||||||
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
$checkMat = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $plantId)->latest('updated_at')->first(); // ->where('quantity', '!=', '')
|
||||||
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', '');
|
if (($checkMat?->stickerMaster->material_type ?? 0) == 3) {
|
||||||
|
Notification::make()
|
||||||
|
->title("Material Type : {$checkMat?->stickerMaster->material_type}")
|
||||||
|
->info()
|
||||||
|
->seconds(1)
|
||||||
|
->send();
|
||||||
|
$totMatQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->invoice_quantity ?? 0;
|
||||||
|
$scanMatQuan = number_format($totMatQuan - (InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNull('serial_number')->where('plant_id', $plantId)->latest('updated_at')->first()?->quantity ?? 0), 3, '.', ''); // ('updated_at', 'desc')
|
||||||
|
} else {
|
||||||
|
$totMatQuan = $totQuan;
|
||||||
|
$scanMatQuan = $scannedMQuantity;
|
||||||
|
}
|
||||||
|
|
||||||
if ($totQuan == $scannedMQuantity) {
|
if ($totQuan == $scannedMQuantity) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
|
|||||||
Reference in New Issue
Block a user