From 24becf78727a1bc096b3feb9999379df28dbeb4f Mon Sep 17 00:00:00 2001
From: Joan Sanchez <joan@verdnatura.es>
Date: Wed, 4 Mar 2020 11:17:35 +0100
Subject: [PATCH] Updated var names

---
 modules/client/front/fiscal-data/index.js                    | 4 ++--
 modules/ticket/back/methods/ticket/specs/makeInvoice.spec.js | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/client/front/fiscal-data/index.js b/modules/client/front/fiscal-data/index.js
index 8afa022887..f8e93ab9fe 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 62bc3b5cd6..b91751d5df 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'
         });