diff --git a/ci4/app/Controllers/Pdf/PrintPresupuestos.php b/ci4/app/Controllers/Pdf/PrintPresupuestos.php index cb915961..4adca2a3 100755 --- a/ci4/app/Controllers/Pdf/PrintPresupuestos.php +++ b/ci4/app/Controllers/Pdf/PrintPresupuestos.php @@ -13,10 +13,12 @@ class PrintPresupuestos extends BaseController $presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel'); $lineasPresupuestoModel = model('App\Models\Presupuestos\PresupuestoLineaModel'); + $direccionesEnvioModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel'); $data['presupuesto'] = $presupuestoModel->getResourceForPdf($id_presupuesto)->get()->getRow(); $data['lp_ByN'] = $lineasPresupuestoModel->getResourceByNForPdf($id_presupuesto)->get()->getRow(); $data['lp_Color'] = $lineasPresupuestoModel->getResourceColorForPdf($id_presupuesto)->get()->getRow(); + $data['direccionesEnvio'] = $direccionesEnvioModel->getResourceForPdf($id_presupuesto)->get()->getResultObject(); return view(getenv('theme.path') . 'pdfs/presupuesto', $data); @@ -28,10 +30,13 @@ class PrintPresupuestos extends BaseController // Cargar modelos $presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel'); $lineasPresupuestoModel = model('App\Models\Presupuestos\PresupuestoLineaModel'); + $direccionesEnvioModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel'); + // Informacion del presupuesto $data['presupuesto'] = $presupuestoModel->getResourceForPdf($presupuesto_id)->get()->getRow(); $data['lp_ByN'] = $lineasPresupuestoModel->getResourceByNForPdf($presupuesto_id)->get()->getRow(); $data['lp_Color'] = $lineasPresupuestoModel->getResourceColorForPdf($presupuesto_id)->get()->getRow(); + $data['direccionesEnvio'] = $direccionesEnvioModel->getResourceForPdf($presupuesto_id)->get()->getResultObject(); // Crear una instancia de Dompdf $options = new \Dompdf\Options(); diff --git a/ci4/app/Models/Presupuestos/PresupuestoDireccionesModel.php b/ci4/app/Models/Presupuestos/PresupuestoDireccionesModel.php index 46d0cc76..b70c2a3a 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoDireccionesModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoDireccionesModel.php @@ -89,4 +89,28 @@ class PresupuestoDireccionesModel extends \App\Models\GoBaseModel ->orLike("t1.telefono", $search) ->groupEnd(); } + + /** + * Get resource data for pdf generation. + * + * @param int $presupuesto_id + * + * @return \CodeIgniter\Database\BaseBuilder + */ + public function getResourceForPdf($presupuesto_id = -1) + { + $builder = $this->db + ->table($this->table . " t1") + ->select( + "t1.direccion AS direccion, t2.nombre AS pais, + t1.municipio AS municipio, t1.provincia AS provincia, t1.cp AS cp, t1.telefono AS telefono, + t1.cantidad AS cantidad" + ); + + $builder->where('t1.presupuesto_id', $presupuesto_id); + $builder->join("lg_paises t2", "t1.pais_id = t2.id", "left"); + + return $builder; + } + } diff --git a/ci4/app/Models/Presupuestos/PresupuestoModel.php b/ci4/app/Models/Presupuestos/PresupuestoModel.php index f5fa27e5..3d55cff5 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoModel.php @@ -364,7 +364,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel t1.retractilado AS retractilado, t1.guardas AS guardas, t1.marcapaginas AS marcapaginas, t1.comentarios_pdf AS comentarios_pdf, t1.total_presupuesto AS total_presupuesto, t1.total_precio_unidad AS total_precio_unidad, - t1.papel_formato_personalizado AS isPersonalizado, + t1.papel_formato_personalizado AS isPersonalizado, t1.envios_recoge_cliente AS recoge_cliente, CONCAT(t1.papel_formato_ancho, 'x', t1.papel_formato_alto) AS formatoPersonalizado, t2.nombre AS cliente, CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t3.email AS email_comercial, diff --git a/ci4/app/Views/themes/backend/vuexy/pdfs/presupuesto.php b/ci4/app/Views/themes/backend/vuexy/pdfs/presupuesto.php index e27928cb..09ebaab6 100755 --- a/ci4/app/Views/themes/backend/vuexy/pdfs/presupuesto.php +++ b/ci4/app/Views/themes/backend/vuexy/pdfs/presupuesto.php @@ -91,7 +91,7 @@ Formato - isPersonalizado) ? $presupuesto->formatoPersonalizado : $presupuesto->formato) ?> mm + isPersonalizado) ? $presupuesto->formatoPersonalizado : $presupuesto->formato) ?> mm @@ -205,43 +205,55 @@ ENVÍO - + recoge_cliente == 1) { ?> El pedido será recogido por el cliente - + + - - - Ejemplares - - Dirección - - - - País - - Provincia - - C.P. - - Ciudad - - Telf. - - - - + + + Ejemplares + cantidad ?> + Dirección + direccion ?> + + + País + pais ?> + Provincia + provincia ?> + C.P. + cp ?> + Ciudad + municipio ?> + Telf. + telefono ?> + + + + + + + No hay definidos envíos + + + - +
- - @@ -252,8 +264,6 @@ - - @@ -265,33 +275,41 @@ +
Tirada U.Impresión 4% U.Envío 21%
tirada ?> uds. TBD € TBD €
Estos precios no incluyen I.V.A.
comentarios_pdf)) { ?> -
OBSERVACIONES
-
- comentarios_pdf); ?> +
+
OBSERVACIONES
+
+ comentarios_pdf); ?> +
- diff --git a/httpdocs/themes/vuexy/css/pdf.presupuesto.css b/httpdocs/themes/vuexy/css/pdf.presupuesto.css index 38796b7d..49121d35 100755 --- a/httpdocs/themes/vuexy/css/pdf.presupuesto.css +++ b/httpdocs/themes/vuexy/css/pdf.presupuesto.css @@ -270,7 +270,8 @@ body table.extras td.t { body table.envio { width: 100%; font-size: 11px; - margin-bottom: 9px; + margin-top: -2px; + margin-bottom: 5px; } body table.envio th { @@ -332,30 +333,25 @@ body table.envio td.t-first { } body table.totales { - width: 64%; + margin-left: auto; + margin-right: 0; + width: 75%; text-align: center; + } body table.totales th { - width: 12%; + width: 16%; font-weight: bold; - font-size: 12px; + font-size: 11px; text-align: center; color: white; background: #0C2C84; padding: 3px; } -body table.totales th.u_envio_21 { - width: 16%; -} - -body table.totales th.hidden { - background: none; -} - body table.totales td { - font-size: 12px; + font-size: 11px; font-weight: bold; text-align: center; border: 1px dotted #4e4e4e; @@ -364,30 +360,26 @@ body table.totales td { } body table.totales td.tirada { - width: 12%; border-left: none; } -body table.totales td.precio, -body table.totales td.u_impresion_4 { - width: 12%; +body table.totales td.precio { + } -body table.totales td.precio_ud { - width: 12%; - border-right: none; +body table.totales td.precio_iva { + } body table.totales td.iva { - border: none; + border-left: none; + border-right: none; + border-bottom: none; text-align: right; font-size: 10px; margin-top: 2px; } -body table.totales td.hidden { - border: none !important; -} /* Presupuesto Manual */ @@ -496,9 +488,21 @@ div.comentarios { padding-right: 10px; } +div.observaciones { + padding: 15px; +} + div.footer { - font-size: 10pt; - text-align: left; + padding: 15px; + position: fixed; + bottom: 0; + font-size: 12px; + text-align: justify; + +} + +div.footer .taxto-info { + } div.footer .texto-email { @@ -506,6 +510,7 @@ div.footer .texto-email { } div.footer .texto-asteriscos { + margin-top: 20px; font-size: 11px; }