diff --git a/modules/client/front/summary/index.html b/modules/client/front/summary/index.html index 8a71599e1..b724f9a6b 100644 --- a/modules/client/front/summary/index.html +++ b/modules/client/front/summary/index.html @@ -293,6 +293,8 @@ Id Nickname + Agency + Route Packages Date State @@ -313,6 +315,17 @@ {{::ticket.nickname}} + + {{::ticket.agencyMode.name}} + + + + {{::ticket.routeFk}} + + {{::ticket.packages}} @@ -371,6 +384,9 @@ + + diff --git a/modules/client/front/summary/index.js b/modules/client/front/summary/index.js index 8a927e205..e50de7da9 100644 --- a/modules/client/front/summary/index.js +++ b/modules/client/front/summary/index.js @@ -22,7 +22,13 @@ class Controller extends Summary { scope: { fields: ['id'] } - } + }, + { + relation: 'agencyMode', + scope: { + fields: ['name'] + } + }, ] }; } diff --git a/modules/invoiceOut/front/card/index.js b/modules/invoiceOut/front/card/index.js index f718f22ae..093fcdf66 100644 --- a/modules/invoiceOut/front/card/index.js +++ b/modules/invoiceOut/front/card/index.js @@ -21,7 +21,7 @@ class Controller extends ModuleCard { }, { relation: 'client', scope: { - fields: ['id', 'socialName', 'name'] + fields: ['id', 'socialName', 'name', 'email'] } } ] diff --git a/modules/invoiceOut/front/descriptor/index.html b/modules/invoiceOut/front/descriptor/index.html index b4c76d808..7e8d6b8d9 100644 --- a/modules/invoiceOut/front/descriptor/index.html +++ b/modules/invoiceOut/front/descriptor/index.html @@ -9,6 +9,12 @@ translate> Show invoice PDF + + Send invoice PDF + + + + + \ No newline at end of file diff --git a/modules/invoiceOut/front/descriptor/index.js b/modules/invoiceOut/front/descriptor/index.js index 3e859478d..e6305db93 100644 --- a/modules/invoiceOut/front/descriptor/index.js +++ b/modules/invoiceOut/front/descriptor/index.js @@ -59,6 +59,14 @@ class Controller extends Descriptor { return this.getData(`InvoiceOuts/${this.id}`, {filter}) .then(res => this.entity = res.data); } + + sendInvoice() { + return this.vnEmail.send('invoice', { + recipientId: this.invoiceOut.client.id, + recipient: this.invoiceOut.client.email, + invoiceId: this.id + }); + } } ngModule.vnComponent('vnInvoiceOutDescriptor', { diff --git a/modules/invoiceOut/front/descriptor/locale/es.yml b/modules/invoiceOut/front/descriptor/locale/es.yml index dd67660ee..ae4396a01 100644 --- a/modules/invoiceOut/front/descriptor/locale/es.yml +++ b/modules/invoiceOut/front/descriptor/locale/es.yml @@ -3,6 +3,7 @@ Volume: Volumen Client card: Ficha del cliente Invoice ticket list: Listado de tickets de la factura Show invoice PDF: Ver factura en PDF +Send invoice PDF: Enviar factura en PDF Delete Invoice: Eliminar factura InvoiceOut deleted: Factura eliminada Are you sure you want to delete this invoice?: Estas seguro de eliminar esta factura? diff --git a/modules/item/back/methods/item/clone.js b/modules/item/back/methods/item/clone.js index 04d018961..3e6f3ab5a 100644 --- a/modules/item/back/methods/item/clone.js +++ b/modules/item/back/methods/item/clone.js @@ -71,7 +71,7 @@ module.exports = Self => { const models = Self.app.models; const originalTaxes = await models.ItemTaxCountry.find({ where: {itemFk: originalId}, - fields: ['botanical', 'countryFk', 'taxClassFk'] + fields: ['countryFk', 'taxClassFk'] }, options); const promises = []; @@ -99,7 +99,7 @@ module.exports = Self => { const models = Self.app.models; const botanical = await models.ItemBotanical.findOne({ where: {itemFk: originalId}, - fields: ['botanical', 'genusFk', 'specieFk'] + fields: ['genusFk', 'specieFk'] }, options); if (botanical) { diff --git a/modules/item/back/models/item-botanical.json b/modules/item/back/models/item-botanical.json index 541218145..6c465f0ee 100644 --- a/modules/item/back/models/item-botanical.json +++ b/modules/item/back/models/item-botanical.json @@ -3,8 +3,7 @@ "base": "Loggable", "log": { "model": "ItemLog", - "relation": "item", - "showField": "botanical" + "relation": "item" }, "options": { "mysql": { diff --git a/print/core/components/email-footer/locale/en.yml b/print/core/components/email-footer/locale/en.yml index ccc0832e8..d18bfe315 100644 --- a/print/core/components/email-footer/locale/en.yml +++ b/print/core/components/email-footer/locale/en.yml @@ -1,7 +1,7 @@ buttons: webAcccess: Visit our website info: Help us to improve -fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla +fiscalAddress: VERDNATURA LEVANTE SL, B97367486 C/ Fenollar, 2. 46680 ALGEMESI · www.verdnatura.es · clientes@verdnatura.es disclaimer: '- NOTICE - This message is private and confidential, and should be used exclusively by the person receiving it. If you have received this message by mistake, diff --git a/print/core/components/email-footer/locale/fr.yml b/print/core/components/email-footer/locale/fr.yml index d93f9769e..70d4381e6 100644 --- a/print/core/components/email-footer/locale/fr.yml +++ b/print/core/components/email-footer/locale/fr.yml @@ -1,7 +1,7 @@ buttons: webAcccess: Visitez notre site web info: Aidez-nous à améliorer -fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla +fiscalAddress: VERDNATURA LEVANTE SL, B97367486 C/ Fenollar, 2. 46680 ALGEMESI · www.verdnatura.es · clientes@verdnatura.es disclaimer: "- AVIS - Ce message est privé et confidentiel et doit être utilisé exclusivement par le destinataire. Si vous avez reçu ce message par erreur, diff --git a/print/core/components/email-footer/locale/pt.yml b/print/core/components/email-footer/locale/pt.yml index d7267dbaf..b8161dd19 100644 --- a/print/core/components/email-footer/locale/pt.yml +++ b/print/core/components/email-footer/locale/pt.yml @@ -1,7 +1,7 @@ buttons: webAcccess: Visite o nosso site info: Ajude-nos a melhorar -fiscalAddress: VERDNATURA LEVANTE SL, B97367486 Avda. Espioca, 100, 46460 Silla +fiscalAddress: VERDNATURA LEVANTE SL, B97367486 C/ Fenollar, 2. 46680 ALGEMESI · www.verdnatura.es · clientes@verdnatura.es disclaimer: '- AVISO - Esta mensagem é privada e confidencial e deve ser usada exclusivamente pela pessoa que a recebe. Se você recebeu esta mensagem por engano, notifique o remetente e diff --git a/print/templates/email/delivery-note-link/locale/pt.yml b/print/templates/email/delivery-note-link/locale/pt.yml index cff3ea52b..1aab4b6d8 100644 --- a/print/templates/email/delivery-note-link/locale/pt.yml +++ b/print/templates/email/delivery-note-link/locale/pt.yml @@ -1,5 +1,5 @@ -subject: Vossa nota de entrega -title: Vossa nota de entrega +subject: Sua nota de entrega +title: Sua nota de entrega dear: Estimado cliente description: Já está disponível sua nota de entrega correspondente a encomenda numero {0}.
Para ver-lo faça um clique neste link. diff --git a/print/templates/email/delivery-note/locale/pt.yml b/print/templates/email/delivery-note/locale/pt.yml index 818a4de4c..0418fe7a5 100644 --- a/print/templates/email/delivery-note/locale/pt.yml +++ b/print/templates/email/delivery-note/locale/pt.yml @@ -1,5 +1,5 @@ -subject: Vossa nota de entrega -title: Vossa nota de entrega +subject: Sua nota de entrega +title: Sua nota de entrega dear: Estimado cliente description: Já está disponível sua nota de entrega correspondente a encomenda {0}.
Podes descarregar-la fazendo um clique no arquivo anexado ao e-mail. diff --git a/print/templates/email/invoice/assets/css/import.js b/print/templates/email/invoice/assets/css/import.js new file mode 100644 index 000000000..b44d6bd37 --- /dev/null +++ b/print/templates/email/invoice/assets/css/import.js @@ -0,0 +1,8 @@ +const Stylesheet = require(`${appPath}/core/stylesheet`); + +module.exports = new Stylesheet([ + `${appPath}/common/css/spacing.css`, + `${appPath}/common/css/misc.css`, + `${appPath}/common/css/layout.css`, + `${appPath}/common/css/email.css`]) + .mergeStyles(); diff --git a/print/templates/email/invoice/attachments.json b/print/templates/email/invoice/attachments.json new file mode 100644 index 000000000..1abbea18a --- /dev/null +++ b/print/templates/email/invoice/attachments.json @@ -0,0 +1,6 @@ +[ + { + "filename": "invoice.pdf", + "component": "invoice" + } +] \ No newline at end of file diff --git a/print/templates/email/invoice/invoice.html b/print/templates/email/invoice/invoice.html new file mode 100644 index 000000000..66bad472a --- /dev/null +++ b/print/templates/email/invoice/invoice.html @@ -0,0 +1,49 @@ + + + + + + {{ $t('subject') }} + + + + + + + + +
+ +
+
+
+ +
+
+ +
+
+ +
+
+

{{ $t('title') }}

+

{{$t('dear')}},

+

+

+

+

+
+
+ +
+
+ +
+
+ +
+
+
+
+ + \ No newline at end of file diff --git a/print/templates/email/invoice/invoice.js b/print/templates/email/invoice/invoice.js new file mode 100755 index 000000000..b8d3b8282 --- /dev/null +++ b/print/templates/email/invoice/invoice.js @@ -0,0 +1,25 @@ +const Component = require(`${appPath}/core/component`); +const emailHeader = new Component('email-header'); +const emailFooter = new Component('email-footer'); + +module.exports = { + name: 'invoice', + async serverPrefetch() { + this.invoice = await this.fetchInvoice(this.invoiceId); + }, + methods: { + fetchInvoice(invoiceId) { + return this.findOneFromDef('invoice', [invoiceId]); + }, + }, + components: { + 'email-header': emailHeader.build(), + 'email-footer': emailFooter.build() + }, + props: { + invoiceId: { + type: String, + required: true + } + } +}; diff --git a/print/templates/email/invoice/locale/en.yml b/print/templates/email/invoice/locale/en.yml new file mode 100644 index 000000000..bf1287cae --- /dev/null +++ b/print/templates/email/invoice/locale/en.yml @@ -0,0 +1,9 @@ +subject: Your invoice +title: Your invoice +dear: Dear client +description: The invoice {0} from the order {1} is now available.
+ You can download it by clicking on the attachment of this email. +poll: If you wish, you can answer our satisfaction survey to + help us provide better service. Your opinion is very important for us! +help: Any questions that arise, do not hesitate to consult it, we are here to assist you! +conclusion: Thanks for your attention! diff --git a/print/templates/email/invoice/locale/es.yml b/print/templates/email/invoice/locale/es.yml new file mode 100644 index 000000000..0147d15ac --- /dev/null +++ b/print/templates/email/invoice/locale/es.yml @@ -0,0 +1,10 @@ +subject: Tu factura +title: Tu factura +dear: Estimado cliente +description: Ya está disponible la factura {0} correspondiente al pedido {1}.
+ Puedes descargarla haciendo clic en el adjunto de este correo. +poll: Si lo deseas, puedes responder a nuestra encuesta de satisfacción para + ayudarnos a prestar un mejor servicio. ¡Tu opinión es muy importante para nosotros! +help: Cualquier duda que te surja, no dudes en consultarla, ¡estamos para + atenderte! +conclusion: ¡Gracias por tu atención! diff --git a/print/templates/email/invoice/locale/fr.yml b/print/templates/email/invoice/locale/fr.yml new file mode 100644 index 000000000..9efbdf5a0 --- /dev/null +++ b/print/templates/email/invoice/locale/fr.yml @@ -0,0 +1,9 @@ +subject: Votre facture +title: Votre facture +dear: Cher client, +description: Le facture {0} correspondant à la commande {1} est maintenant disponible.
+ Vous pouvez le télécharger en cliquant sur la pièce jointe dans cet email. +poll: Si vous le souhaitez, vous pouvez répondre à notre questionaire de satisfaction + pour nous aider à améliorer notre service. Votre avis est très important pour nous! +help: N'hésitez pas nous envoyer toute doute ou question, nous sommes là pour vous aider! +conclusion: Merci pour votre attention! diff --git a/print/templates/email/invoice/locale/pt.yml b/print/templates/email/invoice/locale/pt.yml new file mode 100644 index 000000000..4d779cd3d --- /dev/null +++ b/print/templates/email/invoice/locale/pt.yml @@ -0,0 +1,9 @@ +subject: Sua fatura +title: Sua fatura +dear: Estimado cliente +description: Já está disponível sua fatura {0} correspondente a encomenda {1}.
+ Podes descarregar-la fazendo um clique no arquivo anexado ao e-mail. +poll: Si o deseja, podes responder nosso questionário de satiscação para ajudar-nos a prestar-vos um melhor serviço. Tua opinião é muito importante para nós! +help: Cualquer dúvida que surja, no hesites em consultar-la, Estamos aqui para + atender-te! +conclusion: Obrigado por tua atenção! \ No newline at end of file diff --git a/print/templates/email/invoice/sql/invoice.sql b/print/templates/email/invoice/sql/invoice.sql new file mode 100644 index 000000000..195621a36 --- /dev/null +++ b/print/templates/email/invoice/sql/invoice.sql @@ -0,0 +1,7 @@ +SELECT + io.ref, + t.id AS ticketFk +FROM invoiceOut io + JOIN ticket t ON t.refFk = io.ref + JOIN client c ON c.id = io.clientFk +WHERE io.id = ? \ No newline at end of file diff --git a/print/templates/reports/receipt/receipt.html b/print/templates/reports/receipt/receipt.html index 3371e6871..5dc1846f7 100644 --- a/print/templates/reports/receipt/receipt.html +++ b/print/templates/reports/receipt/receipt.html @@ -21,7 +21,7 @@

{{$t('payed', [ - 'Silla', + 'Algemesí', receipt.payed.getDate(), $t('months')[receipt.payed.getMonth()], receipt.payed.getFullYear()])