mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Implementada la logica para la creacion de albaranes en PDF
This commit is contained in:
@ -28,38 +28,8 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php // Para probar
|
||||
$pedido = new stdClass();
|
||||
|
||||
$pedido->numero = 1234;
|
||||
$pedido->pedido_libro = new stdClass();
|
||||
$pedido->pedido_libro->id = 111;
|
||||
$pedido->customer_nombre = 'John Doe';
|
||||
$pedido->customer_address = '123 Main St, Anytown, USA';
|
||||
$pedido->customer_att = 'Jane Doe';
|
||||
$pedido->mostar_precios = true;
|
||||
|
||||
$linea1 = new stdClass();
|
||||
$linea1->cantidad = 10;
|
||||
$linea1->descripcion = 'Libro1';
|
||||
$linea1->isbn = '123-456-789';
|
||||
$linea1->ref_cliente = 'REF1';
|
||||
$linea1->cajas = 5;
|
||||
$linea1->ejemplares_por_caja = 2;
|
||||
$linea1->precio_unidad = 5;
|
||||
$linea1->total = 20;
|
||||
|
||||
$linea2 = new stdClass();
|
||||
$linea2->cantidad = 4;
|
||||
$linea2->descripcion = 'Libro2';
|
||||
$linea2->isbn = '987-654-321';
|
||||
$linea2->ref_cliente = 'REF2';
|
||||
$linea2->cajas = 2;
|
||||
$linea2->ejemplares_por_caja = 2;
|
||||
$linea2->precio_unidad = 10;
|
||||
$linea2->total = 40;
|
||||
|
||||
$pedido->lineas = [$linea1, $linea2];
|
||||
<?php
|
||||
$mostrarPrecios = $albaran->mostrar_precios == 1;
|
||||
?>
|
||||
|
||||
|
||||
@ -70,19 +40,19 @@
|
||||
Nº ALBARÁN:
|
||||
</th>
|
||||
<th class="num_albaran">
|
||||
<?= $pedido->numero ?>
|
||||
<?= $albaran->id ?>
|
||||
</th>
|
||||
<th class="intro_num_pedido">
|
||||
Nº PEDIDO:
|
||||
</th>
|
||||
<th class="num_pedido">
|
||||
<?= $pedido->pedido_libro->id ?>
|
||||
<?= $albaran->pedido_id ?>
|
||||
</th>
|
||||
<th class="intro_fecha">
|
||||
FECHA:
|
||||
</th>
|
||||
<th class="fecha">
|
||||
<?= date('d/m/Y'); ?>
|
||||
<?= date('d-m-Y', strtotime($albaran->created_at)) ?>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -90,13 +60,13 @@
|
||||
<tr>
|
||||
<td class="intro_cliente" colspan="6">Cliente:</td>
|
||||
<tr>
|
||||
<td class="cliente" colspan="6"><?= $pedido->customer_nombre ?></td>
|
||||
<td class="cliente" colspan="6"><?= $albaran->cliente ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="att" colspan="6">Att: <?= $pedido->customer_att ?></td>
|
||||
<td class="att" colspan="6">Att: <?= $albaran->att_albaran ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="direccion" colspan="6"><?= $pedido->customer_address ?></td>
|
||||
<td class="direccion" colspan="6"><?= $albaran->direccion_albaran ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -110,7 +80,7 @@
|
||||
<th class="concepto">Ref. Cliente</th>
|
||||
<th>Cajas</th>
|
||||
<th>Ejempl./Cajas</th>
|
||||
<?php if ($pedido->mostar_precios): ?>
|
||||
<?php if ($mostrarPrecios): ?>
|
||||
<th class="precio_unidad">€/ud.</th>
|
||||
<th class="subtotal">Subtotal</th>
|
||||
<?php endif; ?>
|
||||
@ -120,7 +90,7 @@
|
||||
<?php
|
||||
$total = 0;
|
||||
$total_precio = 0;
|
||||
foreach ($pedido->lineas as $linea):
|
||||
foreach ($albaranLineas as $linea):
|
||||
?>
|
||||
|
||||
<?php
|
||||
@ -130,7 +100,7 @@
|
||||
<tr>
|
||||
<td class="num_unidades"><?= $linea->cantidad ?></td>
|
||||
<td>
|
||||
<div><?= $linea->descripcion ?></div>
|
||||
<div><?= $linea->titulo ?></div>
|
||||
</td>
|
||||
<td>
|
||||
<div><?= $linea->isbn ?></div>
|
||||
@ -139,8 +109,8 @@
|
||||
<div><?= $linea->ref_cliente ?></div>
|
||||
</td>
|
||||
<td><?= $linea->cajas ?></td>
|
||||
<td class="ejemplares-caja <?= $pedido->mostar_precios ? 'precio' : '' ?>"><?= $linea->ejemplares_por_caja ?></td>
|
||||
<?php if ($pedido->mostar_precios): ?>
|
||||
<td class="ejemplares-caja <?= $mostrarPrecios ? 'precio' : '' ?>"><?= $linea->ejemplares_por_caja ?></td>
|
||||
<?php if ($mostrarPrecios): ?>
|
||||
<td class="precio_unidad">
|
||||
<div><?= $linea->precio_unidad ?></div>
|
||||
</td>
|
||||
@ -172,7 +142,7 @@
|
||||
<td class="ejemplares-caja">
|
||||
<div></div>
|
||||
</td>
|
||||
<?php if ($pedido->mostar_precios): ?>
|
||||
<?php if ($mostrarPrecios): ?>
|
||||
<td class="precio_unidad">
|
||||
<div></div>
|
||||
</td>
|
||||
@ -191,7 +161,7 @@
|
||||
<td class="intro_recibi">
|
||||
RECIBÍ
|
||||
</td>
|
||||
<?php if ($pedido->mostar_precios): ?>
|
||||
<?php if ($mostrarPrecios): ?>
|
||||
<td class="intro_total">
|
||||
TOTAL
|
||||
</td>
|
||||
@ -202,7 +172,6 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user