mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
terminado
This commit is contained in:
@ -2867,7 +2867,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$sumForFactor += round($linea['precio_pedido'], 2);
|
||||
$sumForFactor -= round($linea['precio_pedido'], 2);
|
||||
|
||||
$totalImpresion += round($linea['precio_impresion_horas'], 2);
|
||||
$totalImpresion += round($linea['precio_click_pedido'], 2);
|
||||
$sumForFactor += round($linea['precio_click_pedido'], 2);
|
||||
|
||||
@ -2878,6 +2877,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
|
||||
$sumForFactor += round($linea['total_corte'], 2);
|
||||
}
|
||||
}
|
||||
$margenImpresion += round($linea['precio_impresion_horas'], 2); // coste de maquina y magen son MARGEN, no COSTE
|
||||
$margenImpresion += round($linea['margen_impresion_horas'], 2);
|
||||
$margenImpresion += round($linea['margen_click_pedido'], 2);
|
||||
$sumForFactor -= round($linea['margen_click_pedido'], 2);
|
||||
|
||||
@ -155,7 +155,7 @@ return [
|
||||
'totalClicks' => 'Total clicks',
|
||||
'horas' => 'Horas máquina',
|
||||
'precioHora' => 'Precio hora',
|
||||
'precioImpresion' => 'Precio impresión',
|
||||
'precioImpresion' => 'Coste máquina',
|
||||
'precioPagNegro' => 'Precio pág. negro',
|
||||
'precioPagColor' => 'Precio pág. color',
|
||||
'totalTinta' => 'Total tinta',
|
||||
|
||||
@ -404,7 +404,9 @@ class PresupuestoAdminEdit {
|
||||
}
|
||||
|
||||
// Funciones para detectar cambios en el formulario
|
||||
this.#checkChangesPresupuesto();
|
||||
setTimeout(() => {
|
||||
this.#checkChangesPresupuesto();
|
||||
}, 500);
|
||||
$('#bc-save').on("click", function () {
|
||||
showBreadCrumbSaveButton(false);
|
||||
$('#saveForm').trigger('click');
|
||||
@ -530,45 +532,57 @@ class PresupuestoAdminEdit {
|
||||
|
||||
|
||||
#checkChangesPresupuesto() {
|
||||
|
||||
const self = this;
|
||||
// Detectar cambios en inputs de texto
|
||||
$('input[type="text"]').on('change', function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en inputs de texto
|
||||
$('input[type="number"]').on('change', function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en select
|
||||
$('select').on('change', function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
$('.select2bs').on('change', function (e) {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en checkboxes
|
||||
$('input[type="checkbox"]').change(function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en textareas
|
||||
$('textarea').on('input', function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en otros tipos de input
|
||||
$('input[type="radio"]').change(function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
|
||||
// Detectar cambios en otros tipos de input
|
||||
$('input:not([type])').on('input', function () {
|
||||
showBreadCrumbSaveButton(true);
|
||||
if (!self.cargandoPresupuesto)
|
||||
showBreadCrumbSaveButton(true);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
downloadPreviewImage() {
|
||||
$(document).on("click", ".download-shape", (event) => {
|
||||
let parentDiv = $(event.currentTarget).parent().parent();
|
||||
|
||||
@ -104,6 +104,7 @@ class Resumen {
|
||||
let sumForFactorPonderado = 0.0;
|
||||
|
||||
|
||||
let costeMaquinaHoras = 0.0;
|
||||
let margenPorHoras = 0.0;
|
||||
|
||||
if (updateLP) {
|
||||
@ -122,7 +123,7 @@ class Resumen {
|
||||
}
|
||||
if (rowData.check_impresion_total) {
|
||||
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + '_precioImpresion').val())
|
||||
costeMaquinaHoras += parseFloat($('#' + rowData.row_id + '_precioImpresion').val())
|
||||
margenPorHoras += parseFloat($('#' + rowData.row_id + '_margenImpresion').val())
|
||||
totalImpresion += parseFloat($('#' + rowData.row_id + '_totalClicks').val())
|
||||
margenImpresion += parseFloat($('#' + rowData.row_id + '_margenClicks').val())
|
||||
@ -148,7 +149,7 @@ class Resumen {
|
||||
totalImpresion -= parseFloat(margenImpresion);
|
||||
totalPapel -= parseFloat(margenPapel);
|
||||
|
||||
margenImpresion += parseFloat(margenPorHoras);
|
||||
margenImpresion += parseFloat(margenPorHoras) + parseFloat(costeMaquinaHoras);
|
||||
|
||||
let porcentajeMargenPapel = isNaN(margenPapel / (totalPapel) * 100.0) ? 0 : margenPapel / (totalPapel) * 100.0
|
||||
$('#porcentajeMargenPapel').text(porcentajeMargenPapel.toFixed(0) + '%')
|
||||
|
||||
Reference in New Issue
Block a user