From cd3032deae932e9413219b8655c07cc39ee0364c Mon Sep 17 00:00:00 2001 From: JoaoVictorLNacional Date: Mon, 18 Jan 2021 14:29:24 -0300 Subject: [PATCH 1/2] removido texto desnessesario na pagina de codigos de produtos --- modules/addons/gofasnfeio/outputproduct.php | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/addons/gofasnfeio/outputproduct.php b/modules/addons/gofasnfeio/outputproduct.php index 4880af1..049dd53 100644 --- a/modules/addons/gofasnfeio/outputproduct.php +++ b/modules/addons/gofasnfeio/outputproduct.php @@ -62,7 +62,6 @@ echo ' NFE.oi -

Listagem produtos

'.$nfes_total.' Itens encontrados.
Exibindo de '.$nfes_from.' a '.$nfes_to.'. Página '.$nfes_page.' de '.$nfes_pages.'
From 4acbd1d7e7ed19f2e04db59900f447970bd12a49 Mon Sep 17 00:00:00 2001 From: JoaoVictorLNacional Date: Mon, 18 Jan 2021 15:46:37 -0300 Subject: [PATCH 2/2] =?UTF-8?q?modificado=20forma=20de=20separar=20o=20end?= =?UTF-8?q?ere=C3=A7o=20com=20virugla?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../addons/gofasnfeio/hooks/aftercronjob.php | 19 ++++++++++++++----- .../addons/gofasnfeio/hooks/dailycronjob.php | 17 +++++++++++++---- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/modules/addons/gofasnfeio/hooks/aftercronjob.php b/modules/addons/gofasnfeio/hooks/aftercronjob.php index 64239d5..1e3e141 100644 --- a/modules/addons/gofasnfeio/hooks/aftercronjob.php +++ b/modules/addons/gofasnfeio/hooks/aftercronjob.php @@ -4,6 +4,7 @@ exit(); } use WHMCS\Database\Capsule; + if ($params['debug']) { logModuleCall('gofas_nfeio', 'check', 'check', '', 'replaceVars'); } @@ -72,7 +73,15 @@ } else { $desc = substr(implode("\n", $line_items), 0, 600); } - + if (strpos($client['address1'], ',')) { + $array_adress=explode(",", $client['address1']); + $street = $array_adress[0]; + $number=$array_adress[1]; + } else { + $street = str_replace(',', '', preg_replace('/[0-9]+/i', '', $client['address1'])); + $number=preg_replace('/[^0-9]/', '', $client['address1']); + } + if (0 == !strlen($customer['insc_municipal'])) { $postfields = [ 'cityServiceCode' => $service_code, @@ -86,8 +95,8 @@ 'address' => [ 'country' => gnfe_country_code($client['countrycode']), 'postalCode' => preg_replace('/[^0-9]/', '', $client['postcode']), - 'street' => str_replace(',', '', preg_replace('/[0-9]+/i', '', $client['address1'])), - 'number' => preg_replace('/[^0-9]/', '', $client['address1']), + 'street' => $street, + 'number' => $number, 'additionalInformation' => '', 'district' => $client['address2'], 'city' => [ @@ -112,8 +121,8 @@ 'address' => [ 'country' => gnfe_country_code($client['countrycode']), 'postalCode' => preg_replace('/[^0-9]/', '', $client['postcode']), - 'street' => str_replace(',', '', preg_replace('/[0-9]+/i', '', $client['address1'])), - 'number' => preg_replace('/[^0-9]/', '', $client['address1']), + 'street' => $street, + 'number' => $number, 'additionalInformation' => '', 'district' => $client['address2'], 'city' => [ diff --git a/modules/addons/gofasnfeio/hooks/dailycronjob.php b/modules/addons/gofasnfeio/hooks/dailycronjob.php index 5191f36..9b7422f 100644 --- a/modules/addons/gofasnfeio/hooks/dailycronjob.php +++ b/modules/addons/gofasnfeio/hooks/dailycronjob.php @@ -54,6 +54,15 @@ } else { $desc = substr(implode("\n", $line_items), 0, 600); } + if (strpos($client['address1'], ',')) { + $array_adress=explode(",", $client['address1']); + $street = $array_adress[0]; + $number=$array_adress[1]; + } else { + $street = str_replace(',', '', preg_replace('/[0-9]+/i', '', $client['address1'])); + $number=preg_replace('/[^0-9]/', '', $client['address1']); + } + if (0 == !strlen($customer['insc_municipal'])) { $postfields = [ 'cityServiceCode' => $service_code, @@ -67,8 +76,8 @@ 'address' => [ 'country' => gnfe_country_code($client['countrycode']), 'postalCode' => preg_replace('/[^0-9]/', '', $client['postcode']), - 'street' => str_replace(',', '', preg_replace('/[0-9]+/i', '', $client['address1'])), - 'number' => preg_replace('/[^0-9]/', '', $client['address1']), + 'street' => $street, + 'number' => $number, 'additionalInformation' => '', 'district' => $client['address2'], 'city' => [ @@ -93,8 +102,8 @@ 'address' => [ 'country' => gnfe_country_code($client['countrycode']), 'postalCode' => preg_replace('/[^0-9]/', '', $client['postcode']), - 'street' => str_replace(',', '', preg_replace('/[0-9]+/i', '', $client['address1'])), - 'number' => preg_replace('/[^0-9]/', '', $client['address1']), + 'street' => $street, + 'number' => $number, 'additionalInformation' => '', 'district' => $client['address2'], 'city' => [