From aa245fcfdaeb069cc53e18655f80fcd9b6c70b1c Mon Sep 17 00:00:00 2001 From: Jaime Jimenez Date: Thu, 28 Dec 2023 13:26:16 +0100 Subject: [PATCH] =?UTF-8?q?a=C3=B1adido=20plantilla=20id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Clientes/ClientePreciosEntity.php | 35 ++++++ .../Models/Clientes/ClientePreciosModel.php | 105 ++++++++++++++++++ .../_datosPresupuestoClienteItems.php | 37 ++++-- 3 files changed, 165 insertions(+), 12 deletions(-) create mode 100644 ci4/app/Entities/Clientes/ClientePreciosEntity.php create mode 100644 ci4/app/Models/Clientes/ClientePreciosModel.php diff --git a/ci4/app/Entities/Clientes/ClientePreciosEntity.php b/ci4/app/Entities/Clientes/ClientePreciosEntity.php new file mode 100644 index 00000000..305f72a0 --- /dev/null +++ b/ci4/app/Entities/Clientes/ClientePreciosEntity.php @@ -0,0 +1,35 @@ + null, + "cliente_id" => null, + "plantilla_id" => null, + "tipo" => null, + "tipo_maquina" => null, + "tipo_impresion" => null, + "tiempo_min" => null, + "tiempo_max" => null, + "margen" => null, + "is_deleted" => 0, + "deleted_at" => null, + "created_at" => null, + "updated_at" => null, + "user_updated_id" => null, + "user_created_id" => null, + ]; + protected $casts = [ + "cliente_id" => "int", + "plantilla_id" => "int", + "tiempo_min" => "float", + "tiempo_max" => "float", + "margen" => "float", + "is_deleted" => "int", + "user_updated_id" => "int", + "user_created_id" => "int", + ]; +} diff --git a/ci4/app/Models/Clientes/ClientePreciosModel.php b/ci4/app/Models/Clientes/ClientePreciosModel.php new file mode 100644 index 00000000..c38c456f --- /dev/null +++ b/ci4/app/Models/Clientes/ClientePreciosModel.php @@ -0,0 +1,105 @@ + [ + "label" => "ClientePrecios.cliente_id", + "rules" => "required", + ], + "tipo" => [ + "label" => "ClientePrecios.tipo", + "rules" => "required|in_list[interior,cubierta,sobrecubierta]", + ], + "tipo_maquina" => [ + "label" => "ClientePrecios.tipo_maquina", + "rules" => "required|in_list[toner,inkjet]", + ], + "tipo_impresion" => [ + "label" => "ClientePrecios.tipo_impresion", + "rules" => "required|in_list[negro,color,negrohq,colorhq]", + ], + "tiempo_min" => [ + "label" => "ClientePrecios.tiempo_min", + "rules" => "required|decimal", + ], + "tiempo_max" => [ + "label" => "ClientePrecios.tiempo_max", + "rules" => "required|decimal", + ], + "margen" => [ + "label" => "ClientePrecios.margen", + "rules" => "required|decimal", + ], + + + + ]; + + protected $validationMessages = [ + "cliente_id" => [ + "required" => "ClientePrecios.validation.required", + + ], + "tipo" => [ + "required" => "ClientePrecios.validation.required", + ], + "tipo_maquina" => [ + "required" => "ClientePrecios.validation.required", + ], + "tipo_impresion" => [ + "required" => "ClientePrecios.validation.required", + ], + "tiempo_min" => [ + "required" => "ClientePrecios.validation.required", + ], + "tiempo_max" => [ + "required" => "ClientePrecios.validation.required", + ], + "margen" => [ + "required" => "ClientePrecios.validation.required", + ], + ]; + + +} diff --git a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php index 5babbed0..e7521ed1 100755 --- a/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php +++ b/ci4/app/Views/themes/backend/vuexy/form/presupuestos/cosidotapablanda/_datosPresupuestoClienteItems.php @@ -1063,21 +1063,23 @@ - $('#tipoImpresion').on("change", function () { + $('#tipoImpresion').on("change.select2", function () { updatePapelesComparador(); $('#title_int_rot').html(''); $('#title_int_plana').html(''); - $('#paginas').change(); - - if (($('#tipoImpresion').select2('data')[0].id == 'negro' || $('#tipoImpresion').select2('data')[0].id == 'color')){ $('#tableCompIntRotativa').DataTable().clear().draw(); $('#total_comp_rot').html("0.00"); + if($('#tipoImpresion').select2('data')[0].id == 'negro'){ + $('#compPaginasColor').val('0') + $('#compPaginasNegro').val($('#paginas').val()) + } + if( $('#tableCompIntPlana').DataTable().rows().count() > 0 && - $('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) { + $('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) { $('#tableCompIntPlana').DataTable().clear().draw(); $('#total_comp_plana').html("0.00"); @@ -1087,18 +1089,29 @@ else if (($('#tipoImpresion').select2('data')[0].id == 'negrohq' || $('#tipoImpresion').select2('data')[0].id == 'colorhq')){ - $('#tableCompIntRotativa').DataTable().clear().draw(); - $('#total_comp_rot').html("0.00"); + $('#tableCompIntRotativa').DataTable().clear().draw(); + $('#total_comp_rot').html("0.00"); - if($('#tableCompIntPlana').DataTable().rows().count() > 0 && - !$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) { + if($('#tipoImpresion').select2('data')[0].id == 'negrohq'){ + $('#compPaginasColorhq').val('0') + $('#compPaginasNegrohq').val($('#paginas').val()) + $('#compGramajeNegohq').change().trigger() + } - $('#tableCompIntPlana').DataTable().clear().draw(); - $('#total_comp_plana').html("0.00"); - } + if($('#tableCompIntPlana').DataTable().rows().count() > 0 && + !$('#tableCompIntPlana').DataTable().cell(0, 0).data().includes('hq')) { + + $('#tableCompIntPlana').DataTable().clear().draw(); + $('#total_comp_plana').html("0.00"); + } } }); + $('#tipoImpresion').on("select2:close", function () { + + $('#paginas').change(),trigger(); + }) + function checkComparadorInt(is_color, is_hq, actualizarLinea=false) {