feat(closure): send incoterms authorization
gitea/salix/pipeline/head This commit is unstable
Details
gitea/salix/pipeline/head This commit is unstable
Details
This commit is contained in:
parent
bf8e7eed57
commit
6586595976
|
@ -0,0 +1,7 @@
|
||||||
|
INSERT INTO `vn`.`sample` (code, description, isVisible, hasCompany, hasPreview, datepickerEnabled)
|
||||||
|
VALUES ('incoterms-authorization', 'Autorización de incoterms', 1, 0, 1, 0);
|
||||||
|
|
||||||
|
|
||||||
|
INSERT INTO vn.expedition (agencyModeFk, ticketFk, isBox, created, isRefund, isPickUp, itemFk, counter, checked,
|
||||||
|
workerFk, externalId, packagingFk, itemPackingTypeFk, hostFk, stateTypeFk)
|
||||||
|
VALUES (7, 11, 71, '2022-05-18 11:40:56', false, false, null, 1, 1, 18, null, '94', null, '', 3);
|
|
@ -224,5 +224,7 @@
|
||||||
"The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
|
"The agency is already assigned to another autonomous": "La agencia ya está asignada a otro autónomo",
|
||||||
"date in the future": "Fecha en el futuro",
|
"date in the future": "Fecha en el futuro",
|
||||||
"reference duplicated": "Referencia duplicada",
|
"reference duplicated": "Referencia duplicada",
|
||||||
"This ticket is already a refund": "Este ticket ya es un abono"
|
"This ticket is already a refund": "Este ticket ya es un abono",
|
||||||
|
"isWithoutNegatives": "isWithoutNegatives",
|
||||||
|
"routeFk": "routeFk"
|
||||||
}
|
}
|
|
@ -89,6 +89,26 @@ module.exports = {
|
||||||
const email = new Email('delivery-note-link', args);
|
const email = new Email('delivery-note-link', args);
|
||||||
await email.send();
|
await email.send();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Incoterms authorization
|
||||||
|
const {firstOrder} = await db.findOne(`
|
||||||
|
SELECT COUNT(*) as firstOrder
|
||||||
|
FROM ticket t
|
||||||
|
WHERE t.clientFk = ?
|
||||||
|
AND NOT t.isDeleted
|
||||||
|
`, [ticket.clientFk]);
|
||||||
|
|
||||||
|
if (firstOrder == 1) {
|
||||||
|
const args = Object.assign({
|
||||||
|
ticketId: ticket.id,
|
||||||
|
recipientId: ticket.clientFk,
|
||||||
|
recipient: ticket.recipient,
|
||||||
|
replyTo: ticket.salesPersonEmail
|
||||||
|
}, reqArgs);
|
||||||
|
|
||||||
|
const email = new Email('incoterms-authorization', args);
|
||||||
|
await email.send();
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Domain not found
|
// Domain not found
|
||||||
if (error.responseCode == 450)
|
if (error.responseCode == 450)
|
||||||
|
|
|
@ -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();
|
|
@ -0,0 +1,6 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"filename": "incoterms-authorization.pdf",
|
||||||
|
"component": "incoterms-authorization"
|
||||||
|
}
|
||||||
|
]
|
|
@ -0,0 +1,56 @@
|
||||||
|
<!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('description.dear')}},</p>
|
||||||
|
<p>{{$t('description.instructions')}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Attachments block -->
|
||||||
|
<div class="grid-row" v-if="isPreview">
|
||||||
|
<div class="grid-block vn-pa-ml">
|
||||||
|
<attachment v-for="attachment in attachments"
|
||||||
|
v-bind:key="attachment.filename"
|
||||||
|
v-bind:attachment="attachment"
|
||||||
|
v-bind:args="$props">
|
||||||
|
</attachment>
|
||||||
|
</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>
|
|
@ -0,0 +1,23 @@
|
||||||
|
const Component = require(`${appPath}/core/component`);
|
||||||
|
const emailHeader = new Component('email-header');
|
||||||
|
const emailFooter = new Component('email-footer');
|
||||||
|
const attachment = new Component('attachment');
|
||||||
|
const attachments = require('./attachments.json');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: 'incoterms-authorization',
|
||||||
|
data() {
|
||||||
|
return {attachments};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
'email-header': emailHeader.build(),
|
||||||
|
'email-footer': emailFooter.build(),
|
||||||
|
'attachment': attachment.build()
|
||||||
|
},
|
||||||
|
props: {
|
||||||
|
ticketId: {
|
||||||
|
type: [Number, String],
|
||||||
|
required: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
|
@ -0,0 +1,5 @@
|
||||||
|
subject: Orden de recogida
|
||||||
|
title: Orden de recogida
|
||||||
|
description:
|
||||||
|
dear: Estimado cliente
|
||||||
|
instructions: Aqui tienes tu orden de recogida.
|
Before Width: | Height: | Size: 101 KiB After Width: | Height: | Size: 101 KiB |
Loading…
Reference in New Issue