Merge branch 'dev/grapados' into 'main'

Dev/grapados

See merge request jjimenez/safekat!204
This commit is contained in:
Ignacio Martinez Navajas
2024-04-09 12:02:23 +00:00
7 changed files with 23 additions and 32 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
ci4/.env
.vscode/
xdebug.log

View File

@ -236,7 +236,7 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$sanitizedData['solapas'] = 0;
}
if ($this->request->getPost('solapas_sobrecubierta') == null) {
$sanitizedData['solapas'] = 0;
$sanitizedData['solapas_sobrecubierta'] = 0;
}
$noException = true;

View File

@ -1750,7 +1750,7 @@ class PresupuestoService extends BaseService
if ($tipo_impresion_id == 5 || $tipo_impresion_id == 6 ||
$tipo_impresion_id == 7 || $tipo_impresion_id == 8) {
if ($uso == 'cubierta'){
$linea['fields']['num_formas']['num_formas_horizontales'] *= 2;
$linea['fields']['num_formas']['value'] *= 2;

View File

@ -2,6 +2,12 @@ $('#paginas').on("change", function () {
const url2 = window.location.href;
const url_parts2 = url2.split('/');
if($('#tipo_impresion_id').val() == 21){
if(parseInt($('#paginas').val()) > 80){
$('#paginas').val(80)
}
}
if(url_parts2[url_parts2.length-2] == 'edit'){

View File

@ -19,7 +19,7 @@
<label for="paginas" class="form-label">
<?= lang('Presupuestos.paginas') ?>*
</label>
<input type="number" id="paginas" name="paginas" tabindex="1" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>">
<input type="number" id="paginas" name="paginas" tabindex="1" maxLength="11" class="form-control" value="<?= old('paginas', $presupuestoEntity->paginas) ?>" <?php echo ($tipo_impresion_id == 21)?' max=80':'' ?>>
</div><!--//.mb-3 -->
</div>
@ -110,7 +110,7 @@
</div>
<div class="col-md-12 col-lg-2 px-4">
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8) : ?>
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
<div class="row">
<div class="mb-1">
<div class="form-check form-switch mb-2">
@ -153,7 +153,7 @@
<?php endif; ?>
</div>
<div class="col-md-12 col-lg-2 px-4">
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8) : ?>
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
<?php if($presupuestoEntity->solapas_sobrecubierta == true): ?>
<div class="mb-1" id="div_solapas_ancho_sobrecubierta">
<?php else: ?>
@ -199,7 +199,7 @@
</div>
</div>
<div class="col-md-12 col-lg-6 px-4">
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8) : ?>
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
<div class="row">
<div class="mb-1">
<label id="label_acabado_solapas_id" for="acabado_solapas_id" class="form-label">
@ -219,26 +219,7 @@
<?php endif; ?>
</div>
<div class="col-md-12 col-lg-6 px-4">
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8) : ?>
<div class="row">
<div class="mb-1">
<label id="label_acabado_sobrecubierta_id" for="acabado_sobrecubierta_id" class="form-label">
<?= lang('Presupuestos.acabadoSobrecubierta') ?>*
</label>
<select id="acabado_sobrecubierta_id" name="acabado_sobrecubierta_id" tabindex="3" class="form-control select2bs2" style="width: 100%;">
<?php if (isset($acabadosSobrecubierta) && is_array($acabadosSobrecubierta) && !empty($acabadosSobrecubierta)) :
foreach ($acabadosSobrecubierta as $acabado) : ?>
<option value="<?= $acabado->id ?>" <?= $acabado->id == $presupuestoEntity->acabado_sobrecubierta_id ? ' selected' : '' ?>>
<?= $acabado->label ?>
</option>
<?php endforeach;
endif; ?>
</select>
</div>
</div>
<?php endif; ?>
</div>
</div>

View File

@ -215,7 +215,7 @@
</div>
</div>
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8) : ?>
<?php if ($tipo_impresion_id != 5 && $tipo_impresion_id != 6 && $tipo_impresion_id != 7 && $tipo_impresion_id != 8 && $tipo_impresion_id != 21) : ?>
<div class="row">
<div class="col-md-12 col-lg-2 px-4">
<p><?= lang('PapelImpresion.sobrecubierta') ?></p>
@ -246,7 +246,7 @@
</select>
</div>
<div>
<hr class="my-1">
<hr class="my-1">
</div>
</div>
<?php endif; ?>

View File

@ -1,5 +1,4 @@
// Global parameters
//var _isCosido = true;
var pvObj;
function previewInteriorPlana(lpTagName, isCosido, isTapaDura) {
@ -987,6 +986,12 @@ function getObjetoLP(lpName, _isCosido, _isTapaDura) {
pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (pvObj.anchoSolapa + offsetSolapaValor)) + (2 * sangre) + pvObj.lomoLibro);
pvObj.altoForma += (2 * sangre);
}
// Grapado
else if (pvObj.tipoImpresion === 21) {
let sangre = parseFloat(5); // mm
pvObj.anchoForma = ((2 * pvObj.anchoLibro) + (2 * (pvObj.anchoSolapa + offsetSolapaValor)) + (2 * sangre));
pvObj.altoForma += (2 * sangre);
}
// Espiral TD y TB, Wire-o TD y TB
else if (pvObj.tipoImpresion === 5 || pvObj.tipoImpresion === 6 ||
pvObj.tipoImpresion === 7 || pvObj.tipoImpresion === 8) {
@ -1103,6 +1108,4 @@ function getVisibleTabs() {
}
}
});
}
}