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