Updated alignment and plant load logic and invoice upload root folder
Some checks failed
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Has been cancelled

This commit is contained in:
dhanabalan
2026-02-06 15:06:20 +05:30
parent 9dea321111
commit b415c375ab
2 changed files with 457 additions and 542 deletions

View File

@@ -56,7 +56,7 @@ class LocatorInvoiceValidationResource extends Resource
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->disabled(fn (Get $get) => $get('invoice_number'))
->required()
@@ -498,7 +498,7 @@ class LocatorInvoiceValidationResource extends Resource
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->label('Select Plant')
->required()
@@ -534,8 +534,7 @@ class LocatorInvoiceValidationResource extends Resource
// $invoiceNumber = trim(str_replace('.xlsx', '', $originalName));
// $originalNameOnly = pathinfo($originalName, PATHINFO_FILENAME);
$folderPath = Configuration::where('c_name', 'INVOICE_FOLDER_PATH')
->value('c_value');
$folderPath = 'ExportDispatch'; // Configuration::where('c_name', 'INVOICE_FOLDER_PATH')->value('c_value');
$fullFolderPath = "uploads/$folderPath";
@@ -708,7 +707,7 @@ class LocatorInvoiceValidationResource extends Resource
->options(function (callable $get) {
$userHas = Filament::auth()->user()->plant_id;
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::pluck('name', 'id')->toArray();
return ($userHas && strlen($userHas) > 0) ? Plant::where('id', $userHas)->pluck('name', 'id')->toArray() : Plant::orderBy('code')->pluck('name', 'id')->toArray();
})
->reactive()
->afterStateUpdated(function ($state, callable $set, callable $get): void {