Za tymto ú?elom som na?iel samozrejme viacero pluginov, okrem iného EU VAT Number priamo od WooCommerce alebo EU VAT, OSS & IOSS od YITH, zároveň som ?ítal na tomto fóre aj info, ?e s v???inou tychto pluginov je SuperFaktúra kompatibilná.
Ideálne by v?ak samozrejme bolo, keby som ?iaden ?al?í plugin rie?i? nemusel a v?etko sa dalo vybavi? cez plugin SF.
Pred chví?ou som skúsil v nastaveniach pluginu aktivova? mo?nos? “Overi? platnos? I? DPH”, av?ak v pokladni po zadaní I? DPH (ani ?iadneho iného textu alebo ?ísla) nedochádza k ?iadnej validácii, ani mi zadanie neexistujúceho I? DPH nezabránilo v tom úspe?ne odosla? objednávku – je potrebné okrem tohto checkboxu urobi? e?te nie?o iné, alebo ako to má fungova??
Druhá otázka: ak sa podarí tú validáciu nejako rozbeha? cez plugin SF, zní?i sa aj DPH na 0% pri zahrani?nom zákazníkovi s platnym I? DPH, alebo nie?
Vopred ?akujem za odpove?!
]]>Is there a plan to add a field option for VAT with VIES EU validation for Woocommerce registration forms ? almost no other form plugin offers this feature.
Thanks
]]>
if ( $country === 'IT' ) {
return true;
}
Why when the customer billing country is Italy, VAT validation is only based on REGEX and an API call to https://ec.europa.eu/taxation_customs/vies/vatResponse.html is not used?
]]>This is not currently working. Nothing has been changed or added to the site except updates and it only happened over the weekend.
VIES is working, just tested it.
Any ideas on how to troubleshoot this please?
]]>This behaviour is by design. The EU VAT Assistant errs on the side of caution, and won’t apply an exemption unless the VAT number is confirmed to be valid. When the validation service is down, such verification can’t be performed.
Restoring the service is a responsibility of the Revenue Authority of the respective country (or countries). The EU VAT Assistant can’t do anything about it, from its side.
Possible workaround
If you trust your clients, and you are willing to take the risk of accepting potentially incorrect VAT numbers, you can use the following code to tell the EU VAT Assistant to accept as valid any VAT number that could not be validated due to the remote service being unavailable.
/**
* Indicates if the response code returned by the VIES service
* is "service unavailable.
*
* @return bool
*/
function is_vies_service_unavailable($validation_error) {
return ($validation_error === 'SERVICE_UNAVAILABLE') || ($validation_error === 'MS_UNAVAILABLE');
}
/**
* Intercepts the VAT number validation process, to force the EU VAT
* assistance to accept as valid any number that could not be validated
* due to the remote service being unavailable.
* This code requires the EU VAT Assistant 1.9.16.191004 or newer, due
* to some changes in the VIES response.
*
* @param array $validation_result
* @param string $country
* @param string $vat_number
* @return array
*/
add_filter('wc_aelia_euva_eu_vat_number_raw_validation_result', function($validation_result, $country, $vat_number) {
$validation_error = $validation_result['errors'][0];
if(!empty($validation_error) && is_vies_service_unavailable($validation_error)) {
$validation_result['valid'] = true;
}
return $validation_result;
}, 10, 3);
You can add the code to your theme’s functions.php file, or to a code snippet using the Code Snippets plugin.
Important notes