From 7e50f23563ddb9a96051aa98eba71a73585ded93 Mon Sep 17 00:00:00 2001 From: vicent Date: Fri, 11 Nov 2022 08:55:56 +0100 Subject: [PATCH] refacor code --- .../{10491-august => 10503-november}/00-aclInvoiceOut.sql | 0 .../00-deleteInvoiceOutQueue.sql | 0 db/dump/fixtures.sql | 4 ---- .../back/methods/invoiceOut/specs/invoiceClient.spec.js | 1 + print/templates/email/invoice/invoice.js | 3 ++- 5 files changed, 3 insertions(+), 5 deletions(-) rename db/changes/{10491-august => 10503-november}/00-aclInvoiceOut.sql (100%) rename db/changes/{10502-november => 10503-november}/00-deleteInvoiceOutQueue.sql (100%) diff --git a/db/changes/10491-august/00-aclInvoiceOut.sql b/db/changes/10503-november/00-aclInvoiceOut.sql similarity index 100% rename from db/changes/10491-august/00-aclInvoiceOut.sql rename to db/changes/10503-november/00-aclInvoiceOut.sql diff --git a/db/changes/10502-november/00-deleteInvoiceOutQueue.sql b/db/changes/10503-november/00-deleteInvoiceOutQueue.sql similarity index 100% rename from db/changes/10502-november/00-deleteInvoiceOutQueue.sql rename to db/changes/10503-november/00-deleteInvoiceOutQueue.sql diff --git a/db/dump/fixtures.sql b/db/dump/fixtures.sql index f7c7526ca..29b75602b 100644 --- a/db/dump/fixtures.sql +++ b/db/dump/fixtures.sql @@ -2699,10 +2699,6 @@ INSERT INTO `util`.`notificationSubscription` (`notificationFk`, `userFk`) INSERT INTO `vn`.`routeConfig` (`id`, `defaultWorkCenterFk`) VALUES (1, 9); - -INSERT INTO `vn`.`report` (`id`, `name`) - VALUES - (3, 'invoice'); INSERT INTO `vn`.`productionConfig` (`isPreviousPreparationRequired`, `ticketPrintedMax`, `ticketTrolleyMax`, `rookieDays`, `notBuyingMonths`, `id`, `isZoneClosedByExpeditionActivated`, `maxNotReadyCollections`, `minTicketsToCloseZone`, `movingTicketDelRoute`, `defaultZone`, `defautlAgencyMode`, `hasUniqueCollectionTime`, `maxCollectionWithoutUser`, `pendingCollectionsOrder`, `pendingCollectionsAge`) VALUES diff --git a/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js b/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js index fdf50cbd4..5f890de26 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js +++ b/modules/invoiceOut/back/methods/invoiceOut/specs/invoiceClient.spec.js @@ -24,6 +24,7 @@ describe('InvoiceOut invoiceClient()', () => { it('should make a global invoicing', async() => { spyOn(models.InvoiceOut, 'createPdf').and.returnValue(new Promise(resolve => resolve(true))); + spyOn(models.InvoiceOut, 'invoiceEmail'); const tx = await models.InvoiceOut.beginTransaction({}); const options = {transaction: tx}; diff --git a/print/templates/email/invoice/invoice.js b/print/templates/email/invoice/invoice.js index 8d3dcaea7..4bf0f7d66 100755 --- a/print/templates/email/invoice/invoice.js +++ b/print/templates/email/invoice/invoice.js @@ -4,6 +4,7 @@ module.exports = { name: 'invoice', async serverPrefetch() { this.invoice = await this.fetchInvoice(this.reference); + console.log('this.invoice: ', this.invoice); }, methods: { fetchInvoice(reference) { @@ -15,7 +16,7 @@ module.exports = { }, props: { reference: { - type: Number, + type: String, required: true } }