Buyer waste
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
7f78286d6b
commit
410e651edd
|
@ -3,6 +3,7 @@ const {Report} = require('vn-print');
|
||||||
module.exports = Self => {
|
module.exports = Self => {
|
||||||
Self.remoteMethodCtx('exportationPdf', {
|
Self.remoteMethodCtx('exportationPdf', {
|
||||||
description: 'Returns the exportation pdf',
|
description: 'Returns the exportation pdf',
|
||||||
|
accessType: 'READ',
|
||||||
accepts: [
|
accepts: [
|
||||||
{
|
{
|
||||||
arg: 'ref',
|
arg: 'ref',
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
const {Email} = require('vn-print');
|
||||||
|
|
||||||
|
module.exports = Self => {
|
||||||
|
Self.remoteMethodCtx('buyerWasteEmail', {
|
||||||
|
description: 'Sends the buyer waste email',
|
||||||
|
accessType: 'WRITE',
|
||||||
|
accepts: [
|
||||||
|
{
|
||||||
|
arg: 'id',
|
||||||
|
type: 'number',
|
||||||
|
required: true,
|
||||||
|
description: 'The client id',
|
||||||
|
http: {source: 'path'}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'recipient',
|
||||||
|
type: 'string',
|
||||||
|
description: 'The recipient email',
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'replyTo',
|
||||||
|
type: 'string',
|
||||||
|
description: 'The sender email to reply to',
|
||||||
|
required: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
arg: 'recipientId',
|
||||||
|
type: 'number',
|
||||||
|
description: 'The recipient id to send to the recipient preferred language',
|
||||||
|
required: false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
returns: {
|
||||||
|
type: ['object'],
|
||||||
|
root: true
|
||||||
|
},
|
||||||
|
http: {
|
||||||
|
path: '/:id/buyer-waste-email',
|
||||||
|
verb: 'POST'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Self.clientDebtStatementEmail = async ctx => {
|
||||||
|
const args = Object.assign({}, ctx.args);
|
||||||
|
const params = {
|
||||||
|
recipient: args.recipient,
|
||||||
|
lang: ctx.req.getLocale()
|
||||||
|
};
|
||||||
|
|
||||||
|
delete args.ctx;
|
||||||
|
for (const param in args)
|
||||||
|
params[param] = args[param];
|
||||||
|
|
||||||
|
const email = new Email('buyer-week-waste', params);
|
||||||
|
|
||||||
|
return email.send();
|
||||||
|
};
|
||||||
|
};
|
|
@ -1,9 +1,13 @@
|
||||||
const Stylesheet = require(`${appPath}/core/stylesheet`);
|
const Stylesheet = require(`vn-print/core/stylesheet`);
|
||||||
|
|
||||||
|
const path = require('path');
|
||||||
|
const vnPrintPath = path.resolve('print');
|
||||||
|
|
||||||
module.exports = new Stylesheet([
|
module.exports = new Stylesheet([
|
||||||
`${appPath}/common/css/spacing.css`,
|
`${vnPrintPath}/common/css/spacing.css`,
|
||||||
`${appPath}/common/css/misc.css`,
|
`${vnPrintPath}/common/css/misc.css`,
|
||||||
`${appPath}/common/css/layout.css`,
|
`${vnPrintPath}/common/css/layout.css`,
|
||||||
`${appPath}/common/css/email.css`,
|
`${vnPrintPath}/common/css/email.css`,
|
||||||
`${__dirname}/style.css`])
|
`${__dirname}/style.css`])
|
||||||
.mergeStyles();
|
.mergeStyles();
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
const Component = require(`${appPath}/core/component`);
|
const Component = require(`vn-print/core/component`);
|
||||||
const emailHeader = new Component('email-header');
|
const emailHeader = new Component('email-header');
|
||||||
const emailFooter = new Component('email-footer');
|
const emailFooter = new Component('email-footer');
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue