Merge branch 'dev/formas-presupuestador' into 'main'

Dev/formas presupuestador

See merge request jjimenez/safekat!78
This commit is contained in:
Ignacio Martinez Navajas
2023-11-28 11:57:46 +00:00
9 changed files with 11170 additions and 10665 deletions

View File

@ -22,8 +22,8 @@ CI_ENVIRONMENT = development
# APP # APP
#-------------------------------------------------------------------- #--------------------------------------------------------------------
app.baseURL = 'https://sk-jjo.imnavajas.es' #app.baseURL = 'https://sk-jjo.imnavajas.es'
# app.baseURL = 'https://sk-imn.imnavajas.es' app.baseURL = 'https://sk-imn.imnavajas.es'
# app.baseURL = "http://safekat.test/" # app.baseURL = "http://safekat.test/"
# app.forceGlobalSecureRequests = false # app.forceGlobalSecureRequests = false

View File

@ -161,8 +161,12 @@ return [
'comentariosProduccion' => 'Comentarios Produccion', 'comentariosProduccion' => 'Comentarios Produccion',
'preview' => 'Previsualización de configuraciones', 'preview' => 'Previsualización de configuraciones',
'previewMaquina' => 'Configuración de máquina', 'previewMaquina' => 'Configuración de máquina',
'previewCubierta' => 'Configuración de cubierta', 'previewConfiguracionCubierta' => 'Configuración de cubierta',
'previewPortada' => 'Configuración de portada', <<<<<<< HEAD
'previewEsquemaCubierta' => 'Configuración de portada',
=======
'previewEsquemaCubierta' => 'Esquema de cubierta',
>>>>>>> 594ce37f88c472a7a063e2e5c85e2c0b3899728c
'resumen' => 'Resumen del presupuesto', 'resumen' => 'Resumen del presupuesto',
'confirmar' => 'Confirmar presupuesto', 'confirmar' => 'Confirmar presupuesto',

View File

@ -1288,6 +1288,7 @@ function fill_lp_bn(row, fromComparator=false){
calcularPresupuesto_bn(false) calcularPresupuesto_bn(false)
} }
else{ else{
//console.log(row);
// Si viene de hacerlo a mano... // Si viene de hacerlo a mano...
$('#lp_bn_tiempo').val(row.tiempo_maquina) $('#lp_bn_tiempo').val(row.tiempo_maquina)
$('#lp_bn_numeroPliegos').val(isNaN(parseFloat(row.pliegos_libro)) ? "" : parseFloat(row.pliegos_libro).toFixed(2)) $('#lp_bn_numeroPliegos').val(isNaN(parseFloat(row.pliegos_libro)) ? "" : parseFloat(row.pliegos_libro).toFixed(2))
@ -1301,6 +1302,7 @@ function fill_lp_bn(row, fromComparator=false){
$('#lp_bn_totalClicks').val(isNaN(parseFloat(row.precio_click_pedido)) ? "" : parseFloat(row.precio_click_pedido).toFixed(2)) $('#lp_bn_totalClicks').val(isNaN(parseFloat(row.precio_click_pedido)) ? "" : parseFloat(row.precio_click_pedido).toFixed(2))
$('#lp_bn_tarifa_impresion_id').val(isNaN(parseInt(row.tarifa_impresion_id)) ? "" : parseInt(row.tarifa_impresion_id)) $('#lp_bn_tarifa_impresion_id').val(isNaN(parseInt(row.tarifa_impresion_id)) ? "" : parseInt(row.tarifa_impresion_id))
} }
@ -2899,6 +2901,18 @@ function fill_lp_cubierta(row, fromComparador=false){
} }
else{ else{
console.log(row);
var portadaObjeto = {
anchoLibro:row.dimensiones_libro[0],
altoLibro:row.dimensiones_libro[1],
solapas:$('#solapas_ancho').val(),
lomo:row.mano};
//previewEsquemaCubierta(portadaObjeto);
// Si viene de hacerlo a mano... // Si viene de hacerlo a mano...
$('#lp_cubierta_tiempo').val(row.tiempo_maquina) $('#lp_cubierta_tiempo').val(row.tiempo_maquina)
$('#lp_cubierta_numeroPliegos').val(isNaN(parseFloat(row.pliegos_libro)) ? "" : parseFloat(row.pliegos_libro).toFixed(2)) $('#lp_cubierta_numeroPliegos').val(isNaN(parseFloat(row.pliegos_libro)) ? "" : parseFloat(row.pliegos_libro).toFixed(2))

View File

@ -5,7 +5,7 @@
data-bs-target="#accordionPreviewTip" aria-expanded="false" data-bs-target="#accordionPreviewTip" aria-expanded="false"
aria-controls="accordionPreviewTip"> aria-controls="accordionPreviewTip">
<h4><?= lang("Presupuestos.preview") ?></h4> <h4><?= lang("Presupuestos.preview") ?></h4>
</button> </button>
</h2> </h2>
<div id="accordionPreviewTip" class="accordion-collapse collapse show" <div id="accordionPreviewTip" class="accordion-collapse collapse show"
@ -25,7 +25,7 @@
<?= lang("Presupuestos.previewMaquina") ?> <?= lang("Presupuestos.previewMaquina") ?>
</button> </button>
</li> </li>
<li id="tab-preview-cubierta" class="nav-item"> <li id="tab-preview-configuracion-cubierta" class="nav-item">
<button <button
type="button" type="button"
class="nav-link" class="nav-link"
@ -34,19 +34,19 @@
data-bs-target="#preview-cubierta" data-bs-target="#preview-cubierta"
aria-controls="preview-cubierta" aria-controls="preview-cubierta"
aria-selected="false"> aria-selected="false">
<?= lang("Presupuestos.previewCubierta") ?> <?= lang("Presupuestos.previewConfiguracionCubierta") ?>
</button> </button>
</li> </li>
<li id="tab-preview-portada" class="nav-item"> <li id="tab-preview-esquema-cubierta" class="nav-item">
<button <button
type="button" type="button"
class="nav-link" class="nav-link"
role="tab" role="tab"
data-bs-toggle="tab" data-bs-toggle="tab"
data-bs-target="#preview-portada" data-bs-target="#preview-esquema-cubierta"
aria-controls="preview-portada" aria-controls="preview-esquema-cubierta"
aria-selected="false"> aria-selected="false">
<?= lang("Presupuestos.previewPortada") ?> <?= lang("Presupuestos.previewEsquemaCubierta") ?>
</button> </button>
</li> </li>
@ -204,7 +204,7 @@
</div> </div>
</div> </div>
<div class="tab-pane fade" id="preview-portada" role="tabpanel"> <div class="tab-pane fade" id="preview-esquema-cubierta" role="tabpanel">
<div class="row"> <div class="row">
<div class="col-3"> <div class="col-3">
<div class="p-4 mb-3 pb-3" > <div class="p-4 mb-3 pb-3" >
@ -282,7 +282,7 @@
<!-------------------------------------------------------> <!------------------------------------------------------->
<?= $this->section("additionalInlineJs") ?> <?= $this->section("additionalInlineJs") ?>
$('#tab-preview-cubierta').on( "click", function() { $('#tab-preview-configuracion-cubierta').on( "click", function() {
var cubiertaObjeto = { var cubiertaObjeto = {
anchoMaquina: 487, anchoMaquina: 487,
@ -294,19 +294,23 @@
solapas:45, solapas:45,
lomo:25}; lomo:25};
previewCubierta(cubiertaObjeto); previewConfiguracionCubierta(cubiertaObjeto);
} ); } );
$('#tab-preview-portada').on( "click", function() { $('#tab-preview-esquema-cubierta').on( "click", function() {
var portadaObjeto = { var altoLib = 400;
var cubiertaObjeto = {
altoLibro:220,
anchoLibro:170, anchoLibro:170,
altoLibro:240, anchoCubierta:491,
solapas:45, anchoSolapa:70,
lomo:25}; lomoLibro:11
};
previewPortada(portadaObjeto); previewEsquemaCubierta(cubiertaObjeto);
} ); } );

View File

@ -7,7 +7,7 @@ var styles = {
} }
function previewCubierta(cubiertaObj) { function previewConfiguracionCubierta(cubiertaObj) {
// Local parameters // Local parameters
let fullBookWith = ((2 * cubiertaObj.anchoLibro) + (2 * (cubiertaObj.solapas + _offsetSolapas)) + cubiertaObj.lomo); let fullBookWith = ((2 * cubiertaObj.anchoLibro) + (2 * (cubiertaObj.solapas + _offsetSolapas)) + cubiertaObj.lomo);
@ -16,11 +16,11 @@ function previewCubierta(cubiertaObj) {
$('#draw-cubierta').empty(); $('#draw-cubierta').empty();
// Get the element for placing the graphical elements // Get the element for placing the graphical elements
var divCubierta = document.getElementById('draw-cubierta'); var divCubierta = document.getElementById('draw-cubierta');
var _previewCubierta = new Two({fitted: true}).appendTo(divCubierta); var _previewConfiguracionCubierta = new Two({fitted: true}).appendTo(divCubierta);
// Calculate the center of the canvas element // Calculate the center of the canvas element
var origenCubierta = new Two.Vector(_previewCubierta.width / 2, _previewCubierta.height / 2); var origenCubierta = new Two.Vector(_previewConfiguracionCubierta.width / 2, _previewConfiguracionCubierta.height / 2);
var areaMaquinaCubierta = _previewCubierta.makeRectangle( var areaMaquinaCubierta = _previewConfiguracionCubierta.makeRectangle(
origenCubierta.x, origenCubierta.x,
origenCubierta.y, origenCubierta.y,
cubiertaObj.anchoMaquina, cubiertaObj.anchoMaquina,
@ -28,7 +28,7 @@ function previewCubierta(cubiertaObj) {
areaMaquinaCubierta.stroke = 'black'; areaMaquinaCubierta.stroke = 'black';
areaMaquinaCubierta.linewidth = 1; areaMaquinaCubierta.linewidth = 1;
var areaImpresionCubierta = _previewCubierta.makeRectangle( var areaImpresionCubierta = _previewConfiguracionCubierta.makeRectangle(
origenCubierta.x, origenCubierta.x,
origenCubierta.y, origenCubierta.y,
cubiertaObj.anchoImpresion, cubiertaObj.anchoImpresion,
@ -36,72 +36,189 @@ function previewCubierta(cubiertaObj) {
areaImpresionCubierta.stroke = 'red'; areaImpresionCubierta.stroke = 'red';
areaImpresionCubierta.linewidth = 1; areaImpresionCubierta.linewidth = 1;
var formaCubierta = _previewCubierta.makeRectangle( var formaCubierta = _previewConfiguracionCubierta.makeRectangle(
origenCubierta.x, origenCubierta.x,
origenCubierta.y, origenCubierta.y,
fullBookWith, fullBookWith,
cubiertaObj.altoLibro); cubiertaObj.altoLibro);
formaCubierta.stroke = '#6997D3'; formaCubierta.stroke = 'grey';
formaCubierta.fill = '#6997D3'; formaCubierta.fill = '#F4F8F2';
formaCubierta.linewidth = 1; formaCubierta.linewidth = 1;
// Texts // Texts
_previewCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith/2 -25), origenCubierta.y, styles); _previewConfiguracionCubierta.makeText(cubiertaObj.altoLibro, origenCubierta.x + (fullBookWith / 2 - 25), origenCubierta.y, styles);
_previewCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro/2-15) , styles); _previewConfiguracionCubierta.makeText(fullBookWith, origenCubierta.x, origenCubierta.y + (cubiertaObj.altoLibro / 2 - 15), styles);
_previewCubierta.update(); _previewConfiguracionCubierta.update();
// Update preview info fields // Update preview info fields
$('#prevLibro').text(cubiertaObj.anchoLibro + "X" + cubiertaObj.altoLibro ); $('#prevLibro').text(cubiertaObj.anchoLibro + "X" + cubiertaObj.altoLibro);
$('#prevLomo').text(cubiertaObj.lomo); $('#prevLomo').text(cubiertaObj.lomo);
$('#prevSolapas').text(cubiertaObj.solapas); $('#prevSolapas').text(cubiertaObj.solapas);
} }
function previewPortada(portadaObj) { function previewEsquemaCubierta(objEC) {
// Variables locales
let altoLibro, anchoLibro, lomoLibro, anchoSolapa, anchoCubierta, altoSangrado, anchoSangrado;
let styleCotas = {size: 12, family: 'Public Sans'};
// Definicion de los parametros del Esquema de Cubierta (EC)
if (objEC.anchoSolapa == 0) {
anchoSangrado = 600; // px
altoSangrado = (anchoSangrado * 0.647 > 350) ? anchoSangrado * 0.647 : 350; // px
altoLibro = altoSangrado * 0.97;
anchoLibro = anchoSangrado * 0.419;
anchoSolapa = 0;
lomoLibro = anchoSangrado * 0.133;
anchoCubierta = (2 * anchoLibro) + (2 * anchoSolapa) + lomoLibro;
} else {
anchoSangrado = 600; // px
altoSangrado = (anchoSangrado * 0.418 > 350) ? anchoSangrado * 0.418 : 350; // px
altoLibro = altoSangrado * 0.95;
anchoLibro = anchoSangrado * 0.28;
anchoSolapa = anchoSangrado * 0.163;
lomoLibro = anchoSangrado * 0.09;
anchoCubierta = (2 * anchoLibro) + (2 * anchoSolapa) + lomoLibro;
}
// Clear the canvas element // Clear the canvas element
$('#draw-portada').empty(); $('#draw-portada').empty();
// Get the element for placing the graphical elements // Get the element for placing the graphical elements
var divPortada = document.getElementById('draw-portada'); var divEC = document.getElementById('draw-portada');
var _previewPortada = new Two({fitted: true}).appendTo(divPortada); var previewEC = new Two({fitted: true}).appendTo(divEC);
// Calculate the center of the canvas element // Calculate the center of the canvas element
var origenPortada = new Two.Vector(_previewPortada.width / 2, _previewPortada.height / 2); var origenEC = new Two.Vector(previewEC.width / 2, previewEC.height / 2);
var solapas = _previewPortada.makeRectangle( var sangrado = previewEC.makeRectangle(
origenPortada.x, origenEC.x,
origenPortada.y, origenEC.y,
((2 * portadaObj.anchoLibro) + (2 * (portadaObj.solapas + _offsetSolapas)) + portadaObj.lomo), anchoSangrado,
portadaObj.altoLibro); altoSangrado
solapas.stroke = '#5FD2B5'; );
solapas.fill = '#5FD2B5'; sangrado.stroke = 'black';
solapas.linewidth = 1; sangrado.dashes = [5, 5];
sangrado.fill = '#FCEAF1';
sangrado.linewidth = 1;
var libro = _previewPortada.makeRectangle( if (objEC.anchoSolapa != 0) {
origenPortada.x, var solapas = previewEC.makeRectangle(
origenPortada.y, origenEC.x,
((2 * portadaObj.anchoLibro) + portadaObj.lomo), origenEC.y,
portadaObj.altoLibro); anchoCubierta,
libro.stroke = '#6997D3'; altoLibro);
libro.fill = '#6997D3'; solapas.stroke = 'black';
solapas.linewidth = 1;
// Cotas Solapas
var cotaSolapa2 = previewEC.makeDobleArrow(
origenEC.x - anchoCubierta / 2,
origenEC.y - (altoLibro / 3),
origenEC.x - anchoLibro - lomoLibro / 2,
origenEC.y - (altoLibro / 3),
10);
cotaSolapa2.linewidth = 2;
var cotaSolapa1 = previewEC.makeDobleArrow(
origenEC.x + anchoCubierta / 2,
origenEC.y - (altoLibro / 3),
origenEC.x + anchoLibro + lomoLibro / 2,
origenEC.y - (altoLibro / 3),
10);
cotaSolapa1.linewidth = 2;
// Textos Solapas
let stylesSolapa = {size: 18, family: 'Public Sans'};
previewEC.makeText("Solapa 1", origenEC.x + anchoLibro + (lomoLibro + anchoSolapa) / 2, origenEC.y, stylesSolapa);
previewEC.makeText("Solapa 2", origenEC.x - anchoLibro - (lomoLibro + anchoSolapa) / 2, origenEC.y, stylesSolapa);
// Textos Cotas Solapas
previewEC.makeText(objEC.anchoSolapa + " mm", origenEC.x - anchoLibro - (lomoLibro + anchoSolapa) / 2, origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.anchoSolapa + " mm", origenEC.x + anchoLibro + (lomoLibro + anchoSolapa) / 2, origenEC.y - (altoLibro / 3) + 15, styleCotas);
}
var libro = previewEC.makeRectangle(
origenEC.x,
origenEC.y,
((2 * anchoLibro) + lomoLibro),
altoLibro);
libro.stroke = 'black';
libro.linewidth = 1; libro.linewidth = 1;
var lomo = _previewPortada.makeRectangle( var lomo = previewEC.makeRectangle(
origenPortada.x, origenEC.x,
origenPortada.y, origenEC.y,
portadaObj.lomo, lomoLibro,
portadaObj.altoLibro); altoLibro);
lomo.stroke = '#8171D4'; lomo.stroke = 'black';
lomo.fill = '#8171D4'; lomo.fill = '#F4F8F2';
lomo.linewidth = 1; lomo.linewidth = 1;
_previewPortada.update(); // Cotas
var cotaAnchoCubierta = previewEC.makeDobleArrow(
origenEC.x - (anchoCubierta / 2),
origenEC.y + (altoLibro / 2) + 35,
origenEC.x + (anchoCubierta / 2),
origenEC.y + (altoLibro / 2) + 35,
10);
cotaAnchoCubierta.linewidth = 2;
var cotaAltoLibro = previewEC.makeDobleArrow(
origenEC.x + (anchoCubierta / 2) + 35,
origenEC.y + (altoLibro / 2),
origenEC.x + (anchoCubierta / 2) + 35,
origenEC.y - (altoLibro / 2),
10);
cotaAltoLibro.linewidth = 2;
var cotaLomo = previewEC.makeDobleArrow(
origenEC.x - (lomoLibro / 2),
origenEC.y + (altoLibro / 3),
origenEC.x + (lomoLibro / 2),
origenEC.y + (altoLibro / 3),
10);
cotaLomo.linewidth = 2;
var cotaContraportada = previewEC.makeDobleArrow(
origenEC.x - (lomoLibro / 2 + anchoLibro),
origenEC.y - (altoLibro / 3),
origenEC.x - (lomoLibro / 2),
origenEC.y - (altoLibro / 3),
10);
cotaContraportada.linewidth = 2;
var cotaPortada = previewEC.makeDobleArrow(
origenEC.x + (lomoLibro / 2),
origenEC.y - (altoLibro / 3),
origenEC.x + (lomoLibro / 2 + anchoLibro),
origenEC.y - (altoLibro / 3),
10);
cotaPortada.linewidth = 2;
// Textos:
// Titulos generales
let stylesEC = {size: 22, weight: 'bold', family: 'Public Sans'};
previewEC.makeText("Portada", origenEC.x + (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
previewEC.makeText("Contraportada", origenEC.x - (lomoLibro + anchoLibro) / 2, origenEC.y, stylesEC);
let a = previewEC.makeText("Lomo", origenEC.x, origenEC.y, stylesEC).rotation = -Math.PI / 2;
// Sangrados
let styleSangrado = {size: 10, family: 'Public Sans', style: 'italic', fill: 'red'};
previewEC.makeText("Sangrado 3 mm", origenEC.x, origenEC.y + (altoLibro / 2 + 20), styleSangrado);
previewEC.makeText("Sangrado 3 mm", origenEC.x, origenEC.y - (altoLibro / 2 + 20), styleSangrado);
previewEC.makeText("Sangrado 3 mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
previewEC.makeText("Sangrado 3 mm", origenEC.x - (lomoLibro / 2 + anchoLibro + anchoSolapa + 20), origenEC.y, styleSangrado).rotation = -Math.PI / 2;
// Cotas
previewEC.makeText(objEC.lomoLibro + " mm", origenEC.x, origenEC.y + (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.anchoLibro + " mm", origenEC.x - (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.anchoLibro + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro / 2), origenEC.y - (altoLibro / 3) + 15, styleCotas);
previewEC.makeText(objEC.altoLibro + " mm", origenEC.x + (lomoLibro / 2 + anchoLibro + anchoSolapa) + 50, origenEC.y, styleCotas).rotation = -Math.PI / 2;
previewEC.makeText(objEC.anchoCubierta + " mm", origenEC.x, origenEC.y + (altoLibro / 2) + 50, styleCotas);
previewEC.update();
// Update preview info fields // Update preview info fields
$('#prevLibro').text(portadaObj.anchoLibro + "X" + portadaObj.altoLibro ); $('#prevLibro').text(objEC.anchoLibro + "X" + objEC.altoLibro);
$('#prevLomo').text(portadaObj.lomo); $('#prevLomo').text(objEC.lomoLibro);
$('#prevSolapas').text(portadaObj.solapas); $('#prevSolapas').text(objEC.solapas);
} }

View File

@ -160,6 +160,7 @@ $('#presupuestoForm').on( "submit", function( event ) {
<script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script> <script src="<?= site_url('themes/vuexy/vendor/libs/autosize/autosize.js') ?>"></script>
<?php if(str_contains($formAction,'edit')): ?> <?php if(str_contains($formAction,'edit')): ?>
<script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script> <script src="<?= site_url('js_loader/comparadorCosidoTapaBlanda_js') ?>"></script>
<script src="<?= site_url('js_loader/previsualizador_js') ?>"></script>
<script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script> <script src="<?= site_url('themes/vuexy/vendor/libs/two/two.js') ?>"></script>
<?php endif; ?> <?php endif; ?>
<?=$this->endSection() ?> <?=$this->endSection() ?>

View File

@ -93,6 +93,6 @@ table.dataTable.table-hover>tbody>tr.selected:hover>* {
div.draw-shapes { div.draw-shapes {
width: 95%; width: 95%;
height: 500px; height: 550px;
margin: 2.5% auto; margin: 2.5% auto;
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long