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 Livewire\Livewire;
|
||||||
use Str;
|
use Str;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class InvoiceValidationResource extends Resource
|
class InvoiceValidationResource extends Resource
|
||||||
{
|
{
|
||||||
protected static ?string $model = InvoiceValidation::class;
|
protected static ?string $model = InvoiceValidation::class;
|
||||||
@@ -44,8 +41,6 @@ class InvoiceValidationResource extends Resource
|
|||||||
|
|
||||||
public $invoiceNumber;
|
public $invoiceNumber;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function form(Form $form): Form
|
public static function form(Form $form): Form
|
||||||
{
|
{
|
||||||
return $form
|
return $form
|
||||||
@@ -74,6 +69,10 @@ class InvoiceValidationResource extends Resource
|
|||||||
$set('update_invoice', null);
|
$set('update_invoice', null);
|
||||||
// Ensure `linestop_id` is not cleared
|
// Ensure `linestop_id` is not cleared
|
||||||
if (!$plantId) {
|
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.');
|
$set('ivPlantError', 'Please select a plant first.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user