mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
recuperados cambios de rama antigua
This commit is contained in:
@ -10,6 +10,7 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"presupuesto_id" => null,
|
"presupuesto_id" => null,
|
||||||
"tarifa_encuadernado_id" => null,
|
"tarifa_encuadernado_id" => null,
|
||||||
"precio_unidad" => null,
|
"precio_unidad" => null,
|
||||||
|
"tiempo" => null,
|
||||||
"precio_total" => null,
|
"precio_total" => null,
|
||||||
"margen" => null,
|
"margen" => null,
|
||||||
"created_at" => null,
|
"created_at" => null,
|
||||||
@ -19,6 +20,7 @@ class PresupuestoEncuadernacionesEntity extends \CodeIgniter\Entity\Entity
|
|||||||
"presupuesto_id" => "int",
|
"presupuesto_id" => "int",
|
||||||
"tarifa_encuadernado_id" => "int",
|
"tarifa_encuadernado_id" => "int",
|
||||||
"precio_unidad" => "float",
|
"precio_unidad" => "float",
|
||||||
|
"tiempo" => "float",
|
||||||
"precio_total" => "float",
|
"precio_total" => "float",
|
||||||
"margen" => "float",
|
"margen" => "float",
|
||||||
];
|
];
|
||||||
|
|||||||
@ -12,6 +12,8 @@ return [
|
|||||||
'moduleTitleWireoTB' => 'Presupuesto Libro Wire-o Tapa Blanda',
|
'moduleTitleWireoTB' => 'Presupuesto Libro Wire-o Tapa Blanda',
|
||||||
'moduleTitleGrapado' => 'Presupuesto Libro Grapado',
|
'moduleTitleGrapado' => 'Presupuesto Libro Grapado',
|
||||||
|
|
||||||
|
'advertencia' => 'Advertencia',
|
||||||
|
|
||||||
'presupuestoFresadotapaduraList' => 'Lista presupuestos Libros Fresado Tapa Dura',
|
'presupuestoFresadotapaduraList' => 'Lista presupuestos Libros Fresado Tapa Dura',
|
||||||
'presupuestoFresadotapablandaList' => 'Lista presupuestos Libros Fresado Tapa Blanda',
|
'presupuestoFresadotapablandaList' => 'Lista presupuestos Libros Fresado Tapa Blanda',
|
||||||
'presupuestoCosidotapaduraList' => 'Lista presupuestos Libros Cosido Tapa Dura',
|
'presupuestoCosidotapaduraList' => 'Lista presupuestos Libros Cosido Tapa Dura',
|
||||||
@ -22,12 +24,6 @@ return [
|
|||||||
'libroCosidoTapaDura' => "Cosido Tapa Dura",
|
'libroCosidoTapaDura' => "Cosido Tapa Dura",
|
||||||
'libroFresadoTapaBlanda' => "Fresado Tapa Blanda",
|
'libroFresadoTapaBlanda' => "Fresado Tapa Blanda",
|
||||||
'libroFresadoTapaDura' => "Fresado Tapa Dura",
|
'libroFresadoTapaDura' => "Fresado Tapa Dura",
|
||||||
'libroEspiralTapaDura' => "Espiral Tapa Dura",
|
|
||||||
'libroEspiralTapaBlanda' => "Espiral Tapa Blanda",
|
|
||||||
'libroWireoTapaDura' => "Wire-o Tapa Dura",
|
|
||||||
'libroWireoTapaBlanda' => "Wire-o Tapa Blanda",
|
|
||||||
'libroGrapado' => "Grapado",
|
|
||||||
|
|
||||||
|
|
||||||
'datosPresupuesto' => 'Datos generales del presupuesto',
|
'datosPresupuesto' => 'Datos generales del presupuesto',
|
||||||
'datosLibro' => 'Datos del libro',
|
'datosLibro' => 'Datos del libro',
|
||||||
@ -240,6 +236,7 @@ return [
|
|||||||
// Servicios
|
// Servicios
|
||||||
'precio' => 'Precio',
|
'precio' => 'Precio',
|
||||||
'precioUnidad' => 'Precio unidad',
|
'precioUnidad' => 'Precio unidad',
|
||||||
|
'tiempo' => 'Tiempo',
|
||||||
'precioTotal' => 'Precio total',
|
'precioTotal' => 'Precio total',
|
||||||
'serviciosDefault' => 'Servicios por defecto',
|
'serviciosDefault' => 'Servicios por defecto',
|
||||||
'tarifa' => 'Tarifa',
|
'tarifa' => 'Tarifa',
|
||||||
@ -269,6 +266,9 @@ return [
|
|||||||
'actualizacionPreciosLP' => '<br> - Líneas de presupuesto',
|
'actualizacionPreciosLP' => '<br> - Líneas de presupuesto',
|
||||||
'actualizacionPreciosServicios' => '<br> - Servicios',
|
'actualizacionPreciosServicios' => '<br> - Servicios',
|
||||||
'actualizacionPreciosEnvios' => '<br> - Precio envíos',
|
'actualizacionPreciosEnvios' => '<br> - Precio envíos',
|
||||||
|
|
||||||
|
'actualizacionSolapasCubierta' => 'El tamaño de las solapas de la cubierta se ha actualizado debido a que supera el máximo permitido (este valor depende del ancho del libro y del número de páginas).',
|
||||||
|
'actualizacionSolapasSobrecubierta' => 'El tamaño de las solapas de la sobrecubierta se ha actualizado debido a que supera el máximo permitido (este valor depende del ancho del libro y del número de páginas).',
|
||||||
|
|
||||||
|
|
||||||
'validation' => [
|
'validation' => [
|
||||||
|
|||||||
@ -81,6 +81,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_id'=> $tarifa['tarifa_id'],
|
'tarifa_id'=> $tarifa['tarifa_id'],
|
||||||
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
||||||
'precio_unidad'=> $result_data[0],
|
'precio_unidad'=> $result_data[0],
|
||||||
|
'tiempo' => $tiempo,
|
||||||
'total'=> $result_data[1],
|
'total'=> $result_data[1],
|
||||||
'margen' => $result_data[2],
|
'margen' => $result_data[2],
|
||||||
'proveedor' => $tarifa_proveedor->proveedor_nombre,
|
'proveedor' => $tarifa_proveedor->proveedor_nombre,
|
||||||
@ -107,6 +108,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_nombre'=> $tarifa['tarifa_nombre'],
|
'tarifa_nombre'=> $tarifa['tarifa_nombre'],
|
||||||
'proveedor' => lang('Presupuestos.no_disponible'),
|
'proveedor' => lang('Presupuestos.no_disponible'),
|
||||||
'precio_unidad'=> 0,
|
'precio_unidad'=> 0,
|
||||||
|
'tiempo' => null,
|
||||||
'total'=> 0,
|
'total'=> 0,
|
||||||
'margen' => 0,
|
'margen' => 0,
|
||||||
]);
|
]);
|
||||||
@ -123,6 +125,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_id'=> $tarifa_proveedor->tarifa_enc_id,
|
'tarifa_id'=> $tarifa_proveedor->tarifa_enc_id,
|
||||||
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
||||||
'precio_unidad'=> $result_data[0],
|
'precio_unidad'=> $result_data[0],
|
||||||
|
'tiempo' => null,
|
||||||
'total'=> $result_data[1],
|
'total'=> $result_data[1],
|
||||||
'margen'=> $result_data[2],
|
'margen'=> $result_data[2],
|
||||||
'proveedor' => $tarifa_proveedor->proveedor_nombre,
|
'proveedor' => $tarifa_proveedor->proveedor_nombre,
|
||||||
@ -147,6 +150,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_nombre'=> $tarifa['tarifa_nombre'],
|
'tarifa_nombre'=> $tarifa['tarifa_nombre'],
|
||||||
'proveedor' => lang('Presupuestos.no_disponible'),
|
'proveedor' => lang('Presupuestos.no_disponible'),
|
||||||
'precio_unidad'=> 0,
|
'precio_unidad'=> 0,
|
||||||
|
'tiempo' => null,
|
||||||
'total'=> 0,
|
'total'=> 0,
|
||||||
'margen' => 0,
|
'margen' => 0,
|
||||||
]);
|
]);
|
||||||
@ -201,6 +205,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_id'=> $tarifa->tarifa_enc_id,
|
'tarifa_id'=> $tarifa->tarifa_enc_id,
|
||||||
'tarifa_nombre'=> $tarifa->tarifa_enc_nombre,
|
'tarifa_nombre'=> $tarifa->tarifa_enc_nombre,
|
||||||
'precio_unidad'=> $result_data[0],
|
'precio_unidad'=> $result_data[0],
|
||||||
|
'tiempo' => null,
|
||||||
'total'=> $result_data[1],
|
'total'=> $result_data[1],
|
||||||
'margen'=> $result_data[2],
|
'margen'=> $result_data[2],
|
||||||
'proveedor' => $tarifa->proveedor_nombre,
|
'proveedor' => $tarifa->proveedor_nombre,
|
||||||
@ -223,6 +228,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_nombre'=> $modelTarifa->getNombreTarifaEncuadernacion($tarifa_encuadernacion_id)[0]->nombre,
|
'tarifa_nombre'=> $modelTarifa->getNombreTarifaEncuadernacion($tarifa_encuadernacion_id)[0]->nombre,
|
||||||
'proveedor' => lang('Presupuestos.no_disponible'),
|
'proveedor' => lang('Presupuestos.no_disponible'),
|
||||||
'precio_unidad'=> 0,
|
'precio_unidad'=> 0,
|
||||||
|
'tiempo' => null,
|
||||||
'total'=> 0,
|
'total'=> 0,
|
||||||
'margen'=> 0,
|
'margen'=> 0,
|
||||||
];
|
];
|
||||||
@ -256,6 +262,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_id'=> $tarifa_proveedor->tarifa_enc_id,
|
'tarifa_id'=> $tarifa_proveedor->tarifa_enc_id,
|
||||||
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
'tarifa_nombre'=> $tarifa_proveedor->tarifa_enc_nombre,
|
||||||
'precio_unidad'=> $result_data[0],
|
'precio_unidad'=> $result_data[0],
|
||||||
|
'tiempo' => $tiempo,
|
||||||
'total'=> $result_data[1],
|
'total'=> $result_data[1],
|
||||||
'margen' => $result_data[2],
|
'margen' => $result_data[2],
|
||||||
'proveedor' => $tarifa_proveedor->proveedor_nombre,
|
'proveedor' => $tarifa_proveedor->proveedor_nombre,
|
||||||
@ -279,12 +286,12 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
'tarifa_nombre'=> $modelTarifa->getNombreTarifaEncuadernacion($tarifa_encuadernacion_id)[0]->nombre,
|
'tarifa_nombre'=> $modelTarifa->getNombreTarifaEncuadernacion($tarifa_encuadernacion_id)[0]->nombre,
|
||||||
'proveedor' => lang('Presupuestos.no_disponible'),
|
'proveedor' => lang('Presupuestos.no_disponible'),
|
||||||
'precio_unidad'=> 0,
|
'precio_unidad'=> 0,
|
||||||
|
'tiempo' => null,
|
||||||
'total'=> 0,
|
'total'=> 0,
|
||||||
'margen' => 0,
|
'margen' => 0,
|
||||||
];
|
];
|
||||||
return $ret_array;
|
return $ret_array;
|
||||||
}
|
}
|
||||||
return [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -355,6 +362,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
->where('tarifa_encuadernado_id', $tarifa->tarifa_id)
|
->where('tarifa_encuadernado_id', $tarifa->tarifa_id)
|
||||||
->set('proveedor_id', $proveedor)
|
->set('proveedor_id', $proveedor)
|
||||||
->set('precio_unidad', $tarifa->precio_unidad)
|
->set('precio_unidad', $tarifa->precio_unidad)
|
||||||
|
->set('tiempo', $tarifa->tiempo)
|
||||||
->set('precio_total', $tarifa->precio_total)
|
->set('precio_total', $tarifa->precio_total)
|
||||||
->set('margen', $tarifa->margen)
|
->set('margen', $tarifa->margen)
|
||||||
->update();
|
->update();
|
||||||
@ -368,6 +376,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
->set('tarifa_encuadernado_id', $tarifa->tarifa_id)
|
->set('tarifa_encuadernado_id', $tarifa->tarifa_id)
|
||||||
->set('proveedor_id', $proveedor, false)
|
->set('proveedor_id', $proveedor, false)
|
||||||
->set('precio_unidad', $tarifa->precio_unidad)
|
->set('precio_unidad', $tarifa->precio_unidad)
|
||||||
|
->set('tiempo', $tarifa->tiempo)
|
||||||
->set('precio_total', $tarifa->precio_total)
|
->set('precio_total', $tarifa->precio_total)
|
||||||
->set('margen', $tarifa->margen)
|
->set('margen', $tarifa->margen)
|
||||||
->insert();
|
->insert();
|
||||||
@ -387,7 +396,7 @@ class PresupuestoEncuadernacionesModel extends \App\Models\GoBaseModel
|
|||||||
$builder = $this->db
|
$builder = $this->db
|
||||||
->table($this->table . " t1")
|
->table($this->table . " t1")
|
||||||
->select(
|
->select(
|
||||||
"t1.id AS id, t1.tarifa_encuadernado_id AS tarifa_encuadernado_id, t1.precio_unidad AS precio_unidad,
|
"t1.id AS id, t1.tarifa_encuadernado_id AS tarifa_encuadernado_id, t1.precio_unidad AS precio_unidad, t1.tiempo AS tiempo,
|
||||||
t1.precio_total AS precio_total, t1.margen AS margen, t2.nombre AS nombre, t1.proveedor_id AS proveedor_id, t3.nombre AS proveedor"
|
t1.precio_total AS precio_total, t1.margen AS margen, t2.nombre AS nombre, t1.proveedor_id AS proveedor_id, t3.nombre AS proveedor"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -288,7 +288,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
|||||||
"t1.id AS id, t1.created_at AS fecha, t1.titulo AS titulo, t1.autor AS autor, t1.ferro AS ferro,
|
"t1.id AS id, t1.created_at AS fecha, t1.titulo AS titulo, t1.autor AS autor, t1.ferro AS ferro,
|
||||||
t1.ferro_digital AS ferro_digital, t1.prototipo AS prototipo, t1.solapas AS solapas, t1.solapas_sobrecubierta AS solapas_sobrecubierta,
|
t1.ferro_digital AS ferro_digital, t1.prototipo AS prototipo, t1.solapas AS solapas, t1.solapas_sobrecubierta AS solapas_sobrecubierta,
|
||||||
t1.lomo_cubierta AS lomo_cubierta, t1.lomo_sobrecubierta AS lomo_sobrecubierta,
|
t1.lomo_cubierta AS lomo_cubierta, t1.lomo_sobrecubierta AS lomo_sobrecubierta,
|
||||||
t1.solapas_ancho AS solapas_ancho, t1.solapas_ancho_sobrecubierta AS solapas_ancho_sobrecubierta, t1.paginas AS paginas, t1.tirada AS tirada, t1.coleccion AS coleccion,
|
t1.solapas_ancho AS solapas_ancho, t1.solapas_sobrecubierta_ancho AS solapas_sobrecubierta_ancho, t1.paginas AS paginas, t1.tirada AS tirada, t1.coleccion AS coleccion,
|
||||||
t1.retractilado AS retractilado, t1.guardas AS guardas, t1.marcapaginas AS marcapaginas,
|
t1.retractilado AS retractilado, t1.guardas AS guardas, t1.marcapaginas AS marcapaginas,
|
||||||
t1.comentarios_pdf AS comentarios_pdf, t1.tirada_alternativa_json_data AS tiradas_alternativas,
|
t1.comentarios_pdf AS comentarios_pdf, t1.tirada_alternativa_json_data AS tiradas_alternativas,
|
||||||
t1.total_presupuesto AS total_presupuesto, t1.total_precio_unidad AS total_precio_unidad,
|
t1.total_presupuesto AS total_presupuesto, t1.total_precio_unidad AS total_precio_unidad,
|
||||||
|
|||||||
@ -1469,15 +1469,18 @@ class PresupuestoService extends BaseService
|
|||||||
// Si el presupuesto no es duplicado, se comprueba que
|
// Si el presupuesto no es duplicado, se comprueba que
|
||||||
// no ha cambiado el precio unidad
|
// no ha cambiado el precio unidad
|
||||||
if(round($nueva_tarifa[0]->precio_unidad, 2) != $servicio->precio_unidad ||
|
if(round($nueva_tarifa[0]->precio_unidad, 2) != $servicio->precio_unidad ||
|
||||||
$nueva_tarifa[0]->margen != $servicio->margen){
|
$nueva_tarifa[0]->margen != $servicio->margen ||
|
||||||
|
$nueva_tarifa[0]->tiempo != $servicio->tiempo){
|
||||||
|
|
||||||
$servicio->precio_unidad = round($nueva_tarifa[0]->precio_unidad, 2);
|
$servicio->precio_unidad = round($nueva_tarifa[0]->precio_unidad, 2);
|
||||||
|
$servicio->tiempo = round($nueva_tarifa[0]->tiempo, 2);
|
||||||
$servicio->precio_total = round($nueva_tarifa[0]->total, 2);
|
$servicio->precio_total = round($nueva_tarifa[0]->total, 2);
|
||||||
$servicio->margen = round($nueva_tarifa[0]->margen);
|
$servicio->margen = round($nueva_tarifa[0]->margen);
|
||||||
$cambio = true;
|
$cambio = true;
|
||||||
}
|
}
|
||||||
else if($input_data['is_duplicado'] && $nueva_tarifa[0]->proveedor_id != $servicio->proveedor_id){
|
else if($input_data['is_duplicado'] && $nueva_tarifa[0]->proveedor_id != $servicio->proveedor_id){
|
||||||
$servicio->precio_unidad = round($nueva_tarifa[0]->precio_unidad, 2);
|
$servicio->precio_unidad = round($nueva_tarifa[0]->precio_unidad, 2);
|
||||||
|
$servicio->tiempo = round($nueva_tarifa[0]->tiempo, 2);
|
||||||
$servicio->precio_total = round($nueva_tarifa[0]->total, 2);
|
$servicio->precio_total = round($nueva_tarifa[0]->total, 2);
|
||||||
$servicio->margen = round($nueva_tarifa[0]->margen);
|
$servicio->margen = round($nueva_tarifa[0]->margen);
|
||||||
$servicio->proveedor = $nueva_tarifa[0]->proveedor;
|
$servicio->proveedor = $nueva_tarifa[0]->proveedor;
|
||||||
|
|||||||
@ -718,13 +718,6 @@ $(document).on('click', '.btn-remove', function(e) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// funcion para obtener el cliente id de la url
|
|
||||||
function getId(){
|
|
||||||
var url = window.location.href;
|
|
||||||
var parts = url.split("/");
|
|
||||||
return parts[parts.length-1];
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
@ -775,11 +768,11 @@ function getId(){
|
|||||||
|
|
||||||
editor.on( 'preSubmit', function ( e, d, type ) {
|
editor.on( 'preSubmit', function ( e, d, type ) {
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['cliente_id'] = getId();
|
d.data[0]['cliente_id'] = id;
|
||||||
}
|
}
|
||||||
else if(type === 'edit' ) {
|
else if(type === 'edit' ) {
|
||||||
for (v in d.data){
|
for (v in d.data){
|
||||||
d.data[v]['cliente_id'] = getId();
|
d.data[v]['cliente_id'] = id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -855,7 +848,7 @@ function getId(){
|
|||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfClienteContactos') ?>',
|
url: '<?= route_to('dataTableOfClienteContactos') ?>',
|
||||||
data: {
|
data: {
|
||||||
id_cliente: getId(),
|
id_cliente: id,
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
@ -1019,11 +1012,11 @@ function getId(){
|
|||||||
|
|
||||||
editorPrecios.on( 'preSubmit', function ( e, d, type ) {
|
editorPrecios.on( 'preSubmit', function ( e, d, type ) {
|
||||||
if ( type === 'create'){
|
if ( type === 'create'){
|
||||||
d.data[0]['cliente_id'] = getId();
|
d.data[0]['cliente_id'] = id;
|
||||||
}
|
}
|
||||||
else if(type === 'edit' ) {
|
else if(type === 'edit' ) {
|
||||||
for (v in d.data){
|
for (v in d.data){
|
||||||
d.data[v]['cliente_id'] = getId();
|
d.data[v]['cliente_id'] = id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1083,7 +1076,7 @@ function getId(){
|
|||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfClienteprecios') ?>',
|
url: '<?= route_to('dataTableOfClienteprecios') ?>',
|
||||||
data: {
|
data: {
|
||||||
cliente_id: getId(),
|
cliente_id: id,
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
@ -1373,7 +1366,7 @@ var tableDirecciones = $('#tableOfDireccionesEnvio').DataTable( {
|
|||||||
ajax : $.fn.dataTable.pipeline( {
|
ajax : $.fn.dataTable.pipeline( {
|
||||||
url: '<?= route_to('dataTableOfClienteDirecciones') ?>',
|
url: '<?= route_to('dataTableOfClienteDirecciones') ?>',
|
||||||
data: function ( d ) {
|
data: function ( d ) {
|
||||||
d.cliente_id = getId();
|
d.cliente_id = id;
|
||||||
},
|
},
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
headers: {'X-Requested-With': 'XMLHttpRequest'},
|
||||||
@ -1468,7 +1461,7 @@ function delete_direccion_envio(dataId){
|
|||||||
<?=$this->section('css') ?>
|
<?=$this->section('css') ?>
|
||||||
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">
|
<link rel="stylesheet" href="<?= site_url('themes/vuexy/css/datatables-editor/editor.bootstrap5.min.css') ?>">
|
||||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-sk/plugins/buttons/buttons.bootstrap5.min.css") ?>">
|
||||||
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/datatables.bootstrap5.css") ?>">
|
<link rel="stylesheet" href="<?= site_url("/themes/vuexy/vendor/libs/datatables-bs5/dataTables.bootstrap5.min.css") ?>">
|
||||||
<?=$this->endSection() ?>
|
<?=$this->endSection() ?>
|
||||||
|
|
||||||
<?= $this->section('additionalExternalJs') ?>
|
<?= $this->section('additionalExternalJs') ?>
|
||||||
|
|||||||
@ -121,11 +121,6 @@ $('#tableOfPresupuestos thead tr:eq(1) th').each(function (i) {
|
|||||||
selector.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
|
selector.append('<option value="libroCosidoTapaDura"><?= lang('Presupuestos.libroCosidoTapaDura') ?></option>');
|
||||||
selector.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
|
selector.append('<option value="libroFresadoTapaBlanda"><?= lang('Presupuestos.libroFresadoTapaBlanda') ?></option>');
|
||||||
selector.append('<option value="libroFresadoTapaDura"><?= lang('Presupuestos.libroFresadoTapaDura') ?></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>');
|
|
||||||
|
|
||||||
selector.on('change', function () {
|
selector.on('change', function () {
|
||||||
var val = $.fn.dataTable.util.escapeRegex(
|
var val = $.fn.dataTable.util.escapeRegex(
|
||||||
@ -212,26 +207,6 @@ theTable = $('#tableOfPresupuestos').DataTable({
|
|||||||
return '<?= lang('Presupuestos.libroFresadoTapaDura') ?>';
|
return '<?= lang('Presupuestos.libroFresadoTapaDura') ?>';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "libroEspiralTapaDura":
|
|
||||||
return '<?= lang('Presupuestos.libroEspiralTapaDura') ?>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "libroEspiralTapaBlanda":
|
|
||||||
return '<?= lang('Presupuestos.libroEspiralTapaBlanda') ?>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "libroWireoTapaDura":
|
|
||||||
return '<?= lang('Presupuestos.libroWireoTapaDura') ?>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "libroWireoTapaBlanda":
|
|
||||||
return '<?= lang('Presupuestos.libroWireoTapaBlanda') ?>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "libroGrapado":
|
|
||||||
return '<?= lang('Presupuestos.libroGrapado') ?>';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return data; // Debug
|
return data; // Debug
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -39,41 +39,6 @@ $('#paginas').on("change", function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$('.solapas_cubierta').on('change', function(){
|
|
||||||
|
|
||||||
const ancho_libro = getDimensionLibro().ancho;
|
|
||||||
|
|
||||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
|
||||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
|
||||||
// solapas <= ancho_libro - 10
|
|
||||||
const limite_2 = ancho_libro - 10;
|
|
||||||
const limite = Math.min(limite_1, limite_2);
|
|
||||||
|
|
||||||
if(parseInt($('#solapas_ancho').val()) > limite){
|
|
||||||
$('#solapas_ancho').val(limite)
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#compGramajeCubierta').trigger('change')
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
$('.solapas_sobrecubierta').on('change', function(){
|
|
||||||
|
|
||||||
const ancho_libro = getDimensionLibro().ancho;
|
|
||||||
|
|
||||||
// ancho_libro*2 + lomo + solapas*2 <= 640
|
|
||||||
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
|
||||||
// solapas <= ancho_libro - 10
|
|
||||||
const limite_2 = ancho_libro - 10;
|
|
||||||
const limite = Math.min(limite_1, limite_2);
|
|
||||||
|
|
||||||
if(parseInt($('#solapas_ancho_sobrecubierta').val()) > limite){
|
|
||||||
$('#solapas_ancho_sobrecubierta').val(limite)
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#compGramajeSobrecubierta').trigger('change')
|
|
||||||
})
|
|
||||||
|
|
||||||
$('#tirada').on("change", function (update_tiradas_alternativas = true) {
|
$('#tirada').on("change", function (update_tiradas_alternativas = true) {
|
||||||
|
|
||||||
calcular_mermas()
|
calcular_mermas()
|
||||||
|
|||||||
@ -489,6 +489,7 @@ var tableServiciosEnc = new DataTable('#tableOfServiciosEncuadernacion',{
|
|||||||
language: {
|
language: {
|
||||||
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
url: "/themes/vuexy/vendor/libs/datatables-sk/plugins/i18n/es-ES.json"
|
||||||
},
|
},
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
tableServiciosEnc.on('draw', function(){
|
tableServiciosEnc.on('draw', function(){
|
||||||
@ -523,6 +524,7 @@ function init_servicio_encuadernado(){
|
|||||||
'</option>' +
|
'</option>' +
|
||||||
'</select>',
|
'</select>',
|
||||||
'<span id="precio_unidad_encuadernado_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
'<span id="precio_unidad_encuadernado_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.precio_unidad).toFixed(2) + '</span>',
|
||||||
|
'<span id="tiempo_encuadernado_' + element.tiempo + '">' + convertirTiempo(element.tiempo) + '</span>',
|
||||||
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + element.tarifa_encuadernado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + element.tarifa_encuadernado_id +'" value="' + parseFloat(element.precio_total).toFixed(2) + '"></input>',
|
||||||
'<span style="display: none;" class="update-totales" id="enc_margen_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.margen).toFixed(2) + '</span>',
|
'<span style="display: none;" class="update-totales" id="enc_margen_' + element.tarifa_encuadernado_id + '">' + parseFloat(element.margen).toFixed(2) + '</span>',
|
||||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_encuadernado_id +'"></i></a>'
|
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + element.tarifa_encuadernado_id +'"></i></a>'
|
||||||
@ -584,6 +586,21 @@ function init_servicio_encuadernado(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function convertirTiempo(horas){
|
||||||
|
if(horas != null){
|
||||||
|
|
||||||
|
const seconds = parseFloat(horas) * 3600;
|
||||||
|
// se convierte a formato hh:mm:ss
|
||||||
|
const h = Math.floor(seconds / 3600);
|
||||||
|
const minutos = Math.floor((seconds % 3600) / 60);
|
||||||
|
const segundos = seconds % 60;
|
||||||
|
return h + ':' + minutos + ':' + segundos;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function proveedor_enc_event(){
|
function proveedor_enc_event(){
|
||||||
const dimension = getDimensionLibro();
|
const dimension = getDimensionLibro();
|
||||||
if(parseInt($('#tirada').val())>0){
|
if(parseInt($('#tirada').val())>0){
|
||||||
@ -611,6 +628,7 @@ function proveedor_enc_event(){
|
|||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|
||||||
$('#precio_unidad_encuadernado_' + datos.tarifa_encuadernacion_id).text(parseFloat(data.values[0].precio_unidad).toFixed(2))
|
$('#precio_unidad_encuadernado_' + datos.tarifa_encuadernacion_id).text(parseFloat(data.values[0].precio_unidad).toFixed(2))
|
||||||
|
$('#tiempo_encuadernado_' + datos.tarifa_encuadernacion_id).text(convertirTiempo(data.values[0].tiempo))
|
||||||
$('#precio_total_encuadernado_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].total).toFixed(2))
|
$('#precio_total_encuadernado_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].total).toFixed(2))
|
||||||
$('#enc_margen_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].margen).toFixed(2))
|
$('#enc_margen_' + datos.tarifa_encuadernacion_id).val(parseFloat(data.values[0].margen).toFixed(2))
|
||||||
|
|
||||||
@ -694,6 +712,7 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
|
|||||||
'</option>' +
|
'</option>' +
|
||||||
'</select>',
|
'</select>',
|
||||||
'<span id="precio_unidad_encuadernado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
'<span id="precio_unidad_encuadernado_' + row.tarifa_id + '">' + parseFloat(row.precio_unidad).toFixed(2) + '</span>',
|
||||||
|
'<span id="tiempo_encuadernado_' + row.tiempo + '">' + convertirTiempo(row.tiempo) + '</span>',
|
||||||
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
'<input class="update-totales-servicios" id="precio_total_encuadernado_' + row.tarifa_id +'" value="' + parseFloat(row.total).toFixed(2) + '"></input>',
|
||||||
'<span style="display: none;" class="update-totales" id="enc_margen_' + row.tarifa_id + '">' + parseFloat(row.margen).toFixed(2) + '</span>',
|
'<span style="display: none;" class="update-totales" id="enc_margen_' + row.tarifa_id + '">' + parseFloat(row.margen).toFixed(2) + '</span>',
|
||||||
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'"></i></a>'
|
'<a href="javascript:void(0);"><i class="ti ti-trash ti-sm btn-delete-serv mx-2" data-id="' + row.tarifa_id +'"></i></a>'
|
||||||
@ -796,9 +815,15 @@ function get_datos_encuadernacion(){
|
|||||||
values['precio_unidad'] = $(this).text()
|
values['precio_unidad'] = $(this).text()
|
||||||
break
|
break
|
||||||
case 4:
|
case 4:
|
||||||
values['precio_total'] = $(this).children(":first").val()
|
values['tiempo'] = $(this).text()
|
||||||
|
// se pasa el string hh:mm:ss a horas
|
||||||
|
if(values['tiempo'] != null)
|
||||||
|
values['tiempo'] = parseInt(values['tiempo'].split(':')[0]) + parseInt(values['tiempo'].split(':')[1])/60 + parseInt(values['tiempo'].split(':')[2])/3600
|
||||||
break
|
break
|
||||||
case 5:
|
case 5:
|
||||||
|
values['precio_total'] = $(this).children(":first").val()
|
||||||
|
break
|
||||||
|
case 6:
|
||||||
values['margen'] = $(this).text()
|
values['margen'] = $(this).text()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|||||||
@ -167,6 +167,7 @@
|
|||||||
<th><?= lang('Presupuestos.tarifa') ?></th>
|
<th><?= lang('Presupuestos.tarifa') ?></th>
|
||||||
<th><?= lang('Proveedores.proveedor') ?></th>
|
<th><?= lang('Proveedores.proveedor') ?></th>
|
||||||
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
<th><?= lang('Presupuestos.precioUnidad') ?></th>
|
||||||
|
<th><?= lang('Presupuestos.tiempo') ?></th>
|
||||||
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
<th><?= lang('Presupuestos.precioTotal') ?></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
<th class="text-nowrap"><?= lang('Basic.global.Action') ?></th>
|
||||||
@ -311,5 +312,48 @@
|
|||||||
init_servicio_preimpresion()
|
init_servicio_preimpresion()
|
||||||
|
|
||||||
init_servicio_extra()
|
init_servicio_extra()
|
||||||
|
|
||||||
|
$('.solapas_cubierta').on('change', function(){
|
||||||
|
|
||||||
|
const ancho_libro = getDimensionLibro().ancho;
|
||||||
|
|
||||||
|
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||||
|
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||||
|
// solapas <= ancho_libro - 10
|
||||||
|
const limite_2 = ancho_libro - 10;
|
||||||
|
const limite = Math.min(limite_1, limite_2);
|
||||||
|
|
||||||
|
if(parseInt($('#solapas_ancho').val()) > limite){
|
||||||
|
$('#solapas_ancho').val(limite)
|
||||||
|
asyncMessageDialog(
|
||||||
|
window.Presupuestos.advertencia,
|
||||||
|
window.Presupuestos.actualizacionSolapasCubierta,
|
||||||
|
function(){});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#compGramajeCubierta').trigger('change')
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$('.solapas_sobrecubierta').on('change', function(){
|
||||||
|
|
||||||
|
const ancho_libro = getDimensionLibro().ancho;
|
||||||
|
|
||||||
|
// ancho_libro*2 + lomo + solapas*2 <= 640
|
||||||
|
const limite_1 = ((640 - ancho_libro*2 - getLomoLineasPresupuesto()) / 2.0).toFixed(1);
|
||||||
|
// solapas <= ancho_libro - 10
|
||||||
|
const limite_2 = ancho_libro - 10;
|
||||||
|
const limite = Math.min(limite_1, limite_2);
|
||||||
|
|
||||||
|
if(parseInt($('#solapas_ancho_sobrecubierta').val()) > limite){
|
||||||
|
$('#solapas_ancho_sobrecubierta').val(limite)
|
||||||
|
asyncMessageDialog(
|
||||||
|
window.Presupuestos.advertencia,
|
||||||
|
window.Presupuestos.actualizacionSolapasSobrecubierta,
|
||||||
|
function(){});
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#compGramajeSobrecubierta').trigger('change')
|
||||||
|
})
|
||||||
|
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
|
|||||||
@ -134,19 +134,6 @@ if (!empty($token) && $tfa == false) {
|
|||||||
</li>
|
</li>
|
||||||
<!--/ Notification -->
|
<!--/ Notification -->
|
||||||
|
|
||||||
<!-- Search Budgets -->
|
|
||||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
|
||||||
<a
|
|
||||||
class="nav-link hide-arrow"
|
|
||||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
|
||||||
title="Acceso directo a buscador de presupuestos"
|
|
||||||
>
|
|
||||||
<i class="ti ti-report-search ti-md"></i>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!--/ Search Budgets -->
|
|
||||||
|
|
||||||
<!-- View Mode links -->
|
<!-- View Mode links -->
|
||||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||||
<a
|
<a
|
||||||
|
|||||||
@ -140,19 +140,6 @@ if (!empty($token) && $tfa == false) {
|
|||||||
</li>
|
</li>
|
||||||
<!--/ Notification -->
|
<!--/ Notification -->
|
||||||
|
|
||||||
<!-- Search Budgets -->
|
|
||||||
<li class="nav-item navbar-dropdown dropdown me-3 me-xl-1">
|
|
||||||
<a
|
|
||||||
class="nav-link hide-arrow"
|
|
||||||
href="<?= site_url('presupuestos/buscador'); ?>"
|
|
||||||
title="Acceso directo a buscador de presupuestos"
|
|
||||||
>
|
|
||||||
<i class="ti ti-report-search ti-md"></i>
|
|
||||||
|
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<!--/ Search Budgets -->
|
|
||||||
|
|
||||||
<!-- View Mode links -->
|
<!-- View Mode links -->
|
||||||
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
<li class="nav-item dropdown-shortcuts navbar-dropdown dropdown me-2 me-xl-0">
|
||||||
<a
|
<a
|
||||||
|
|||||||
Reference in New Issue
Block a user