Clear invoice, serial, quantities on change plant

This commit is contained in:
dhanabalan
2025-04-19 19:25:19 +05:30
parent 700f4715f7
commit 1073a7cb0b

View File

@@ -31,9 +31,6 @@ use Maatwebsite\Excel\Facades\Excel;
use Livewire\Livewire;
use Str;
class InvoiceValidationResource extends Resource
{
protected static ?string $model = InvoiceValidation::class;
@@ -44,8 +41,6 @@ class InvoiceValidationResource extends Resource
public $invoiceNumber;
public static function form(Form $form): Form
{
return $form
@@ -74,6 +69,10 @@ class InvoiceValidationResource extends Resource
$set('update_invoice', null);
// Ensure `linestop_id` is not cleared
if (!$plantId) {
$set('invoice_number', null);
$set('serial_number', null);
$set('total_quantity', null);
$set('scanned_quantity', null);
$set('ivPlantError', 'Please select a plant first.');
return;
}