From 3df03b31a354ac8231851527aecac1786747e98f Mon Sep 17 00:00:00 2001 From: joan Date: Fri, 1 Oct 2021 10:56:40 +0200 Subject: [PATCH] fix(invoice): invalid date for PDF storage --- modules/invoiceOut/back/methods/invoiceOut/createPdf.js | 8 ++++---- modules/invoiceOut/back/methods/invoiceOut/download.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js index 2a0aec2bb..b866a5cf2 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js @@ -59,10 +59,10 @@ module.exports = Self => { } }); - const created = invoiceOut.created; - const year = created.getFullYear().toString(); - const month = (created.getMonth() + 1).toString(); - const day = created.getDate().toString(); + const issued = invoiceOut.issued; + const year = issued.getFullYear().toString(); + const month = (issued.getMonth() + 1).toString(); + const day = issued.getDate().toString(); const container = await models.InvoiceContainer.container(year); const rootPath = container.client.root; diff --git a/modules/invoiceOut/back/methods/invoiceOut/download.js b/modules/invoiceOut/back/methods/invoiceOut/download.js index 0dcbd0e92..f1138dd51 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/download.js +++ b/modules/invoiceOut/back/methods/invoiceOut/download.js @@ -45,10 +45,10 @@ module.exports = Self => { try { const invoiceOut = await models.InvoiceOut.findById(id, null, myOptions); - const created = invoiceOut.created; - const year = created.getFullYear().toString(); - const month = (created.getMonth() + 1).toString(); - const day = created.getDate().toString(); + const issued = invoiceOut.issued; + const year = issued.getFullYear().toString(); + const month = (issued.getMonth() + 1).toString(); + const day = issued.getDate().toString(); const container = await models.InvoiceContainer.container(year); const rootPath = container.client.root;