Zen Cart Logo
Forums / All Other Contributions/Addons / VAT4EU Support Thread

VAT4EU Support Thread

Views: 25,605

Results 41 to 60 of 90
2 Mar 2020, 9:00 AM
#41
dharrison avatar

dharrison

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.

2 Mar 2020, 12:31 PM
#42
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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;
2 Mar 2020, 12:44 PM
#43
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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.

2 Mar 2020, 12:53 PM
#44
dharrison avatar

dharrison

Zen Follower

Join Date:
Mar 2009
Location:
Essex, UK
Posts:
448
Plugin Contributions:
0

Re: VAT4EU Support Thread

That works! :cool: Thanks Cindy.

And yes please, do let us know when the update is okayed.

:hug:

4 Mar 2020, 7:14 PM
#45
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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

6 Mar 2020, 2:37 PM
#46
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: VAT4EU Support Thread

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") :-)

6 Mar 2020, 4:42 PM
#47
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

Thanks for that! I've opened an issue on the VAT4EU GitHub to track the associated change.

8 Mar 2020, 12:11 PM
#48
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

@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)");
        }
    }
11 Mar 2020, 8:25 AM
#49
yesaul avatar

yesaul

New Zenner

Join Date:
Apr 2011
Location:
Espoo, Finland
Posts:
71
Plugin Contributions:
0

Re: VAT4EU Support Thread

@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

11 Mar 2020, 4:16 PM
#50
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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'.

12 Mar 2020, 9:04 AM
#51
dml73 avatar

dml73

Zen Follower

Join Date:
Oct 2007
Posts:
413
Plugin Contributions:
0

Re: VAT4EU Support Thread

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?

12 Mar 2020, 11:48 AM
#52
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

DML73:

Where exactly do I add 'GR'? In what file?
That's one of the VAT4EU configuration settings (European Union Countries List).

14 Mar 2020, 2:13 PM
#53
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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.

18 Mar 2020, 4:37 PM
#54
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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

14 Jul 2020, 2:19 PM
#55
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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.

18 Jul 2020, 6:19 PM
#56
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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

24 Jul 2020, 3:46 PM
#57
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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).

30 Jul 2020, 4:34 PM
#58
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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

19 Nov 2021, 8:28 PM
#59
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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.

29 Nov 2021, 4:01 PM
#60
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,081
Plugin Contributions:
56

Re: VAT4EU Support Thread

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