ranjith-dev #323

Merged
jothi merged 2 commits from ranjith-dev into master 2026-02-10 06:56:39 +00:00
Showing only changes of commit 3845063af8 - Show all commits

View File

@@ -136,10 +136,15 @@ class InvoiceValidationResource extends Resource
// $invNo = $get('invoice_number');
$set('serial_number', null);
$set('update_invoice', null);
// Session::put('invoice_number', $state);
session(['invoice_number' => $state]);
if (strlen($state) <= 15) {
$set('invoice_number', strtoupper($state));
session(['invoice_number' => strtoupper($state)]);
} else {
// Session::put('invoice_number', $state);
session(['invoice_number' => $state]);
// if (!$invNo) { return; } else { }
// if (!$invNo) { return; } else { }
}
}),
Forms\Components\TextInput::make('serial_number')
@@ -194,18 +199,18 @@ class InvoiceValidationResource extends Resource
return;
}
$invoiceNumber = $get('invoice_number');
if ($get('update_invoice') == '1') {
$totQuan = InvoiceValidation::where('invoice_number', $get('invoice_number'))->where('plant_id', $get('plant_id'))->count();
$totQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('plant_id', $get('plant_id'))->count();
if ($totQuan <= 0) {
$set('update_invoice', null);
return;
}
$totMQuan = InvoiceValidation::where('invoice_number', $get('invoice_number'))->whereNotNull('quantity')->where('plant_id', $get('plant_id'))->count();
$scanMQuan = InvoiceValidation::where('invoice_number', $get('invoice_number'))->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $get('plant_id'))->count();
$scanSQuan = InvoiceValidation::where('invoice_number', $get('invoice_number'))->where('scanned_status', 'Scanned')->where('plant_id', $get('plant_id'))->count();
$totMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('quantity')->where('plant_id', $get('plant_id'))->count();
$scanMQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->whereNotNull('serial_number')->where('serial_number', '!=', '')->where('plant_id', $get('plant_id'))->count();
$scanSQuan = InvoiceValidation::where('invoice_number', $invoiceNumber)->where('scanned_status', 'Scanned')->where('plant_id', $get('plant_id'))->count();
if ($totMQuan > 0) {
if ($totQuan == $scanMQuan) {
@@ -429,7 +434,7 @@ class InvoiceValidationResource extends Resource
throw new \Exception('Only .xlsx files allowed.');
}
$originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
$originalNameOnly = strtoupper(pathinfo($originalName, PATHINFO_FILENAME));
$originalName = "{$originalNameOnly}.xlsx";
@@ -769,7 +774,7 @@ class InvoiceValidationResource extends Resource
throw new \Exception('Only .xlsx files allowed.');
}
$originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
$originalNameOnly = strtoupper(pathinfo($originalName, PATHINFO_FILENAME));
$originalName = "{$originalNameOnly}.xlsx";