diff --git a/CHANGELOG-en.md b/CHANGELOG-en.md index 144c92f..05df5b3 100644 --- a/CHANGELOG-en.md +++ b/CHANGELOG-en.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.2.20] - 2024-05-03 +### Changed +- Use `Tax ID` as `Vat Number` registrar option. + ## [2.2.19] - 2024-03-11 ### fixed - `adminContactType` in dondominiossl diff --git a/CHANGELOG-es.md b/CHANGELOG-es.md index bf3b24a..7df18b0 100644 --- a/CHANGELOG-es.md +++ b/CHANGELOG-es.md @@ -7,6 +7,10 @@ y este proyecto se adhiere a [Semantic Versioning](https://semver.org/spec/v2.0. ## [Pendiente por lanzar] +## [2.2.20] - 2024-05-03 +### Changed +- Opción para utilizar `Tax ID` como `Vat Number` en opciones del registrador. + ## [2.2.19] - 2024-03-11 ### fixed - `adminContactType` en dondominiossl diff --git a/README-en.md b/README-en.md index 307687f..889c2df 100644 --- a/README-en.md +++ b/README-en.md @@ -8,7 +8,7 @@ This project has all the developed integrations between MrDomain and WHMCS. ## Status | Version | |:--------| -| 2.2.19 | +| 2.2.20 | ## Requirements | Name | Version | diff --git a/README.md b/README.md index c9b7495..7d00abc 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Este proyecto contiene todos los módulos desarrollados entre DonDominio y WHMCS ## Estado | Version | |:--------| -| 2.2.19 | +| 2.2.20 | ## Requerimientos | Name | Version | diff --git a/composer.json b/composer.json index 921121f..0a30998 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "dondominio/whmcs", "description": "DonDominio - WHCMCS Modules Integration", - "version": "2.2.19", + "version": "2.2.20", "license": "LGPL-3.0-only", "type": "project", "minimum-stability": "dev", diff --git a/src/modules/addons/dondominio/lib/Services/WHMCS_Service.php b/src/modules/addons/dondominio/lib/Services/WHMCS_Service.php index a59e3bb..ba2e5f1 100644 --- a/src/modules/addons/dondominio/lib/Services/WHMCS_Service.php +++ b/src/modules/addons/dondominio/lib/Services/WHMCS_Service.php @@ -299,6 +299,20 @@ public function getDomainExtendedById($id) if (!empty($extDomain->vatnumber)) { return $extDomain; } + + $useTaxID = Capsule::selectOne(' + SELECT * FROM `tblregistrars` + WHERE `tblregistrars`.`registrar` = "dondominio" + AND `tblregistrars`.`setting` = "useTaxID" + ')->value; + + if (!empty($useTaxID) && function_exists('decrypt')) { + $useTaxIDMode = decrypt($useTaxID); + if ($useTaxIDMode === 'on' && $extDomain->tax_id !== '') { + $extDomain->vatnumber = $extDomain->tax_id; + return $extDomain; + } + } $registrarFileName = Capsule::selectOne(' SELECT * FROM `tblregistrars` diff --git a/src/modules/addons/dondominio/version.json b/src/modules/addons/dondominio/version.json index cfa9002..0de0713 100644 --- a/src/modules/addons/dondominio/version.json +++ b/src/modules/addons/dondominio/version.json @@ -1,4 +1,4 @@ { - "version": "2.2.19", - "releaseDate": "2024-03-11" + "version": "2.2.20", + "releaseDate": "2024-05-03" } diff --git a/src/modules/registrars/dondominio/lib/Actions/Action.php b/src/modules/registrars/dondominio/lib/Actions/Action.php index 90b2011..1b783d7 100644 --- a/src/modules/registrars/dondominio/lib/Actions/Action.php +++ b/src/modules/registrars/dondominio/lib/Actions/Action.php @@ -296,6 +296,10 @@ protected function getVATNumber() // Search by Custom Field if (empty($vatNumber) && !empty($this->params['vat'])) { + if ($this->params['useTaxID'] && array_key_exists('tax_id', $this->params) && is_string($this->params['tax_id']) && $this->params['tax_id'] !== '' ) { + return $this->params['tax_id']; + } + $vatNumberCustomField = $this->app->getService('whmcs')->getCustomFieldByFieldName($this->params['vat']); // Try to find custom field through old select version diff --git a/src/modules/registrars/dondominio/lib/Actions/getConfigArray.php b/src/modules/registrars/dondominio/lib/Actions/getConfigArray.php index f23bd31..b984fda 100644 --- a/src/modules/registrars/dondominio/lib/Actions/getConfigArray.php +++ b/src/modules/registrars/dondominio/lib/Actions/getConfigArray.php @@ -55,6 +55,11 @@ public function __invoke() "Options" => "," . implode(",", $customFields), "Description" => "Custom field containing the VAT Number for your customers" ], + 'useTaxID' => [ + 'FriendlyName' => 'Use tax ID', + 'Type' => 'yesno', + 'Description' => 'Use Tax ID as VAT Number' + ], //FOACONTACT "foacontact" => [ "FriendlyName" => "FOA Contact", diff --git a/src/modules/registrars/dondominio/version.json b/src/modules/registrars/dondominio/version.json index a678a6c..68d4838 100644 --- a/src/modules/registrars/dondominio/version.json +++ b/src/modules/registrars/dondominio/version.json @@ -1,4 +1,4 @@ { - "version": "2.2.19", - "releaseDate": "2024-03-11" + "version": "2.2.20", + "releaseDate": "2024-05-03" } \ No newline at end of file diff --git a/src/modules/servers/dondominiossl/version.json b/src/modules/servers/dondominiossl/version.json index cfa9002..0de0713 100644 --- a/src/modules/servers/dondominiossl/version.json +++ b/src/modules/servers/dondominiossl/version.json @@ -1,4 +1,4 @@ { - "version": "2.2.19", - "releaseDate": "2024-03-11" + "version": "2.2.20", + "releaseDate": "2024-05-03" }