Hide update_invoice toggle button on scanning
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Filament\Resources;
|
namespace App\Filament\Resources;
|
||||||
|
|
||||||
|
use AlperenErsoy\FilamentExport\Actions\FilamentExportBulkAction;
|
||||||
use App\Filament\Exports\InvoiceValidationExporter;
|
use App\Filament\Exports\InvoiceValidationExporter;
|
||||||
use App\Filament\Resources\InvoiceValidationResource\Pages;
|
use App\Filament\Resources\InvoiceValidationResource\Pages;
|
||||||
use App\Models\InvoiceValidation;
|
use App\Models\InvoiceValidation;
|
||||||
@@ -122,6 +123,10 @@ class InvoiceValidationResource extends Resource
|
|||||||
'x-model' => 'value',
|
'x-model' => 'value',
|
||||||
'wire:keydown.enter.prevent' => 'processSerialNumber(value)', // Using wire:keydown
|
'wire:keydown.enter.prevent' => 'processSerialNumber(value)', // Using wire:keydown
|
||||||
])
|
])
|
||||||
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
|
$set('update_invoice', 0);
|
||||||
|
// if (!$invNo) { return; } else { }
|
||||||
|
})
|
||||||
->columnSpan(1),
|
->columnSpan(1),
|
||||||
Forms\Components\TextInput::make('total_quantity')
|
Forms\Components\TextInput::make('total_quantity')
|
||||||
->label('Total Quantity')
|
->label('Total Quantity')
|
||||||
@@ -136,7 +141,7 @@ class InvoiceValidationResource extends Resource
|
|||||||
->boolean()
|
->boolean()
|
||||||
->grouped()
|
->grouped()
|
||||||
->reactive()
|
->reactive()
|
||||||
->hidden(fn (callable $get) => ($get('invoice_number') == null || $get('update_invoice') === '0') || !empty($get('serial_number')))
|
->hidden(fn (callable $get) => ($get('invoice_number') == null || $get('update_invoice') == '0') || !empty($get('serial_number')))
|
||||||
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
->afterStateUpdated(function ($state, callable $set, callable $get) {
|
||||||
if(!$get('plant_id'))
|
if(!$get('plant_id'))
|
||||||
{
|
{
|
||||||
@@ -904,6 +909,7 @@ class InvoiceValidationResource extends Resource
|
|||||||
Tables\Actions\DeleteBulkAction::make(),
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
Tables\Actions\ForceDeleteBulkAction::make(),
|
Tables\Actions\ForceDeleteBulkAction::make(),
|
||||||
Tables\Actions\RestoreBulkAction::make(),
|
Tables\Actions\RestoreBulkAction::make(),
|
||||||
|
FilamentExportBulkAction::make('export')
|
||||||
]),
|
]),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user