Merge pull request 'ranjith-dev' (#323) from ranjith-dev into master
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

Reviewed-on: #323
This commit was merged in pull request #323.
This commit is contained in:
2026-02-10 06:56:38 +00:00

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) {
@@ -425,11 +430,11 @@ class InvoiceValidationResource extends Resource
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
if ($extension !== 'xlsx') {
if ($extension != 'xlsx') {
throw new \Exception('Only .xlsx files allowed.');
}
$originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
$originalNameOnly = strtoupper(pathinfo($originalName, PATHINFO_FILENAME));
$originalName = "{$originalNameOnly}.xlsx";
@@ -765,11 +770,11 @@ class InvoiceValidationResource extends Resource
$originalName = $uploadedFile->getClientOriginalName();
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
if ($extension !== 'xlsx') {
if ($extension != 'xlsx') {
throw new \Exception('Only .xlsx files allowed.');
}
$originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
$originalNameOnly = strtoupper(pathinfo($originalName, PATHINFO_FILENAME));
$originalName = "{$originalNameOnly}.xlsx";