From 0dc1848870d84049cf8a256ebaf038fb5a91fcf0 Mon Sep 17 00:00:00 2001 From: alexm Date: Tue, 22 Mar 2022 15:13:34 +0100 Subject: [PATCH 1/3] feat(print_deliveryNote): add withoutPrices type --- .../ticket/front/descriptor-menu/index.html | 9 +++++-- modules/ticket/front/descriptor-menu/index.js | 3 ++- .../front/descriptor-menu/locale/es.yml | 1 + .../reports/delivery-note/delivery-note.html | 24 +++++++++---------- .../reports/delivery-note/delivery-note.js | 4 ++++ 5 files changed, 26 insertions(+), 15 deletions(-) diff --git a/modules/ticket/front/descriptor-menu/index.html b/modules/ticket/front/descriptor-menu/index.html index d613fb5de..03a23c780 100644 --- a/modules/ticket/front/descriptor-menu/index.html +++ b/modules/ticket/front/descriptor-menu/index.html @@ -21,7 +21,7 @@ as PDF @@ -32,6 +32,12 @@ translate> as PDF + + as PDF without prices + @@ -44,7 +50,6 @@ vn-click-stop="sendDeliveryNoteMenu.show($event, 'left')" translate> Send Delivery Note... -
-

{{$t('title')}}

+

{{$t(type)}}

@@ -23,7 +23,7 @@ - + @@ -77,10 +77,10 @@ - - - - + + + + @@ -88,10 +88,10 @@ - - - - + + + + - +
{{client.id}}
{{$t('ticketId')}}{{$t(type)}} {{ticket.id}}
{{$t('reference')}} {{$t('quantity')}} {{$t('concept')}}{{$t('price')}}{{$t('discount')}}{{$t('vat')}}{{$t('amount')}}{{$t('price')}}{{$t('discount')}}{{$t('vat')}}{{$t('amount')}}
{{sale.itemFk | zerofill('000000')}} {{sale.quantity}} {{sale.concept}}{{sale.price | currency('EUR', $i18n.locale)}}{{(sale.discount / 100) | percentage}}{{sale.vatType}}{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}{{sale.price | currency('EUR', $i18n.locale)}}{{(sale.discount / 100) | percentage}}{{sale.vatType}}{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}
@@ -107,7 +107,7 @@
{{$t('subtotal')}} @@ -181,7 +181,7 @@ -
+
diff --git a/print/templates/reports/delivery-note/delivery-note.js b/print/templates/reports/delivery-note/delivery-note.js index 0ee7c8c91..7f9ca7d0f 100755 --- a/print/templates/reports/delivery-note/delivery-note.js +++ b/print/templates/reports/delivery-note/delivery-note.js @@ -119,6 +119,10 @@ module.exports = { ticketId: { type: [Number, String], required: true + }, + type: { + type: String, + required: true } } }; From 1051a9cafbe764b9201bd32e2df877219f1db21a Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 23 Mar 2022 09:42:00 +0100 Subject: [PATCH 2/3] traductions --- print/templates/reports/delivery-note/locale/en.yml | 1 + print/templates/reports/delivery-note/locale/es.yml | 1 + print/templates/reports/delivery-note/locale/fr.yml | 1 + print/templates/reports/delivery-note/locale/pt.yml | 1 + 4 files changed, 4 insertions(+) diff --git a/print/templates/reports/delivery-note/locale/en.yml b/print/templates/reports/delivery-note/locale/en.yml index 16d0954e2..05b6d73ed 100644 --- a/print/templates/reports/delivery-note/locale/en.yml +++ b/print/templates/reports/delivery-note/locale/en.yml @@ -1,5 +1,6 @@ reportName: delivery-note title: Delivery note +withoutPrices: Delivery note ticketId: Delivery note clientId: Client deliveryAddress: Delivery address diff --git a/print/templates/reports/delivery-note/locale/es.yml b/print/templates/reports/delivery-note/locale/es.yml index ca670ad59..1a6e156cc 100644 --- a/print/templates/reports/delivery-note/locale/es.yml +++ b/print/templates/reports/delivery-note/locale/es.yml @@ -1,6 +1,7 @@ reportName: albaran title: Albarán ticketId: Albarán +withoutPrices: Albarán clientId: Cliente deliveryAddress: Dirección de entrega fiscalData: Datos fiscales diff --git a/print/templates/reports/delivery-note/locale/fr.yml b/print/templates/reports/delivery-note/locale/fr.yml index 6b3779a5b..1cc171669 100644 --- a/print/templates/reports/delivery-note/locale/fr.yml +++ b/print/templates/reports/delivery-note/locale/fr.yml @@ -1,5 +1,6 @@ reportName: bon-de-livraison title: Bon de livraison +withoutPrices: Bon de livraison ticketId: BL clientId: Client deliveryAddress: Adresse de livraison diff --git a/print/templates/reports/delivery-note/locale/pt.yml b/print/templates/reports/delivery-note/locale/pt.yml index 1a9c1fbd1..ca25041f2 100644 --- a/print/templates/reports/delivery-note/locale/pt.yml +++ b/print/templates/reports/delivery-note/locale/pt.yml @@ -1,5 +1,6 @@ reportName: nota-de-entrega title: Nota de Entrega +withoutPrices: Nota de Entrega ticketId: Nota de Entrega clientId: Cliente deliveryAddress: Morada de Entrega From ebfd0bdb29b4bfba2b3ff48422fbdee6831bc217 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 23 Mar 2022 09:46:44 +0100 Subject: [PATCH 3/3] use computed function --- .../reports/delivery-note/delivery-note.html | 20 +++++++++---------- .../reports/delivery-note/delivery-note.js | 3 +++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/print/templates/reports/delivery-note/delivery-note.html b/print/templates/reports/delivery-note/delivery-note.html index 09b799076..93e1c2255 100644 --- a/print/templates/reports/delivery-note/delivery-note.html +++ b/print/templates/reports/delivery-note/delivery-note.html @@ -77,10 +77,10 @@ - - - - + + + + @@ -88,10 +88,10 @@ - - - - + + + + - +
{{$t('reference')}} {{$t('quantity')}} {{$t('concept')}}{{$t('price')}}{{$t('discount')}}{{$t('vat')}}{{$t('amount')}}{{$t('price')}}{{$t('discount')}}{{$t('vat')}}{{$t('amount')}}
{{sale.itemFk | zerofill('000000')}} {{sale.quantity}} {{sale.concept}}{{sale.price | currency('EUR', $i18n.locale)}}{{(sale.discount / 100) | percentage}}{{sale.vatType}}{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}{{sale.price | currency('EUR', $i18n.locale)}}{{(sale.discount / 100) | percentage}}{{sale.vatType}}{{sale.price * sale.quantity * (1 - sale.discount / 100) | currency('EUR', $i18n.locale)}}
@@ -107,7 +107,7 @@
{{$t('subtotal')}} @@ -181,7 +181,7 @@ -
+
diff --git a/print/templates/reports/delivery-note/delivery-note.js b/print/templates/reports/delivery-note/delivery-note.js index 7f9ca7d0f..48aef8b64 100755 --- a/print/templates/reports/delivery-note/delivery-note.js +++ b/print/templates/reports/delivery-note/delivery-note.js @@ -44,6 +44,9 @@ module.exports = { }); return total; + }, + showPrices() { + return this.type != 'withoutPrices'; } }, methods: {