diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/disenioLibro.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/disenioLibro.js
index c5dcd30e..31c46e6a 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/disenioLibro.js
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/disenioLibro.js
@@ -646,11 +646,18 @@ async function calcularPresupuesto() {
clienteId: $('#clienteId').val(),
servicios: servicios,
}
+
+ // Si es cosido, se añade el número de páginas del cuadernillo
+ if ($('#cosidoDiv').hasClass('checked')) {
+ datos.paginasCuadernillo = $('#paginasCuadernillo').val();
+ }
// Si hay solapas de cubierta
if ($('#solapasCubierta').is(':checked')) {
datos.solapasCubierta = $('#anchoSolapasCubierta').val()
}
+
+
// Si hay sobrecubierta
if ($('#enableSobrecubierta').is(':checked')) {
if($('#papelSobrecubierta option:selected').val()>0 && $('#gramajeSobrecubierta option:selected').val()>0){
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/resumen.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/resumen.js
index d9350ae2..956eb8fa 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/resumen.js
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/resumen.js
@@ -218,6 +218,12 @@ function finalizarPresupuesto(confirmar){
clienteId: $('#clienteId').val(),
servicios: servicios,
};
+
+ // Si es cosido, se añade el número de páginas del cuadernillo
+ if ($('#cosidoDiv').hasClass('checked')) {
+ datos_libro.paginasCuadernillo = $('#paginasCuadernillo').val();
+ }
+
// Si hay solapas de cubierta
if ($('#solapasCubierta').is(':checked')) {
datos_libro.solapasCubierta = $('#anchoSolapasCubierta').val()
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/tipoLibroItems.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/tipoLibroItems.js
index d345dbdb..11ee90da 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/tipoLibroItems.js
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cliente/tipoLibroItems.js
@@ -33,6 +33,12 @@ function updateTipoLibroCheck(el)
else {
$('#tapaDuraDiv').show();
}
+ if(el.closest('.custom-option-tipo').id == 'cosidoDiv') {
+ $('#div_pagCuadernillo').show();
+ }
+ else {
+ $('#div_pagCuadernillo').hide();
+ }
} else {
el.closest('.custom-option-tipo').classList.remove('checked')
}
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.js b/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.js
index 43087a11..9ecd91ec 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.js
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.js
@@ -518,7 +518,7 @@ function init_servicio_encuadernado(){
const tarifa_id = element.tarifa_encuadernado_id
var proveedor_nombre = element.proveedor===null? window.Presupuestos.no_disponible: element.proveedor
- tableServiciosEnc.row.add([
+ var linea = [
element.tarifa_encuadernado_id,
element.nombre,
'
',
'
' + parseFloat(element.precio_unidad).toFixed(2) + '',
- '
' + convertirTiempo(element.tiempo) + '',
+ (element.hasOwnProperty('paginas_por_cuadernillo') && element.paginas_por_cuadernillo!=null)?selectForCuadernillos(element.tarifa_encuadernado_id, element.paginas_por_cuadernillo):'',
+ '
' + convertirTiempo(element.tiempo) + '',
'
',
'
' + parseFloat(element.margen).toFixed(2) + '',
'
'
- ]).draw(false)
+ ]
+
+ tableServiciosEnc.row.add(linea).draw(false)
$('#precio_total_encuadernado_' + element.tarifa_encuadernado_id).on('change', function(){
updatePresupuesto({
@@ -583,14 +586,40 @@ function init_servicio_encuadernado(){
cache: true
}
});
- $('#proveedor_enc_' + element.tarifa_encuadernado_id).on('change', proveedor_enc_event)
+ $('#proveedor_enc_' + element.tarifa_encuadernado_id).on('change', select_enc_event)
+
+ if(element.hasOwnProperty('paginas_por_cuadernillo') && element.paginas_por_cuadernillo!=null){
+
+ $('#cuadernillos_' + element.tarifa_encuadernado_id).select2({
+ allowClear: false,
+ minimumResultsForSearch: -1,
+ });
+
+ $('#cuadernillos_' + element.tarifa_encuadernado_id).on('change', select_enc_event)
+ }
+
});
check_serv_enc_error()
}
+function selectForCuadernillos(tarifa_id, select_value){
+ const value_list = [32, 28, 24, 20, 16];
+ var string =
+ '
';
+ return string;
+}
+
function convertirTiempo(horas){
- if(horas != null && horas.length>0){
+ if(horas != null){
if(parseFloat(horas)>0){
const seconds = parseFloat(horas) * 3600;
// se convierte a formato hh:mm:ss
@@ -598,32 +627,49 @@ function convertirTiempo(horas){
const minutos = Math.floor((seconds % 3600) / 60);
const segundos = seconds % 60;
return h + ':' + minutos + ':' + segundos;
- }
+ }
else{
return "";
}
+
}
else{
return "";
}
}
-function proveedor_enc_event(){
+function select_enc_event(){
+
const dimension = getDimensionLibro();
+
if(parseInt($('#tirada').val())>0){
- var tirada = parseInt($('#tirada').val())
+ var tirada = parseInt($('#tirada').val()) + parseInt($('#merma').val())
}
else{
var tirada = 0
}
+ var tarifa_id = null;
+ if(this.id.includes('proveedor_enc')){
+ tarifa_id = this.id.split('_')[2];
+ }
+ else{
+ tarifa_id = this.id.split('_')[1];
+ }
+ // se checkea si el elemento #cuadernillos_ + tarifa_id existe
+ var paginas_por_cuadernillo = null;
+ if($('#cuadernillos_' + tarifa_id).length){
+ paginas_por_cuadernillo = parseInt($('#cuadernillos_' + tarifa_id).select2('data')[0].id);
+ }
+
var datos = {
- tarifa_encuadernacion_id: this.id.split('_')[2],
+ tarifa_encuadernacion_id: tarifa_id,
paginas: parseInt($('#paginas').val())>0?parseInt($('#paginas').val()):0,
tirada: tirada,
ancho: dimension.ancho,
alto: dimension.alto,
- proveedor_id: parseInt($('#' + this.id).select2('data')[0].id),
+ paginas_por_cuadernillo: paginas_por_cuadernillo,
+ proveedor_id: parseInt($('#proveedor_enc_' + tarifa_id).select2('data')[0].id),
POD: parseInt($('#POD').val())
};
datos = Object.assign(datos, window.token_ajax);
@@ -677,7 +723,7 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
const dimension = getDimensionLibro();
if(parseInt($('#tirada').val())>0){
- var tirada = parseInt($('#tirada').val())
+ var tirada = parseInt($('#tirada').val()) + parseInt($('#merma').val())
}
else{
var tirada = 0
@@ -719,7 +765,8 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
'' +
'',
'
' + parseFloat(row.precio_unidad).toFixed(2) + '',
- '
' + convertirTiempo(row.tiempo) + '',
+ (row.hasOwnProperty('paginas_por_cuadernillo') && row.paginas_por_cuadernillo!=null)?selectForCuadernillos(row.tarifa_id, 32):'',
+ '
' + convertirTiempo(row.tiempo) + '',
'
',
'
' + parseFloat(row.margen).toFixed(2) + '',
'
'
@@ -745,7 +792,7 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
data: function (params) {
if( parseInt( $('#tirada').val() )>0){
- var tirada = parseInt($('#tirada').val())
+ var tirada = parseInt($('#tirada').val()) + parseInt($('#merma').val())
}
else{
var tirada = 0
@@ -755,8 +802,8 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
tarifa_id: row.tarifa_id,
paginas: parseInt($('#paginas').val())>0?parseInt($('#paginas').val()):0,
tirada: tirada,
- ancho: ancho_libro,
- alto: alto_libro,
+ ancho: dimension.ancho,
+ alto: dimension.alto,
searchtxt: params.term, // search term
}
return_data = Object.assign(return_data, window.token_ajax);
@@ -773,9 +820,17 @@ async function get_tarifas_enc(tipo=null, tarifa_id = -1){
}
});
- $('#proveedor_enc_' + row.tarifa_id).on('change', proveedor_enc_event)
-
+ $('#proveedor_enc_' + row.tarifa_id).on('change', select_enc_event)
+
+ if(row.hasOwnProperty('paginas_por_cuadernillo') && row.paginas_por_cuadernillo!=null){
+ $('#cuadernillos_' + row.tarifa_id).select2({
+ allowClear: false,
+ minimumResultsForSearch: -1,
+ });
+
+ $('#cuadernillos_' + row.tarifa_id).on('change', select_enc_event)
+ }
});
check_serv_enc_error()
yeniden(data[window.csrf_token]);
@@ -821,16 +876,21 @@ function get_datos_encuadernacion(){
case 3:
values['precio_unidad'] = $(this).text()
break
- case 4:
+ case 4:
+ values['paginas_por_cuadernillo'] = $(this).children(":first").val()
+ // Si el valor es "undefined" se pone a null
+ if(values['paginas_por_cuadernillo'] == "undefined")
+ values['paginas_por_cuadernillo'] = null
+ case 5:
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
- case 5:
+ case 6:
values['precio_total'] = $(this).children(":first").val()
break
- case 6:
+ case 7:
values['margen'] = $(this).text()
break
}
@@ -1709,7 +1769,7 @@ async function actualizar_servicios(update_preimpresion=false){
$('#precio_unidad_encuadernado_' + line[0].tarifa_id).text(parseFloat(line[0].precio_unidad).toFixed(2))
$('#precio_total_encuadernado_' + line[0].tarifa_id).val(parseFloat(line[0].total).toFixed(2))
$('#enc_margen_' + line[0].tarifa_id).val(parseFloat(line[0].margen).toFixed(2))
- $('#proveedor_enc_' + line[0].tarifa_id).on('change', proveedor_enc_event)
+ $('#proveedor_enc_' + line[0].tarifa_id).on('change', select_enc_event)
});
check_serv_enc_error()
yeniden(data[window.csrf_token]);
diff --git a/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php b/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
index 09eb3fef..498fd0eb 100644
--- a/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
+++ b/ci4/app/Views/themes/vuexy/form/presupuestos/cosidotapablanda/_datosServiciosItems.php
@@ -167,6 +167,7 @@
= lang('Presupuestos.tarifa') ?> |
= lang('Proveedores.proveedor') ?> |
= lang('Presupuestos.precioUnidad') ?> |
+
= lang('Presupuestos.paginasCuadernillo') ?> |
= lang('Presupuestos.tiempo') ?> |
= lang('Presupuestos.precioTotal') ?> |
|
diff --git a/ci4/app/Views/themes/vuexy/pdfs/factura.php b/ci4/app/Views/themes/vuexy/pdfs/factura.php
new file mode 100644
index 00000000..55a05982
--- /dev/null
+++ b/ci4/app/Views/themes/vuexy/pdfs/factura.php
@@ -0,0 +1,193 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
+ | FACTURA Nº: |
+ = ($factura->estado == 'draft') ? 'BORRADOR' : $factura->numero ?> |
+ FECHA: |
+ = $factura->fecha_factura_at ?> |
+
+
+
+
+ | Dirección: |
+
+
+ | Persona de contacto: |
+ = $factura->cliente_direccion ?> |
+
+
+ | Razón social: = $factura->cliente ?>
+ |
+ = $factura->cliente_cp ?>
+ , = $factura->cliente_ciudad ?> |
+
+
+ | CIF: = $factura->cliente_cif ?> |
+ = $factura->cliente_pais ?> |
+
+
+
+
+
+
+
+
+ | Tipo y Nombre del trabajo |
+ Uds. |
+ Precio |
+ IVA |
+ Subtotal |
+
+
+
+
+ precio_unidad > 0): ?>
+
+ |
+ = nl2br($linea->descripcion); ?>
+ |
+
+ = ($linea->cantidad > 0) ? $linea->cantidad : '' ?>
+ |
+
+ = ($linea->cantidad > 0) ? $linea->precio_unidad : '' ?>
+ |
+
+ = ($linea->cantidad > 0) ? $linea->iva : '' ?>
+ |
+
+ = ($linea->cantidad > 0) ? $linea->base : '' ?>
+ |
+
+
+
+
+
+
+
+
+
+
+
+

+
+
+
+
+
+
+
+ | BASE |
+ IVA |
+ TOTAL |
+
+
+
+
+
+ | = $tipo_iva->base ?> € |
+ = $tipo_iva->iva ?> % |
+ = $tipo_iva->total_iva ?> € |
+ = $tipo_iva->total ?> € |
+
+
+
+
+
+
+
+ | TOTAL |
+ = $factura->total ?> € |
+
+
+
+
+
+
+
+ | Vencimiento |
+ Fecha |
+ Forma de pago |
+ BIC / IBAN |
+
+
+
+
+ | = $factura->dias_vencimiento ?> días |
+ = $factura->vencimiento ?> |
+ = $factura->forma_pago ?> |
+
+ = ($factura->forma_pago == "Transferencias") ? 'ES33 2100 1134 14 1300319844' : $factura->cliente_ccc ?>
+ |
+
+
+
+
+
+
+
+
+
diff --git a/httpdocs/themes/vuexy/css/pdf.factura.css b/httpdocs/themes/vuexy/css/pdf.factura.css
new file mode 100644
index 00000000..c34cddfa
--- /dev/null
+++ b/httpdocs/themes/vuexy/css/pdf.factura.css
@@ -0,0 +1,313 @@
+/* Facturas Safekat */
+
+* {
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Open Sans', sans-serif;
+ font-size: 14px;
+ line-height: 1.42857143;
+ color: #333;
+ background-color: #fff;
+}
+
+table {
+ border-spacing: 0;
+ background-color: transparent;
+ border-collapse: collapse;
+}
+
+th {
+ text-align: left;
+}
+
+td {
+ padding: 0;
+}
+
+body table.logo {
+ padding: 0;
+ width: 100%;
+ color: black;
+}
+
+body table.logo td.logo img {
+ width: 100%;
+ vertical-align: middle;
+}
+/* Estilos intro-factura */
+body table.intro-factura {
+ width: 100%;
+ font-size: 12px;
+ margin-top: -22px;
+}
+
+body table.intro-factura th {
+ background: black;
+ color: white;
+ padding: 7px;
+}
+
+body table.intro-factura th.intro_num_factura {
+ width: 20%;
+ padding-left: 15px;
+}
+
+body table.intro-factura th.num_factura {
+ width: 47%;
+ font-weight: lighter;
+ text-align: left;
+}
+
+body table.intro-factura th.intro_fecha {
+ width: 17%;
+ text-align: right;
+}
+
+body table.intro-factura th.fecha {
+ width: 15%;
+ text-align: right;
+ font-weight: lighter;
+}
+
+body table.intro-factura td {
+ background: #e3e4e7;
+ padding-left: 15px;
+ color: black;
+ font-size: 12px;
+}
+
+body table.intro-factura td.intro_direccion {
+ padding-top: 10px;
+ padding-right: 8px;
+ font-weight: bold;
+}
+
+body table.intro-factura td.direccion {
+ padding-right: 8px;
+}
+
+/* Estilos cuerpo factura */
+div.cuerpo-factura {
+ margin-bottom: 25px;
+}
+
+table.factura-data-superior {
+ width: 100%;
+}
+
+table.factura-data-superior th {
+ padding: 5px !important;
+ background: #0C2C84;
+ color: white;
+ padding-left: 10px;
+ font-weight: lighter;
+ font-size: 12px;
+ border-right: 1px solid white;
+}
+
+table.factura-data-superior td {
+ border: 1px dotted #4e4e4e;
+ border-top: none;
+ padding: 5px !important;
+ text-align: right;
+ font-size: 11px;
+}
+
+table.factura-data-superior td.tipo_trabajo {
+ border-left: none;
+ text-align: left;
+}
+
+table.factura-data-superior td.subtotal {
+ border-right: none;
+}
+
+/* Estilos para el sello de Solunion */
+.sello-solunion {
+ float: left; /* Hace que el sello flote a la izquierda */
+ margin-left: 100px; /* Espacio entre el sello y la tabla */
+}
+
+.sello-solunion img {
+ display: block; /* Asegura que la imagen se comporte como un bloque dentro del div */
+ width: 80px; /* Ajusta el tamaño de la imagen según sea necesario */
+ height: auto;
+}
+
+/* Contenedor para manejar el flujo de contenido */
+.container {
+ overflow: hidden; /* Asegura que el contenedor se ajuste al contenido flotante */
+}
+
+/* Estilos para la tabla de precios inferior */
+table.factura-precio-inferior {
+ width: 60%; /* Ajusta el ancho de la tabla al 100% del contenedor */
+ text-align: right;
+ border-collapse: collapse; /* Asegura que los bordes se colapsen para evitar espacio extra */
+ margin-bottom: 0; /* Elimina el margen inferior para evitar espacio extra */
+}
+
+table.factura-precio-inferior th, table.factura-precio-inferior td {
+ padding: 5px;
+ border-bottom: 1px dotted #4e4e4e;
+}
+
+table.factura-precio-inferior th.intro_base,
+table.factura-precio-inferior th.intro_iva,
+table.factura-precio-inferior th.intro_total {
+ background: #0C2C84;
+ color: white;
+ font-size: 12px;
+}
+
+table.factura-precio-inferior td.base,
+table.factura-precio-inferior td.iva,
+table.factura-precio-inferior td.value_iva,
+table.factura-precio-inferior td.total {
+ font-size: 11px;
+}
+
+/* Estilos para la tabla de totales */
+table.totales {
+ width: 28%; /* Ajusta el ancho de la tabla según sea necesario */
+ background: #0C2C84;
+ color: white;
+ font-size: 12px;
+ border-collapse: collapse; /* Asegura que los bordes se colapsen para evitar espacio extra */
+ margin-top: 0; /* Elimina el margen superior para evitar espacio extra */
+ margin-bottom: 0; /* Elimina el margen inferior para evitar espacio extra */
+}
+
+table.totales td.intro_total_factura {
+ width: 20%;
+ text-align: right;
+ padding: 5px;
+}
+
+table.totales td.total_factura {
+ width: 15%;
+ text-align: right;
+ padding-right: 10px;
+}
+
+
+/* Estilos factura-data-inferior-iva */
+table.factura-data-inferior-iva {
+ width: 100%;
+ margin-top: 8px;
+}
+
+table.factura-data-inferior-iva th {
+ padding: 5px !important;
+ background: rgb(233, 240, 255);
+ font-weight: lighter;
+ font-size: 12px;
+ padding-left: 7px;
+ color: black;
+ border-right: 1px solid white;
+}
+
+table.factura-data-inferior-iva th.intro_vencimiento,
+table.factura-data-inferior-iva th.inferior_intro_fecha {
+ width: 15%;
+}
+
+table.factura-data-inferior-iva th.intro_forma_pago {
+ width: 20%;
+}
+
+table.factura-data-inferior-iva th.intro_bic {
+ width: 50%;
+}
+
+table.factura-data-inferior-iva td {
+ border-bottom: 1px dotted #4e4e4e;
+ border-top: none;
+ padding-left: 8px;
+ padding: 3px !important;
+ font-size: 11px;
+}
+
+table.factura-data-inferior-iva td.vencimiento,
+table.factura-data-inferior-iva td.inferior_fecha,
+table.factura-data-inferior-iva td.forma_pago {
+ border-right: 1px dotted black;
+}
+
+/* Estilos factura-precio-inferior */
+table.factura-data-inferior {
+ width: 100%;
+ background: #e3e4e7;
+ font-size: 12px;
+ margin-top: 5px;
+}
+
+table.factura-data-inferior th {
+ padding-top: 2px;
+ font-weight: lighter;
+}
+
+table.factura-data-inferior th.intro_vencimiento,
+table.factura-data-inferior th.intro_base,
+table.factura-data-inferior th.base {
+ padding-top: 8px;
+}
+
+table.factura-data-inferior th.intro_vencimiento,
+table.factura-data-inferior th.inferior_intro_fecha,
+table.factura-data-inferior th.intro_forma_pago,
+table.factura-data-inferior th.intro_bic {
+ font-weight: bold;
+ padding-left: 10px;
+}
+
+table.factura-data-inferior th.intro_base,
+table.factura-data-inferior th.intro_value_iva,
+table.factura-data-inferior th.intro_iva,
+table.factura-data-inferior th.intro_total {
+ color: #0C2C84;
+ text-align: right;
+ padding-right: 5px;
+}
+
+table.factura-data-inferior th.base,
+table.factura-data-inferior th.iva,
+table.factura-data-inferior th.value_iva,
+table.factura-data-inferior th.total {
+ border-left: 1px dashed grey;
+ text-align: right;
+ padding-right: 10px;
+ width: 15%;
+}
+
+table.factura-data-inferior th.intro_bic,
+table.factura-data-inferior th.intro_total,
+table.factura-data-inferior th.total {
+ padding-bottom: 8px;
+}
+
+/* Estilos para el pie de página */
+.footer {
+ width: 95%;
+ position: fixed; /* Fija el pie de página en la parte inferior */
+ bottom: 15px; /* Coloca el pie de página en la parte inferior de la página */
+}
+
+/* Estilos pie */
+div.pie {
+ font-family: sans-serif;
+ font-size: 7px;
+ margin: 5mm 0 5mm 0;
+}
+
+/* Estilos pie-pagina */
+table.pie-pagina {
+ font-family: sans-serif;
+ color: #0C2C84;
+ float: left;
+ vertical-align: bottom;
+ font-size: 10px;
+ font-weight: bold;
+}
\ No newline at end of file