mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
añadido calculo de formas rot y merma automatica para rot
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
<div id="accordionDatosLibroTip" class="accordion-collapse collapse show" data-bs-parent="#accordionDatosLibro">
|
||||
<div class="accordion-body">
|
||||
|
||||
<div id='alert-datosLibro'></div>
|
||||
<!-- Fila 1 -->
|
||||
<div class="row">
|
||||
<div class="col-md-12 col-lg-2 px-4">
|
||||
@ -287,20 +288,37 @@ function calcular_mermas(){
|
||||
merma_lineas = []
|
||||
$('#tableLineasPresupuesto tbody tr:visible ').each(function(){
|
||||
if(!this.id.includes('_data') && !this.id.endsWith('_cubierta') && !this.id.endsWith('_sobrecubierta')){
|
||||
const formas_linea = parseInt($('#' + this.id + '_formas').val())
|
||||
const formas_linea = <?php echo $isCosido; ?>==0?parseInt($('#' + this.id + '_formas').val()):parseInt($('#' + this.id + '_formas').val())/2
|
||||
if(formas_linea > tirada)
|
||||
merma_lineas.push(formas_linea-tirada)
|
||||
else
|
||||
merma_lineas.push(tirada%formas_linea)
|
||||
}
|
||||
})
|
||||
|
||||
htmlString = ''
|
||||
if(merma_lineas.length>0)
|
||||
merma = Math.max(...merma_lineas)
|
||||
else
|
||||
else{
|
||||
htmlString = `
|
||||
<div class="alert alert-warning d-flex align-items-baseline" role="alert">
|
||||
<span class="alert-icon alert-icon-lg text-primary me-2">
|
||||
<i class="ti ti-bell ti-sm"></i>
|
||||
</span>
|
||||
<div class="d-flex flex-column ps-1">
|
||||
<h5 class="alert-heading mb-2"><?= lang("Presupuestos.validation.no_lp_for_merma") ?></h5>
|
||||
</div>
|
||||
</div>`;
|
||||
|
||||
|
||||
merma = 0
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$('#mermacubierta').val(parseInt(merma))
|
||||
$('#merma').val(parseInt(merma))
|
||||
$('#alert-datosLibro').html(htmlString)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2724,7 +2724,7 @@ $('#lp_rot_color_defecto').on("click", function () {
|
||||
function fill_lp_rot_color(row, fromComparador=false){
|
||||
|
||||
if(fromComparador){
|
||||
console.log(row)
|
||||
//console.log(row)
|
||||
$('#lp_rot_color_paginas').val(row.paginas)
|
||||
$('#lp_rot_color_papel').val(row.papelGenericoId)
|
||||
$('#lp_rot_color_gramaje').empty()
|
||||
|
||||
Reference in New Issue
Block a user