arreglados bug en el tamanio, al guardar cuando hay tamanio personalizado en en update tarifas enc horas

This commit is contained in:
2024-02-19 17:02:07 +01:00
parent ff323deccd
commit 40acf85725
3 changed files with 31 additions and 15 deletions

View File

@ -100,6 +100,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
// JJO
$sanitizedData['user_created_id'] = $session->id_user;
if ($sanitizedData['papel_formato_id'] == null) {
$sanitizedData['papel_formato_id'] = 0;
}
$noException = true;
if ($successfulResult = $this->canValidate($this->model->validationRulesAdd, $this->model->validationMessagesAdd)) : // if ($successfulResult = $this->validate($this->formValidationRules) ) :
@ -218,6 +222,10 @@ class Cosidotapablanda extends \App\Controllers\GoBaseResourceController
$sanitizedData['papel_formato_personalizado'] = false;
}
if ($this->request->getPost('papel_formato_id') == null) {
$sanitizedData['papel_formato_id'] = 0;
}
$noException = true;
if($sanitizedData['papel_formato_id'] == null && $sanitizedData['papel_formato_ancho'] == null
&& $sanitizedData['papel_formato_alto'] == null){

View File

@ -253,7 +253,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
array_push($ret_array,
(object)[
'tarifa_id'=> $tarifa['tarifa_id'],
'tarifa_id'=> $tarifa_proveedor->tarifa_enc_id,
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
'precio_unidad'=> $result_data[0],
'total'=> $result_data[1],

View File

@ -73,13 +73,13 @@
<div class="row">
<div class="col-md-12 col-lg-6">
<div class="mb-3">
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="0.01" class="form-control" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAncho" name="papel_formato_ancho" maxLength="8" step="0.01" class="form-control formato_libro" value="<?= old('papel_formato_ancho', $presupuestoEntity->papel_formato_ancho) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
<div class="col-md-12 col-lg-6">
<div class="mb-3">
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="0.01" class="form-control" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
<input <?= $presupuestoEntity->papel_formato_personalizado == true ? '' : 'style="display: none"'; ?> type="number" id="papelFormatoAlto" name="papel_formato_alto" maxLength="8" step="0.01" class="form-control formato_libro" value="<?= old('papel_formato_alto', $presupuestoEntity->papel_formato_alto) ?>">
</div><!--//.mb-3 -->
</div><!--//.col -->
</div>
@ -359,7 +359,7 @@ $('#papelFormatoPersonalizado').on("click",function(){
document.getElementById("papelFormatoAncho").style.display = "block";
document.getElementById("papelFormatoAlto").style.display = "block";
$('#papelFormatoId').next(".select2-container").hide();
$('#papelFormatoId').val('').change();
$('#papelFormatoId').val(0).change();
document.getElementById("label_papelFormatoId").innerHTML =
"<?=lang('Presupuestos.papelFormatoId') ?> (" +
"<?=lang('Presupuestos.papelFormatoAncho') ?> x <?=lang('Presupuestos.papelFormatoAncho') ?>)*";
@ -404,23 +404,31 @@ $('#papelFormatoPersonalizado').on("click",function(){
});
$('#papelFormatoId').on('select2:select', function (e){
$('#papelFormatoId').on('select2:select', event_change_formato)
$('.formato_libro').on('change', event_change_formato)
function event_change_formato(){
ancho_libro = getDimensionLibro().ancho;
alto_libro = getDimensionLibro().alto;
checkPaginasPresupuesto()
updateLineasPresupuesto()
// Si es negro o color
if ($('#tipoImpresion').select2('data')[0].id == 'negro' ||
$('#tipoImpresion').select2('data')[0].id == 'color') {
$('#compPaginasNegro').trigger('change')
}
// Si es negrohq o colorhq
if ($('#tipoImpresion').select2('data')[0].id == 'negrohq' ||
$('#tipoImpresion').select2('data')[0].id == 'colorhq') {
$('#compPaginasNegrohq').trigger('change');
}
update_servicios(false)
})
}
<?php endif; ?>
$('#papelFormatoAncho').on('change', function (e){
ancho_libro = getDimensionLibro().ancho;
alto_libro = getDimensionLibro().alto;
})
$('#papelFormatoAlto').on('change', function (e){
ancho_libro = getDimensionLibro().ancho;
alto_libro = getDimensionLibro().alto;
})
<?php if($tipo_impresion_id != 1 && $tipo_impresion_id != 3 && $tipo_impresion_id != 5 && $tipo_impresion_id != 7): ?>
$("#solapas").on("click", function () {