diff --git a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js index 58f8c47336..2a0aec2bb0 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js @@ -28,7 +28,7 @@ module.exports = Self => { Self.createPdf = async function(ctx, id, options) { const models = Self.app.models; const headers = ctx.req.headers; - const origin = headers.origin || headers.referer; + const origin = headers.origin; const authorization = ctx.req.accessToken.id; if (process.env.NODE_ENV == 'test') diff --git a/modules/invoiceOut/back/methods/invoiceOut/download.js b/modules/invoiceOut/back/methods/invoiceOut/download.js index a42da48bab..0dcbd0e925 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/download.js +++ b/modules/invoiceOut/back/methods/invoiceOut/download.js @@ -56,10 +56,6 @@ module.exports = Self => { const fileName = `${year}${invoiceOut.ref}.pdf`; const fileSrc = path.join(src, fileName); - // Creates PDF document if it has not been created - if (!invoiceOut.hasPdf || !fs.existsSync(fileSrc)) - await Self.createPdf(ctx, invoiceOut.id, myOptions); - const file = { path: fileSrc, contentType: 'application/pdf',