mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Ajustado el estilo de presupuesto y añadidos envios
This commit is contained in:
@ -13,10 +13,12 @@ class PrintPresupuestos extends BaseController
|
|||||||
|
|
||||||
$presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel');
|
$presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel');
|
||||||
$lineasPresupuestoModel = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
$lineasPresupuestoModel = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
||||||
|
$direccionesEnvioModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||||
|
|
||||||
$data['presupuesto'] = $presupuestoModel->getResourceForPdf($id_presupuesto)->get()->getRow();
|
$data['presupuesto'] = $presupuestoModel->getResourceForPdf($id_presupuesto)->get()->getRow();
|
||||||
$data['lp_ByN'] = $lineasPresupuestoModel->getResourceByNForPdf($id_presupuesto)->get()->getRow();
|
$data['lp_ByN'] = $lineasPresupuestoModel->getResourceByNForPdf($id_presupuesto)->get()->getRow();
|
||||||
$data['lp_Color'] = $lineasPresupuestoModel->getResourceColorForPdf($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);
|
return view(getenv('theme.path') . 'pdfs/presupuesto', $data);
|
||||||
@ -28,10 +30,13 @@ class PrintPresupuestos extends BaseController
|
|||||||
// Cargar modelos
|
// Cargar modelos
|
||||||
$presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel');
|
$presupuestoModel = model('App\Models\Presupuestos\PresupuestoModel');
|
||||||
$lineasPresupuestoModel = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
$lineasPresupuestoModel = model('App\Models\Presupuestos\PresupuestoLineaModel');
|
||||||
|
$direccionesEnvioModel = model('App\Models\Presupuestos\PresupuestoDireccionesModel');
|
||||||
|
|
||||||
// Informacion del presupuesto
|
// Informacion del presupuesto
|
||||||
$data['presupuesto'] = $presupuestoModel->getResourceForPdf($presupuesto_id)->get()->getRow();
|
$data['presupuesto'] = $presupuestoModel->getResourceForPdf($presupuesto_id)->get()->getRow();
|
||||||
$data['lp_ByN'] = $lineasPresupuestoModel->getResourceByNForPdf($presupuesto_id)->get()->getRow();
|
$data['lp_ByN'] = $lineasPresupuestoModel->getResourceByNForPdf($presupuesto_id)->get()->getRow();
|
||||||
$data['lp_Color'] = $lineasPresupuestoModel->getResourceColorForPdf($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
|
// Crear una instancia de Dompdf
|
||||||
$options = new \Dompdf\Options();
|
$options = new \Dompdf\Options();
|
||||||
|
|||||||
@ -89,4 +89,28 @@ class PresupuestoDireccionesModel extends \App\Models\GoBaseModel
|
|||||||
->orLike("t1.telefono", $search)
|
->orLike("t1.telefono", $search)
|
||||||
->groupEnd();
|
->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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -364,7 +364,7 @@ class PresupuestoModel extends \App\Models\GoBaseModel
|
|||||||
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.comentarios_pdf AS comentarios_pdf,
|
||||||
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,
|
||||||
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,
|
CONCAT(t1.papel_formato_ancho, 'x', t1.papel_formato_alto) AS formatoPersonalizado,
|
||||||
t2.nombre AS cliente,
|
t2.nombre AS cliente,
|
||||||
CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t3.email AS email_comercial,
|
CONCAT(t3.first_name, ' ', t3.last_name) AS comercial, t3.email AS email_comercial,
|
||||||
|
|||||||
@ -91,7 +91,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td class="t">Formato</td>
|
<td class="t">Formato</td>
|
||||||
<td class="v" colspan="5">
|
<td class="v" colspan="5">
|
||||||
<?= (($presupuesto->isPersonalizado) ? $presupuesto->formatoPersonalizado : $presupuesto->formato) ?> mm
|
<?= (($presupuesto->isPersonalizado) ? $presupuesto->formatoPersonalizado : $presupuesto->formato) ?> mm
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -205,43 +205,55 @@
|
|||||||
<th class="intro_envio" colspan="10">ENVÍO</th>
|
<th class="intro_envio" colspan="10">ENVÍO</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<?php if (isset($envios_recogeCliente)) { ?>
|
<?php
|
||||||
|
if ($presupuesto->recoge_cliente == 1) { ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="10">El pedido será recogido por el cliente</td>
|
<td colspan="10">El pedido será recogido por el cliente</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php } else {
|
<?php
|
||||||
?>
|
} else {
|
||||||
|
if (count($direccionesEnvio) != 0) {
|
||||||
|
?>
|
||||||
|
<tbody>
|
||||||
|
|
||||||
<tbody>
|
<?php foreach ($direccionesEnvio as $direccionEnvio) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="t-ejemplares">Ejemplares</td>
|
<td class="t-ejemplares">Ejemplares</td>
|
||||||
<td class="v-ejemplares"><?= "TBD" ?></td>
|
<td class="v-ejemplares"><?= $direccionEnvio->cantidad ?></td>
|
||||||
<td class="t-first-direccion">Dirección</td>
|
<td class="t-first-direccion">Dirección</td>
|
||||||
<td class="v-first-direccion" colspan="7"><?= "TBC" ?></td>
|
<td class="v-first-direccion" colspan="7"><?= $direccionEnvio->direccion ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="t">País</td>
|
<td class="t">País</td>
|
||||||
<td class="v"><?= "TBC" ?></td>
|
<td class="v"><?= $direccionEnvio->pais ?></td>
|
||||||
<td class="t-first">Provincia</td>
|
<td class="t-first">Provincia</td>
|
||||||
<td class="v-first"><?= "TBC" ?></td>
|
<td class="v-first"><?= $direccionEnvio->provincia ?></td>
|
||||||
<td class="t-second">C.P.</td>
|
<td class="t-second">C.P.</td>
|
||||||
<td class="v-second"><?= "TBC" ?></td>
|
<td class="v-second"><?= $direccionEnvio->cp ?></td>
|
||||||
<td class="t-third">Ciudad</td>
|
<td class="t-third">Ciudad</td>
|
||||||
<td class="v-third"><?= "TBC" ?></td>
|
<td class="v-third"><?= $direccionEnvio->municipio ?></td>
|
||||||
<td class="t-fourth">Telf.</td>
|
<td class="t-fourth">Telf.</td>
|
||||||
<td class="v-fourth"><?= "TBC" ?></td>
|
<td class="v-fourth"><?= $direccionEnvio->telefono ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
<?php } ?>
|
||||||
<?php } ?>
|
</tbody>
|
||||||
|
<?php
|
||||||
|
} else { ?>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td colspan="10">No hay definidos envíos</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
} ?>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<table class="totales" align="right">
|
<table class="totales">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="hidden"></th>
|
|
||||||
<th class="hidden"></th>
|
|
||||||
<th>Tirada</th>
|
<th>Tirada</th>
|
||||||
<th>U.Impresión 4%</th>
|
<th>U.Impresión 4%</th>
|
||||||
<th>U.Envío 21%</th>
|
<th>U.Envío 21%</th>
|
||||||
@ -252,8 +264,6 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="hidden"></td>
|
|
||||||
<td class="hidden"></td>
|
|
||||||
<td class="tirada"><?= $presupuesto->tirada ?> uds.</td>
|
<td class="tirada"><?= $presupuesto->tirada ?> uds.</td>
|
||||||
<td class="precio">TBD €</td>
|
<td class="precio">TBD €</td>
|
||||||
<td class="precio">TBD €</td>
|
<td class="precio">TBD €</td>
|
||||||
@ -265,33 +275,41 @@
|
|||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="iva" colspan="5">Estos precios no incluyen I.V.A.</td>
|
<td class="iva" colspan="5">Estos precios no incluyen I.V.A.</td>
|
||||||
|
<td class="iva"></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<?php if (isset($presupuesto->comentarios_pdf)) { ?>
|
<?php if (isset($presupuesto->comentarios_pdf)) { ?>
|
||||||
<h6 class="observaciones">OBSERVACIONES</h6>
|
<div class="observaciones">
|
||||||
<div class="comentarios">
|
<h6 class="observaciones">OBSERVACIONES</h6>
|
||||||
<?= nl2br($presupuesto->comentarios_pdf); ?>
|
<div class="comentarios">
|
||||||
|
<?= nl2br($presupuesto->comentarios_pdf); ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<p>Por la grave crisis de papel que está sufriendo el sector, este presupuesto deberá ser confirmado con su
|
<p class="texto-info">Por la grave crisis de papel que está sufriendo el sector, este presupuesto deberá ser confirmado con su
|
||||||
comercial el día que se oficialice el pedido, dado que pueda darse la situación de que no haya stock
|
comercial el día que se oficialice el pedido, dado que pueda darse la situación de que no haya stock
|
||||||
disponible o que su precio haya variado considerablemente, para así poder ofrecerle alternativas.</p>
|
disponible o que su precio haya variado considerablemente, para así poder ofrecerle alternativas.
|
||||||
<p class="texto-email">Esperando que los precios se ajusten a sus necesidades,<br/>
|
</p>
|
||||||
<?= $presupuesto->comercial ?> • email: <?= $presupuesto->email_comercial ?></p>
|
<p class="texto-email">
|
||||||
<p class="texto-asteriscos">(*) En el formato de desarrollo de cubierta están contemplados los 3 mm. de vuelta
|
Esperando que los precios se ajusten a sus necesidades,<br/>
|
||||||
de solapas en caso de llevarlas.<br/>
|
<?= $presupuesto->comercial ?> • email: <?= $presupuesto->email_comercial ?>
|
||||||
(**) Estos precios están sujetos a análisis de cobertura de tinta del archivo PDF de interior.</p>
|
</p>
|
||||||
|
<p class="texto-asteriscos">
|
||||||
|
(*) En el formato de desarrollo de cubierta están contemplados los 3 mm. de vuelta de solapas en caso de
|
||||||
|
llevarlas.<br/>
|
||||||
|
(**) Estos precios están sujetos a análisis de cobertura de tinta del archivo PDF de interior.
|
||||||
|
</p>
|
||||||
<span class="texto-presupuesto">
|
<span class="texto-presupuesto">
|
||||||
Este presupuesto se calcula en base a los datos aportados, por lo que su importe puede variar a la vista del original definitivo a imprimir si éste difiere de los datos inicialmente incluidos, en cuyo caso se le facilitará un nuevo presupuesto corregido para que lo apruebe antes de realizar el pedido.
|
Este presupuesto se calcula en base a los datos aportados, por lo que su importe puede variar a la vista del
|
||||||
<br/>
|
original definitivo a imprimir si éste difiere de los datos inicialmente incluidos, en cuyo caso se le
|
||||||
Este presupuesto es válido durante 30 días.</span>
|
facilitará un nuevo presupuesto corregido para que lo apruebe antes de realizar el pedido.<br/>
|
||||||
|
Este presupuesto es válido durante 30 días.
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -270,7 +270,8 @@ body table.extras td.t {
|
|||||||
body table.envio {
|
body table.envio {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
margin-bottom: 9px;
|
margin-top: -2px;
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.envio th {
|
body table.envio th {
|
||||||
@ -332,30 +333,25 @@ body table.envio td.t-first {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body table.totales {
|
body table.totales {
|
||||||
width: 64%;
|
margin-left: auto;
|
||||||
|
margin-right: 0;
|
||||||
|
width: 75%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.totales th {
|
body table.totales th {
|
||||||
width: 12%;
|
width: 16%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
color: white;
|
color: white;
|
||||||
background: #0C2C84;
|
background: #0C2C84;
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.totales th.u_envio_21 {
|
|
||||||
width: 16%;
|
|
||||||
}
|
|
||||||
|
|
||||||
body table.totales th.hidden {
|
|
||||||
background: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
body table.totales td {
|
body table.totales td {
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px dotted #4e4e4e;
|
border: 1px dotted #4e4e4e;
|
||||||
@ -364,30 +360,26 @@ body table.totales td {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body table.totales td.tirada {
|
body table.totales td.tirada {
|
||||||
width: 12%;
|
|
||||||
border-left: none;
|
border-left: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.totales td.precio,
|
body table.totales td.precio {
|
||||||
body table.totales td.u_impresion_4 {
|
|
||||||
width: 12%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.totales td.precio_ud {
|
body table.totales td.precio_iva {
|
||||||
width: 12%;
|
|
||||||
border-right: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.totales td.iva {
|
body table.totales td.iva {
|
||||||
border: none;
|
border-left: none;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: none;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
body table.totales td.hidden {
|
|
||||||
border: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Presupuesto Manual */
|
/* Presupuesto Manual */
|
||||||
|
|
||||||
@ -496,9 +488,21 @@ div.comentarios {
|
|||||||
padding-right: 10px;
|
padding-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
div.observaciones {
|
||||||
|
padding: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
div.footer {
|
div.footer {
|
||||||
font-size: 10pt;
|
padding: 15px;
|
||||||
text-align: left;
|
position: fixed;
|
||||||
|
bottom: 0;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: justify;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
div.footer .taxto-info {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div.footer .texto-email {
|
div.footer .texto-email {
|
||||||
@ -506,6 +510,7 @@ div.footer .texto-email {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.footer .texto-asteriscos {
|
div.footer .texto-asteriscos {
|
||||||
|
margin-top: 20px;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user