mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Terminada exposicion de tablas ubicacion y series
This commit is contained in:
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
use App\Controllers\BaseResourceController;
|
use App\Controllers\BaseResourceController;
|
||||||
use App\Models\Collection;
|
use App\Models\Collection;
|
||||||
use App\Entities\Configuracion\UbicacionesEntity;
|
use App\Entities\Configuracion\SeriesFacturasEntity;
|
||||||
use App\Models\Configuracion\UbicacionesModel;
|
use App\Models\Configuracion\SeriesFacturasModel;
|
||||||
|
|
||||||
class SeriesFacturas extends BaseResourceController
|
class SeriesFacturas extends BaseResourceController
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $modelName = UbicacionesModel::class;
|
protected $modelName = SeriesFacturasModel::class;
|
||||||
protected $format = 'json';
|
protected $format = 'json';
|
||||||
|
|
||||||
protected static $singularObjectName = 'Series Facturas';
|
protected static $singularObjectName = 'Series Facturas';
|
||||||
@ -31,7 +31,7 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
// Breadcrumbs (IMN)
|
// Breadcrumbs (IMN)
|
||||||
$this->viewData['breadcrumb'] = [
|
$this->viewData['breadcrumb'] = [
|
||||||
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
['title' => lang("App.menu_configuration"), 'route' => "javascript:void(0);", 'active' => false],
|
||||||
['title' => lang("App.menu_ubicaciones"), 'route' => route_to('seriesFacturasList'), 'active' => true]
|
['title' => lang("App.menu_series_facturas"), 'route' => route_to('seriesFacturasList'), 'active' => true]
|
||||||
];
|
];
|
||||||
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
@ -44,14 +44,14 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
$viewData = [
|
$viewData = [
|
||||||
'currentModule' => static::$controllerSlug,
|
'currentModule' => static::$controllerSlug,
|
||||||
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('SeriesFacturas.moduleTitle')]),
|
'pageSubTitle' => lang('Basic.global.ManageAllRecords', [lang('SeriesFacturas.moduleTitle')]),
|
||||||
'ubicacionesEntity' => new UbicacionesEntity(),
|
'seriesFacturasEntity' => new SeriesFacturasEntity(),
|
||||||
'usingServerSideDataTable' => true,
|
'usingServerSideDataTable' => true,
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
$viewData = array_merge($this->viewData, $viewData); // merge any possible values from the parent controller class
|
||||||
|
|
||||||
return view(static::$viewPath . 'viewUbicacionesList', $viewData);
|
return view(static::$viewPath . 'viewSeriesFacturasList', $viewData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
|
|
||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
$this->viewData['ubicacionesEntity'] = isset($sanitizedData) ? new UbicacionesEntity($sanitizedData) : new UbicacionesEntity();
|
$this->viewData['seriesFacturasEntity'] = isset($sanitizedData) ? new SeriesFacturasEntity($sanitizedData) : new SeriesFacturasEntity();
|
||||||
$this->viewData['formAction'] = route_to('seriesFacturasAdd');
|
$this->viewData['formAction'] = route_to('seriesFacturasAdd');
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
$this->viewData['boxTitle'] = lang('Basic.global.addNew') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.addNewSuffix');
|
||||||
|
|
||||||
@ -116,9 +116,9 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
return $this->redirect2listView();
|
return $this->redirect2listView();
|
||||||
endif;
|
endif;
|
||||||
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
|
||||||
$ubicacionesEntity = $this->model->find($id);
|
$seriesFacturasEntity = $this->model->find($id);
|
||||||
|
|
||||||
if ($ubicacionesEntity == false) :
|
if ($seriesFacturasEntity == false) :
|
||||||
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('SeriesFacturas.moduleTitle')), $id]);
|
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('SeriesFacturas.moduleTitle')), $id]);
|
||||||
return $this->redirect2listView('sweet-error', $message);
|
return $this->redirect2listView('sweet-error', $message);
|
||||||
endif;
|
endif;
|
||||||
@ -148,11 +148,11 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
|
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
$ubicacionesEntity->fill($sanitizedData);
|
$seriesFacturasEntity->fill($sanitizedData);
|
||||||
$thenRedirect = false;
|
$thenRedirect = false;
|
||||||
endif;
|
endif;
|
||||||
if ($noException && $successfulResult) :
|
if ($noException && $successfulResult) :
|
||||||
$id = $ubicacionesEntity->id ?? $id;
|
$id = $seriesFacturasEntity->id ?? $id;
|
||||||
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
$message = lang('Basic.global.updateSuccess', [lang('Basic.global.record')]) . '.';
|
||||||
|
|
||||||
if ($thenRedirect) :
|
if ($thenRedirect) :
|
||||||
@ -168,7 +168,7 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
endif; // $noException && $successfulResult
|
endif; // $noException && $successfulResult
|
||||||
endif; // ($requestMethod === 'post')
|
endif; // ($requestMethod === 'post')
|
||||||
|
|
||||||
$this->viewData['ubicacionesEntity'] = $ubicacionesEntity;
|
$this->viewData['seriesFacturasEntity'] = $seriesFacturasEntity;
|
||||||
$this->viewData['formAction'] = route_to('seriesFacturasEdit', $id);
|
$this->viewData['formAction'] = route_to('seriesFacturasEdit', $id);
|
||||||
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . lang('SeriesFacturas.moduleTitle') . ' ' . lang('Basic.global.edit3');
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ class SeriesFacturas extends BaseResourceController
|
|||||||
$length = $reqData['length'] ?? 5;
|
$length = $reqData['length'] ?? 5;
|
||||||
$search = $reqData['search']['value'];
|
$search = $reqData['search']['value'];
|
||||||
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
$requestedOrder = $reqData['order']['0']['column'] ?? 1;
|
||||||
$order = UbicacionesModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
|
$order = SeriesFacturasModel::SORTABLE[$requestedOrder > 0 ? $requestedOrder : 1];
|
||||||
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
$dir = $reqData['order']['0']['dir'] ?? 'asc';
|
||||||
|
|
||||||
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
$resourceData = $this->model->getResource($search)->orderBy($order, $dir)->limit($length, $start)->get()->getResultObject();
|
||||||
|
|||||||
@ -688,7 +688,7 @@ return [
|
|||||||
"menu_maquina_defecto" => "Maquinas por defecto",
|
"menu_maquina_defecto" => "Maquinas por defecto",
|
||||||
"menu_papelgenerico" => "Papel generico",
|
"menu_papelgenerico" => "Papel generico",
|
||||||
"menu_papelimpresion" => "Papel impresión",
|
"menu_papelimpresion" => "Papel impresión",
|
||||||
"menu_series_factura" => "Series facturas",
|
"menu_series_facturas" => "Series facturas",
|
||||||
"menu_ubicaciones" => "Ubicaciones",
|
"menu_ubicaciones" => "Ubicaciones",
|
||||||
"menu_serviciocliente" => "Servicio cliente",
|
"menu_serviciocliente" => "Servicio cliente",
|
||||||
"menu_tamanioformatos" => "Tamaño formatos",
|
"menu_tamanioformatos" => "Tamaño formatos",
|
||||||
|
|||||||
@ -1,21 +1,24 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'id' => 'ID',
|
'id' => 'ID',
|
||||||
'moduleTitle' => 'Series Facturas',
|
'moduleTitle' => 'Series Facturas',
|
||||||
'nombre' => 'Nombre',
|
'nombre' => 'Nombre',
|
||||||
'validation' => [
|
'tipo' => 'Tipo',
|
||||||
'id' => [
|
'formato' => 'Formato',
|
||||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
'next' => 'Próxima',
|
||||||
],
|
'grupo' => 'Grupo',
|
||||||
|
'validation' => [
|
||||||
|
'id' => [
|
||||||
|
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||||
|
],
|
||||||
|
|
||||||
'nombre' => [
|
'nombre' => [
|
||||||
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
'max_length' => 'El campo {field} no puede exceder {param} caracteres en longitud.',
|
||||||
'required' => 'El campo {field} es obligatorio.',
|
'required' => 'El campo {field} es obligatorio.',
|
||||||
],
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
@ -1,12 +1,57 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 col-lg-12 px-4">
|
<div class="col-md-12 col-lg-12 px-4">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<label for="nombre" class="form-label">
|
<label for="nombre" class="form-label">
|
||||||
<?=lang('Ubicaciones.nombre') ?>*
|
<?= lang('SeriesFacturas.nombre') ?>*
|
||||||
</label>
|
</label>
|
||||||
<input type="text" id="nombre" name="nombre" maxLength="255" class="form-control" value="<?=old('nombre', $ubicacionesEntity->nombre) ?>">
|
<input type="text"
|
||||||
</div><!--//.mb-3 -->
|
id="nombre"
|
||||||
|
name="nombre"
|
||||||
|
maxLength="255"
|
||||||
|
class="form-control"
|
||||||
|
value="<?= old('nombre', $seriesFacturasEntity->nombre) ?>"
|
||||||
|
>
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
</div><!--//.col -->
|
<div class="mb-3">
|
||||||
|
<label for="tipo" class="form-label">
|
||||||
|
<?= lang('SeriesFacturas.tipo') ?>*
|
||||||
|
</label>
|
||||||
|
<select id="tipo" name="tipo" required class="form-control select2" style="width: 100%;">
|
||||||
|
<option value="facturacion" <?= "facturacion" == $seriesFacturasEntity->tipo ? ' selected' : '' ?>>
|
||||||
|
Facturación
|
||||||
|
</option>
|
||||||
|
<option value="albaranes" <?= "albaranes" == $seriesFacturasEntity->tipo ? ' selected' : '' ?>>
|
||||||
|
Albaranes
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
</div><!-- //.row -->
|
<div class="mb-3">
|
||||||
|
<label for="tipo" class="form-label">
|
||||||
|
<?= lang('SeriesFacturas.formato') ?>*
|
||||||
|
</label>
|
||||||
|
<input type="text"
|
||||||
|
id="formato"
|
||||||
|
name="formato"
|
||||||
|
maxLength="255"
|
||||||
|
class="form-control"
|
||||||
|
value="<?= old('formato', $seriesFacturasEntity->formato) ?>"
|
||||||
|
>
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
<div class="mb-3">
|
||||||
|
<label for="tipo" class="form-label">
|
||||||
|
<?= lang('SeriesFacturas.next') ?>*
|
||||||
|
</label>
|
||||||
|
<input type="text"
|
||||||
|
id="next"
|
||||||
|
name="next"
|
||||||
|
class="form-control"
|
||||||
|
value="<?= old('next', $seriesFacturasEntity->next) ?>"
|
||||||
|
>
|
||||||
|
</div><!--//.mb-3 -->
|
||||||
|
|
||||||
|
</div><!--//.col -->
|
||||||
|
|
||||||
|
</div><!-- //.row -->
|
||||||
@ -10,18 +10,18 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
<h3 class="card-title"><?= $boxTitle ?? $pageTitle ?></h3>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<form id="ubicacionesForm" class="card-body" method="post" action="<?= $formAction ?>">
|
<form id="seriesFacturasForm" class="card-body" method="post" action="<?= $formAction ?>">
|
||||||
<?= csrf_field() ?>
|
<?= csrf_field() ?>
|
||||||
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
<?= view("themes/_commonPartialsBs/_alertBoxes") ?>
|
||||||
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
<?= !empty($validation->getErrors()) ? $validation->listErrors("bootstrap_style") : "" ?>
|
||||||
<?= view("themes/vuexy/form/configuracion/ubicaciones/_ubicacionesFormItems") ?>
|
<?= view("themes/vuexy/form/configuracion/series-facturas/_seriesFacturasFormItems") ?>
|
||||||
<div class="pt-4">
|
<div class="pt-4">
|
||||||
<input type="submit"
|
<input type="submit"
|
||||||
class="btn btn-primary float-start me-sm-3 me-1"
|
class="btn btn-primary float-start me-sm-3 me-1"
|
||||||
name="save"
|
name="save"
|
||||||
value="<?= lang("Basic.global.Save") ?>"
|
value="<?= lang("Basic.global.Save") ?>"
|
||||||
/>
|
/>
|
||||||
<?= anchor(route_to("ubicacionesList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
<?= anchor(route_to("seriesFacturasList"), lang("Basic.global.Cancel"), ["class" => "btn btn-secondary float-start",]) ?>
|
||||||
|
|
||||||
</div><!-- /.card-footer -->
|
</div><!-- /.card-footer -->
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
<div class="card card-info">
|
<div class="card card-info">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<h3 class="card-title"><?=lang('SeriesFacturas.moduleTitle') ?></h3>
|
<h3 class="card-title"><?=lang('SeriesFacturas.moduleTitle') ?></h3>
|
||||||
<?=anchor(route_to('ubicacionesAdd'), lang('Basic.global.addNew') . ' ' .lang('SeriesFacturas.moduleTitle'), ['class'=>'btn btn-primary float-end']); ?>
|
<?=anchor(route_to('seriesFacturasAdd'), lang('Basic.global.addNew') . ' ' .lang('SeriesFacturas.moduleTitle'), ['class'=>'btn btn-primary float-end']); ?>
|
||||||
</div><!--//.card-header -->
|
</div><!--//.card-header -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
<?= view('themes/_commonPartialsBs/_alertBoxes'); ?>
|
||||||
@ -18,7 +18,10 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= lang('SeriesFacturas.nombre') ?></th>
|
<th><?= lang('SeriesFacturas.nombre') ?></th>
|
||||||
<th><?= lang('SeriesFacturas.nombre') ?></th>
|
<th><?= lang('SeriesFacturas.tipo') ?></th>
|
||||||
|
<th><?= lang('SeriesFacturas.formato') ?></th>
|
||||||
|
<th><?= lang('SeriesFacturas.next') ?></th>
|
||||||
|
<th><?= lang('SeriesFacturas.grupo') ?></th>
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -87,6 +90,9 @@
|
|||||||
columns : [
|
columns : [
|
||||||
{ 'data': 'nombre' },
|
{ 'data': 'nombre' },
|
||||||
{ 'data': 'tipo' },
|
{ 'data': 'tipo' },
|
||||||
|
{ 'data': 'formato' },
|
||||||
|
{ 'data': 'next' },
|
||||||
|
{ 'data': 'grupo' },
|
||||||
{ 'data': actionBtns }
|
{ 'data': actionBtns }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user