diff --git a/app/common/Ideal/Model.php b/app/common/Ideal/Model.php index c68827a..ec2c59b 100644 --- a/app/common/Ideal/Model.php +++ b/app/common/Ideal/Model.php @@ -26,7 +26,7 @@ abstract class Model implements Define\Model public function jsonSerialize(): mixed { return [ - 'id' => $this->id, + 'id' => $this->id ?? '', ...$this->jsonComplement() ]; } diff --git a/app/resources/routes/api/ventas/reservations.php b/app/resources/routes/api/ventas/reservations.php index 7625931..d0dedcd 100644 --- a/app/resources/routes/api/ventas/reservations.php +++ b/app/resources/routes/api/ventas/reservations.php @@ -10,6 +10,7 @@ $app->group('/reservations', function($app) { }); $app->get('[/]', Reservations::class); }); +$app->post('/reservation/add[/]', [Reservations::class, 'addOne']); $app->group('/reservation/{reservation_id}', function($app) { $app->post('/edit[/]', [Reservations::class, 'edit']); $app->delete('[/]', [Reservations::class, 'delete']); diff --git a/app/resources/views/layout/body/scripts/rut.blade.php b/app/resources/views/layout/body/scripts/rut.blade.php index a6b86c1..0045e4b 100644 --- a/app/resources/views/layout/body/scripts/rut.blade.php +++ b/app/resources/views/layout/body/scripts/rut.blade.php @@ -24,6 +24,12 @@ rut.replace(/\D/g, '') return rut.replace(/^(\d{1,2})(\d{3})(\d{3})$/, '$1.$2.$3') } + static clean(rut) { + if (!(typeof rut === 'string' || rut instanceof String)) { + rut = rut.toString() + } + return rut.replace(/\D/g, '') + } static validar(rut, digito) { if (!(typeof digito === 'string' || digito instanceof String)) { digito = digito.toString() diff --git a/app/resources/views/ventas/reservations/add_modal.blade.php b/app/resources/views/ventas/reservations/add_modal.blade.php index 3f137b1..90a0251 100644 --- a/app/resources/views/ventas/reservations/add_modal.blade.php +++ b/app/resources/views/ventas/reservations/add_modal.blade.php @@ -4,13 +4,13 @@
- +
- +
@@ -18,7 +18,7 @@
- +
-
@@ -30,29 +30,29 @@
- +
- +
- +
- +
- +
- +
@@ -82,25 +82,25 @@
- +
- +
@
- +
- +
- +
@@ -115,7 +115,7 @@