mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado editar cliente
This commit is contained in:
@ -7,47 +7,141 @@
|
||||
<h3>Resumen</h3>
|
||||
<div class="col-sm-6">
|
||||
<h5 class="mb-1">Libro</h5>
|
||||
<p class="mb-0"><small id="tipoLibro">Rústica cosido tapa blanda</small></p>
|
||||
<p class="mb-0"><small id="resumenTamanio">Tamaño: 100x100</small></p>
|
||||
<p class="mb-0"><small id="resumenPaginas">Número de páginas: 200</small></p>
|
||||
<p class="mb-0"><small id="resumenTirada">Tirada: 200</small></p>
|
||||
<p class="mb-0"><small id="resumenPrototipo">Prototipo: NO</small></p>
|
||||
<p class="mb-3"><small id="resumenFerro">Ferro: NO</small></p>
|
||||
<p class="mb-0"><small id="tipoLibro"><?php echo (isset($presupuestoEntity->resumen->titulo)?$presupuestoEntity->resumen->titulo:'') ?></small></p>
|
||||
<p class="mb-0"><small id="resumenTamanio">Tamaño: <?php echo (isset($presupuestoEntity->resumen->tamanio)?$presupuestoEntity->resumen->tamanio:'') ?></small></p>
|
||||
<p class="mb-0"><small id="resumenPaginas">Número de páginas: <?php echo $presupuestoEntity->paginas ?></small></p>
|
||||
<p class="mb-0"><small id="resumenTirada">Tirada: <?php echo $presupuestoEntity->tirada ?></small></p>
|
||||
<p class="mb-0"><small id="resumenPrototipo">Prototipo: <?php echo ($presupuestoEntity->prototipo?'SI':'NO') ?></small></p>
|
||||
<p class="mb-3"><small id="resumenFerro">Ferro: <?php echo ($presupuestoEntity->ferro?'SI':'NO') ?></small></p>
|
||||
|
||||
<h5 class="mb-1">Interior</h5>
|
||||
<p class="mb-0"><small id="tipoImpresion">Impresion: Negro premium</small></p>
|
||||
<p id="pResumenPaginasColor" class="mb-0" style="display:none"><small id="resumenPaginasColor">Páginas a color: 100</small></p>
|
||||
<p class="mb-3"><small id="resumenPapelInterior">Papel: Blanco Offset 70gr/m²</small></p>
|
||||
<p class="mb-0"><small id="tipoImpresion">Impresion:
|
||||
<?php echo (isset($presupuestoEntity->resumen->tipo_impresion)?$presupuestoEntity->resumen->tipo_impresion:'') ?>
|
||||
</small></p>
|
||||
<p id="pResumenPaginasColor" class="mb-0" <?php echo ($presupuestoEntity->paginasColor==0?'style="display:none"':'')?>>
|
||||
<small id="resumenPaginasColor">Páginas a color: <?php echo $presupuestoEntity->paginasColor?></small></p>
|
||||
<p class="mb-3"><small id="resumenPapelInterior">Papel:
|
||||
<?php echo (isset($presupuestoEntity->papel_interior_nombre)?$presupuestoEntity->papel_interior_nombre:'') ?>
|
||||
<?php echo (isset($presupuestoEntity->gramaje_interior)?$presupuestoEntity->gramaje_interior:'') ?>gr/m²</small></p>
|
||||
|
||||
<h5 class="mb-1">Cubierta</h5>
|
||||
<p class="mb-0"><small id="resumenPapelCubierta">Papel: Blanco Offset 70gr/m²</small></p>
|
||||
<p class="mb-0"><small id="resumenCarasCubierta">Impresión: 1 cara</small></p>
|
||||
<p class="mb-0"><small id="resumenSolapasCubierta">Solapas: 25mm</small></p>
|
||||
<p class="mb-3"><small id="resumenAcabadoCubierta">Acabado: Ninguno</small></p>
|
||||
<p class="mb-0"><small id="resumenPapelCubierta">Papel:
|
||||
<?php echo (isset($presupuestoEntity->papel_cubierta_nombre)?$presupuestoEntity->papel_cubierta_nombre:''); ?>
|
||||
<?php echo (isset($presupuestoEntity->gramaje_cubierta)?$presupuestoEntity->gramaje_cubierta:''); ?>gr/m²</small></p>
|
||||
<p class="mb-0"><small id="resumenCarasCubierta">Impresión: <?php echo ($presupuestoEntity->paginas_cubierta==2?"1 cara":"2 caras");?></small></p>
|
||||
<?php if($presupuestoEntity->solapas_ancho>0 || $presupuestoEntity->estado_id==1): ?>
|
||||
<p class="mb-0"><small id="resumenSolapasCubierta">Solapas: <?php echo $presupuestoEntity->solapas_ancho;?>mm</small></p>
|
||||
<?php endif; ?>
|
||||
<?php if($presupuestoEntity->acabado_cubierta_id>0 || $presupuestoEntity->estado_id==1): ?>
|
||||
<p class="mb-3"><small id="resumenAcabadoCubierta">Acabado:
|
||||
<?php if (isset($datosPresupuesto->acabadosCubierta) && is_array($datosPresupuesto->acabadosCubierta) && !empty($datosPresupuesto->acabadosCubierta)) :
|
||||
foreach ($datosPresupuesto->acabadosCubierta as $acabado) :
|
||||
if ($acabado->id == $presupuestoEntity->acabado_cubierta_id):
|
||||
echo $acabado->label;
|
||||
endif;
|
||||
endforeach;
|
||||
endif; ?>
|
||||
</small></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<h5 class="mb-1 resumen-sobrecubierta">Sobrecubierta</h5>
|
||||
<p class="mb-0 resumen-sobrecubierta"><small id="resumenPapelSobrecubierta">Papel: Blanco Offset 70gr/m²</small></p>
|
||||
<p class="mb-0 resumen-sobrecubierta"><small id="resumenSolapasCubierta">Ancho solapas: 25mm</small></p>
|
||||
<p class="mb-3 resumen-sobrecubierta"><small id="resumenAcabadoCubierta">Acabado: Ninguno</small></p>
|
||||
<?php if($presupuestoEntity->papel_sobrecubierta || $presupuestoEntity->estado_id==1): ?>
|
||||
<h5 class="mb-1 resumen-sobrecubierta">Sobrecubierta</h5>
|
||||
<p class="mb-0 resumen-sobrecubierta"><small id="resumenPapelSobrecubierta">Papel:
|
||||
<?php echo (isset($presupuestoEntity->papel_sobrecubierta_nombre)?$presupuestoEntity->papel_sobrecubierta_nombre:'') ?>
|
||||
<?php echo (isset($presupuestoEntity->gramaje_sobrecubierta)?$presupuestoEntity->gramaje_sobrecubierta:'') ?>gr/m²</small></p>
|
||||
<?php if($presupuestoEntity->solapas_ancho_sobrecubierta>0 || $presupuestoEntity->estado_id==1): ?>
|
||||
<p class="mb-0 resumen-sobrecubierta"><small id="resumenSolapasCubierta">Ancho solapas: <?php echo $presupuestoEntity->solapas_ancho_sobrecubierta;?>mm</small></p>
|
||||
<?php endif; ?>
|
||||
<p class="mb-3 resumen-sobrecubierta"><small id="resumenAcabadoSobrecubierta">Acabado:
|
||||
<?php if (isset($datosPresupuesto->acabadosSobrecubierta) && is_array($datosPresupuesto->acabadosSobrecubierta) && !empty($datosPresupuesto->acabadosSobrecubierta)) :
|
||||
foreach ($datosPresupuesto->acabadosSobrecubierta as $acabado) :
|
||||
if ($acabado->id == $presupuestoEntity->acabado_sobrecubierta_id):
|
||||
echo $acabado->label;
|
||||
endif;
|
||||
endforeach;
|
||||
endif; ?>
|
||||
</small></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<h5 class="mb-1 resumen-guardas">Guardas</h5>
|
||||
<p class="mb-0 resumen-guardas"><small id="resumenGuardasPapel">Papel: Blanco Offset 70gr/m²</small></p>
|
||||
<p class="mb-3 resumen-guardas"><small id="resumenGuardasCaras">Impresión: 1 cara</small></p>
|
||||
<?php if($presupuestoEntity->papel_guardas || $presupuestoEntity->estado_id==1): ?>
|
||||
<h5 class="mb-1 resumen-guardas">Guardas</h5>
|
||||
<p class="mb-0 resumen-guardas"><small id="resumenGuardasPapel">Papel:
|
||||
<?php echo (isset($presupuestoEntity->papel_guardas_nombre)?$presupuestoEntity->papel_guardas_nombre:''); ?>
|
||||
170gr/m²</small></p>
|
||||
<p class="mb-3 resumen-guardas"><small id="resumenGuardasCaras">Impresión:
|
||||
<?php if(!isset($presupuestoEntity->paginas_guardas) || $presupuestoEntity->paginas_guardas==0):
|
||||
echo "Sin impresion";
|
||||
elseif($presupuestoEntity->paginas_guardas==4):
|
||||
echo "1 cara";
|
||||
else:
|
||||
echo "2 caras";
|
||||
endif; ?></small></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<h5 class="mb-1 resumen-extras">Extras</h5>
|
||||
<p class="mb-0 resumen-extras" id="resumenRetractilado1"><small>Retractilado individual</small></p>
|
||||
<p class="mb-0 resumen-extras" id="resumenRetractilado5"><small>Retractilado de 5</small></p>
|
||||
<p class="mb-0 resumen-extras" id="resumenFajaColor"><small>Imprimir faja a color</small></p>
|
||||
<?php if($presupuestoEntity->retractiladol || $presupuestoEntity->retractilado5 || $presupuestoEntity->faja_color || $presupuestoEntity->estado_id==1): ?>
|
||||
<h5 class="mb-1 resumen-extras">Extras</h5>
|
||||
<?php endif; ?>
|
||||
<?php if($presupuestoEntity->retractiladol): ?>
|
||||
<p class="mb-0 resumen-extras" id="resumenRetractilado1"><small>Retractilado individual</small></p>
|
||||
<?php elseif ($presupuestoEntity->retractilado5): ?>
|
||||
<p class="mb-0 resumen-extras" id="resumenRetractilado5"><small>Retractilado de 5</small></p>
|
||||
<?php elseif ($presupuestoEntity->faja_color): ?>
|
||||
<p class="mb-0 resumen-extras" id="resumenFajaColor"><small>Imprimir faja a color</small></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
<h4 id="resumenTotalIVA" class="mb-1">Total: 100€</h4>
|
||||
<h6 id="resumenPrecioU" class="mb-0">10.4€/ud</h6>
|
||||
|
||||
<?php if($presupuestoEntity->estado_id==2):
|
||||
$total = $presupuestoEntity->total_aceptado;
|
||||
$iva = $presupuestoEntity->iva_reducido?1.04:1.21;
|
||||
$total *= $iva;
|
||||
$total_unidad = $total / $presupuestoEntity->tirada;
|
||||
echo '<h4 id="resumenTotalIVA" class="mb-1">Total: ' . round($total, 2) . '€</h4>';
|
||||
echo '<h6 id="resumenPrecioU" class="mb-0">' . round($total_unidad, 4) . '€/ud</h6>'
|
||||
?>
|
||||
<?php else: ?>
|
||||
<h4 id="resumenTotalIVA" class="mb-1">Total: 100€</h4>
|
||||
<h6 id="resumenPrecioU" class="mb-0">10.4€/ud</h6>
|
||||
<?php endif; ?>
|
||||
<div id="shape-container">
|
||||
<div id="pv_ec_shape" style="width:95%;height:550px;margin:2.5% auto;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($presupuestoEntity->estado_id==2):
|
||||
echo '<div class="row mb-3">';
|
||||
echo '<h3>Direcciones de envío</h3>';
|
||||
echo '<div class="col-sm-6">';
|
||||
if(isset($presupuestoEntity->direcciones_envio)):
|
||||
foreach ($presupuestoEntity->direcciones_envio as $direccion):
|
||||
echo '<div class="row mb-3">';
|
||||
echo '<div class="col-sm-5 form-check custom-option custom-option-basic checked">';
|
||||
echo '<label class="form-check-label custom-option-content">';
|
||||
echo '<span class="custom-option-header mb-2">';
|
||||
echo '<h6 class="fw-semibold mb-0">' . $direccion['att'] . '</h6>';
|
||||
echo '<span class="badge bg-label-primary">' . $direccion['cantidad'] . ' unidades</span>';
|
||||
echo '</span>';
|
||||
echo '<span class="custom-option-body">';
|
||||
echo '<small>' . $direccion['direccion'] . '</small><br>';
|
||||
echo '<small>' . $direccion['cp'] . '</small><br>';
|
||||
echo '<small>' . $direccion['municipio'] .', ' . $direccion['pais'] . '</small><br>';
|
||||
echo '<small>' . $direccion['telefono'] . '</small><br>';
|
||||
echo '<small>' . $direccion['email'] . '</small><br>';
|
||||
if($direccion['entregaPieCalle'] == 1){
|
||||
echo '<small><i>Envío en palets</i></small><br>';
|
||||
}
|
||||
echo '<hr class="my-2">';
|
||||
echo '</span>';
|
||||
echo '</label>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
@ -59,5 +153,6 @@ window.total_unidad = <?= $presupuestoEntity->total_precio_unidad ?>;
|
||||
window.iva_reducido= <?= $presupuestoEntity->iva_reducido ?>;
|
||||
window.routes_resumen = {
|
||||
guardarPresupuesto: "<?= route_to('guardarPresupuesto') ?>",
|
||||
duplicarPresupuesto: "<?= route_to('duplicarPresupuesto') ?>",
|
||||
}
|
||||
<?= $this->endSection() ?>
|
||||
@ -44,7 +44,7 @@ function generarResumen(){
|
||||
$('#resumenSolapasCubierta').text('Solapas: No')
|
||||
}
|
||||
|
||||
if ($('.enable-sobrecubierta').is(':visible')) {
|
||||
if ($('#enableSobrecubierta').is(':checked')) {
|
||||
$(".resumen-sobrecubierta").show();
|
||||
$('#resumenPapelCubierta').text($('#papelSobrecubierta option:selected').text().trim() + ' ' +
|
||||
$('#gramajeSobrecubierta option:selected').text() + 'gr/m²');
|
||||
@ -56,7 +56,8 @@ function generarResumen(){
|
||||
$(".resumen-sobrecubierta").hide();
|
||||
}
|
||||
|
||||
if ($('.guardas').is(':visible')) {
|
||||
if ($('#divGuardas').css('display') != 'none') {
|
||||
|
||||
$(".resumen-guardas").show();
|
||||
$('#resumenGuardasPapel').text($('#papelGuardas option:selected').text().trim() + ' ' + '170gr/m²');
|
||||
$('#resumenGuardasCaras').text('Impresión: ' + $('#impresionGuardas option:selected').text())
|
||||
@ -145,6 +146,41 @@ $('#btnConfirm').on('click', function() {
|
||||
|
||||
});
|
||||
|
||||
$('#btnDuplicar').on('click', function() {
|
||||
|
||||
const paths = window.location.pathname.split("/").filter(path => path !== "");
|
||||
let id=0;
|
||||
if(paths.length > 0 && paths[paths.length - 2] == 'edit'){
|
||||
id=paths[paths.length - 1];
|
||||
}
|
||||
datos = {
|
||||
id: id,
|
||||
}
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
$('#loader').show();
|
||||
|
||||
$.ajax({
|
||||
url: window.routes_resumen.duplicarPresupuesto,
|
||||
type: 'POST',
|
||||
data: datos,
|
||||
success: function(response) {
|
||||
|
||||
if(Object.keys(response).length > 0) {
|
||||
if(response.success){
|
||||
$('#loader').hide();
|
||||
window.location.href = document.location.origin + '/presupuestos/presupuestocliente/edit/' + response.id;
|
||||
}
|
||||
}
|
||||
$('#loader').hide();
|
||||
|
||||
},
|
||||
error: function() {
|
||||
$('#loader').hide();
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('#btnBack').on('click', function() {
|
||||
window.location.href = document.location.origin + '/presupuestocliente/list';
|
||||
@ -241,7 +277,7 @@ function finalizarPresupuesto(confirmar){
|
||||
tirada: tirada,
|
||||
peso: peso_libro,
|
||||
iva_reducido: $('#ivaReducido').val()==1?1:0,
|
||||
confirmar: confirmar,
|
||||
confirmar: confirmar?1:0,
|
||||
},
|
||||
|
||||
datos = Object.assign(datos, window.token_ajax)
|
||||
|
||||
@ -172,7 +172,7 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
||||
}
|
||||
],
|
||||
stateSave: false,
|
||||
order: [[1, 'asc']],
|
||||
order: [[1, 'desc']],
|
||||
language: {
|
||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||
},
|
||||
|
||||
@ -22,9 +22,6 @@
|
||||
|
||||
<?php if($presupuestoEntity->estado_id==1): ?>
|
||||
<div class="step active" data-target="#tipo-libro">
|
||||
<?php else: ?>
|
||||
<div class="step" data-target="#tipo-libro">
|
||||
<?php endif; ?>
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-book ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
@ -56,13 +53,9 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="line"></div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
<?php if($presupuestoEntity->estado_id==1): ?>
|
||||
<div class="step" data-target="#resumen-libro">
|
||||
<?php else: ?>
|
||||
<div class="step active" data-target="#resumen-libro">
|
||||
<?php endif; ?>
|
||||
<button type="button" class="step-trigger" aria-selected="false" disabled="disabled">
|
||||
<span class="bs-stepper-circle"><i class="ti ti-checkbox ti-sm"></i></span>
|
||||
<span class="bs-stepper-label">
|
||||
@ -91,9 +84,6 @@
|
||||
<!-- Tipo Libro -->
|
||||
<?php if($presupuestoEntity->estado_id==1): ?>
|
||||
<div id="tipo-libro" class="content active dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<?php else: ?>
|
||||
<div id="tipo-libro" class="content dstepper-block fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="row g-3">
|
||||
|
||||
@ -149,14 +139,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<!-- Review & Complete -->
|
||||
<?php if($presupuestoEntity->estado_id==1): ?>
|
||||
<div id="resumen-libro" class="content fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<?php else: ?>
|
||||
<div id="resumen-libro" class="content active fv-plugins-bootstrap5 fv-plugins-framework">
|
||||
<?php endif; ?>
|
||||
<div class="row g-3">
|
||||
|
||||
<?= view("themes/vuexy/form/presupuestos/cliente/_resumenItems") ?>
|
||||
@ -177,7 +163,7 @@
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Guardar</span>
|
||||
<i class="ti ti-arrow-right ti-xs"></i>
|
||||
</button>
|
||||
<button id="btnConfirm" class="btn btn-success btn-submit btn-next mx-2 waves-effect waves-light">
|
||||
<button id="btnConfirm" class="btn btn-success btn-submit btn-next mx-2 waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Confirmar</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
<?php else: ?>
|
||||
@ -185,6 +171,11 @@
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Volver</span><i class="ti ti-check ti-xs"></i>
|
||||
</button>
|
||||
<?php endif; ?>
|
||||
<button id="btnDuplicar" class="btn btn-primary btn-submit waves-effect waves-light ml-2">
|
||||
<span class="align-middle d-sm-inline-block d-none me-sm-1">Duplicar</span>
|
||||
<i class="ti ti-copy ti-xs"></i>
|
||||
</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user