|
|
@@ -6,7 +6,7 @@ use Livewire\Component;
|
|
|
|
|
|
class PaymentMethod extends Component
|
|
|
{
|
|
|
- public $records, $name, $enabled, $dataId, $bank_id, $update = false, $add = false;
|
|
|
+ public $records, $name, $enabled, $money, $dataId, $bank_id, $update = false, $add = false;
|
|
|
|
|
|
public $banks = array();
|
|
|
|
|
|
@@ -20,6 +20,7 @@ class PaymentMethod extends Component
|
|
|
|
|
|
public function resetFields(){
|
|
|
$this->name = '';
|
|
|
+ $this->money = false;
|
|
|
$this->enabled = true;
|
|
|
}
|
|
|
|
|
|
@@ -48,6 +49,7 @@ class PaymentMethod extends Component
|
|
|
\App\Models\PaymentMethod::create([
|
|
|
'name' => $this->name,
|
|
|
'bank_id' => $this->bank_id,
|
|
|
+ 'money' => $this->money,
|
|
|
'enabled' => $this->enabled
|
|
|
]);
|
|
|
session()->flash('success','Metodo pagamento creato');
|
|
|
@@ -66,6 +68,7 @@ class PaymentMethod extends Component
|
|
|
} else {
|
|
|
$this->name = $payment_method->name;
|
|
|
$this->enabled = $payment_method->enabled;
|
|
|
+ $this->money = $payment_method->money;
|
|
|
$this->bank_id = $payment_method->bank_id;
|
|
|
$this->dataId = $payment_method->id;
|
|
|
$this->update = true;
|
|
|
@@ -83,6 +86,7 @@ class PaymentMethod extends Component
|
|
|
\App\Models\PaymentMethod::whereId($this->dataId)->update([
|
|
|
'name' => $this->name,
|
|
|
'bank_id' => $this->bank_id,
|
|
|
+ 'money' => $this->money,
|
|
|
'enabled' => $this->enabled
|
|
|
]);
|
|
|
session()->flash('success','Metodo pagamento aggiornato');
|