Merge branch 'mod/presu_cliente' into 'main'

Mod/presu cliente

See merge request jjimenez/safekat!266
This commit is contained in:
Ignacio Martinez Navajas
2024-06-07 13:36:18 +00:00
9 changed files with 58 additions and 32 deletions

View File

@ -114,9 +114,9 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$datosPresupuesto->tapa = 'blanda';
$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();
@ -131,8 +131,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
public function edit($requestedId = null)
{
// JJO
$session = session();
if ($requestedId == null) :
return $this->redirect2listView();
@ -145,8 +143,6 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
return $this->redirect2listView('sweet-error', $message);
endif;
$requestMethod = $this->request->getMethod();
$datosPresupuesto = (object)array();
$datosPresupuesto->POD = model('App\Models\Configuracion\ConfiguracionSistemaModel')->getPOD();
$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->viewData['formAction'] = route_to('updateCosidotapablanda', $id);
$this->viewData['formAction'] = 'edit';
$this->viewData['paisList'] = $this->getPaisListItems();

View File

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

View File

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

View File

@ -1,7 +1,7 @@
<div class="col-12 pb-2">
<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">

View File

@ -745,7 +745,7 @@ async function calcularPresupuesto() {
if(!error){
$('#lomo_cubierta').val(response.lomo_cubierta);
$('#lomo_cubierta').val(response.info.lomo_cubierta);
$('#precios').show();
@ -770,7 +770,15 @@ async function calcularPresupuesto() {
$('#divTiradasPrecio').append(html);
}
}
}
if($('#resumen-libro').hasClass('active')) {
initDirecciones();
initTiradasDirecciones();
generarResumen();
previewEsquemaCubierta(true);
}
}
},
error: function (error) {

View File

@ -344,7 +344,12 @@
}
});
});
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,5 @@ function getObjetoToPreview() {
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>');
// Agregar opciones al selector
var selector = $('select', this);
selector.append('<option value="">Todos</option>'); // Opción vacía
selector.append('<option value="libroCosidoTapaBlanda"><?= lang('Presupuestos.libroCosidoTapaBlanda') ?></option>');
selector.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
selector.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
selector.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></option>');
selector.append('<option value="libroEspiralTapaDura"><?= lang('Presupuestos.libroEspiralTapaDura') ?></option>');
selector.append('<option value="libroEspiralTapaBlanda"><?= lang('Presupuestos.libroEspiralTapaBlanda') ?></option>');
selector.append('<option value="libroWireoTapaDura"><?= lang('Presupuestos.libroWireoTapaDura') ?></option>');
selector.append('<option value="libroWireoTapaBlanda"><?= lang('Presupuestos.libroWireoTapaBlanda') ?></option>');
selector.append('<option value="libroGrapado"><?= lang('Presupuestos.libroGrapado') ?></option>');
var selectorTipo = $('select', this);
selectorTipo.append('<option value="">Todos</option>'); // Opción vacía
selectorTipo.append('<option value="libroCosidoTapaBlanda"><?= lang('Presupuestos.libroCosidoTapaBlanda') ?></option>');
selectorTipo.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
selectorTipo.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
selectorTipo.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></option>');
selectorTipo.append('<option value="libroEspiralTapaDura"><?= lang('Presupuestos.libroEspiralTapaDura') ?></option>');
selectorTipo.append('<option value="libroEspiralTapaBlanda"><?= lang('Presupuestos.libroEspiralTapaBlanda') ?></option>');
selectorTipo.append('<option value="libroWireoTapaDura"><?= lang('Presupuestos.libroWireoTapaDura') ?></option>');
selectorTipo.append('<option value="libroWireoTapaBlanda"><?= lang('Presupuestos.libroWireoTapaBlanda') ?></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(
$(this).val()
);

View File

@ -276,6 +276,8 @@ window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
});
initDisenioLibro();
<?php endif; ?>
@ -283,9 +285,6 @@ window.token_ajax= {<?= csrf_token() ?? "token" ?>: <?= csrf_token() ?>v};
<?= $this->endSection() ?>
<?= $this->section('css') ?>
<link rel="stylesheet" href="<?= site_url('themes/vuexy/vendor/libs/bs-stepper/bs-stepper.css') ?>" />