1
0
forked from poc/pds

Hide update_invoice toggle button on scanning

This commit is contained in:
dhanabalan
2025-04-28 00:19:43 +05:30
parent a275e18d0b
commit a6b9f88101

View File

@@ -2,6 +2,7 @@
namespace App\Filament\Resources;
use AlperenErsoy\FilamentExport\Actions\FilamentExportBulkAction;
use App\Filament\Exports\InvoiceValidationExporter;
use App\Filament\Resources\InvoiceValidationResource\Pages;
use App\Models\InvoiceValidation;
@@ -122,6 +123,10 @@ class InvoiceValidationResource extends Resource
'x-model' => 'value',
'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),
Forms\Components\TextInput::make('total_quantity')
->label('Total Quantity')
@@ -136,7 +141,7 @@ class InvoiceValidationResource extends Resource
->boolean()
->grouped()
->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) {
if(!$get('plant_id'))
{
@@ -904,6 +909,7 @@ class InvoiceValidationResource extends Resource
Tables\Actions\DeleteBulkAction::make(),
Tables\Actions\ForceDeleteBulkAction::make(),
Tables\Actions\RestoreBulkAction::make(),
FilamentExportBulkAction::make('export')
]),
]);
}