Falta lomo

This commit is contained in:
imnavajas
2024-06-06 19:55:51 +02:00
parent af6780b36c
commit 120e46f994
9 changed files with 58 additions and 27 deletions

View File

@ -114,9 +114,9 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$datosPresupuesto->tapa = 'blanda'; $datosPresupuesto->tapa = 'blanda';
$datosPresupuesto->clienteList = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null); $datosPresupuesto->clienteList = $this->getClienteListItems($presupuestoEntity->cliente_id ?? null);
$presupuestoEntity->estado = 1; $presupuestoEntity->estado_id = 1;
$this->viewData['formAction'] = route_to('crearPresupuestoCliente'); $this->viewData['formAction'] = 'add';
$this->viewData['paisList'] = $this->getPaisListItems(); $this->viewData['paisList'] = $this->getPaisListItems();
@ -131,8 +131,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
public function edit($requestedId = null) public function edit($requestedId = null)
{ {
// JJO
$session = session();
if ($requestedId == null) : if ($requestedId == null) :
return $this->redirect2listView(); return $this->redirect2listView();
@ -145,8 +143,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
return $this->redirect2listView('sweet-error', $message); return $this->redirect2listView('sweet-error', $message);
endif; endif;
$requestMethod = $this->request->getMethod();
$datosPresupuesto = (object)array(); $datosPresupuesto = (object)array();
$datosPresupuesto->POD = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD(); $datosPresupuesto->POD = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
$datosPresupuesto->paisList = model('App\Models\Configuracion\PaisModel')->getAllForMenu('id, nombre', 'nombre', true); $datosPresupuesto->paisList = model('App\Models\Configuracion\PaisModel')->getAllForMenu('id, nombre', 'nombre', true);
@ -181,7 +177,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$this->generarResumen($presupuestoEntity); $this->generarResumen($presupuestoEntity);
} }
$this->viewData['formAction'] = route_to('updateCosidotapablanda', $id); $this->viewData['formAction'] = 'edit';
$this->viewData['paisList'] = $this->getPaisListItems(); $this->viewData['paisList'] = $this->getPaisListItems();

View File

@ -7,8 +7,6 @@ use CodeIgniter\Controller;
class Intranet extends Controller class Intranet extends Controller
{ {
function presupuestos($resource_name) function presupuestos($resource_name)
{ {
helper('file'); helper('file');

View File

@ -200,7 +200,7 @@ window.routes_resumen = {
duplicarPresupuesto: "<?= route_to('duplicarPresupuesto') ?>", duplicarPresupuesto: "<?= route_to('duplicarPresupuesto') ?>",
} }
<?php if ($presupuestoEntity->estado_id==2): ?> <?php if ($presupuestoEntity->estado_id===2): ?>
previewEsquemaCubierta(true); previewEsquemaCubierta(true);
const previewTemplate = `<div class="dz-preview dz-file-preview"> const previewTemplate = `<div class="dz-preview dz-file-preview">

View File

@ -1,7 +1,7 @@
<div class="col-12 pb-2"> <div class="col-12 pb-2">
<div class="tipo_libro"> <div class="tipo_libro">
<input hidden readonly id="lomo_cubierta" name="lomo_cubierta" maxLength="12" class="form-control" value="<?= old('lomoCubierta', $presupuestoEntity->lomoCubierta) ?>"> <input type="hidden" id="lomo_cubierta" value=<?php echo $presupuestoEntity->lomo_cubierta ?>>
<div class="row row-cols-3 mb-6 d-flex justify-content-center d-flex justify-content-center"> <div class="row row-cols-3 mb-6 d-flex justify-content-center d-flex justify-content-center">

View File

@ -771,6 +771,14 @@ async function calcularPresupuesto() {
$('#divTiradasPrecio').append(html); $('#divTiradasPrecio').append(html);
} }
} }
if($('#resumen-libro').hasClass('active')) {
initDirecciones();
initTiradasDirecciones();
generarResumen();
previewEsquemaCubierta(true);
}
} }
}, },
error: function (error) { error: function (error) {

View File

@ -345,6 +345,11 @@
}); });
}); });
var url = $(location).attr('href'); // Obtener URL actual
if (url.includes('/edit/')) { // Comprobar si la URL contiene 'edit'
validationStepper.to(4);
}
} }
})(); })();

