diff --git a/modules/client/front/fiscal-data/index.js b/modules/client/front/fiscal-data/index.js index 8afa02288..f8e93ab9f 100644 --- a/modules/client/front/fiscal-data/index.js +++ b/modules/client/front/fiscal-data/index.js @@ -7,8 +7,8 @@ export default class Controller extends Component { delete this.client.despiteOfClient; const hasContactData = this.client.email || this.client.phone || this.client.mobile; - const isDataChecked = !orgData.isTaxDataChecked && this.client.isTaxDataChecked; - if (isDataChecked && hasContactData) + const hasChangedTaxData = !orgData.isTaxDataChecked && this.client.isTaxDataChecked; + if (hasChangedTaxData && hasContactData) this.checkExistingClient(); else this.save(); } diff --git a/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js b/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js index 62bc3b5cd..b91751d5d 100644 --- a/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js +++ b/modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js @@ -3,6 +3,7 @@ const app = require('vn-loopback/server/server'); describe('ticket makeInvoice()', () => { let invoice; let ticketId = 11; + const okState = 3; afterAll(async done => { let ticket = await app.models.Ticket.findById(11); @@ -11,7 +12,7 @@ describe('ticket makeInvoice()', () => { let ticketTrackings = await app.models.TicketTracking.find({ where: { ticketFk: ticketId, - stateFk: {neq: 3} + stateFk: {neq: okState} }, order: 'id DESC' });