Compare commits
3 Commits
b50493f2f2
...
b40a7e3ae7
| Author | SHA1 | Date | |
|---|---|---|---|
| b40a7e3ae7 | |||
|
|
ddf256c209 | ||
|
|
3845063af8 |
@@ -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) {
|
||||||
@@ -425,11 +430,11 @@ class InvoiceValidationResource extends Resource
|
|||||||
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
|
$originalName = $uploadedFile->getClientOriginalName(); // e.g. 3RA0018732.xlsx
|
||||||
|
|
||||||
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
|
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
|
||||||
if ($extension !== 'xlsx') {
|
if ($extension != 'xlsx') {
|
||||||
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";
|
||||||
|
|
||||||
@@ -765,11 +770,11 @@ class InvoiceValidationResource extends Resource
|
|||||||
$originalName = $uploadedFile->getClientOriginalName();
|
$originalName = $uploadedFile->getClientOriginalName();
|
||||||
|
|
||||||
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
|
$extension = strtolower(pathinfo($originalName, PATHINFO_EXTENSION));
|
||||||
if ($extension !== 'xlsx') {
|
if ($extension != 'xlsx') {
|
||||||
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