mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
adaptado el preview a presupuestos confirmados
This commit is contained in:
@ -1262,57 +1262,57 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
$guardas = [];
|
$guardas = [];
|
||||||
$peso_guardas = 0.0;
|
$peso_guardas = 0.0;
|
||||||
$coste_guardas = 0.0;
|
$coste_guardas = 0.0;
|
||||||
|
if($datos_guardas != 0){
|
||||||
|
if (count($datos_guardas) != 0) {
|
||||||
|
|
||||||
if (count($datos_guardas) != 0) {
|
$guardas = $datos_guardas;
|
||||||
|
$papel_generico_guardas = [
|
||||||
|
'id' => $datos_guardas['papel'] ?? 0,
|
||||||
|
'nombre' => $datos_guardas['nombre'] ?? "",
|
||||||
|
];
|
||||||
|
$input_data['papel_generico'] = $papel_generico_guardas;
|
||||||
|
$input_data['gramaje'] = $datos_guardas['gramaje'] ?? 0;
|
||||||
|
$input_data['datosPedido']->paginas = 8;
|
||||||
|
$input_data['paginas_color'] = 8;
|
||||||
|
$input_data['datosPedido']->paginas_impresion = $datos_guardas['caras'] ?? 0;
|
||||||
|
$input_data['datosPedido']->solapas_ancho = 0;
|
||||||
|
$input_data['datosPedido']->solapas = 0;
|
||||||
|
$input_data['isColor'] = 1;
|
||||||
|
$input_data['isHq'] = 1;
|
||||||
|
$input_data['uso'] = 'guardas';
|
||||||
|
|
||||||
$guardas = $datos_guardas;
|
// Para el caso de Fresado y Cosido tapa dura, las guardas son un diptico
|
||||||
$papel_generico_guardas = [
|
// y hay que imprimirlas como "cosido" (dos hojas pegadas). En el caso de espiral
|
||||||
'id' => $datos_guardas['papel'] ?? 0,
|
// o wire-o tapa dura, las guardas se imprimen como hojas sueltas
|
||||||
'nombre' => $datos_guardas['nombre'] ?? "",
|
if ($tipo_impresion_id == 1 || $tipo_impresion_id == 3) {
|
||||||
];
|
$input_data['datosPedido']->isCosido = true;
|
||||||
$input_data['papel_generico'] = $papel_generico_guardas;
|
} else if ($tipo_impresion_id == 5 || $tipo_impresion_id == 7) {
|
||||||
$input_data['gramaje'] = $datos_guardas['gramaje'] ?? 0;
|
$input_data['datosPedido']->isCosido = false;
|
||||||
$input_data['datosPedido']->paginas = 8;
|
|
||||||
$input_data['paginas_color'] = 8;
|
|
||||||
$input_data['datosPedido']->paginas_impresion = $datos_guardas['caras'] ?? 0;
|
|
||||||
$input_data['datosPedido']->solapas_ancho = 0;
|
|
||||||
$input_data['datosPedido']->solapas = 0;
|
|
||||||
$input_data['isColor'] = 1;
|
|
||||||
$input_data['isHq'] = 1;
|
|
||||||
$input_data['uso'] = 'guardas';
|
|
||||||
|
|
||||||
// Para el caso de Fresado y Cosido tapa dura, las guardas son un diptico
|
|
||||||
// y hay que imprimirlas como "cosido" (dos hojas pegadas). En el caso de espiral
|
|
||||||
// o wire-o tapa dura, las guardas se imprimen como hojas sueltas
|
|
||||||
if ($tipo_impresion_id == 1 || $tipo_impresion_id == 3) {
|
|
||||||
$input_data['datosPedido']->isCosido = true;
|
|
||||||
} else if ($tipo_impresion_id == 5 || $tipo_impresion_id == 7) {
|
|
||||||
$input_data['datosPedido']->isCosido = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$guardas = PresupuestoClienteService::obtenerGuardas($input_data);
|
|
||||||
|
|
||||||
if (count($guardas) > 0) {
|
|
||||||
$coste_guardas += floatval($guardas['total_impresion']);
|
|
||||||
$peso_guardas += floatval($guardas['peso']);
|
|
||||||
if ($extra_info) {
|
|
||||||
|
|
||||||
$this->calcular_coste_linea(
|
|
||||||
$guardas,
|
|
||||||
$totalPapel,
|
|
||||||
$margenPapel,
|
|
||||||
$sumForFactor,
|
|
||||||
$totalImpresion,
|
|
||||||
$margenImpresion
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if ($coste_guardas <= 0)
|
|
||||||
$error->guardas = lang('Presupuestos.errores.noGuardas');
|
|
||||||
else
|
|
||||||
$error->guardas = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
$guardas = PresupuestoClienteService::obtenerGuardas($input_data);
|
||||||
|
|
||||||
|
if (count($guardas) > 0) {
|
||||||
|
$coste_guardas += floatval($guardas['total_impresion']);
|
||||||
|
$peso_guardas += floatval($guardas['peso']);
|
||||||
|
if ($extra_info) {
|
||||||
|
|
||||||
|
$this->calcular_coste_linea(
|
||||||
|
$guardas,
|
||||||
|
$totalPapel,
|
||||||
|
$margenPapel,
|
||||||
|
$sumForFactor,
|
||||||
|
$totalImpresion,
|
||||||
|
$margenImpresion
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($coste_guardas <= 0)
|
||||||
|
$error->guardas = lang('Presupuestos.errores.noGuardas');
|
||||||
|
else
|
||||||
|
$error->guardas = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($extra_info) {
|
if ($extra_info) {
|
||||||
$totalPapel -= $margenPapel;
|
$totalPapel -= $margenPapel;
|
||||||
$totalImpresion -= $margenImpresion;
|
$totalImpresion -= $margenImpresion;
|
||||||
|
|||||||
@ -1,46 +1,110 @@
|
|||||||
<div class="col-12 pb-2">
|
<div class="col-12 pb-2">
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
|
<?php if($presupuestoEntity->estado_id==2): ?>
|
||||||
|
<h2>PRESUPUESTO ACEPTADO</h2>
|
||||||
|
<input type="hidden" id="lomo_cubierta" value=<?php echo $presupuestoEntity->lomo_cubierta ?>>
|
||||||
|
<br>
|
||||||
|
<?php endif; ?>
|
||||||
<h3>Resumen</h3>
|
<h3>Resumen</h3>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<h5 class="mb-1">Libro</h5>
|
<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="tipoLibro"><?php echo (isset($presupuestoEntity->resumen->titulo)?$presupuestoEntity->resumen->titulo:'') ?></small></p>
|
||||||
<p class="mb-0"><small id="resumenTamanio">Tamaño: 100x100</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: 200</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: 200</small></p>
|
<p class="mb-0"><small id="resumenTirada">Tirada: <?php echo $presupuestoEntity->tirada ?></small></p>
|
||||||
<p class="mb-0"><small id="resumenPrototipo">Prototipo: NO</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: 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>
|
<h5 class="mb-1">Interior</h5>
|
||||||
<p class="mb-0"><small id="tipoImpresion">Impresion: Negro premium</small></p>
|
<p class="mb-0"><small id="tipoImpresion">Impresion:
|
||||||
<p id="pResumenPaginasColor" class="mb-0" style="display:none"><small id="resumenPaginasColor">Páginas a
|
<?php echo (isset($presupuestoEntity->resumen->tipo_impresion)?$presupuestoEntity->resumen->tipo_impresion:'') ?>
|
||||||
color: 100</small></p>
|
</small></p>
|
||||||
<p class="mb-3"><small id="resumenPapelInterior">Papel: Blanco Offset 70gr/m²</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>
|
<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="resumenPapelCubierta">Papel:
|
||||||
<p class="mb-0"><small id="resumenCarasCubierta">Impresión: 1 cara</small></p>
|
<?php echo (isset($presupuestoEntity->papel_cubierta_nombre)?$presupuestoEntity->papel_cubierta_nombre:''); ?>
|
||||||
<p class="mb-0"><small id="resumenSolapasCubierta">Solapas: 25mm</small></p>
|
<?php echo (isset($presupuestoEntity->gramaje_cubierta)?$presupuestoEntity->gramaje_cubierta:''); ?>gr/m²</small></p>
|
||||||
<p class="mb-3"><small id="resumenAcabadoCubierta">Acabado: Ninguno</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>
|
<?php if($presupuestoEntity->papel_sobrecubierta || $presupuestoEntity->estado_id==1): ?>
|
||||||
<p class="mb-0 resumen-sobrecubierta"><small id="resumenPapelSobrecubierta">Papel: Blanco Offset
|
<h5 class="mb-1 resumen-sobrecubierta">Sobrecubierta</h5>
|
||||||
70gr/m²</small></p>
|
<p class="mb-0 resumen-sobrecubierta"><small id="resumenPapelSobrecubierta">Papel:
|
||||||
<p class="mb-0 resumen-sobrecubierta"><small id="resumenSolapasCubierta">Ancho solapas: 25mm</small></p>
|
<?php echo (isset($presupuestoEntity->papel_sobrecubierta_nombre)?$presupuestoEntity->papel_sobrecubierta_nombre:'') ?>
|
||||||
<p class="mb-3 resumen-sobrecubierta"><small id="resumenAcabadoCubierta">Acabado: Ninguno</small></p>
|
<?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>
|
<?php if($presupuestoEntity->papel_guardas || $presupuestoEntity->estado_id==1): ?>
|
||||||
<p class="mb-0 resumen-guardas"><small id="resumenGuardasPapel">Papel: Blanco Offset 70gr/m²</small></p>
|
<h5 class="mb-1 resumen-guardas">Guardas</h5>
|
||||||
<p class="mb-3 resumen-guardas"><small id="resumenGuardasCaras">Impresión: 1 cara</small></p>
|
<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>
|
<?php if($presupuestoEntity->retractiladol || $presupuestoEntity->retractilado5 || $presupuestoEntity->faja_color || $presupuestoEntity->estado_id==1): ?>
|
||||||
<p class="mb-0 resumen-extras" id="resumenRetractilado1"><small>Retractilado individual</small></p>
|
<h5 class="mb-1 resumen-extras">Extras</h5>
|
||||||
<p class="mb-0 resumen-extras" id="resumenRetractilado5"><small>Retractilado de 5</small></p>
|
<?php endif; ?>
|
||||||
<p class="mb-0 resumen-extras" id="resumenFajaColor"><small>Imprimir faja a color</small></p>
|
<?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>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<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="shape-container">
|
||||||
<div id="thumbnail_ec_shape" style="width:350px;height:300px;margin:2.5% auto;"></div>
|
<div id="thumbnail_ec_shape" style="width:350px;height:300px;margin:2.5% auto;"></div>
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
@ -52,6 +116,39 @@
|
|||||||
</div>
|
</div>
|
||||||
</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>
|
</div>
|
||||||
|
|
||||||
<!-- Modal -->
|
<!-- Modal -->
|
||||||
@ -75,8 +172,17 @@
|
|||||||
|
|
||||||
|
|
||||||
<?= $this->section("additionalInlineJs") ?>
|
<?= $this->section("additionalInlineJs") ?>
|
||||||
|
window.estado = <?= $presupuestoEntity->estado_id ?>;
|
||||||
|
window.tirada = <?= $presupuestoEntity->selected_tirada ?>;
|
||||||
|
window.total = <?= $presupuestoEntity->total_aceptado ?>;
|
||||||
|
window.total_unidad = <?= $presupuestoEntity->total_precio_unidad ?>;
|
||||||
|
window.iva_reducido= <?= $presupuestoEntity->iva_reducido ?>;
|
||||||
window.routes_resumen = {
|
window.routes_resumen = {
|
||||||
guardarPresupuesto: "<?= route_to('guardarPresupuesto') ?>",
|
guardarPresupuesto: "<?= route_to('guardarPresupuesto') ?>",
|
||||||
|
duplicarPresupuesto: "<?= route_to('duplicarPresupuesto') ?>",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(<?php echo $presupuestoEntity->estado_id?>==2)
|
||||||
|
previewEsquemaCubierta(true);
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -38,303 +38,306 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Deal Details
|
// Deal Details
|
||||||
const FormValidation2 = FormValidation.formValidation(clientePresupuestoWizardFormStep2, {
|
if(clientePresupuestoWizardFormStep2 !== null){
|
||||||
fields: {
|
const FormValidation2 = FormValidation.formValidation(clientePresupuestoWizardFormStep2, {
|
||||||
},
|
fields: {
|
||||||
plugins: {
|
|
||||||
trigger: new FormValidation.plugins.Trigger(),
|
|
||||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
|
||||||
// Use this for enabling/changing valid/invalid class
|
|
||||||
// eleInvalidClass: '',
|
|
||||||
eleValidClass: '',
|
|
||||||
rowSelector: '.col-sm-3'
|
|
||||||
}),
|
|
||||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
|
||||||
submitButton: new FormValidation.plugins.SubmitButton()
|
|
||||||
}
|
|
||||||
}).on('core.form.valid', function () {
|
|
||||||
// Jump to the next step when all fields in the current step are valid
|
|
||||||
validationStepper.next();
|
|
||||||
});
|
|
||||||
|
|
||||||
// Deal Usage
|
|
||||||
const FormValidation3 = FormValidation.formValidation(clientePresupuestoWizardFormStep3, {
|
|
||||||
fields: {
|
|
||||||
titulo: {
|
|
||||||
validators: {
|
|
||||||
notEmpty: {
|
|
||||||
message: window.Presupuestos.validation.requerido_short
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
clienteId: {
|
plugins: {
|
||||||
validators: {
|
trigger: new FormValidation.plugins.Trigger(),
|
||||||
callback: {
|
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||||
message: window.Presupuestos.validation.cliente,
|
// Use this for enabling/changing valid/invalid class
|
||||||
callback: function (input) {
|
// eleInvalidClass: '',
|
||||||
// Get the selected options
|
eleValidClass: '',
|
||||||
const options = $("#clienteId").select2('data');
|
rowSelector: '.col-sm-3'
|
||||||
const hasValidOption = options.some(option => parseInt(option.id) > 0);
|
}),
|
||||||
return options !== null && options.length > 0 && hasValidOption;
|
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||||
},
|
submitButton: new FormValidation.plugins.SubmitButton()
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
tirada: {
|
|
||||||
validators: {
|
|
||||||
callback: {
|
|
||||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
|
||||||
callback: function (input) {
|
|
||||||
const value = $("#tirada").val();
|
|
||||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
paginas: {
|
|
||||||
validators: {
|
|
||||||
callback: {
|
|
||||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
|
||||||
callback: function (input) {
|
|
||||||
const value = $("#paginas").val();
|
|
||||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
paginasColor: {
|
|
||||||
validators: {
|
|
||||||
callback: {
|
|
||||||
message: window.Presupuestos.validation.integer_greatherThan_0,
|
|
||||||
callback: function (input) {
|
|
||||||
if ($('#pagColorDiv').is(':hidden'))
|
|
||||||
return true;
|
|
||||||
else {
|
|
||||||
const value = $("#paginasColor").val();
|
|
||||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
gramajeInterior: {
|
|
||||||
validators: {
|
|
||||||
callback: {
|
|
||||||
callback: function (input) {
|
|
||||||
const value = $("#tirada").val();
|
|
||||||
if ($('#gramajeInterior option:selected').text().length == 0) {
|
|
||||||
if(value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0){
|
|
||||||
return {
|
|
||||||
valid: false,
|
|
||||||
message: window.Presupuestos.validation.sin_gramaje,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
|
||||||
valid: value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0,
|
|
||||||
message: window.Presupuestos.validation.tirada_no_valida,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
gramajeCubierta: {
|
|
||||||
validators: {
|
|
||||||
callback: {
|
|
||||||
message: window.Presupuestos.validation.tirada_no_valida,
|
|
||||||
callback: function (input) {
|
|
||||||
const value = $("#tirada").val();
|
|
||||||
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
|
||||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
callback: {
|
|
||||||
message: window.Presupuestos.validation.sin_gramaje,
|
|
||||||
callback: function (input) {
|
|
||||||
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
gramajeSobrecubierta: {
|
|
||||||
validators: {
|
|
||||||
callback: {
|
|
||||||
message: window.Presupuestos.validation.tirada_no_valida,
|
|
||||||
callback: function (input) {
|
|
||||||
const value = $("#tirada").val();
|
|
||||||
if ($('#gramajeSobrecubierta option:selected').text().length == 0) {
|
|
||||||
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
trigger: new FormValidation.plugins.Trigger(),
|
|
||||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
|
||||||
// Use this for enabling/changing valid/invalid class
|
|
||||||
// eleInvalidClass: '',
|
|
||||||
eleValidClass: '',
|
|
||||||
rowSelector: function (field, ele) {
|
|
||||||
// field is the field name
|
|
||||||
// ele is the field element
|
|
||||||
switch (field) {
|
|
||||||
case 'gramajeInterior':
|
|
||||||
case 'gramajeCubierta':
|
|
||||||
case 'gramajeSobrecubierta':
|
|
||||||
return '.col-sm-2';
|
|
||||||
|
|
||||||
case 'titulo':
|
|
||||||
return '.col-sm-12';
|
|
||||||
|
|
||||||
case 'clienteId':
|
|
||||||
return '.col-sm-6';
|
|
||||||
|
|
||||||
default:
|
|
||||||
return '.col-sm-3';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
|
||||||
submitButton: new FormValidation.plugins.SubmitButton()
|
|
||||||
}
|
|
||||||
}).on('core.form.valid', function () {
|
|
||||||
validationStepper.next();
|
|
||||||
initDirecciones();
|
|
||||||
initTiradasDirecciones();
|
|
||||||
});
|
|
||||||
|
|
||||||
const tirada = $('#tirada');
|
|
||||||
tirada.on('change', function () {
|
|
||||||
// Revalidate the clienteId field when an option is chosen
|
|
||||||
FormValidation2.revalidateField('gramajeInterior');
|
|
||||||
FormValidation2.revalidateField('gramajeCubierta');
|
|
||||||
FormValidation2.revalidateField('gramajeSobrecubierta');
|
|
||||||
});
|
|
||||||
|
|
||||||
// Direcciones
|
|
||||||
const FormValidation4 = FormValidation.formValidation(clientePresupuestoWizardFormStep4, {
|
|
||||||
fields: {
|
|
||||||
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
trigger: new FormValidation.plugins.Trigger(),
|
|
||||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
|
||||||
// Use this for enabling/changing valid/invalid class
|
|
||||||
// eleInvalidClass: '',
|
|
||||||
eleValidClass: '',
|
|
||||||
rowSelector: '.col-md-12'
|
|
||||||
}),
|
|
||||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
|
||||||
submitButton: new FormValidation.plugins.SubmitButton()
|
|
||||||
}
|
|
||||||
}).on('core.form.valid', function () {
|
|
||||||
if(validarEnvio()){
|
|
||||||
generarResumen();
|
|
||||||
validationStepper.next();
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
let text = "El número de unidades enviadas no coincie con la tirada seleccionada.";
|
|
||||||
if($('#prototipo').is(':checked')) {
|
|
||||||
text += "<br>(Tenga en cuenta que se ha seleccionado la opción de prototipo)";
|
|
||||||
}
|
|
||||||
$('#errorDirecciones').text(text);
|
|
||||||
$('#errorDirecciones').show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Deal Usage
|
|
||||||
const FormValidation5 = FormValidation.formValidation(clientePresupuestoWizardFormStep5, {
|
|
||||||
fields: {
|
|
||||||
// * Validate the fields here based on your requirements
|
|
||||||
},
|
|
||||||
plugins: {
|
|
||||||
trigger: new FormValidation.plugins.Trigger(),
|
|
||||||
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
|
||||||
// Use this for enabling/changing valid/invalid class
|
|
||||||
// eleInvalidClass: '',
|
|
||||||
eleValidClass: '',
|
|
||||||
rowSelector: '.col-md-12'
|
|
||||||
}),
|
|
||||||
autoFocus: new FormValidation.plugins.AutoFocus(),
|
|
||||||
submitButton: new FormValidation.plugins.SubmitButton()
|
|
||||||
}
|
|
||||||
}).on('core.form.valid', function () {
|
|
||||||
// You can submit the form
|
|
||||||
// clientePresupuestoWizardForm.submit()
|
|
||||||
// or send the form data to server via an Ajax request
|
|
||||||
// To make the demo simple, I just placed an alert
|
|
||||||
//alert('Submitted..!!');
|
|
||||||
});
|
|
||||||
|
|
||||||
clientePresupuestoWizardNext.forEach(item => {
|
|
||||||
item.addEventListener('click', event => {
|
|
||||||
// When click the Next button, we will validate the current step
|
|
||||||
switch (validationStepper._currentIndex) {
|
|
||||||
case 0:
|
|
||||||
FormValidation2.validate();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
|
||||||
FormValidation3.validate();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 2:
|
|
||||||
FormValidation4.validate();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
FormValidation5.validate();
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
validationStepper.next();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
}).on('core.form.valid', function () {
|
||||||
|
// Jump to the next step when all fields in the current step are valid
|
||||||
|
validationStepper.next();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
clientePresupuestoWizardPrev.forEach(item => {
|
|
||||||
item.addEventListener('click', event => {
|
|
||||||
switch (validationStepper._currentIndex) {
|
|
||||||
case 4:
|
|
||||||
validationStepper.previous();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
// Deal Usage
|
||||||
validationStepper.previous();
|
const FormValidation3 = FormValidation.formValidation(clientePresupuestoWizardFormStep3, {
|
||||||
break;
|
fields: {
|
||||||
|
titulo: {
|
||||||
case 2:
|
validators: {
|
||||||
for (let i = 0; i < 4; i++) {
|
notEmpty: {
|
||||||
let id = "tiradaPrecio" + i;
|
message: window.Presupuestos.validation.requerido_short
|
||||||
if ($('#' + id).length > 0) {
|
},
|
||||||
$('#' + id).show();
|
}
|
||||||
|
},
|
||||||
|
clienteId: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.cliente,
|
||||||
|
callback: function (input) {
|
||||||
|
// Get the selected options
|
||||||
|
const options = $("#clienteId").select2('data');
|
||||||
|
const hasValidOption = options.some(option => parseInt(option.id) > 0);
|
||||||
|
return options !== null && options.length > 0 && hasValidOption;
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
validationStepper.previous();
|
},
|
||||||
break;
|
tirada: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||||
|
callback: function (input) {
|
||||||
|
const value = $("#tirada").val();
|
||||||
|
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
paginas: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||||
|
callback: function (input) {
|
||||||
|
const value = $("#paginas").val();
|
||||||
|
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
paginasColor: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.integer_greatherThan_0,
|
||||||
|
callback: function (input) {
|
||||||
|
if ($('#pagColorDiv').is(':hidden'))
|
||||||
|
return true;
|
||||||
|
else {
|
||||||
|
const value = $("#paginasColor").val();
|
||||||
|
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gramajeInterior: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
callback: function (input) {
|
||||||
|
const value = $("#tirada").val();
|
||||||
|
if ($('#gramajeInterior option:selected').text().length == 0) {
|
||||||
|
if(value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0){
|
||||||
|
return {
|
||||||
|
valid: false,
|
||||||
|
message: window.Presupuestos.validation.sin_gramaje,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
valid: value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0,
|
||||||
|
message: window.Presupuestos.validation.tirada_no_valida,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gramajeCubierta: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.tirada_no_valida,
|
||||||
|
callback: function (input) {
|
||||||
|
const value = $("#tirada").val();
|
||||||
|
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
||||||
|
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.sin_gramaje,
|
||||||
|
callback: function (input) {
|
||||||
|
if ($('#gramajeCubierta option:selected').text().length == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
gramajeSobrecubierta: {
|
||||||
|
validators: {
|
||||||
|
callback: {
|
||||||
|
message: window.Presupuestos.validation.tirada_no_valida,
|
||||||
|
callback: function (input) {
|
||||||
|
const value = $("#tirada").val();
|
||||||
|
if ($('#gramajeSobrecubierta option:selected').text().length == 0) {
|
||||||
|
return value.length > 0 && Number.isInteger(parseInt(value)) && parseInt(value) > 0;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
trigger: new FormValidation.plugins.Trigger(),
|
||||||
|
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||||
|
// Use this for enabling/changing valid/invalid class
|
||||||
|
// eleInvalidClass: '',
|
||||||
|
eleValidClass: '',
|
||||||
|
rowSelector: function (field, ele) {
|
||||||
|
// field is the field name
|
||||||
|
// ele is the field element
|
||||||
|
switch (field) {
|
||||||
|
case 'gramajeInterior':
|
||||||
|
case 'gramajeCubierta':
|
||||||
|
case 'gramajeSobrecubierta':
|
||||||
|
return '.col-sm-2';
|
||||||
|
|
||||||
case 1:
|
case 'titulo':
|
||||||
validationStepper.previous();
|
return '.col-sm-12';
|
||||||
break;
|
|
||||||
|
|
||||||
case 0:
|
case 'clienteId':
|
||||||
window.location.href = document.location.origin + '/presupuestocliente/list';
|
return '.col-sm-6';
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
return '.col-sm-3';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||||
|
submitButton: new FormValidation.plugins.SubmitButton()
|
||||||
|
}
|
||||||
|
}).on('core.form.valid', function () {
|
||||||
|
validationStepper.next();
|
||||||
|
initDirecciones();
|
||||||
|
initTiradasDirecciones();
|
||||||
|
});
|
||||||
|
|
||||||
|
const tirada = $('#tirada');
|
||||||
|
tirada.on('change', function () {
|
||||||
|
// Revalidate the clienteId field when an option is chosen
|
||||||
|
FormValidation2.revalidateField('gramajeInterior');
|
||||||
|
FormValidation2.revalidateField('gramajeCubierta');
|
||||||
|
FormValidation2.revalidateField('gramajeSobrecubierta');
|
||||||
|
});
|
||||||
|
|
||||||
|
// Direcciones
|
||||||
|
const FormValidation4 = FormValidation.formValidation(clientePresupuestoWizardFormStep4, {
|
||||||
|
fields: {
|
||||||
|
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
trigger: new FormValidation.plugins.Trigger(),
|
||||||
|
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||||
|
// Use this for enabling/changing valid/invalid class
|
||||||
|
// eleInvalidClass: '',
|
||||||
|
eleValidClass: '',
|
||||||
|
rowSelector: '.col-md-12'
|
||||||
|
}),
|
||||||
|
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||||
|
submitButton: new FormValidation.plugins.SubmitButton()
|
||||||
|
}
|
||||||
|
}).on('core.form.valid', function () {
|
||||||
|
if(validarEnvio()){
|
||||||
|
generarResumen();
|
||||||
|
validationStepper.next();
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
let text = "El número de unidades enviadas no coincie con la tirada seleccionada.";
|
||||||
|
if($('#prototipo').is(':checked')) {
|
||||||
|
text += "<br>(Tenga en cuenta que se ha seleccionado la opción de prototipo)";
|
||||||
|
}
|
||||||
|
$('#errorDirecciones').text(text);
|
||||||
|
$('#errorDirecciones').show();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
// Deal Usage
|
||||||
|
const FormValidation5 = FormValidation.formValidation(clientePresupuestoWizardFormStep5, {
|
||||||
|
fields: {
|
||||||
|
// * Validate the fields here based on your requirements
|
||||||
|
},
|
||||||
|
plugins: {
|
||||||
|
trigger: new FormValidation.plugins.Trigger(),
|
||||||
|
bootstrap5: new FormValidation.plugins.Bootstrap5({
|
||||||
|
// Use this for enabling/changing valid/invalid class
|
||||||
|
// eleInvalidClass: '',
|
||||||
|
eleValidClass: '',
|
||||||
|
rowSelector: '.col-md-12'
|
||||||
|
}),
|
||||||
|
autoFocus: new FormValidation.plugins.AutoFocus(),
|
||||||
|
submitButton: new FormValidation.plugins.SubmitButton()
|
||||||
|
}
|
||||||
|
}).on('core.form.valid', function () {
|
||||||
|
// You can submit the form
|
||||||
|
// clientePresupuestoWizardForm.submit()
|
||||||
|
// or send the form data to server via an Ajax request
|
||||||
|
// To make the demo simple, I just placed an alert
|
||||||
|
//alert('Submitted..!!');
|
||||||
|
});
|
||||||
|
|
||||||
|
clientePresupuestoWizardNext.forEach(item => {
|
||||||
|
item.addEventListener('click', event => {
|
||||||
|
// When click the Next button, we will validate the current step
|
||||||
|
switch (validationStepper._currentIndex) {
|
||||||
|
case 0:
|
||||||
|
FormValidation2.validate();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
FormValidation3.validate();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
FormValidation4.validate();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
FormValidation5.validate();
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
validationStepper.next();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
clientePresupuestoWizardPrev.forEach(item => {
|
||||||
|
item.addEventListener('click', event => {
|
||||||
|
switch (validationStepper._currentIndex) {
|
||||||
|
case 4:
|
||||||
|
validationStepper.previous();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 3:
|
||||||
|
validationStepper.previous();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
for (let i = 0; i < 4; i++) {
|
||||||
|
let id = "tiradaPrecio" + i;
|
||||||
|
if ($('#' + id).length > 0) {
|
||||||
|
$('#' + id).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
validationStepper.previous();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
validationStepper.previous();
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 0:
|
||||||
|
window.location.href = document.location.origin + '/presupuestocliente/list';
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|||||||
@ -12,22 +12,44 @@ $(document).on('shown.bs.modal', function (e) {
|
|||||||
|
|
||||||
function previewEsquemaCubierta(isThumbnail = false) {
|
function previewEsquemaCubierta(isThumbnail = false) {
|
||||||
|
|
||||||
if ($('#cosidoDiv').hasClass('checked') || $("#fresadoDiv").hasClass('checked')) {
|
if($('#cosidoDiv').length){
|
||||||
console.log("Cosido/Fresado");
|
|
||||||
if ($("#tapaBlanda").is(":checked")) {
|
if ($('#cosidoDiv').hasClass('checked') || $("#fresadoDiv").hasClass('checked')) {
|
||||||
portadaTapaBlanda(isThumbnail);
|
//console.log("Cosido/Fresado");
|
||||||
} else if ($("#tapaDura").is(":checked")) {
|
if ($("#tapaBlanda").is(":checked")) {
|
||||||
portadaTapaDura(isThumbnail);3
|
portadaTapaBlanda(isThumbnail);
|
||||||
|
} else if ($("#tapaDura").is(":checked")) {
|
||||||
|
portadaTapaDura(isThumbnail);
|
||||||
|
}
|
||||||
|
} else if ($('#espiralDiv').hasClass('checked') || $('#wireoDiv').hasClass('checked')) {
|
||||||
|
//console.log("Espiral/Wireo");
|
||||||
|
if ($("#tapaBlanda").is(":checked")) {
|
||||||
|
portadaEspiral(isThumbnail, false);
|
||||||
|
} else if ($("#tapaDura").is(":checked")) {
|
||||||
|
portadaEspiral(isThumbnail, true);
|
||||||
|
}
|
||||||
|
} else if ($('#grapadoDiv').hasClass('checked')) {
|
||||||
|
portadaGrapado(isThumbnail);
|
||||||
}
|
}
|
||||||
} else if ($('#espiralDiv').hasClass('checked') || $('#wireoDiv').hasClass('checked')) {
|
}
|
||||||
console.log("Espiral/Wireo");
|
else{
|
||||||
if ($("#tapaBlanda").is(":checked")) {
|
let titulo = $('#tipoLibro').text().toLowerCase();
|
||||||
portadaEspiral(isThumbnail, false);
|
if(titulo.includes("cosido") || titulo.includes("fresado")){
|
||||||
} else if ($("#tapaDura").is(":checked")) {
|
if(titulo.includes("dura"))
|
||||||
portadaEspiral(isThumbnail, true);
|
portadaTapaDura(isThumbnail);
|
||||||
|
else{
|
||||||
|
portadaTapaBlanda(isThumbnail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (titulo.includes("espiral") || titulo.includes("wire-o")){
|
||||||
|
if(titulo.includes("dura"))
|
||||||
|
portadaEspiral(isThumbnail, true);
|
||||||
|
else
|
||||||
|
portadaEspiral(isThumbnail, false);
|
||||||
|
}
|
||||||
|
else if (titulo.includes("grapado")){
|
||||||
|
portadaGrapado(isThumbnail);
|
||||||
}
|
}
|
||||||
} else if ($('#grapadoDiv').hasClass('checked')) {
|
|
||||||
portadaGrapado(isThumbnail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -772,12 +794,23 @@ function portadaGrapado(isThumbnail = false) {
|
|||||||
|
|
||||||
function getObjetoToPreview() {
|
function getObjetoToPreview() {
|
||||||
|
|
||||||
pvObj = {
|
if($('#cosidoDiv').length){
|
||||||
lomoLibro: $('#lomo_cubierta').val() === '' ? parseFloat('0.0') : parseFloat($('#lomo_cubierta').val()),
|
pvObj = {
|
||||||
anchoSolapa: $('#solapasCubierta').is(':checked') ? parseFloat($('#anchoSolapasCubierta').val()) : parseFloat(0),
|
lomoLibro: $('#lomo_cubierta').val() === '' ? parseFloat('0.0') : parseFloat($('#lomo_cubierta').val()),
|
||||||
altoLibro: getDimensionLibro().alto,
|
anchoSolapa: $('#solapasCubierta').is(':checked') ? parseFloat($('#anchoSolapasCubierta').val()) : parseFloat(0),
|
||||||
anchoLibro: getDimensionLibro().ancho
|
altoLibro: getDimensionLibro().alto,
|
||||||
};
|
anchoLibro: getDimensionLibro().ancho
|
||||||
console.log(pvObj);
|
};
|
||||||
|
} else {
|
||||||
|
let tamanio = $('#resumenTamanio').text().split(' ')[1].split('x');
|
||||||
|
let solapas = parseInt($('#resumenSolapasCubierta').length ? $('#resumenSolapasCubierta').text().split(' ')[1].replace("mm", '') : 0);
|
||||||
|
pvObj = {
|
||||||
|
lomoLibro: $('#lomo_cubierta').val() === '' ? parseFloat('0.0') : parseFloat($('#lomo_cubierta').val()),
|
||||||
|
anchoSolapa: solapas,
|
||||||
|
altoLibro: parseInt(tamanio[1]),
|
||||||
|
anchoLibro: parseInt(tamanio[0])
|
||||||
|
};
|
||||||
|
}
|
||||||
|
//console.log(pvObj);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -226,7 +226,9 @@ $('#clienteId').select2({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
initDisenioLibro();
|
if(<?= $presupuestoEntity->estado_id ?>==1){
|
||||||
|
initDisenioLibro();
|
||||||
|
}
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
8600
xdebug.log
8600
xdebug.log
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user