View File

@ -811,6 +811,7 @@ function getObjetoToPreview() {
anchoLibro: parseInt(tamanio[0]) anchoLibro: parseInt(tamanio[0])
}; };
} }
//console.log(pvObj); console.log($('#lomo_cubierta').val());
} }

View File

@ -114,19 +114,40 @@ $('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) {
$(this).html('<select class="form-control" style="min-width:100px;max-width:120px;font-size:0.8rem !important;"></select>'); $(this).html('<select class="form-control" style="min-width:100px;max-width:120px;font-size:0.8rem !important;"></select>');
// Agregar opciones al selector // Agregar opciones al selector
var selector = $('select', this); var selectorTipo = $('select', this);
selector.append('<option value="">Todos</option>'); // Opción vacía selectorTipo.append('<option value="">Todos</option>'); // Opción vacía
selector.append('<option value="libroCosidoTapaBlanda"><?= lang('Presupuestos.libroCosidoTapaBlanda') ?></option>'); selectorTipo.append('<option value="libroCosidoTapaBlanda"><?= lang('Presupuestos.libroCosidoTapaBlanda') ?></option>');
selector.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>'); selectorTipo.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
selector.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>'); selectorTipo.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
selector.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></option>'); selectorTipo.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></option>');
selector.append('<option value="libroEspiralTapaDura"><?= lang('Presupuestos.libroEspiralTapaDura') ?></option>'); selectorTipo.append('<option value="libroEspiralTapaDura"><?= lang('Presupuestos.libroEspiralTapaDura') ?></option>');
selector.append('<option value="libroEspiralTapaBlanda"><?= lang('Presupuestos.libroEspiralTapaBlanda') ?></option>'); selectorTipo.append('<option value="libroEspiralTapaBlanda"><?= lang('Presupuestos.libroEspiralTapaBlanda') ?></option>');
selector.append('<option value="libroWireoTapaDura"><?= lang('Presupuestos.libroWireoTapaDura') ?></option>'); selectorTipo.append('<option value="libroWireoTapaDura"><?= lang('Presupuestos.libroWireoTapaDura') ?></option>');
selector.append('<option value="libroWireoTapaBlanda"><?= lang('Presupuestos.libroWireoTapaBlanda') ?></option>'); selectorTipo.append('<option value="libroWireoTapaBlanda"><?= lang('Presupuestos.libroWireoTapaBlanda') ?></option>');
selector.append('<option value="libroGrapado"><?= lang('Presupuestos.libroGrapado') ?></option>'); selectorTipo.append('<option value="libroGrapado"><?= lang('Presupuestos.libroGrapado') ?></option>');
selector.on('change', function () { selectorTipo.on('change', function () {
var val = $.fn.dataTable.util.escapeRegex(
$(this).val()
);
theTable.column(i).search(val).draw();
});
}
<?php if ($clienteId == 0): ?>
else if (i == 8) {
<?php else: ?>
else if (i == 7) {
<?php endif; ?>
// Agregar un selector en la tercera columna
$(this).html('<select class="form-control" style="min-width:100px;max-width:120px;font-size:0.8rem !important;"></select>');
// Agregar opciones al selector
var selectorEstado = $('select', this);
selectorEstado.append('<option value="">Todos</option>'); // Opción vacía
selectorEstado.append('<option value="1"><?= lang('Presupuestos.presupuestoEstadoBorrador') ?></option>');
selectorEstado.append('<option value="2"><?= lang('Presupuestos.presupuestoEstadoAceptado') ?></option>');
selectorEstado.on('change', function () {
var val = $.fn.dataTable.util.escapeRegex( var val = $.fn.dataTable.util.escapeRegex(
$(this).val() $(this).val()
); );

View File

@ -276,6 +276,8 @@ window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
}); });
initDisenioLibro(); initDisenioLibro();
<?php endif; ?> <?php endif; ?>