From ab60e78d1c9ef9d7935464da3bee4042f004533c Mon Sep 17 00:00:00 2001 From: Juan Date: Tue, 22 May 2018 12:09:53 +0200 Subject: [PATCH] #256 TIN validation only when isTaxDataChecked is set to true --- services/loopback/common/models/client.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/loopback/common/models/client.js b/services/loopback/common/models/client.js index e71af03252..667916de45 100644 --- a/services/loopback/common/models/client.js +++ b/services/loopback/common/models/client.js @@ -52,6 +52,9 @@ module.exports = Self => { }); let validateTin = require('../validations/validateTin'); async function tinIsValid(err, done) { + if (!this.isTaxDataChecked) + return done(); + let filter = { fields: ['code'], where: {id: this.countryFk}