Merge branch 'dev' into 2989-client_debt_sample
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2021-07-20 09:07:36 +00:00
commit f24e7cafce
23 changed files with 190 additions and 14 deletions

View File

@ -293,6 +293,8 @@
<vn-tr>
<vn-th field="id" number>Id</vn-th>
<vn-th field="nickname" expand>Nickname</vn-th>
<vn-th field="agencyModeFk" expand>Agency</vn-th>
<vn-th field="routeFk" expand>Route</vn-th>
<vn-th field="packages" shrink>Packages</vn-th>
<vn-th field="shipped" shrink-date>Date</vn-th>
<vn-th>State</vn-th>
@ -313,6 +315,17 @@
{{::ticket.nickname}}
</span>
</vn-td>
<vn-td shrink>
{{::ticket.agencyMode.name}}
</vn-td>
<vn-td shrink>
<span
title="{{::ticket.route}}"
vn-click-stop="routeDescriptor.show($event, ticket.routeFk)"
class="link">
{{::ticket.routeFk}}
</span>
</vn-td>
<vn-td shrink>
{{::ticket.packages}}
</vn-td>
@ -371,6 +384,9 @@
<vn-client-descriptor-popover
vn-id="clientDescriptor">
</vn-client-descriptor-popover>
<vn-route-descriptor-popover
vn-id="routeDescriptor">
</vn-route-descriptor-popover>
<vn-worker-descriptor-popover
vn-id="workerDescriptor">
</vn-worker-descriptor-popover>

View File

@ -22,7 +22,13 @@ class Controller extends Summary {
scope: {
fields: ['id']
}
},
{
relation: 'agencyMode',
scope: {
fields: ['name']
}
},
]
};
}

View File

@ -21,7 +21,7 @@ class Controller extends ModuleCard {
}, {
relation: 'client',
scope: {
fields: ['id', 'socialName', 'name']
fields: ['id', 'socialName', 'name', 'email']
}
}
]

View File

@ -9,6 +9,12 @@
translate>
Show invoice PDF
</a>
<vn-item
ng-click="invoiceConfirmation.show()"
name="sendInvoice"
translate>
Send invoice PDF
</vn-item>
<vn-item
ng-click="deleteConfirmation.show()"
vn-acl="invoicing"
@ -98,3 +104,11 @@
question="Are you sure you want to regenerate the invoice PDF document?"
message="You are going to regenerate the invoice PDF document">
</vn-confirm>
<!-- Send invoice confirmation popup -->
<vn-confirm
vn-id="invoiceConfirmation"
on-accept="$ctrl.sendInvoice()"
question="Are you sure you want to send it?"
message="Send invoice PDF">
</vn-confirm>

View File

@ -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', {

View File

@ -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?

View File

@ -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) {

View File

@ -3,8 +3,7 @@
"base": "Loggable",
"log": {
"model": "ItemLog",
"relation": "item",
"showField": "botanical"
"relation": "item"
},
"options": {
"mysql": {

View File

@ -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,

View File

@ -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,

View File

@ -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

View File

@ -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 <strong>{0}</strong>. <br/>
Para ver-lo faça um clique <a href="https://www.verdnatura.es/#!form=ecomerce/ticket&ticket={0}">neste link</a>.

View File

@ -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}. <br/>
Podes descarregar-la fazendo um clique no arquivo anexado ao e-mail.

View File

@ -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();

View File

@ -0,0 +1,6 @@
[
{
"filename": "invoice.pdf",
"component": "invoice"
}
]

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html v-bind:lang="$i18n.locale">
<head>
<meta name="viewport" content="width=device-width">
<meta name="format-detection" content="telephone=no">
<title>{{ $t('subject') }}</title>
</head>
<body>
<table class="grid">
<tbody>
<tr>
<td>
<!-- Empty block -->
<div class="grid-row">
<div class="grid-block empty"></div>
</div>
<!-- Header block -->
<div class="grid-row">
<div class="grid-block">
<email-header v-bind="$props"></email-header>
</div>
</div>
<!-- Block -->
<div class="grid-row">
<div class="grid-block vn-pa-ml">
<h1>{{ $t('title') }}</h1>
<p>{{$t('dear')}},</p>
<p v-html="$t('description', [invoice.ref, invoice.ticketFk])"></p>
<p v-html="$t('poll')"></p>
<p v-html="$t('help')"></p>
<p v-html="$t('conclusion')"></p>
</div>
</div>
<!-- Footer block -->
<div class="grid-row">
<div class="grid-block">
<email-footer v-bind="$props"></email-footer>
</div>
</div>
<!-- Empty block -->
<div class="grid-row">
<div class="grid-block empty"></div>
</div>
</td>
</tr>
</tbody>
</table>
</body>
</html>

View File

@ -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
}
}
};

View File

@ -0,0 +1,9 @@
subject: Your invoice
title: Your invoice
dear: Dear client
description: The invoice <strong>{0}</strong> from the order <strong>{1}</strong> is now available. <br/>
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, <strong>we are here to assist you!</strong>
conclusion: Thanks for your attention!

View File

@ -0,0 +1,10 @@
subject: Tu factura
title: Tu factura
dear: Estimado cliente
description: Ya está disponible la factura <strong>{0}</strong> correspondiente al pedido <strong>{1}</strong>. <br/>
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, <strong>¡estamos para
atenderte!</strong>
conclusion: ¡Gracias por tu atención!

View File

@ -0,0 +1,9 @@
subject: Votre facture
title: Votre facture
dear: Cher client,
description: Le facture <strong>{0}</strong> correspondant à la commande <strong>{1}</strong> est maintenant disponible.<br/>
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, <strong>nous sommes là pour vous aider!</strong>
conclusion: Merci pour votre attention!

View File

@ -0,0 +1,9 @@
subject: Sua fatura
title: Sua fatura
dear: Estimado cliente
description: Já está disponível sua fatura <strong>{0}</strong> correspondente a encomenda {1}. <br/>
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, <strong>Estamos aqui para
atender-te!</strong>
conclusion: Obrigado por tua atenção!

View File

@ -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 = ?

View File

@ -21,7 +21,7 @@
<div class="signature">
<img v-bind:src="getReportSrc('signature.png')">
<p class="centered">{{$t('payed', [
'Silla',
'Algemesí',
receipt.payed.getDate(),
$t('months')[receipt.payed.getMonth()],
receipt.payed.getFullYear()])