Clear invoice, serial, quantities on change plant
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user