mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-28 06:38:51 +00:00
trabajando en añadir
This commit is contained in:
@ -0,0 +1,150 @@
|
||||
<div th:fragment="direccionForm">
|
||||
<form id="direccionForm" novalidate th:action="${action}" th:object="${direccion}" method="post"
|
||||
th:data-add="#{direcciones.add}" th:data-edit="#{direcciones.editar}">
|
||||
<div class="form-group">
|
||||
<label for="alias">
|
||||
<span th:text="#{direcciones.alias}">Alias</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="alias" th:field="*{alias}" maxlength="100" required>
|
||||
<div class="invalid-feedback"></div>
|
||||
<label th:text="#{direcciones.alias-descripcion}" class="form-text text-muted"></label>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="att">
|
||||
<span th:text="#{direcciones.nombre}">Nombre y Apellidos</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="att" th:field="*{att}" maxlength="150" required>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="direccion">
|
||||
<span th:text="#{direcciones.direccion}">Dirección</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<textarea class="form-control direccion-item" id="direccion" th:field="*{direccion}" maxlength="255"
|
||||
required style="max-height: 125px;"></textarea>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-6 col-md-6 col-sm-12 ml-0">
|
||||
<label for="cp">
|
||||
<span th:text="#{direcciones.cp}">Código Postal</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input type="number" class="form-control direccion-item" id="cp" th:field="*{cp}" min="1" max="99999"
|
||||
required>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-6 col-md-6 col-sm-12 mr-0">
|
||||
<label for="ciudad">
|
||||
<span th:text="#{direcciones.ciudad}">Ciudad</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="ciudad" th:field="*{ciudad}" maxlength="100" required>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-6 col-md-6 col-sm-12 ml-0">
|
||||
<label for="provincia">
|
||||
<span th:text="#{direcciones.provincia}">Provincia</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="provincia" th:field="*{provincia}" maxlength="100"
|
||||
required>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-6 col-md-6 col-sm-12 mr-0">
|
||||
<label for="pais">
|
||||
<span th:text="#{direcciones.pais}">País</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<select class="form-control select2 direccion-item" id="pais" th:field="*{paisCode3}">
|
||||
<option th:each="pais : ${paises}" th:value="${pais.id}" th:text="${pais.text}"
|
||||
th:selected="${pais.id} == ${direccion.paisCode3}">
|
||||
</option>
|
||||
</select>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="telefono">
|
||||
<span th:text="#{direcciones.telefono}">Teléfono</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="telefono" th:field="*{telefono}" maxlength="50">
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="instrucciones">
|
||||
<span th:text="#{direcciones.instrucciones}">Instrucciones</span>
|
||||
</label>
|
||||
<textarea class="form-control direccion-item" id="instrucciones" th:field="*{instrucciones}" maxlength="255"
|
||||
required style="max-height: 125px;"></textarea>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-check form-switch form-switch-custom my-2">
|
||||
<input type="checkbox"
|
||||
class="form-check-input form-switch-custom-primary direccion-item direccionFacturacion"
|
||||
id="direccionFacturacion" name="direccionFacturacion" th:field="*{direccionFacturacion}">
|
||||
<label for="direccionFacturacion" class="form-check-label" th:text="#{direcciones.isFacturacion}">Usar
|
||||
también como
|
||||
dirección de facturación</label>
|
||||
</div>
|
||||
|
||||
<div
|
||||
th:class="'form-group direccionFacturacionItems' + (${direccion != null and direccion.direccionFacturacion} ? '' : ' d-none')">
|
||||
<label for="razon_social">
|
||||
<span th:text="#{direcciones.razon_social}">Razón Social</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="razonSocial" th:field="*{razonSocial}" maxlength="150">
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
th:class="'row direccionFacturacionItems' + (${direccion != null and direccion.direccionFacturacion} ? '' : ' d-none')">
|
||||
<div class="form-group col-lg-6 col-md-6 col-sm-12 ml-0">
|
||||
<label for="tipoIdentificacionFiscal">
|
||||
<span th:text="#{direcciones.tipo_identificacion_fiscal}">Tipo de identificación fiscal</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<select class="form-control select2 direccion-item" id="tipoIdentificacionFiscal"
|
||||
th:field="*{tipoIdentificacionFiscal}">
|
||||
<option th:value="DNI" th:text="#{direcciones.dni}">DNI</option>
|
||||
<option th:value="NIE" th:text="#{direcciones.nie}">NIE</option>
|
||||
<option th:value="Pasaporte" th:text="#{direcciones.pasaporte}">Pasaporte</option>
|
||||
<option th:value="CIF" th:text="#{direcciones.cif}">CIF</option>
|
||||
<option th:value="VAT_ID" th:text="#{direcciones.vat_id}">VAT ID</option>
|
||||
</select>
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-lg-6 col-md-6 col-sm-12 ml-0">
|
||||
<label for="identificacionFiscal">
|
||||
<span th:text="#{direcciones.identificacion_fiscal}">Número de identificación fiscal</span>
|
||||
<span class="text-danger">*</span>
|
||||
</label>
|
||||
<input class="form-control direccion-item" id="identificacionFiscal" th:field="*{identificacionFiscal}"
|
||||
maxlength="50">
|
||||
<div class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-items-center justify-content-center">
|
||||
<button type="submit" class="btn btn-secondary mt-3" th:text="#{direcciones.add}"></button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
@ -0,0 +1,128 @@
|
||||
<!doctype html>
|
||||
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
|
||||
layout:decorate="~{imprimelibros/layout}">
|
||||
|
||||
<head>
|
||||
<th:block layout:fragment="pagetitle" />
|
||||
<th:block th:replace="~{imprimelibros/partials/head-css :: head-css}" />
|
||||
<th:block layout:fragment="pagecss">
|
||||
<link th:href="@{/assets/css/presupuestador.css}" rel="stylesheet"
|
||||
th:unless="${#authorization.expression('isAuthenticated()')}" />
|
||||
<link th:href="@{/assets/libs/datatables/dataTables.bootstrap5.min.css}" rel="stylesheet" />
|
||||
</th:block>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div th:replace="~{imprimelibros/partials/topbar :: topbar}" />
|
||||
<div th:replace="~{imprimelibros/partials/sidebar :: sidebar}" />
|
||||
|
||||
<th:block layout:fragment="content">
|
||||
<div th:if="${#authorization.expression('isAuthenticated()')}">
|
||||
|
||||
<!-- Modales-->
|
||||
<div
|
||||
th:replace="imprimelibros/partials/modal-form :: modal('direccionFormModal', 'direcciones.add', 'modal-md', 'direccionFormModalBody')">
|
||||
</div>
|
||||
|
||||
<nav aria-label="breadcrumb">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="/"><i class="ri-home-5-fill"></i></a></li>
|
||||
<li class="breadcrumb-item active" aria-current="page" th:text="#{direcciones.breadcrumb}">
|
||||
Direcciones</li>
|
||||
</ol>
|
||||
</nav>
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
<input type="hidden" id="isUser" th:value="${isUser}" />
|
||||
|
||||
<button type="button" class="btn btn-secondary mb-3" id="addButton">
|
||||
<i class="ri-add-line align-bottom me-1"></i> <span
|
||||
th:text="#{direcciones.add}">Añadir</span>
|
||||
</button>
|
||||
|
||||
<table id="direcciones-datatable" class="table table-striped table-nowrap responsive w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" th:text="#{direcciones.tabla.id}">ID</th>
|
||||
<th scope="col" th:text="#{direcciones.tabla.cliente}">Cliente</th>
|
||||
<th scope="col" th:text="#{direcciones.alias}">Alias</th>
|
||||
<th scope="col" th:text="#{direcciones.nombre}">Nombre y Apellidos</th>
|
||||
<th scope="col" th:text="#{direcciones.direccion}">Dirección</th>
|
||||
<th scope="col" th:text="#{direcciones.cp}">Código Postal</th>
|
||||
<th scope="col" th:text="#{direcciones.ciudad}">Ciudad</th>
|
||||
<th scope="col" th:text="#{direcciones.provincia}">Provincia</th>
|
||||
<th scope="col" th:text="#{direcciones.pais}">País</th>
|
||||
<th scope="col" th:text="#{direcciones.tabla.acciones}">Acciones</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><input type="text" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="id" /></th>
|
||||
<th>
|
||||
<input type="text" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="cliente" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="text" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="alias" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="nombre" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="margenMin" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="direccion" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="margenMax" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="cp" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="cp" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="ciudad" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="ciudad" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="provincia" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="provincia" />
|
||||
</th>
|
||||
<th>
|
||||
<input type="pais" class="form-control form-control-sm direcciones-filter"
|
||||
data-col="pais" />
|
||||
</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
<th:block layout:fragment="modal" />
|
||||
<th:block th:replace="~{theme/partials/vendor-scripts :: scripts}" />
|
||||
<th:block layout:fragment="pagejs">
|
||||
<script th:inline="javascript">
|
||||
window.languageBundle = /*[[${languageBundle}]]*/ {};
|
||||
</script>
|
||||
<script th:src="@{/assets/libs/datatables/datatables.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/datatables/dataTables.bootstrap5.min.js}"></script>
|
||||
|
||||
<!-- JS de Buttons y dependencias -->
|
||||
<script th:src="@{/assets/libs/datatables/dataTables.buttons.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/jszip/jszip.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/pdfmake/pdfmake.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/pdfmake/vfs_fonts.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/datatables/buttons.html5.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/datatables/buttons.print.min.js}"></script>
|
||||
<script th:src="@{/assets/libs/datatables/buttons.colVis.min.js}"></script>
|
||||
|
||||
<script type="module" th:src="@{/assets/js/pages/imprimelibros/direcciones/list.js}"></script>
|
||||
|
||||
</th:block>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@ -43,6 +43,16 @@
|
||||
<i class="ri-file-paper-2-line"></i> <span th:text="#{app.sidebar.presupuestos}">Presupuestos</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link menu-link" href="/direcciones">
|
||||
<i class="ri-truck-line"></i>
|
||||
<span th:if="${#authentication.principal.role == 'SUPERADMIN' or #authentication.principal.role == 'ADMIN'}"
|
||||
th:text="#{app.sidebar.direcciones-admin}">Administrar Direcciones</span>
|
||||
</span>
|
||||
<span th:if="${#authentication.principal.role != 'SUPERADMIN' and #authentication.principal.role != 'ADMIN'}"
|
||||
th:text="#{app.sidebar.direcciones}">Mis Direcciones</span>
|
||||
</a>
|
||||
</li>
|
||||
<li th:if="${#authentication.principal.role == 'SUPERADMIN' or #authentication.principal.role == 'ADMIN'}" class="nav-item">
|
||||
<a class="nav-link menu-link collapsed" href="#sidebarConfig" data-bs-toggle="collapse"
|
||||
role="button" aria-expanded="false" aria-controls="sidebarConfig">
|
||||
|
||||
Reference in New Issue
Block a user