feat: refs #7784 Changes in entry-order-pdf #2872

Merged
guillermo merged 4 commits from 7784-entryOrderPdf into dev 2024-08-21 12:36:17 +00:00
8 changed files with 97 additions and 72 deletions

View File

@ -22,7 +22,7 @@ labels AS (
b.id, b.id,
b.itemFk, b.itemFk,
p.name producer, p.name producer,
IF(i2.id, i2.comment, i.comment) comment IFNULL(i2.comment, i.comment) comment
FROM buy b FROM buy b
JOIN item i ON i.id = b.itemFk JOIN item i ON i.id = b.itemFk
LEFT JOIN producer p ON p.id = i.producerFk LEFT JOIN producer p ON p.id = i.producerFk

View File

@ -1,14 +1,20 @@
h3 { h3 {
font-weight: 100; font-weight: 100;
color: #555 color: #555
} }
.report-info { .report-info {
font-size: 20px font-size: 20px
} }
.description strong { .description strong {
text-transform: uppercase; text-transform: uppercase;
} }
.nowrap {
white-space: nowrap;
}
.padding {
padding: 16px;
}
.tags {
font-size: 10px;
margin: 0;
}

View File

@ -4,23 +4,23 @@
</template> </template>
<div class="grid-row"> <div class="grid-row">
<div class="grid-block"> <div class="grid-block">
<div class="columns"> <h1 class="title uppercase">{{$t('title')}}</h1>
<div class="columns header-tables">
<div class="size50"> <div class="size50">
<div class="body"> <div class="body">
<h1 class="title uppercase">{{$t('title')}}</h1>
<table class="row-oriented report-info"> <table class="row-oriented report-info">
<tbody> <tbody>
<tr> <tr>
<td class="font gray uppercase">{{$t('entryId')}}</td> <td class="font gray uppercase padding nowrap">{{$t('entryId')}}</td>
<th>{{entry.id}}</th> <th>{{entry.id}}</th>
</tr> </tr>
<tr> <tr>
<td class="font gray uppercase">{{$t('date')}}</td> <td class="font gray uppercase padding nowrap">{{$t('date')}}</td>
<th>{{formatDate(entry.landed,'%d-%m-%Y')}}</th> <th>{{formatDate(entry.landed,'%d-%m-%Y')}}</th>
</tr> </tr>
<tr> <tr>
<td class="font gray uppercase">{{$t('ref')}}</td> <td class="font gray uppercase padding nowrap">{{$t('ref')}}</td>
<th>{{entry.invoiceNumber}}</th> <th>{{entry.invoiceNumber | dashIfEmpty}}</th>
guillermo marked this conversation as resolved Outdated

dashIfEmpty es una funcio que gastem en salix, y en els reports Pablo se la creà si tu tb la necesites seria tindrela els dos de forma global

dashIfEmpty es una funcio que gastem en salix, y en els reports Pablo se la creà si tu tb la necesites seria tindrela els dos de forma global

imagine que has confirmat que la tenies disponible en este context i et mostra --- quan no tens valor

imagine que has confirmat que la tenies disponible en este context i et mostra --- quan no tens valor
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -38,42 +38,56 @@
</div> </div>
</div> </div>
</div> </div>
<table class="column-oriented vn-mt-ml"> <table class="column-oriented vn-mt-ml border-collapse">
<thead> <thead>
<tr> <tr>
<th class="number">{{$t('boxes')}}</th> <th class="number">{{$t('boxes')}}</th>
<th width="5%" class="number"></th>
<th class="number">{{$t('packing')}}</th> <th class="number">{{$t('packing')}}</th>
<th width="50%">{{$t('concept')}}</th> <th width="40%">{{$t('concept')}}</th>
<th width="10%">{{$t('reference')}}</th>
<th width="10%">{{$t('tags')}}</th>
<th width="10%" class="number">{{$t('quantity')}}</th> <th width="10%" class="number">{{$t('quantity')}}</th>
<th width="5%" class="number"></th>
<th width="15%" class="number">{{$t('price')}}</th> <th width="15%" class="number">{{$t('price')}}</th>
<th width="5%" class="number"></th>
<th width="15%" class="number">{{$t('amount')}}</th> <th width="15%" class="number">{{$t('amount')}}</th>
</tr> </tr>
</thead> </thead>
<tbody v-for="buy in buys"> <tbody v-for="buy in buys">
<tr> <tr>
<td class="number">{{buy.box}}</td> <td class="number">{{buy.stickers}}</td>
<td width="5%" class="number">x</td>
<td class="number">{{buy.packing}}</td> <td class="number">{{buy.packing}}</td>
<td width="50%">{{buy.itemName}}</td> <td width="40%" class="nowrap">{{buy.name}}</td>
<td width="10%">{{buy.comment}}</td>
<td width="10%" class="font light-gray tags">
<span v-if="buy.value5" class="nowrap"><strong>{{buy.tag5}} → </strong>{{buy.value5}} </span>
<span v-if="buy.value6" class="nowrap"><strong>{{buy.tag6}} → </strong>{{buy.value6}} </span>
<span v-if="buy.value7" class="nowrap"><strong>{{buy.tag7}} → </strong>{{buy.value7}} </span>
</td>
<td width="10%" class="number">{{buy.quantity | number($i18n.locale)}}</td> <td width="10%" class="number">{{buy.quantity | number($i18n.locale)}}</td>
<td width="5%" class="number">x</td>
<td width="15%" class="number">{{buy.buyingValue | currency('EUR', $i18n.locale)}}</td> <td width="15%" class="number">{{buy.buyingValue | currency('EUR', $i18n.locale)}}</td>
<td width="5%" class="number">=</td>
<td width="15%" class="number"> <td width="15%" class="number">
{{buy.buyingValue * buy.quantity | currency('EUR', $i18n.locale)}} {{buy.buyingValue * buy.quantity | currency('EUR', $i18n.locale)}}
</td> </td>
</tr> </tr>
<tr class="description font light-gray">
<td colspan="7">
<span v-if="buy.value5"> <strong>{{buy.tag5}}</strong> {{buy.value5}} </span>
<span v-if="buy.value6"> <strong>{{buy.tag6}}</strong> {{buy.value6}} </span>
<span v-if="buy.value7"> <strong>{{buy.tag7}}</strong> {{buy.value7}} </span>
</td>
</tr>
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr class="font bold">
<td colspan="5" class="font bold"> <td class="number">{{getTotalBy('stickers')}}</td>
<span class="pull-right">{{$t('total')}}</span> <td></td>
</td> <td></td>
<td class="number">{{getTotal() | currency('EUR', $i18n.locale)}}</td> <td></td>
<td></td>
<td></td>
<td class="number">{{getTotalBy('quantity') | number($i18n.locale)}}</td>
<td></td>
<td></td>
<td></td>
<td class="number">{{getTotalBy('amount') | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

View File

@ -13,13 +13,17 @@ module.exports = {
return {totalBalance: 0.00}; return {totalBalance: 0.00};
}, },
methods: { methods: {
getTotal() { getTotalBy(property) {
let total = 0.00; return this.buys.reduce((total, buy) => {
this.buys.forEach(buy => { switch (property) {
total += buy.quantity * buy.buyingValue; case 'amount':
}); return total + buy.quantity * buy.buyingValue;
case 'quantity':
return total; return total + buy.quantity;
case 'stickers':
return total + buy.stickers;
}
}, 0);
} }
}, },
props: { props: {

View File

@ -2,7 +2,7 @@ reportName: pedido-de-entrada
title: Pedido title: Pedido
supplierName: Proveedor supplierName: Proveedor
supplierStreet: Dirección supplierStreet: Dirección
entryId: Referencia interna entryId: Nº Entrada
date: Fecha date: Fecha
ref: Nº Factura ref: Nº Factura
boxes: Cajas boxes: Cajas
@ -15,3 +15,5 @@ total: Total
entry: Entrada {0} entry: Entrada {0}
supplierData: Datos del proveedor supplierData: Datos del proveedor
notes: Notas notes: Notas
reference: Referencia
tags: Tags

View File

@ -1,16 +1,17 @@
SELECT SELECT b.itemFk,
b.itemFk,
b.quantity, b.quantity,
b.buyingValue, b.buyingValue,
b.stickers box, b.stickers,
b.packing, b.packing,
i.name itemName, i.name,
IFNULL(i2.comment, i.comment) comment,
guillermo marked this conversation as resolved Outdated

ja que has de canviar alguna cosa açò es correcte, pero mes concís IFNULL(i2.comment, i.comment)

ja que has de canviar alguna cosa açò es correcte, pero mes concís IFNULL(i2.comment, i.comment)
i.tag5, i.tag5,
i.value5, i.value5,
i.tag6, i.tag6,
i.value6, i.value6,
i.tag7, i.tag7,
i.value7 i.value7
FROM buy b FROM buy b
JOIN item i ON i.id = b.itemFk JOIN item i ON i.id = b.itemFk
WHERE b.entryFk = ? LEFT JOIN item i2 ON i2.id = b.itemOriginalFk
WHERE b.entryFk = ?

View File

@ -1,9 +1,8 @@
SELECT SELECT e.id,
e.id,
e.invoiceNumber, e.invoiceNumber,
c.code companyCode, c.code companyCode,
t.landed t.landed
FROM entry e FROM entry e
JOIN travel t ON t.id = e.travelFk JOIN travel t ON t.id = e.travelFk
JOIN company c ON c.id = e.companyFk JOIN company c ON c.id = e.companyFk
WHERE e.id = ? WHERE e.id = ?

View File

@ -1,11 +1,10 @@
SELECT SELECT s.name,
s.name,
s.street, s.street,
s.nif, s.nif,
s.postCode, s.postCode,
s.city, s.city,
p.name province p.name province
FROM supplier s FROM supplier s
JOIN entry e ON e.supplierFk = s.id JOIN entry e ON e.supplierFk = s.id
LEFT JOIN province p ON p.id = s.provinceFk LEFT JOIN province p ON p.id = s.provinceFk
WHERE e.id = ? WHERE e.id = ?