Implementacion de modulo de pedidos
This commit is contained in:
@@ -12,9 +12,9 @@ class CancelacionController extends Component
|
||||
use WithPagination;
|
||||
|
||||
const CODIGO_CANCELACION = 3;
|
||||
public $buscador = '' , $modal = false;
|
||||
public $buscador = '' , $modal = false, $modalDate = false;
|
||||
|
||||
public $cancelacion;
|
||||
public $cancelacion, $created_at;
|
||||
|
||||
protected $rules = [
|
||||
'cancelacion.codigo' => 'min:0',
|
||||
@@ -71,6 +71,26 @@ class CancelacionController extends Component
|
||||
$this->closeModal();
|
||||
}
|
||||
|
||||
public function editDate(Movimiento $movimiento)
|
||||
{
|
||||
$this->cancelacion = $movimiento;
|
||||
$this->showModal('modalDate');
|
||||
}
|
||||
|
||||
public function saveDate()
|
||||
{
|
||||
$this->validate([
|
||||
'created_at' => 'required',
|
||||
]);
|
||||
|
||||
$this->cancelacion->created_at = $this->created_at;
|
||||
$this->cancelacion->save();
|
||||
session()->flash('message',"La fecha ha sido cambiada correctamente.");
|
||||
|
||||
$this->clearInputs();
|
||||
$this->closeModal('modalDate');
|
||||
}
|
||||
|
||||
public function delete(Movimiento $venta)
|
||||
{
|
||||
|
||||
@@ -82,14 +102,14 @@ class CancelacionController extends Component
|
||||
}
|
||||
|
||||
|
||||
public function showModal()
|
||||
public function showModal($modal = "modal")
|
||||
{
|
||||
$this->modal = true;
|
||||
$this->{$modal} = true;
|
||||
}
|
||||
|
||||
public function closeModal()
|
||||
public function closeModal($modal = "modal")
|
||||
{
|
||||
$this->modal = false;
|
||||
$this->{$modal} = false;
|
||||
}
|
||||
|
||||
public function clearInputs()
|
||||
|
||||
Reference in New Issue
Block a user