From 52f62519158a6dd0351becd74682cab0cd556428 Mon Sep 17 00:00:00 2001 From: Andre Belafronte Date: Thu, 17 Mar 2022 21:50:54 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20corrige=20m=C3=A9todo=20respons=C3=A1vel?= =?UTF-8?q?=20por=20verificar=20condi=C3=A7=C3=A3o=20de=20emiss=C3=A3o=20d?= =?UTF-8?q?a=20NF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit O método getClientIssueCondition estava retornando nulo em algumas situações onde deveria retornar uma condição padrão. --- .../Models/ClientConfiguration/Repository.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/addons/NFEioServiceInvoices/lib/Models/ClientConfiguration/Repository.php b/modules/addons/NFEioServiceInvoices/lib/Models/ClientConfiguration/Repository.php index 9e06329..24f2d9f 100644 --- a/modules/addons/NFEioServiceInvoices/lib/Models/ClientConfiguration/Repository.php +++ b/modules/addons/NFEioServiceInvoices/lib/Models/ClientConfiguration/Repository.php @@ -66,19 +66,22 @@ public function createClientCustomConfigTable() public function getClientIssueCondition($clientId) { - $issueCondition = 'seguir configuração do módulo nfe.io'; $value = Capsule::table($this->tableName) - ->where('client_id', $clientId) - ->where('key', 'issue_nfe_cond') + ->where([ + ['client_id', '=' ,$clientId], + ['key', '=' ,'issue_nfe_cond'] + ]) ->value('value'); - $value = strtolower($value); - - if (!is_null($value) OR $value !== $issueCondition) { - $issueCondition = $value; + if (is_null($value) OR $value === 'Seguir configuração do módulo NFE.io') { + $issueCondition = 'seguir configuração do módulo nfe.io'; + } else { + $issueCondition = strtolower($value); } + logModuleCall('NFEioServiceInvoices', "getClientIssueCondition", $clientId, "{$issueCondition}" .' - '. $value); + return $issueCondition; }