diff --git a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js index e56516237..71e7c1543 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/createPdf.js +++ b/modules/invoiceOut/back/methods/invoiceOut/createPdf.js @@ -44,7 +44,7 @@ module.exports = Self => { try { const invoiceOut = await Self.findById(id, null, myOptions); const hasInvoicing = await models.Account.hasRole(userId, 'invoicing', myOptions); - + console.log(invoiceOut, !hasInvoicing); if (invoiceOut.hasPdf && !hasInvoicing) throw new UserError(`You don't have enough privileges`); diff --git a/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js b/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js index fe005f1ab..208d55358 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js +++ b/modules/invoiceOut/back/methods/invoiceOut/downloadZip.js @@ -47,6 +47,7 @@ module.exports = Self => { ids = ids.split(','); for (let id of ids) { + console.log(zipConfig, totalSize, zipConfig ? zipConfig.maxSize : null); if (zipConfig && totalSize > zipConfig.maxSize) throw new UserError('Files are too large'); const invoiceOutPdf = await models.InvoiceOut.download(ctx, id, myOptions); const fileName = extractFileName(invoiceOutPdf[2]); diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js index 26eae45ac..803338ef3 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/createPdf.spec.js @@ -11,7 +11,6 @@ describe('InvoiceOut createPdf()', () => { const ctx = {req: activeCtx}; it('should create a new PDF file and set true the hasPdf property', async() => { - pending('https://redmine.verdnatura.es/issues/5035'); const invoiceId = 1; spyOn(LoopBackContext, 'getCurrentContext').and.returnValue({ active: activeCtx diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js index 0f62a6876..41ea45487 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/downloadZip.spec.js @@ -30,8 +30,6 @@ describe('InvoiceOut downloadZip()', () => { }); it('should return an error if the size of the files is too large', async() => { - pending('https://redmine.verdnatura.es/issues/5035'); - const tx = await models.InvoiceOut.beginTransaction({}); let error; diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js index d3d789393..9264bf77d 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/filter.spec.js @@ -65,8 +65,9 @@ describe('InvoiceOut filter()', () => { await invoiceOut.updateAttribute('hasPdf', true, options); const result = await models.InvoiceOut.filter(ctx, {id: invoiceOut.id}, options); + console.log(result); - expect(result.length).toBeGreaterThanOrEqual(1); + expect(result.length).toEqual(1); await tx.rollback(); } catch (e) {