refs #4650 cambios en la query
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Alexandre Riera 2022-10-25 15:03:09 +02:00
parent 67402dfe5e
commit 7948523685
3 changed files with 300 additions and 295 deletions

View File

@ -1,13 +1,13 @@
<!DOCTYPE html> <!DOCTYPE html>
<html v-bind:lang="$i18n.locale"> <html v-bind:lang="$i18n.locale">
<body> <body>
<table class="grid"> <table class="grid">
<tbody> <tbody>
<tr> <tr>
<td> <td>
<!-- Header block --> <!-- Header block -->
<report-header v-bind="$props" <report-header v-bind="$props" v-bind:company-code="ticket.companyCode">
v-bind:company-code="ticket.companyCode">
</report-header> </report-header>
<!-- Block --> <!-- Block -->
<div class="grid-row"> <div class="grid-row">
@ -88,10 +88,13 @@
<td width="5%">{{sale.itemFk | zerofill('000000')}}</td> <td width="5%">{{sale.itemFk | zerofill('000000')}}</td>
<td class="number">{{sale.quantity}}</td> <td class="number">{{sale.quantity}}</td>
<td width="50%">{{sale.concept}}</td> <td width="50%">{{sale.concept}}</td>
<td class="number" v-if="showPrices">{{sale.price | currency('EUR', $i18n.locale)}}</td> <td class="number" v-if="showPrices">{{sale.price | currency('EUR',
<td class="centered" width="5%" v-if="showPrices">{{(sale.discount / 100) | percentage}}</td> $i18n.locale)}}</td>
<td class="centered" width="5%" v-if="showPrices">{{(sale.discount / 100) |
percentage}}</td>
<td class="centered" v-if="showPrices">{{sale.vatType}}</td> <td class="centered" v-if="showPrices">{{sale.vatType}}</td>
<td class="number" v-if="showPrices">{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}</td> <td class="number" v-if="showPrices">{{sale.price * sale.quantity * (1 -
sale.discount / 100) | currency('EUR', $i18n.locale)}}</td>
</tr> </tr>
<tr class="description font light-gray"> <tr class="description font light-gray">
<td colspan="7"> <td colspan="7">
@ -139,10 +142,12 @@
<td width="5%"></td> <td width="5%"></td>
<td class="number">{{service.quantity}}</td> <td class="number">{{service.quantity}}</td>
<td width="50%">{{service.description}}</td> <td width="50%">{{service.description}}</td>
<td class="number">{{service.price | currency('EUR', $i18n.locale)}}</td> <td class="number">{{service.price | currency('EUR', $i18n.locale)}}
</td>
<td class="centered" width="5%"></td> <td class="centered" width="5%"></td>
<td class="centered">{{service.taxDescription}}</td> <td class="centered">{{service.taxDescription}}</td>
<td class="number">{{service.price | currency('EUR', $i18n.locale)}}</td> <td class="number">{{service.price | currency('EUR', $i18n.locale)}}
</td>
</tr> </tr>
</tbody> </tbody>
<tfoot> <tfoot>
@ -219,7 +224,8 @@
</tr> </tr>
<tr class="font bold"> <tr class="font bold">
<td colspan="2">{{$t('total')}}</td> <td colspan="2">{{$t('total')}}</td>
<td colspan="2" class="number">{{getTotal() | currency('EUR', $i18n.locale)}}</td> <td colspan="2" class="number">{{getTotal() | currency('EUR',
$i18n.locale)}}</td>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>
@ -263,12 +269,6 @@
</div> </div>
<!-- End of phytosanitary block --> <!-- End of phytosanitary block -->
</div> </div>
<div class="columns vn-mb-ml">
<!-- Observations block-->
<div class="size100 no-page-break" v-if="hasObservations">
<h2>{{$t('observations')}}</h2>
<p class="observations">{{ticket.description}}</p>
</div>
<div class="columns"> <div class="columns">
<!-- Signature block --> <!-- Signature block -->
<div class="size50 pull-left no-page-break"> <div class="size50 pull-left no-page-break">
@ -282,18 +282,23 @@
</div> </div>
<!-- End of signature block --> <!-- End of signature block -->
</div> </div>
<div class="columns vn-mb-ml" v-if="hasObservations">
<!-- Observations block-->
<div class="size100 no-page-break">
<h2>{{$t('observations')}}</h2>
<p class="observations">{{ticket.description}}</p>
</div>
</div>
</div> </div>
</div> </div>
<!-- Footer block --> <!-- Footer block -->
<report-footer id="pageFooter" <report-footer id="pageFooter" v-bind:company-code="ticket.companyCode"
v-bind:company-code="ticket.companyCode" v-bind:left-text="footerType" v-bind:center-text="client.socialName" v-bind="$props">
v-bind:left-text="footerType"
v-bind:center-text="client.socialName"
v-bind="$props">
</report-footer> </report-footer>
</td> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
</body> </body>
</html> </html>

View File

@ -54,6 +54,9 @@ module.exports = {
footerType() { footerType() {
const translatedType = this.$t(this.deliverNoteType); const translatedType = this.$t(this.deliverNoteType);
return `${translatedType} ${this.id}`; return `${translatedType} ${this.id}`;
},
hasObservations() {
return this.ticket.description !== null;
} }
}, },
@ -120,9 +123,6 @@ module.exports = {
return phytosanitary.filter((item, index) => return phytosanitary.filter((item, index) =>
phytosanitary.indexOf(item) == index phytosanitary.indexOf(item) == index
).join(', '); ).join(', ');
},
hasObservations() {
return this.ticket.code == 'deliveryNote' && this.ticket.description != null;
} }
}, },
components: { components: {

View File

@ -3,10 +3,10 @@ SELECT
t.shipped, t.shipped,
c.code companyCode, c.code companyCode,
t.packages, t.packages,
tto.description, tto.description
ot.code
FROM ticket t FROM ticket t
JOIN company c ON c.id = t.companyFk JOIN company c ON c.id = t.companyFk
LEFT JOIN ticketObservation tto ON tto.ticketFk = t.id LEFT JOIN ticketObservation tto
LEFT JOIN observationType ot ON tto.observationTypeFk = ot.id ON tto.ticketFk = t.id
WHERE t.id = 1; AND tto.observationTypeFk = (SELECT id FROM observationType WHERE code = 'deliveryNote')
WHERE t.id = ?