Zen Follower
- Join Date:
- Mar 2009
- Location:
- Essex, UK
- Posts:
- 448
- Plugin Contributions:
- 0
VAT4EU Support Thread
Hi Cindy
This is a fresh install that I am using.
Views: 25,605
Zen Follower
Hi Cindy
This is a fresh install that I am using.
Administrator
Deb, I'm getting an update for VAT4EU going. In the interim, you can edit that naughty line in the Vat4EuAdminObserver, changing the highlighted function:
$vat_info =
'<tr>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td><strong>' . VAT4EU_ENTRY_VAT_NUMBER . '</strong></td>' . PHP_EOL .
' <td>' . zen_draw_input_field('vat_number', [B]zen_html_quotes[/B]($vat_number), 'size="45"') . $valid_indicator . $hidden_fields . '</td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
'</tr>' . PHP_EOL .
'<tr>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td><strong>' . VAT4EU_ENTRY_OVERRIDE_VALIDATION . '</strong></td>' . PHP_EOL .
' <td>' . zen_draw_checkbox_field('vat_number_override', '', ($vat_validated == VatValidation::VAT_ADMIN_OVERRIDE)) . '</td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
'</tr>' . PHP_EOL;
$p2 .= $vat_info;
break;
to
$vat_info =
'<tr>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td><strong>' . VAT4EU_ENTRY_VAT_NUMBER . '</strong></td>' . PHP_EOL .
' <td>' . zen_draw_input_field('vat_number', [B]zen_db_output[/B]($vat_number), 'size="45"') . $valid_indicator . $hidden_fields . '</td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
'</tr>' . PHP_EOL .
'<tr>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td><strong>' . VAT4EU_ENTRY_OVERRIDE_VALIDATION . '</strong></td>' . PHP_EOL .
' <td>' . zen_draw_checkbox_field('vat_number_override', '', ($vat_validated == VatValidation::VAT_ADMIN_OVERRIDE)) . '</td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
' <td> </td>' . PHP_EOL .
'</tr>' . PHP_EOL;
$p2 .= $vat_info;
break;
Administrator
I've just submitted v2.0.3 of VAT4EU to the Zen Cart moderators for their review; I'll post back here once it's available for download.
This release contains changes associated with the following GitHub issue:
#6: Correct call to unknown zen_html_quotes function.
Zen Follower
That works! :cool: Thanks Cindy.
And yes please, do let us know when the update is okayed.
:hug:
Administrator
lat9:
I've just submitted v2.0.3 of VAT4EU to the Zen Cart moderators for their review; I'll post back here once it's available for download.
This release contains changes associated with the following GitHub issue:#6: Correct call to unknown zen_html_quotes function.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
New Zenner
Hello,
This add-on is unfortunately not working for VAT-Numbers from Greece.
(It seems a little bit strange to me, I'm the first, who noticed this, but I haven't found any information about this 'bug' in this thread - please excuse me, if I've missed something)
The problem is: Greek VAT-Numbers are an exception, they're starting with 'EL', but not with 'GR' (short Country cobe by ISO)
The problem can be fixed, by adding the following code:
$country_iso_code_2 = $country_iso_code_2 == 'GR' ? 'EL' : $country_iso_code_2;
after
$country_iso_code_2 = $this->getCountryIsoCode2($countries_id);
in validateVatNumber method (file Vat4EuAdminObserver.php)
...Or you can simply replace ISO-2 code for Greece (from "GR" to "EL") :-)
Administrator
Thanks for that! I've opened an issue on the VAT4EU GitHub to track the associated change.
Administrator
@yesaul, I chose to make a slightly different change so that the corrected validation would apply to both the admin and the storefront, changing /includes/classes/VatValidation.php:
// -----
// The class constructor gathers the to-be-verified country-code (2-character ISO) and
// the associated VAT Number. The "VAT Number" value must include any country code
// prefix.
//
// Since we'll need the SOAP service to automatically validate the VAT Number, check now
// to see that the PHP installation includes that service, logging a warning if not.
//
public function __construct($countryCode, $vatNumber)
{
if (defined('VAT4EU_ENABLED') && VAT4EU_ENABLED == 'true') {
$this->debug = (defined('VAT4EU_DEBUG') && VAT4EU_DEBUG == 'true');
[B]
// -----
// Greek VAT numbers start with 'EL' instead of their country-code ('GR').
//
$this->countryCode = ($countryCode == 'GR') ? 'EL' : $countryCode;
$this->vatNumber = strtoupper($vatNumber);[/B]
if (!class_exists('SoapClient')) {
trigger_error('VAT Number validation not possible, "SoapClient" class is not available.', E_USER_WARNING);;
} else {
$this->soapInstalled = true;
try {
$this->_client = new SoapClient(self::WSDL, array('trace' => true) );
} catch(Exception $e) {
$this->soapInstalled = false;
trigger_error("VAT Number validation not possible, VAT Translation Error: " . $e->getMessage(), E_USER_WARNING);
}
}
$this->trace("__construct($countryCode, $vatNumber)");
}
}
New Zenner
@lat9, Sure, your solution is better :-)
But note: it is necessary also to replace 'EL' to 'GR' (or simply add 'GR') in VAT4EU_EU_COUNTRIES configuration key
Administrator
yesaul:
@lat9, Sure, your solution is better :-)
But note: it is necessary also to replace 'EL' to 'GR' (or simply add 'GR') in VAT4EU_EU_COUNTRIES configuration key
Most excellent point, @yesaul. Thanks for the update. I'll get that updated 'shortly'.
Zen Follower
yesaul:
@lat9, Sure, your solution is better :-)
But note: it is necessary also to replace 'EL' to 'GR' (or simply add 'GR') in VAT4EU_EU_COUNTRIES configuration key
Where exactly do I add 'GR'? In what file?
Administrator
DML73:
Where exactly do I add 'GR'? In what file?
That's one of the VAT4EU configuration settings (European Union Countries List).
Administrator
I've just submitted v2.0.4 of VAT4EU to the Zen Cart moderators for their review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#7: Correct check (and configuration) for Greek VAT numbers.
#8: Admin, correct PHP notice when VAT number shouldn't be added to an address.
Administrator
lat9:
I've just submitted v2.0.4 of VAT4EU to the Zen Cart moderators for their review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:#7: Correct check (and configuration) for Greek VAT numbers.
#8: Admin, correct PHP notice when VAT number shouldn't be added to an address.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
Administrator
I've just submitted v3.0.0 of ***VAT4EU ***to the Zen Cart moderators for review and will post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#9: Correct PHP notice during account-creation.
#10: Initial installation, use numeric values for integer fields in added database elements.
#11: No more core-file overwrites! Minimum Zen Cart version for initial installation is now zc156b.
Administrator
lat9:
I've just submitted v3.0.0 of ***VAT4EU ***to the Zen Cart moderators for review and will post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#9: Correct PHP notice during account-creation.
#10: Initial installation, use numeric values for integer fields in added database elements.
#11: No more core-file overwrites! Minimum Zen Cart version for initial installation is now zc156b.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
Administrator
Sorry for the churn, but I came across some logs indicating that the VIES service now requires https-protocol access so I've just submitted v3.0.1 of VAT4EU to the Zen Cart moderators for review. I'll post back here when it's available for download.
This release contains the change associated with GitHub issue #12 (Access the VIES WSDL using https protocol).
Administrator
lat9:
Sorry for the churn, but I came across some logs indicating that the VIES service now requires https-protocol access so I've just submitted v3.0.1 of VAT4EU to the Zen Cart moderators for review. I'll post back here when it's available for download.
This release contains the change associated with GitHub issue #12 (Access the VIES WSDL using https protocol).
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
Administrator
I've just submitted v3.1.0 of VAT4EU for the plugin moderators' review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#13: Various re-factorings; the minimum PHP version is now PHP 5.6.0.
#14: Use zen_is_logged_in() and zen_in_guest_checkout() to determine customer's logged-in status; VAT processing now only for non-guest customers.
#15: Since Brexit, GB is no longer part of the EU; the VIES service no longer recognizes GB-based VAT numbers.
Administrator
lat9:
I've just submitted v3.1.0 of VAT4EU for the plugin moderators' review; I'll post back here when it's available for download.
This release contains changes associated with the following GitHub issues:
#13: Various re-factorings; the minimum PHP version is now PHP 5.6.0.
#14: Use zen_is_logged_in() and zen_in_guest_checkout() to determine customer's logged-in status; VAT processing now only for non-guest customers.
#15: Since Brexit, GB is no longer part of the EU; the VIES service no longer recognizes GB-based VAT numbers.
Now available for download: https://www.zen-cart.com/downloads.php?do=file&id=2164
Tell staff why this post should be reviewed.