mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
modificaciones
This commit is contained in:
@ -1561,7 +1561,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
|||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function calcular_presupuesto($datos_entrada, $selected_tirada, $extra_info = false)
|
protected function calcular_presupuesto($datos_entrada, $selected_tirada, $extra_info = false)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$return_data = [];
|
$return_data = [];
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
<!-- Fila 2 -->
|
<!-- Fila 2 -->
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-12 col-lg-2 px-4">
|
<div class="col-md-12 col-lg-2 px-4">
|
||||||
<div class="row impresion-con-solapas">
|
<div class="row solapas-cubierta-div">
|
||||||
<div class="mb-1">
|
<div class="mb-1">
|
||||||
<div class="form-check form-switch mb-2">
|
<div class="form-check form-switch mb-2">
|
||||||
<input class="form-check-input solapas_cubierta" type="checkbox" id="solapas" name="solapas" tabindex="6" value="1">
|
<input class="form-check-input solapas_cubierta" type="checkbox" id="solapas" name="solapas" tabindex="6" value="1">
|
||||||
@ -102,10 +102,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12 col-lg-2 px-4">
|
<div class="col-md-12 col-lg-2 px-4">
|
||||||
<div class="row impresion-con-solapas">
|
<div class="row solapas-sobrecubierta-div">
|
||||||
<div class="mb-1">
|
<div class="mb-1">
|
||||||
<div class="form-check form-switch mb-2">
|
<div class="form-check form-switch mb-2">
|
||||||
<input class="form-check-input solapas_sobrecubierta" type="checkbox" id="solapas_sobrecubierta" name="solapas_sobrecubierta" tabindex="6" value="1">
|
<input class="form-check-input solapas_sobrecubierta" type="checkbox" id="solapas_sobrecubierta" name="solapas_sobrecubierta" tabindex="6" value="1" onclick="return false;">
|
||||||
<label class="form-check-label" for="solapas_sobrecubierta"><?= lang('Presupuestos.solapasSobrecubierta') ?></label>
|
<label class="form-check-label" for="solapas_sobrecubierta"><?= lang('Presupuestos.solapasSobrecubierta') ?></label>
|
||||||
</div>
|
</div>
|
||||||
</div><!--//.mb-3 -->
|
</div><!--//.mb-3 -->
|
||||||
@ -128,7 +128,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-12 col-lg-2 px-4">
|
<div class="col-md-12 col-lg-2 px-4">
|
||||||
<div class="mb-1 impresion-con-solapas d-none" id="div_solapas_ancho">
|
<div class="mb-1 solapas-cubierta-div d-none" id="div_solapas_ancho">
|
||||||
<label for="solapas_ancho" class="form-label">
|
<label for="solapas_ancho" class="form-label">
|
||||||
<?= lang('Presupuestos.solapasAnchoCubierta') ?>*
|
<?= lang('Presupuestos.solapasAnchoCubierta') ?>*
|
||||||
</label>
|
</label>
|
||||||
@ -137,11 +137,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-12 col-lg-2 px-4">
|
<div class="col-md-12 col-lg-2 px-4">
|
||||||
<div class="mb-1 impresion-con-solapas d-none" id="div_solapas_ancho_sobrecubierta">
|
<div class="mb-1 solapas-sobrecubierta-div d-none" id="div_solapas_ancho_sobrecubierta">
|
||||||
<label for="solapas_ancho_sobrecubierta" class="form-label">
|
<label for="solapas_ancho_sobrecubierta" class="form-label">
|
||||||
<?= lang('Presupuestos.solapasAnchoSobrecubierta') ?>*
|
<?= lang('Presupuestos.solapasAnchoSobrecubierta') ?>*
|
||||||
</label>
|
</label>
|
||||||
<input type="number" id="solapas_ancho_sobrecubierta" name="solapas_ancho_sobrecubierta" placeholder="0" maxLength="8" step="1" class="form-control solapas_sobrecubierta" value="">
|
<input type="number" id="solapas_ancho_sobrecubierta" name="solapas_ancho_sobrecubierta" placeholder="60" min="60" maxLength="8" step="1" class="form-control solapas_sobrecubierta" value="">
|
||||||
</div><!--//.mb-1 -->
|
</div><!--//.mb-1 -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -243,6 +243,7 @@ class Comparador {
|
|||||||
this.papelSobrecubierta.onChange(() => this.gramajeSobrecubierta.setVal(0))
|
this.papelSobrecubierta.onChange(() => this.gramajeSobrecubierta.setVal(0))
|
||||||
this.sobrecubierta.on('change', () => {
|
this.sobrecubierta.on('change', () => {
|
||||||
if (this.sobrecubierta.val() == 1) {
|
if (this.sobrecubierta.val() == 1) {
|
||||||
|
$('#solapas_sobrecubierta').prop('checked', true);
|
||||||
$('#compPapelSobrecubierta').prop('disabled', false);
|
$('#compPapelSobrecubierta').prop('disabled', false);
|
||||||
$('#compGramajeSobrecubierta').prop('disabled', false);
|
$('#compGramajeSobrecubierta').prop('disabled', false);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -85,6 +85,17 @@ class DatosLibro {
|
|||||||
|
|
||||||
this.paginas.on('change', this.changePaginas.bind(this));
|
this.paginas.on('change', this.changePaginas.bind(this));
|
||||||
this.tirada.on('change', this.changeTirada.bind(this));
|
this.tirada.on('change', this.changeTirada.bind(this));
|
||||||
|
|
||||||
|
$('.formato-libro').on('change', function () {
|
||||||
|
$(document).trigger('update-lineas-presupuesto');
|
||||||
|
/* TO-DO
|
||||||
|
updatePresupuesto({
|
||||||
|
update_servicios: true,
|
||||||
|
update_envios: true,
|
||||||
|
update_resumen: true,
|
||||||
|
update_tiradas_alternativas: true
|
||||||
|
})*/
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,9 +172,12 @@ class DatosLibro {
|
|||||||
|
|
||||||
this.checkPaginasPresupuesto();
|
this.checkPaginasPresupuesto();
|
||||||
|
|
||||||
|
$('.tamanio-personalizado').addClass('d-none');
|
||||||
|
|
||||||
|
$(document).trigger('update-lineas-presupuesto');
|
||||||
|
|
||||||
// TO-DO
|
// TO-DO
|
||||||
/*updatePresupuesto({
|
/*updatePresupuesto({
|
||||||
update_lineas: true,
|
|
||||||
update_servicios: true,
|
update_servicios: true,
|
||||||
update_envios: true,
|
update_envios: true,
|
||||||
update_resumen: true,
|
update_resumen: true,
|
||||||
@ -190,6 +204,7 @@ class DatosLibro {
|
|||||||
$("#label_papelFormatoId").text(
|
$("#label_papelFormatoId").text(
|
||||||
window.language.Presupuestos.papelFormatoId + '*');
|
window.language.Presupuestos.papelFormatoId + '*');
|
||||||
}
|
}
|
||||||
|
$(document).trigger('update-lineas-presupuesto');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -367,20 +382,31 @@ class DatosLibro {
|
|||||||
|
|
||||||
if ($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3 ||
|
if ($('#tipo_impresion_id').val() == 1 || $('#tipo_impresion_id').val() == 3 ||
|
||||||
$('#tipo_impresion_id').val() == 5 || $('#tipo_impresion_id').val() == 7) {
|
$('#tipo_impresion_id').val() == 5 || $('#tipo_impresion_id').val() == 7) {
|
||||||
$(".impresion-con-solapas").addClass('d-none');
|
$(".solapas-cubierta-div").addClass('d-none');
|
||||||
}
|
}
|
||||||
else {
|
else{
|
||||||
if (datos.solapasCubierta) {
|
if (datos.solapasCubierta) {
|
||||||
this.solapasCubierta.prop('checked', true);
|
this.solapasCubierta.prop('checked', true);
|
||||||
this.anchoSolapasCubierta.val(datos.solapasCubiertaAncho);
|
this.anchoSolapasCubierta.val(datos.solapasCubiertaAncho);
|
||||||
$('#div_solapas_ancho').removeClass('d-none');
|
$('#div_solapas_ancho').removeClass('d-none');
|
||||||
}
|
}
|
||||||
if (datos.solapasSobrecubierta) {
|
else{
|
||||||
this.solapasSobrecubierta.prop('checked', true);
|
this.solapasCubierta.prop('checked', false);
|
||||||
this.anchoSolapasSobrecubierta.val(datos.solapasSobrecubiertaAncho);
|
this.anchoSolapasCubierta.val(0);
|
||||||
$('#div_solapas_ancho_sobrecubierta').removeClass('d-none');
|
$('#div_solapas_ancho').addClass('d-none');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (datos.solapasSobrecubierta) {
|
||||||
|
this.solapasSobrecubierta.prop('checked', true);
|
||||||
|
this.anchoSolapasSobrecubierta.val(datos.solapasSobrecubiertaAncho);
|
||||||
|
$('#div_solapas_ancho_sobrecubierta').removeClass('d-none');
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.solapasSobrecubierta.prop('checked', false);
|
||||||
|
this.anchoSolapasSobrecubierta.val(0);
|
||||||
|
$('#div_solapas_ancho_sobrecubierta').addClass('d-none');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.acabadoCubierta.setOption(datos.acabadoCubierta.id, datos.acabadoCubierta.text);
|
this.acabadoCubierta.setOption(datos.acabadoCubierta.id, datos.acabadoCubierta.text);
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,6 @@ class LineasPresupuesto {
|
|||||||
|
|
||||||
// TO-DO
|
// TO-DO
|
||||||
/*updatePresupuesto({
|
/*updatePresupuesto({
|
||||||
update_lineas: false,
|
|
||||||
update_servicios: true,
|
update_servicios: true,
|
||||||
update_envios: true,
|
update_envios: true,
|
||||||
update_resumen: true,
|
update_resumen: true,
|
||||||
@ -1464,6 +1463,10 @@ class LineasPresupuesto {
|
|||||||
cliente_id: $('#clienteId').find(":selected").val(),
|
cliente_id: $('#clienteId').find(":selected").val(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(datos.ancho==0 || datos.alto==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (linea.includes('rot')) {
|
if (linea.includes('rot')) {
|
||||||
if (fromComparador) {
|
if (fromComparador) {
|
||||||
datos.paginas_negro = parseInt($('#compPaginasNegro').val())
|
datos.paginas_negro = parseInt($('#compPaginasNegro').val())
|
||||||
@ -1514,27 +1517,39 @@ class LineasPresupuesto {
|
|||||||
(response) => {
|
(response) => {
|
||||||
if (response.lineas.length > 0) {
|
if (response.lineas.length > 0) {
|
||||||
|
|
||||||
$.each(response.lineas, function (key, value) {
|
let borrar_linea = true;
|
||||||
|
// Si viene del comparador
|
||||||
|
if (Object.keys(input_data).length == 0) {
|
||||||
|
borrar_linea = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(let $i=0; $i<response.lineas.length; $i++){
|
||||||
|
|
||||||
// Se cogen los valores de la linea con los datos correspondientes
|
// Se cogen los valores de la linea con los datos correspondientes
|
||||||
if (value.fields.maquina_id === input_data.maquina_id &&
|
if (response.lineas[$i].fields.maquina_id === input_data.maquina_id &&
|
||||||
value.fields.papel_generico_id === input_data.papel_generico_id &&
|
response.lineas[$i].fields.papel_generico_id === input_data.papel_generico_id &&
|
||||||
value.fields.papel_impresion_id === input_data.papel_impresion_id) {
|
response.lineas[$i].fields.papel_impresion_id === input_data.papel_impresion_id) {
|
||||||
|
|
||||||
|
borrar_linea = false;
|
||||||
|
|
||||||
// Si viene del comparador
|
// Si viene del comparador
|
||||||
if (Object.keys(input_data).length == 0) {
|
if (Object.keys(input_data).length == 0) {
|
||||||
value.fields.check_papel_total = $('#' + linea + '_checkPapel').is(":checked") ? 1 : 0
|
response.lineas[$i].fields.check_papel_total = $('#' + linea + '_checkPapel').is(":checked") ? 1 : 0
|
||||||
value.fields.check_impresion_total = $('#' + linea + '_checkClicks').is(":checked") ? 1 : 0
|
response.lineas[$i].fields.check_impresion_total = $('#' + linea + '_checkClicks').is(":checked") ? 1 : 0
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
value.fields.check_papel_total = 1
|
response.lineas[$i].fields.check_papel_total = 1;
|
||||||
value.fields.check_impresion_total = 1
|
response.lineas[$i].fields.check_impresion_total = 1;
|
||||||
}
|
}
|
||||||
self.rellenarDatosLinea(linea, value.fields);
|
self.rellenarDatosLinea(linea, response.lineas[$i].fields);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
if(borrar_linea){
|
||||||
|
self.table.row('#' + linea).remove().draw();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let pags = $("#" + linea + "_paginas").val()
|
let pags = $("#" + linea + "_paginas").val()
|
||||||
|
|||||||
Reference in New Issue
Block a user