From d46c590ccb76f15f2e1e03e63de0b59d3699a676 Mon Sep 17 00:00:00 2001 From: jgallego Date: Thu, 18 Nov 2021 08:21:02 +0100 Subject: [PATCH] test --- .../invoice-in/specs/getTotals.spec.js | 20 +++++++++++++++++++ .../back/methods/invoice-in/toBook.js | 2 -- modules/invoiceIn/front/descriptor/index.html | 2 +- .../front/descriptor-menu/locale/es.yml | 3 ++- 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 modules/invoiceIn/back/methods/invoice-in/specs/getTotals.spec.js diff --git a/modules/invoiceIn/back/methods/invoice-in/specs/getTotals.spec.js b/modules/invoiceIn/back/methods/invoice-in/specs/getTotals.spec.js new file mode 100644 index 000000000..7f74d756f --- /dev/null +++ b/modules/invoiceIn/back/methods/invoice-in/specs/getTotals.spec.js @@ -0,0 +1,20 @@ +const models = require('vn-loopback/server/server').models; + +describe('invoiceIn getTotals()', () => { + it('should check that returns invoiceIn totals', async() => { + const invoiceInId = 1; + const tx = await models.InvoiceIn.beginTransaction({}); + const options = {transaction: tx}; + + try { + const invoiceIntotals = await models.InvoiceIn.getTotals(invoiceInId, options); + + expect(invoiceIntotals.totalTaxableBase).toEqual(invoiceIntotals.totalDueDay); + + await tx.rollback(); + } catch (e) { + await tx.rollback(); + throw e; + } + }); +}); diff --git a/modules/invoiceIn/back/methods/invoice-in/toBook.js b/modules/invoiceIn/back/methods/invoice-in/toBook.js index ab2befc05..588d53f1f 100644 --- a/modules/invoiceIn/back/methods/invoice-in/toBook.js +++ b/modules/invoiceIn/back/methods/invoice-in/toBook.js @@ -1,5 +1,3 @@ -const UserError = require('vn-loopback/util/user-error'); - module.exports = Self => { Self.remoteMethodCtx('toBook', { description: 'To book the invoiceIn', diff --git a/modules/invoiceIn/front/descriptor/index.html b/modules/invoiceIn/front/descriptor/index.html index 89945ce07..99cf7e010 100644 --- a/modules/invoiceIn/front/descriptor/index.html +++ b/modules/invoiceIn/front/descriptor/index.html @@ -74,6 +74,6 @@ \ No newline at end of file diff --git a/modules/invoiceOut/front/descriptor-menu/locale/es.yml b/modules/invoiceOut/front/descriptor-menu/locale/es.yml index 01e58633b..c3ec1c40e 100644 --- a/modules/invoiceOut/front/descriptor-menu/locale/es.yml +++ b/modules/invoiceOut/front/descriptor-menu/locale/es.yml @@ -14,4 +14,5 @@ InvoiceOut booked: Factura asentada Are you sure you want to book this invoice?: Estas seguro de querer asentar esta factura? Regenerate PDF invoice: Regenerar PDF factura The invoice PDF document has been regenerated: El documento PDF de la factura ha sido regenerado -The email can't be empty: El correo no puede estar vacío \ No newline at end of file +The email can't be empty: El correo no puede estar vacío +Are you sure you want to book this invoice?: Estas seguro de contabilizar esta factura?