diff --git a/app/Http/Livewire/CancelacionController.php b/app/Http/Livewire/CancelacionController.php index 6c82528..94d2699 100644 --- a/app/Http/Livewire/CancelacionController.php +++ b/app/Http/Livewire/CancelacionController.php @@ -71,6 +71,16 @@ class CancelacionController extends Component $this->closeModal(); } + public function delete(Movimiento $venta) + { + + if(auth()->user()->hasRole('admin')) + { + $venta->delete(); + session()->flash('message',"La cancelacion se ha eliminado del sistema."); + } + } + public function showModal() { diff --git a/app/Http/Livewire/VentaController.php b/app/Http/Livewire/VentaController.php index f9a2693..69c7c68 100644 --- a/app/Http/Livewire/VentaController.php +++ b/app/Http/Livewire/VentaController.php @@ -102,6 +102,16 @@ class VentaController extends Component $this->closeModal(); } + public function delete(Movimiento $venta) + { + + if(auth()->user()->hasRole('admin')) + { + $venta->delete(); + session()->flash('message',"La venta se ha eliminado del sistema."); + } + } + public function showModal() { diff --git a/app/Http/Livewire/VentaEspecialController.php b/app/Http/Livewire/VentaEspecialController.php index e8eef3d..afed243 100644 --- a/app/Http/Livewire/VentaEspecialController.php +++ b/app/Http/Livewire/VentaEspecialController.php @@ -111,7 +111,7 @@ class VentaEspecialController extends Component $this->ventaEspecial->user_id = Auth::user()->id; $this->ventaEspecial->save(); - session()->flash('message',"La venta se ha registrado correctamente!"); + session()->flash('message',"La venta especial se ha registrado correctamente!"); $this->clearInputs(); $this->closeModal(); @@ -156,6 +156,16 @@ class VentaEspecialController extends Component $this->closeModalLiquidar(); } + public function delete(Movimiento $venta) + { + + if(auth()->user()->hasRole('admin')) + { + $venta->delete(); + session()->flash('message',"La venta especial se ha eliminado del sistema."); + } + } + public function showModal() { diff --git a/resources/views/venta/cancelacion.blade.php b/resources/views/venta/cancelacion.blade.php index ce9a47f..8989f14 100644 --- a/resources/views/venta/cancelacion.blade.php +++ b/resources/views/venta/cancelacion.blade.php @@ -33,6 +33,7 @@