mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
quitado el botón de servicios defecto. Se añaden automaticamente cuando se crea
This commit is contained in:
@ -121,6 +121,52 @@ class Presupuestoadmin extends \App\Controllers\BaseResourceController
|
||||
|
||||
$id = $this->model->db->insertID();
|
||||
|
||||
// Guardar los servicios de encuadernación por defecto
|
||||
$POD = model('App\Models\Configuracion\ConfigVariableModel')->getVariable('POD')->value;
|
||||
$ancho = 0;
|
||||
$alto = 0;
|
||||
if(isset($sanitizedData['papel_formato_personalizado']) && $sanitizedData['papel_formato_personalizado'] == '1'){
|
||||
$ancho = $sanitizedData['papel_formato_ancho'];
|
||||
$alto = $sanitizedData['papel_formato_alto'];
|
||||
}
|
||||
else{
|
||||
$papelFormatoModel = new PapelFormatoModel();
|
||||
$papelFormato = $papelFormatoModel->find($sanitizedData['papel_formato_id']);
|
||||
$ancho = $papelFormato->ancho;
|
||||
$alto = $papelFormato->alto;
|
||||
}
|
||||
$servDefectoEnc = PresupuestoCLienteService::getServiciosEncuadernacionDefault([
|
||||
'tipo_impresion_id' => $sanitizedData['tipo_impresion_id'],
|
||||
'tirada' => $sanitizedData['tirada'],
|
||||
'paginas' => $sanitizedData['paginas'],
|
||||
'ancho' => $ancho,
|
||||
'alto' => $alto,
|
||||
'POD' => $POD,
|
||||
'solapas' => 0, // default
|
||||
'paginasCuadernillo' => 32, // default
|
||||
]);
|
||||
|
||||
$model = new PresupuestoEncuadernacionesModel();
|
||||
foreach($servDefectoEnc as $servicio){
|
||||
|
||||
$data = [
|
||||
'presupuesto_id' => $id,
|
||||
'tarifa_encuadernado_id' => $servicio->tarifa_id,
|
||||
'proveedor_id' => $servicio->proveedor_id,
|
||||
'tiempo' => $servicio->tiempo,
|
||||
'precio_total' => round($servicio->total, 2),
|
||||
'precio_unidad' => round($servicio->precio_unidad, 2),
|
||||
'margen' => $servicio->margen,
|
||||
];
|
||||
|
||||
// Se comprueba que $servicio tiene paginasCuadernillo
|
||||
if (isset($servicio->paginas_por_cuadernillo)) {
|
||||
$data['paginas_por_cuadernillo'] = $servicio->paginas_por_cuadernillo;
|
||||
}
|
||||
|
||||
$model->insert($data);
|
||||
}
|
||||
|
||||
$message = lang('Basic.global.saveSuccess', [lang('Basic.global.record')]) . '.';
|
||||
|
||||
if ($thenRedirect):
|
||||
|
||||
@ -12,9 +12,11 @@
|
||||
data-bs-parent="#accordionDatosServicios">
|
||||
<div class="accordion-body">
|
||||
<div class="row">
|
||||
<?php /* ?>
|
||||
<div class="col-md-12 col-lg-4 py-4">
|
||||
<button id="serv_default" type="button" class="btn btn-secondary waves-effect waves-light float-start"><?= lang("Presupuestos.serviciosDefault")?></button>
|
||||
</div>
|
||||
<?php */ ?>
|
||||
</div>
|
||||
<div class="nav-align-top mb-4">
|
||||
<ul class="nav nav-pills mb-3 nav-servicios" role="tablist">
|
||||
|
||||
@ -15,7 +15,7 @@ class Servicios {
|
||||
this.ServiciosManipulado = new ServiciosManipulado(this.csrf_token, this.csrf_hash);
|
||||
this.serviciosExtra = new ServiciosExtra(this.csrf_token, this.csrf_hash);
|
||||
|
||||
this.serviciosDefecto = $('#serv_default');
|
||||
//this.serviciosDefecto = $('#serv_default');
|
||||
}
|
||||
|
||||
init() {
|
||||
@ -28,21 +28,22 @@ class Servicios {
|
||||
this.ServiciosManipulado.init();
|
||||
this.serviciosExtra.init();
|
||||
|
||||
/*
|
||||
this.serviciosDefecto.on('click', function () {
|
||||
|
||||
$('#loader').modal('show');
|
||||
try {
|
||||
self.ServiciosEncuadernacion.getServiciosDefecto().then(function (response) {
|
||||
self.ServiciosManipulado.getServiciosDefecto().then(function (response) {
|
||||
//self.ServiciosManipulado.getServiciosDefecto().then(function (response) {
|
||||
$('#loader').modal('hide');
|
||||
});
|
||||
//});
|
||||
});
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error);
|
||||
$('#loader').modal('hide');
|
||||
}
|
||||
});
|
||||
});*/
|
||||
|
||||
$('.nav-servicios button').on('shown.bs.tab', function () {
|
||||
$("#tableOfServiciosAcabado").DataTable().columns.adjust();
|
||||
|
||||
Reference in New Issue
Block a user