Changeset 3339144
- Timestamp:
- 08/04/2025 04:34:49 PM (5 months ago)
- Location:
- woocommerce-eu-vat-compliance
- Files:
-
- 4 added
- 2 deleted
- 12 edited
- 49 copied
-
tags/1.35.5 (copied) (copied from woocommerce-eu-vat-compliance/trunk)
-
tags/1.35.5/bootstrap.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/bootstrap.php) (5 diffs)
-
tags/1.35.5/control-centre.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/control-centre.php) (12 diffs)
-
tags/1.35.5/css/tablesorter-theme.jui.css (copied) (copied from woocommerce-eu-vat-compliance/trunk/css/tablesorter-theme.jui.css)
-
tags/1.35.5/data/rates.json (copied) (copied from woocommerce-eu-vat-compliance/trunk/data/rates.json) (3 diffs)
-
tags/1.35.5/eu-vat-compliance.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/eu-vat-compliance.php) (2 diffs)
-
tags/1.35.5/includes (copied) (copied from woocommerce-eu-vat-compliance/trunk/includes)
-
tags/1.35.5/includes/debug-fragment.php (added)
-
tags/1.35.5/includes/reports-ui.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/includes/reports-ui.php)
-
tags/1.35.5/includes/vat-compliance-order-export.php (added)
-
tags/1.35.5/includes/widgets.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/includes/widgets.php)
-
tags/1.35.5/js/admin.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/admin.js)
-
tags/1.35.5/js/jquery.tablesorter.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/jquery.tablesorter.js)
-
tags/1.35.5/js/jquery.tablesorter.min.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/jquery.tablesorter.min.js)
-
tags/1.35.5/js/jquery.tablesorter.widgets.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/jquery.tablesorter.widgets.js)
-
tags/1.35.5/js/jquery.tablesorter.widgets.min.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/jquery.tablesorter.widgets.min.js)
-
tags/1.35.5/js/widget-output.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/widget-output.js)
-
tags/1.35.5/js/widget-output.min.js (copied) (copied from woocommerce-eu-vat-compliance/trunk/js/widget-output.min.js)
-
tags/1.35.5/languages/woocommerce-eu-vat-compliance-nl_NL.mo (copied) (copied from woocommerce-eu-vat-compliance/trunk/languages/woocommerce-eu-vat-compliance-nl_NL.mo)
-
tags/1.35.5/languages/woocommerce-eu-vat-compliance-nl_NL.po (copied) (copied from woocommerce-eu-vat-compliance/trunk/languages/woocommerce-eu-vat-compliance-nl_NL.po)
-
tags/1.35.5/languages/woocommerce-eu-vat-compliance.pot (copied) (copied from woocommerce-eu-vat-compliance/trunk/languages/woocommerce-eu-vat-compliance.pot)
-
tags/1.35.5/number-lookups (copied) (copied from woocommerce-eu-vat-compliance/trunk/number-lookups)
-
tags/1.35.5/number-lookups/hmrc.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/number-lookups/hmrc.php)
-
tags/1.35.5/number-lookups/lookup-service.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/number-lookups/lookup-service.php)
-
tags/1.35.5/number-lookups/vatsense.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/number-lookups/vatsense.php)
-
tags/1.35.5/number-lookups/vies.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/number-lookups/vies.php)
-
tags/1.35.5/nusoap/class.nusoap_base.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/nusoap/class.nusoap_base.php)
-
tags/1.35.5/nusoap/class.soap_parser.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/nusoap/class.soap_parser.php) (1 diff)
-
tags/1.35.5/nusoap/class.soap_transport_http.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/nusoap/class.soap_transport_http.php)
-
tags/1.35.5/nusoap/class.soapclient.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/nusoap/class.soapclient.php)
-
tags/1.35.5/nusoap/class.wsdl.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/nusoap/class.wsdl.php) (5 diffs)
-
tags/1.35.5/nusoap/class.xmlschema.php (modified) (1 diff)
-
tags/1.35.5/preselect-country.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/preselect-country.php) (4 diffs)
-
tags/1.35.5/rate-providers/base-generic.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/base-generic.php)
-
tags/1.35.5/rate-providers/base-xml.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/base-xml.php)
-
tags/1.35.5/rate-providers/czechnb.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/czechnb.php)
-
tags/1.35.5/rate-providers/danishnb.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/danishnb.php)
-
tags/1.35.5/rate-providers/ecb.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/ecb.php)
-
tags/1.35.5/rate-providers/hmrc-uk.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/hmrc-uk.php)
-
tags/1.35.5/rate-providers/norwaycb.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/norwaycb.php)
-
tags/1.35.5/rate-providers/romaniannb.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/romaniannb.php)
-
tags/1.35.5/rate-providers/russiacb.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rate-providers/russiacb.php)
-
tags/1.35.5/rates.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/rates.php)
-
tags/1.35.5/readiness-tests.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/readiness-tests.php) (2 diffs)
-
tags/1.35.5/readme.txt (copied) (copied from woocommerce-eu-vat-compliance/trunk/readme.txt) (3 diffs)
-
tags/1.35.5/record-order-details.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/record-order-details.php) (4 diffs)
-
tags/1.35.5/regions/eu.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/regions/eu.php)
-
tags/1.35.5/regions/norway.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/regions/norway.php)
-
tags/1.35.5/regions/switzerland.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/regions/switzerland.php)
-
tags/1.35.5/regions/uk.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/regions/uk.php)
-
tags/1.35.5/regions/vat-region.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/regions/vat-region.php)
-
tags/1.35.5/reports.php (copied) (copied from woocommerce-eu-vat-compliance/trunk/reports.php)
-
tags/1.35.5/vendor (deleted)
-
tags/1.35.5/widgets.php (deleted)
-
trunk/bootstrap.php (modified) (5 diffs)
-
trunk/control-centre.php (modified) (12 diffs)
-
trunk/data/rates.json (modified) (3 diffs)
-
trunk/eu-vat-compliance.php (modified) (2 diffs)
-
trunk/includes/debug-fragment.php (added)
-
trunk/includes/vat-compliance-order-export.php (added)
-
trunk/nusoap/class.soap_parser.php (modified) (1 diff)
-
trunk/nusoap/class.wsdl.php (modified) (5 diffs)
-
trunk/nusoap/class.xmlschema.php (modified) (1 diff)
-
trunk/preselect-country.php (modified) (4 diffs)
-
trunk/readiness-tests.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/record-order-details.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-eu-vat-compliance/tags/1.35.5/bootstrap.php
r3277213 r3339144 101 101 102 102 // Update customer vat location on updating address on block checkout. 103 add_action('woocommerce_store_api_cart_update_customer_from_request', array($this, 'update_customer_vat_location') , 10, 2);103 add_action('woocommerce_store_api_cart_update_customer_from_request', array($this, 'update_customer_vat_location')); 104 104 } 105 105 … … 243 243 244 244 /** 245 * Update customer vatlocation for update tax245 * Update customer VAT location for update tax 246 246 * 247 247 * @param WC_Customer $customer Customer object. 248 * @param WP_REST_Request $request Request object.249 */250 public function update_customer_vat_location(\WC_Customer $customer, \WP_REST_Request $request) {248 */ 249 public function update_customer_vat_location(\WC_Customer $customer) { 250 251 251 $validation_util = new Automattic\WooCommerce\StoreApi\Utilities\ValidationUtils(); 252 252 $vat_controller = WooCommerce_EU_VAT_Compliance('WC_EU_VAT_Compliance_VAT_Number'); … … 261 261 * This resets the state to an empty string if it doesn't match the country. 262 262 */ 263 if ( !$validation_util->validate_state( $billing_state, $billing_country )) {263 if (!$validation_util->validate_state($billing_state, $billing_country)) { 264 264 $billing_state = ''; 265 265 } … … 310 310 if (!empty($vat_number) && $vat_controller) { 311 311 $check_result = $vat_controller->check_vat_number_validity($country, $vat_number, false, true); 312 313 if (empty($check_result['vat_number_accepted'])) { 314 $vat_number = null; 315 316 // Remove vat number if it's not valid vat number. 317 $this->wc->session->set('vat_number', null); 318 } 312 } 313 if (!isset($check_result) || empty($check_result['vat_number_accepted'])) { 314 $vat_number = null; 315 // Do not store invalid VAT numbers in the session 316 $this->wc->session->set('vat_number', null); 319 317 } 320 318 … … 1644 1642 1645 1643 /** 1644 * See if the designated checkout page uses the checkout shortcode. 1645 * N.B. Theoretically the designated checkout page might not actually be the one the site uses; a custom checkout may be in use, etc. 1646 * 1647 * @return Boolean 1648 */ 1649 public function checkout_page_uses_shortcode() { 1650 1651 $checkout_id = wc_get_page_id('checkout'); 1652 1653 // No checkout page found 1654 if ($checkout_id <= 0) return false; 1655 1656 $content = get_post_field('post_content', $checkout_id); 1657 1658 return has_shortcode($content, 'woocommerce_checkout'); 1659 } 1660 1661 /** 1662 * See if the designated cart page uses the cart shortcode. 1663 * N.B. Theoretically the designated cart page might not actually be the one the site uses; a custom cart may be in use, etc. 1664 * 1665 * @return Boolean 1666 */ 1667 public function cart_page_uses_shortcode() { 1668 1669 $cart_id = wc_get_page_id('cart'); 1670 1671 // No cart page found 1672 if ($cart_id <= 0) return false; 1673 1674 $content = get_post_field('post_content', $cart_id); 1675 1676 return has_shortcode($content, 'woocommerce_cart'); 1677 } 1678 1679 /** 1646 1680 * Rename the "Valid EU VAT Number" field to "Valid VAT Number" 1647 1681 */ -
woocommerce-eu-vat-compliance/tags/1.35.5/control-centre.php
r3188577 r3339144 165 165 if (empty($_POST['settings']) || !is_string($_POST['settings'])) die; 166 166 167 parse_str( $_POST['settings'], $posted_settings);167 parse_str(stripslashes($_POST['settings']), $posted_settings); 168 168 169 169 $posted_settings = stripslashes_deep($posted_settings); … … 318 318 'content' => $contents 319 319 )); 320 } elseif ('load_readiness_tab' === $_POST['subaction']) { 321 ob_start(); 322 $this->render_tab_readiness_table(); 323 $contents = @ob_get_contents(); 324 @ob_end_clean(); 325 326 echo json_encode(array( 327 'result' => 'ok', 328 'content' => $contents 329 )); 330 320 331 } elseif ('export_settings' == $_POST['subaction']) { 321 332 322 $plugin_version = WooCommerce_EU_VAT_Compliance()->get_version(); 333 $compliance = WooCommerce_EU_VAT_Compliance(); 334 335 $plugin_version = $compliance->get_version(); 323 336 324 337 include(ABSPATH.WPINC.'/version.php'); … … 333 346 } 334 347 335 $options['woocommerce_ default_country'] = WC()->countries->get_base_country();348 $options['woocommerce_base_country'] = WC()->countries->get_base_country(); 336 349 337 350 $results = array( … … 339 352 'versions' => array( 340 353 'wc' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : '?', 341 'wc_ eu_vat_compliance' => '?',354 'wc_vat_compliance' => '?', 342 355 'wp' => $wp_version 356 ), 357 'features' => array( 358 'hpos_enabled' => $compliance->woocommerce_custom_order_tables_enabled(), 359 'checkout_page_using_shortcode' => $compliance->checkout_page_uses_shortcode(), 360 'cart_page_using_shortcode' => $compliance->cart_page_uses_shortcode(), 343 361 ), 344 362 ); … … 483 501 )); 484 502 485 $active_tab = !empty($_REQUEST['tab']) ? $_REQUEST['tab'] : 'settings';503 $active_tab = empty($_REQUEST['tab']) ? 'settings' : stripslashes($_REQUEST['tab']); 486 504 if ('taxes' == $active_tab || !empty($_GET['range'])) $active_tab = 'reports'; 487 505 … … 525 543 foreach ($tabs as $slug => $title) { 526 544 ?> 527 <a class="nav-tab <?php if ($slug == $active_tab) echo 'nav-tab-active'; ?>" href="#wceuvat-navtab-<?php echo $slug;?>-content" id="wceuvat-navtab-<?php echo $slug;?>"><?php echo $title;?></a>545 <a class="nav-tab <?php if ($slug == $active_tab) echo 'nav-tab-active'; ?>" href="#wceuvat-navtab-<?php echo esc_attr($slug);?>-content" id="wceuvat-navtab-<?php echo esc_attr($slug);?>"><?php echo esc_html($title);?></a> 528 546 <?php 529 547 } … … 532 550 533 551 foreach ($tabs as $slug => $title) { 534 echo "<div class=\"wceuvat-navtab-content\" id=\"wceuvat-navtab-". $slug."-content\"";552 echo "<div class=\"wceuvat-navtab-content\" id=\"wceuvat-navtab-".esc_attr($slug)."-content\""; 535 553 if ($slug != $active_tab) echo ' style="display:none;"'; 536 554 echo ">"; … … 1450 1468 echo '<p>'.esc_html__("N.B. If you are not selling goods for which the \"place of supply\" is deemed to be the customer's location (rather than the seller's; e.g. electronically supplied goods), then the tests for the presence of up-to-date VAT per-country rates are not relevant and you should not use them.", 'woocommerce-eu-vat-compliance').'</p>'; 1451 1469 1470 // This is populated via AJAX so that the tests don't have to be done upon each settings page load 1471 echo '<div id="wcvat_readiness_results_table_container"></div>'; 1472 1473 // N.B. This is duplicated in render_tab_readiness(); keep them in sync. 1474 $opts = get_option('wceuvat_background_tests'); 1475 $email = empty($opts['email']) ? '' : (string) $opts['email']; 1476 1477 $default_bottom_blurb = '<p><a href="https://www.simbahosting.co.uk/s3/product/woocommerce-eu-vat-compliance/">'.esc_html__('To automatically run these tests daily, and notify yourself of any failed tests by email, use our Premium version.', 'woocommerce-eu-vat-compliance').'</a></p>'; 1478 $bottom_blurb = apply_filters('wceuvat_readinesstests_bottom_section', $default_bottom_blurb, $email); 1479 1480 echo $bottom_blurb; 1481 1482 echo '</div>'; 1483 1484 } 1485 1486 /** 1487 * Output the readiness test result table 1488 */ 1489 private function render_tab_readiness_table() { 1452 1490 if (!class_exists('WC_EU_VAT_Compliance_Readiness_Tests')) require_once(WC_VAT_COMPLIANCE_DIR.'/readiness-tests.php'); 1453 1491 $test = new WC_EU_VAT_Compliance_Readiness_Tests(); 1454 1492 $results = $test->get_results(); 1455 1493 1456 1494 $result_descriptions = $test->result_descriptions(); 1457 1495 1458 1496 ?> 1459 1497 <table> 1460 1498 <thead> 1461 <tr>1462 <th></th>1463 <th style="text-align:left; min-width: 140px;"><?php _e('Test', 'woocommerce-eu-vat-compliance');?></th>1464 <th style="text-align:left; min-width:60px;"><?php _e('Result', 'woocommerce-eu-vat-compliance');?></th>1465 <th style="text-align:left;"><?php _e('Futher information', 'woocommerce-eu-vat-compliance');?></th>1466 </tr>1499 <tr> 1500 <th></th> 1501 <th style="text-align:left; min-width: 140px;"><?php _e('Test', 'woocommerce-eu-vat-compliance');?></th> 1502 <th style="text-align:left; min-width:60px;"><?php _e('Result', 'woocommerce-eu-vat-compliance');?></th> 1503 <th style="text-align:left;"><?php _e('Futher information', 'woocommerce-eu-vat-compliance');?></th> 1504 </tr> 1467 1505 </thead> 1468 1506 <tbody> 1469 1507 <?php 1470 1508 1509 // N.B. This is duplicated in render_tab_readiness(); keep them in sync. 1471 1510 $opts = get_option('wceuvat_background_tests'); 1472 $email = empty($opts['email']) ? '' : (string)$opts['email']; 1473 1511 $email = empty($opts['email']) ? '' : (string) $opts['email']; 1474 1512 $default_bottom_blurb = '<p><a href="https://www.simbahosting.co.uk/s3/product/woocommerce-eu-vat-compliance/">'.esc_html__('To automatically run these tests daily, and notify yourself of any failed tests by email, use our Premium version.', 'woocommerce-eu-vat-compliance').'</a></p>'; 1475 1513 $bottom_blurb = apply_filters('wceuvat_readinesstests_bottom_section', $default_bottom_blurb, $email); 1476 1514 $premium_present = ($bottom_blurb == $default_bottom_blurb) ? false : true; 1477 1515 1478 1516 foreach ($results as $id => $res) { 1479 1517 if (!is_array($res)) continue; … … 1494 1532 } 1495 1533 $row_bg = 'color:'.$col; 1496 1534 1497 1535 $checked = (is_array($opts) && empty($opts['tests'][$id])) ? false : true; 1498 1536 1499 1537 ?> 1500 1501 <tr style="<?php echo $row_bg;?>">1502 <td style="vertical-align:top;"><?php1503 if ($premium_present) { ?>1504 <input type="checkbox" id="wceuvat_test_<?php echo esc_attr($id);?>" name="wceuvat_test_<?php echo esc_attr($id);?>" value="1" <?php if ($checked) echo 'checked="checked"'; ?>>1538 1539 <tr style="<?php echo esc_attr($row_bg);?>"> 1540 <td style="vertical-align:top;"><?php 1541 if ($premium_present) { ?> 1542 <input type="checkbox" id="wceuvat_test_<?php echo esc_attr($id);?>" name="wceuvat_test_<?php echo esc_attr($id);?>" value="1" <?php if ($checked) echo 'checked="checked"'; ?>> 1505 1543 <?php } ?> 1506 1544 </td> … … 1508 1546 <td style="vertical-align:top;"><?php echo $result_descriptions[$res['result']];?></td> 1509 1547 <td style="vertical-align:top;"><?php echo $res['info'];?></td> 1510 </tr>1511 <?php1512 } 1513 1548 </tr> 1549 <?php 1550 } 1551 1514 1552 ?> 1515 1553 </tbody> 1516 1554 </table> 1555 1517 1556 <?php 1518 1519 echo $bottom_blurb; 1520 1521 echo '</div>'; 1522 1523 } 1524 1557 } 1558 1525 1559 /** 1526 1560 * Called by the WP action admin_footer when on our settings page … … 1532 1566 $nonce = wp_create_nonce("wc_eu_vat_nonce"); 1533 1567 $response = esc_js(__('Response:', 'woocommerce-eu-vat-compliance')); 1534 $loading = esc_js(__(' Loading...', 'woocommerce-eu-vat-compliance'));1568 $loading = esc_js(__('Running readiness tests...', 'woocommerce-eu-vat-compliance')); 1535 1569 $error = esc_js(__('Error', 'woocommerce-eu-vat-compliance')); 1536 1570 … … 1669 1703 $('#wceuvat-navtab-'+id.substring(15)+'-content').show(); 1670 1704 // This is not yet ready 1671 //$('#wceuvat_tabs').trigger('show_'+id.substring(15));1705 $('#wceuvat_tabs').trigger('show_'+id.substring(15)); 1672 1706 } 1673 1707 return false; 1674 1708 }); 1675 1709 1676 var content_loaded = false; 1677 $('#wceuvat_tabs').on('show_reports', function() { 1678 if (content_loaded) return; 1679 content_loaded = true; 1680 $('#wceuvat-navtab-reports-content').html('$loading'); 1710 var readiness_content_loaded = false; 1711 1712 $('#wceuvat_tabs').on('show_readiness', function() { 1713 1714 if (readiness_content_loaded) return; 1715 1716 readiness_content_loaded = true; 1717 1718 jQuery.blockUI({ message: "<h1>$loading</h1>" }); 1719 1720 $('#wcvat_readiness_results_table_container').html('$loading'); 1721 1681 1722 $.post(ajaxurl, { 1682 1723 action: "wc_eu_vat_cc", 1683 subaction: 'load_re ports_tab',1724 subaction: 'load_readiness_tab', 1684 1725 _wpnonce: '$nonce' 1685 1726 }, function(response) { 1686 1727 resp = JSON.parse(response); 1687 1728 if (resp.result == 'ok') { 1688 $('#wc euvat-navtab-reports-content').html(resp.content);1729 $('#wcvat_readiness_results_table_container').html(resp.content); 1689 1730 } else { 1690 $('#wc euvat-navtab-reports-content').html('$error');1731 $('#wcvat_readiness_results_table_container').html('$error'); 1691 1732 console.log(resp); 1692 1733 } 1734 jQuery.unblockUI(); 1693 1735 }); 1694 1736 }); -
woocommerce-eu-vat-compliance/tags/1.35.5/data/rates.json
r3277213 r3339144 1 1 { 2 "last_updated": "2025-0 3-06T21:00:00Z",2 "last_updated": "2025-08-04T12:00:00Z", 3 3 "disclaimer": "This data is compiled from official European Commission sources to be as accurate as possible, however no guarantee of accuracy is provided. Use at your own risk. Don't trust random people on the internet without doing your own research.", 4 4 "rates": { … … 62 62 "EE": { 63 63 "country": "Estonia", 64 "standard_rate": 2 2.00,65 "standard_rate_by_time": { "0": 20.00, "1704063600": 22.00 },64 "standard_rate": 24.00, 65 "standard_rate_by_time": { "0": 20.00, "1704063600": 22.00, "1751324400": 24.00 }, 66 66 "reduced_rate": 9.00, 67 67 "reduced_rate_alt": false, … … 206 206 "RO": { 207 207 "country": "Romania", 208 "standard_rate": 19.00, 209 "reduced_rate": 9.00, 210 "reduced_rate_alt": 5.00, 208 "standard_rate": 21.00, 209 "standard_rate_by_time": { "0": 19.00, "1754002800": 21.00 }, 210 "reduced_rate": 11.00, 211 "reduced_rate_by_time": { "0": 9.00, "1754002800": 11.00 }, 212 "reduced_rate_alt": false, 211 213 "super_reduced_rate": false, 212 214 "parking_rate": false -
woocommerce-eu-vat-compliance/tags/1.35.5/eu-vat-compliance.php
r3277213 r3339144 4 4 Plugin URI: https://www.simbahosting.co.uk/s3/product/woocommerce-eu-vat-compliance/ 5 5 Description: Provides features to assist WooCommerce with European VAT compliance 6 Version: 1.3 4.06 Version: 1.35.5 7 7 Text Domain: woocommerce-eu-vat-compliance 8 8 Domain Path: /languages … … 11 11 License: GNU General Public License v3.0 12 12 License URI: https://www.gnu.org/licenses/gpl-3.0.html 13 WC requires at least: 4. 5.014 WC tested up to: 9.8.013 WC requires at least: 4.8.0 14 WC tested up to: 10.0.0 15 15 // N.B. WooCommerce doesn't check the minor version. So, '3.9.0' means 'the entire 3.9 series' 16 16 Copyright: 2014- David Anderson -
woocommerce-eu-vat-compliance/tags/1.35.5/nusoap/class.soap_parser.php
r2988486 r3339144 101 101 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 102 102 xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding); 103 // Set the object for the parser.104 xml_set_object($this->parser, $this);105 103 // Set the element handlers for the parser. 106 xml_set_element_handler($this->parser, 'start_element','end_element');107 xml_set_character_data_handler($this->parser, 'character_data');104 xml_set_element_handler($this->parser, array($this, 'start_element'), array($this, 'end_element')); 105 xml_set_character_data_handler($this->parser, array($this, 'character_data')); 108 106 109 107 // Parse the XML file. -
woocommerce-eu-vat-compliance/tags/1.35.5/nusoap/class.wsdl.php
r2988486 r3339144 75 75 * @access public 76 76 */ 77 function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){77 public function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ 78 78 parent::__construct(); 79 79 $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); … … 274 274 // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 275 275 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 276 // Set the object for the parser.277 xml_set_object($this->parser, $this);278 276 // Set the element handlers for the parser. 279 xml_set_element_handler($this->parser, 'start_element', 'end_element');280 xml_set_character_data_handler($this->parser, 'character_data');277 xml_set_element_handler($this->parser, array($this, 'start_element'), array($this, 'end_element')); 278 xml_set_character_data_handler($this->parser, array($this, 'character_data')); 281 279 // Parse the XML file. 282 280 if (!xml_parse($this->parser, $wsdl_string, true)) { … … 307 305 * start-element handler 308 306 * 309 * @param string$parser XML parser object307 * @param object $parser XML parser object 310 308 * @param string $name element name 311 309 * @param string $attrs associative array of attributes … … 521 519 * end-element handler 522 520 * 523 * @param string$parser XML parser object521 * @param object $parser XML parser object 524 522 * @param string $name element name 525 523 * @access private … … 555 553 * @access private 556 554 */ 557 function character_data($parser, $data)555 public function character_data($parser, $data) 558 556 { 559 557 $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; -
woocommerce-eu-vat-compliance/tags/1.35.5/nusoap/class.xmlschema.php
r1607044 r3339144 120 120 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 121 121 122 // Set the object for the parser.123 xml_set_object($this->parser, $this);124 125 122 // Set the element handlers for the parser. 126 123 if($type == "schema"){ 127 xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement');128 xml_set_character_data_handler($this->parser, 'schemaCharacterData');124 xml_set_element_handler($this->parser, array($this, 'schemaStartElement'), array($this, 'schemaEndElement')); 125 xml_set_character_data_handler($this->parser, array($this, 'schemaCharacterData')); 129 126 } elseif($type == "xml"){ 130 xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement');131 xml_set_character_data_handler($this->parser, 'xmlCharacterData');127 xml_set_element_handler($this->parser, array($this, 'xmlStartElement'), array($this, 'xmlEndElement')); 128 xml_set_character_data_handler($this->parser, array($this, 'xmlCharacterData')); 132 129 } 133 130 -
woocommerce-eu-vat-compliance/tags/1.35.5/preselect-country.php
r3277213 r3339144 246 246 $is_checkout_rest = $is_rest_request && in_array($this->current_rest_route, array('/wc/store/v1/cart/update-customer', '/wc/store/v1/checkout')); 247 247 248 // wc-ajax=ppc-create-order : call made by https://wordpress.org/plugins/woocommerce-paypal-payments/ ; on the back-end it uses the PayPal API to create an order, and returns the ID back to the front-end, which can then access a PayPal pop-up for that order. Thus it has to be treated as a checkout-context. 249 $is_checkout_request = $is_checkout_rest || (isset($_REQUEST['wc-ajax']) && in_array($_REQUEST['wc-ajax'], array('ppc-create-order'))); 250 248 251 // $state = $address[1]; $postcode = $address[2]; $city = $address[3]; 249 252 $country = isset($address[0]) ? $address[0] : ''; … … 261 264 262 265 // Checkout or cart context? 263 if ($is_checkout_re st || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart()) || defined('WOOCOMMERCE_CHECKOUT') || defined('WOOCOMMERCE_CART')) {266 if ($is_checkout_request || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart()) || defined('WOOCOMMERCE_CHECKOUT') || defined('WOOCOMMERCE_CART')) { 264 267 265 268 // Processing of checkout form activity - get from session only 266 269 $allow_from_widget_or_request = (!defined('WOOCOMMERCE_CHECKOUT') || !WOOCOMMERCE_CHECKOUT) && (!function_exists('is_checkout') || !is_checkout()) ? true : false; 267 if ($is_checkout_re st) $allow_from_widget_or_request = false;270 if ($is_checkout_request) $allow_from_widget_or_request = false; 268 271 269 272 // This excludes the final checkout processing case - i.e. includes only the pages 270 $allow_default = ($is_checkout_re st || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart())) && (!defined('WOOCOMMERCE_CHECKOUT') || !WOOCOMMERCE_CHECKOUT);273 $allow_default = ($is_checkout_request || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart())) && (!defined('WOOCOMMERCE_CHECKOUT') || !WOOCOMMERCE_CHECKOUT); 271 274 272 275 // On the cart or checkout, don't use a GeoIP lookup; don't allow use of the widget on the checkout … … 276 279 return array($vat_country, $vat_state, '', ''); 277 280 } 281 278 282 return $address; 279 283 } … … 285 289 return array($vat_country, $vat_state, '', ''); 286 290 } 287 291 288 292 return $address; 289 293 -
woocommerce-eu-vat-compliance/tags/1.35.5/readiness-tests.php
r3277213 r3339144 92 92 protected function res($result, $info) { 93 93 if (is_bool($result)) { 94 if ($result) { 95 $rescode = 'pass'; 96 } else { 97 $rescode = 'fail'; 98 } 94 $rescode = $result ? 'pass' : 'fail'; 99 95 } else { 100 96 $rescode = 'unknown'; … … 115 111 $minimum_supported_wc_version = '3.8'; 116 112 117 $result = (defined('WOOCOMMERCE_VERSION') && version_compare(WOOCOMMERCE_VERSION, $minimum_supported_wc_version, '>='));113 $result = defined('WOOCOMMERCE_VERSION') && version_compare(WOOCOMMERCE_VERSION, $minimum_supported_wc_version, '>='); 118 114 if ($result) { 119 115 // translators: a version number -
woocommerce-eu-vat-compliance/tags/1.35.5/readme.txt
r3277213 r3339144 3 3 Requires at least: 5.3 4 4 Tested up to: 6.8 5 Stable tag: 1.3 4.05 Stable tag: 1.35.5 6 6 Requires PHP: 7.1 7 7 Tags: woocommerce, eu vat, vat compliance, iva, moss … … 131 131 == Changelog == 132 132 133 = 1.35.5 - 2025-08-04 = 134 135 * TWEAK: Update VAT rates for Romania 136 137 = 1.35.4 - 2025-08-01 = 138 139 * TWEAK: When pre-filling the checkout page, if the VAT number was stored with a double-prefix, then fix it 140 * TWEAK: Update VAT rate for Estonia 141 142 = 1.35.3 - 2025-07-09 = 143 144 * TWEAK: Use WC_Order::save_meta_data() instead of WC_Order::save() in WC_EU_VAT_Compliance_Record_Order_Details to avoid unnecessary database updates 145 146 = 1.35.2 - 2025-06-25 = 147 148 * FIX: Invalidate the cart total calcuation cache if the cart hash has changed, fixing the issue of "exemption based upon value" calculations on the shortcode-based 'cart' page being based upon the pre-updated cart during an update operation 149 * TWEAK: Run readiness tests upon loading of the 'Readiness Report' tab instead of upon page loading, for quicker page loading and avoidance of unnecessary network calls. 150 * TWEAK: In the order and settings exports, include information on whether the designated cart page uses the cart shortcode 151 152 = 1.35.1 - 2025-06-17 = 153 154 * FIX: Fix incorrect reference to customer object during PayPal official extension off-site checkout 155 * TWEAK: In the order and settings exports, include information on whether the designated checkout page uses the checkout shortcode 156 * TWEAK: In the settings export, rename woocommerce_default_country to woocommerce_base_country and wc_eu_vat_compliance to wc_vat_compliance 157 158 = 1.35.0 - 2025-06-11 = 159 160 * FIX: Fix regression on the block checkout by which changes to the VAT number field were not feeding back to the "Order Review" section 161 * TWEAK: Provide more information in some cases of WSDL layer setup failure 162 * TWEAK: Replace use of xml_set_object() in nusoap code to resolve PHP 8.4 deprecations 163 * TWEAK: Mark as supporting WooCommerce 4.8+ (nothing has been changed to stop supporting previous versions; but this is now the official support requirement) 164 165 = 1.34.3 - 2025-04-30 = 166 167 * FIX: A further fix for the official WooCommerce PayPal extension; customer VAT exemptions were not applied on the non-standard AJAX call 168 169 = 1.34.2 - 2025-04-26 = 170 171 * FIX: The official WooCommerce PayPal extension uses a non-standard AJAX call when calculating order totals, resulting in possible incorrect context-dependent identification of taxation country 172 173 = 1.34.1 - 2025-04-22 = 174 175 * TWEAK: In the "VAT compliance information" meta-box, the status had regressed to being shown where the VAT number should have been displaying 176 133 177 = 1.34.0 - 2025-04-19 = 134 178 135 * FEATURE: When performing VAT number validations upon subscription renewal, exempt from taxes (requires Subscri ptio0.12.11 or later) if the user is still VAT exempt based upon a fresh look-up179 * FEATURE: When performing VAT number validations upon subscription renewal, exempt from taxes (requires Subscriben 0.12.11 or later) if the user is still VAT exempt based upon a fresh look-up 136 180 * TWEAK: When performing VAT number validations upon subscription renewal, prefer the most recent VAT number, trust the previous order's look-up less, record unsuccessful results with more detail, and do not retain information from previous lookups 137 181 * TWEAK: Prevent a PHP notice upon order placement if using the block checkout with no shipping required … … 1737 1781 1738 1782 == Upgrade Notice == 1739 * 1.3 4.0 Various improvements and fixes relating to the block checkout and handling of tax changes between a subscription renewal order and prior order. Also - since 1.32.1, the Premium version now uses version 2.0 of the HMRC (UK) VAT number lookup service, which is the only version available from January - if you are using it, you must go into the plugin settings and go through the authentication procedure. Other minor tweaks and improvements. A recommended update for all.1783 * 1.35.5 - Update VAT rates. N.B. Since 1.32.1, the Premium version now uses version 2.0 of the HMRC (UK) VAT number lookup service, which is the only version available from January - if you are using it, you must go into the plugin settings and go through the authentication procedure. Other minor tweaks and improvements. A recommended update for all. -
woocommerce-eu-vat-compliance/tags/1.35.5/record-order-details.php
r3277213 r3339144 276 276 $order->update_meta_data('wceuvat_conversion_rates', $conversion_rates); 277 277 278 $order->save ();278 $order->save_meta_data(); 279 279 280 280 return $conversion_rates; … … 337 337 if ($save_in_order) { 338 338 $order->update_meta_data('vat_compliance_vat_paid', $vat_paid); 339 $order->save ();339 $order->save_meta_data(); 340 340 } 341 341 … … 398 398 399 399 $order->update_meta_data('vat_compliance_country_info', apply_filters('wc_eu_vat_compliance_meta_country_info', $country_info, $order)); 400 $order->save ();400 $order->save_meta_data(); 401 401 402 402 echo ' '.__("The following information is based upon looking up the customer's IP address now.", 'woocommerce-eu-vat-compliance'); … … 616 616 $status = __('entered, but invalid', 'woocommerce-eu-vat-compliance'); 617 617 // translators: a status message and a VAT number 618 echo '<p><strong>'.sprintf(esc_html__('VAT number (%1$s): % 1$s', 'woocommerce-eu-vat-compliance'), $status, '</strong>'.$vat_number)."</p>\n";618 echo '<p><strong>'.sprintf(esc_html__('VAT number (%1$s): %2$s', 'woocommerce-eu-vat-compliance'), $status, '</strong>'.$vat_number)."</p>\n"; 619 619 } 620 620 -
woocommerce-eu-vat-compliance/trunk/bootstrap.php
r3277213 r3339144 101 101 102 102 // Update customer vat location on updating address on block checkout. 103 add_action('woocommerce_store_api_cart_update_customer_from_request', array($this, 'update_customer_vat_location') , 10, 2);103 add_action('woocommerce_store_api_cart_update_customer_from_request', array($this, 'update_customer_vat_location')); 104 104 } 105 105 … … 243 243 244 244 /** 245 * Update customer vatlocation for update tax245 * Update customer VAT location for update tax 246 246 * 247 247 * @param WC_Customer $customer Customer object. 248 * @param WP_REST_Request $request Request object.249 */250 public function update_customer_vat_location(\WC_Customer $customer, \WP_REST_Request $request) {248 */ 249 public function update_customer_vat_location(\WC_Customer $customer) { 250 251 251 $validation_util = new Automattic\WooCommerce\StoreApi\Utilities\ValidationUtils(); 252 252 $vat_controller = WooCommerce_EU_VAT_Compliance('WC_EU_VAT_Compliance_VAT_Number'); … … 261 261 * This resets the state to an empty string if it doesn't match the country. 262 262 */ 263 if ( !$validation_util->validate_state( $billing_state, $billing_country )) {263 if (!$validation_util->validate_state($billing_state, $billing_country)) { 264 264 $billing_state = ''; 265 265 } … … 310 310 if (!empty($vat_number) && $vat_controller) { 311 311 $check_result = $vat_controller->check_vat_number_validity($country, $vat_number, false, true); 312 313 if (empty($check_result['vat_number_accepted'])) { 314 $vat_number = null; 315 316 // Remove vat number if it's not valid vat number. 317 $this->wc->session->set('vat_number', null); 318 } 312 } 313 if (!isset($check_result) || empty($check_result['vat_number_accepted'])) { 314 $vat_number = null; 315 // Do not store invalid VAT numbers in the session 316 $this->wc->session->set('vat_number', null); 319 317 } 320 318 … … 1644 1642 1645 1643 /** 1644 * See if the designated checkout page uses the checkout shortcode. 1645 * N.B. Theoretically the designated checkout page might not actually be the one the site uses; a custom checkout may be in use, etc. 1646 * 1647 * @return Boolean 1648 */ 1649 public function checkout_page_uses_shortcode() { 1650 1651 $checkout_id = wc_get_page_id('checkout'); 1652 1653 // No checkout page found 1654 if ($checkout_id <= 0) return false; 1655 1656 $content = get_post_field('post_content', $checkout_id); 1657 1658 return has_shortcode($content, 'woocommerce_checkout'); 1659 } 1660 1661 /** 1662 * See if the designated cart page uses the cart shortcode. 1663 * N.B. Theoretically the designated cart page might not actually be the one the site uses; a custom cart may be in use, etc. 1664 * 1665 * @return Boolean 1666 */ 1667 public function cart_page_uses_shortcode() { 1668 1669 $cart_id = wc_get_page_id('cart'); 1670 1671 // No cart page found 1672 if ($cart_id <= 0) return false; 1673 1674 $content = get_post_field('post_content', $cart_id); 1675 1676 return has_shortcode($content, 'woocommerce_cart'); 1677 } 1678 1679 /** 1646 1680 * Rename the "Valid EU VAT Number" field to "Valid VAT Number" 1647 1681 */ -
woocommerce-eu-vat-compliance/trunk/control-centre.php
r3188577 r3339144 165 165 if (empty($_POST['settings']) || !is_string($_POST['settings'])) die; 166 166 167 parse_str( $_POST['settings'], $posted_settings);167 parse_str(stripslashes($_POST['settings']), $posted_settings); 168 168 169 169 $posted_settings = stripslashes_deep($posted_settings); … … 318 318 'content' => $contents 319 319 )); 320 } elseif ('load_readiness_tab' === $_POST['subaction']) { 321 ob_start(); 322 $this->render_tab_readiness_table(); 323 $contents = @ob_get_contents(); 324 @ob_end_clean(); 325 326 echo json_encode(array( 327 'result' => 'ok', 328 'content' => $contents 329 )); 330 320 331 } elseif ('export_settings' == $_POST['subaction']) { 321 332 322 $plugin_version = WooCommerce_EU_VAT_Compliance()->get_version(); 333 $compliance = WooCommerce_EU_VAT_Compliance(); 334 335 $plugin_version = $compliance->get_version(); 323 336 324 337 include(ABSPATH.WPINC.'/version.php'); … … 333 346 } 334 347 335 $options['woocommerce_ default_country'] = WC()->countries->get_base_country();348 $options['woocommerce_base_country'] = WC()->countries->get_base_country(); 336 349 337 350 $results = array( … … 339 352 'versions' => array( 340 353 'wc' => defined('WOOCOMMERCE_VERSION') ? WOOCOMMERCE_VERSION : '?', 341 'wc_ eu_vat_compliance' => '?',354 'wc_vat_compliance' => '?', 342 355 'wp' => $wp_version 356 ), 357 'features' => array( 358 'hpos_enabled' => $compliance->woocommerce_custom_order_tables_enabled(), 359 'checkout_page_using_shortcode' => $compliance->checkout_page_uses_shortcode(), 360 'cart_page_using_shortcode' => $compliance->cart_page_uses_shortcode(), 343 361 ), 344 362 ); … … 483 501 )); 484 502 485 $active_tab = !empty($_REQUEST['tab']) ? $_REQUEST['tab'] : 'settings';503 $active_tab = empty($_REQUEST['tab']) ? 'settings' : stripslashes($_REQUEST['tab']); 486 504 if ('taxes' == $active_tab || !empty($_GET['range'])) $active_tab = 'reports'; 487 505 … … 525 543 foreach ($tabs as $slug => $title) { 526 544 ?> 527 <a class="nav-tab <?php if ($slug == $active_tab) echo 'nav-tab-active'; ?>" href="#wceuvat-navtab-<?php echo $slug;?>-content" id="wceuvat-navtab-<?php echo $slug;?>"><?php echo $title;?></a>545 <a class="nav-tab <?php if ($slug == $active_tab) echo 'nav-tab-active'; ?>" href="#wceuvat-navtab-<?php echo esc_attr($slug);?>-content" id="wceuvat-navtab-<?php echo esc_attr($slug);?>"><?php echo esc_html($title);?></a> 528 546 <?php 529 547 } … … 532 550 533 551 foreach ($tabs as $slug => $title) { 534 echo "<div class=\"wceuvat-navtab-content\" id=\"wceuvat-navtab-". $slug."-content\"";552 echo "<div class=\"wceuvat-navtab-content\" id=\"wceuvat-navtab-".esc_attr($slug)."-content\""; 535 553 if ($slug != $active_tab) echo ' style="display:none;"'; 536 554 echo ">"; … … 1450 1468 echo '<p>'.esc_html__("N.B. If you are not selling goods for which the \"place of supply\" is deemed to be the customer's location (rather than the seller's; e.g. electronically supplied goods), then the tests for the presence of up-to-date VAT per-country rates are not relevant and you should not use them.", 'woocommerce-eu-vat-compliance').'</p>'; 1451 1469 1470 // This is populated via AJAX so that the tests don't have to be done upon each settings page load 1471 echo '<div id="wcvat_readiness_results_table_container"></div>'; 1472 1473 // N.B. This is duplicated in render_tab_readiness(); keep them in sync. 1474 $opts = get_option('wceuvat_background_tests'); 1475 $email = empty($opts['email']) ? '' : (string) $opts['email']; 1476 1477 $default_bottom_blurb = '<p><a href="https://www.simbahosting.co.uk/s3/product/woocommerce-eu-vat-compliance/">'.esc_html__('To automatically run these tests daily, and notify yourself of any failed tests by email, use our Premium version.', 'woocommerce-eu-vat-compliance').'</a></p>'; 1478 $bottom_blurb = apply_filters('wceuvat_readinesstests_bottom_section', $default_bottom_blurb, $email); 1479 1480 echo $bottom_blurb; 1481 1482 echo '</div>'; 1483 1484 } 1485 1486 /** 1487 * Output the readiness test result table 1488 */ 1489 private function render_tab_readiness_table() { 1452 1490 if (!class_exists('WC_EU_VAT_Compliance_Readiness_Tests')) require_once(WC_VAT_COMPLIANCE_DIR.'/readiness-tests.php'); 1453 1491 $test = new WC_EU_VAT_Compliance_Readiness_Tests(); 1454 1492 $results = $test->get_results(); 1455 1493 1456 1494 $result_descriptions = $test->result_descriptions(); 1457 1495 1458 1496 ?> 1459 1497 <table> 1460 1498 <thead> 1461 <tr>1462 <th></th>1463 <th style="text-align:left; min-width: 140px;"><?php _e('Test', 'woocommerce-eu-vat-compliance');?></th>1464 <th style="text-align:left; min-width:60px;"><?php _e('Result', 'woocommerce-eu-vat-compliance');?></th>1465 <th style="text-align:left;"><?php _e('Futher information', 'woocommerce-eu-vat-compliance');?></th>1466 </tr>1499 <tr> 1500 <th></th> 1501 <th style="text-align:left; min-width: 140px;"><?php _e('Test', 'woocommerce-eu-vat-compliance');?></th> 1502 <th style="text-align:left; min-width:60px;"><?php _e('Result', 'woocommerce-eu-vat-compliance');?></th> 1503 <th style="text-align:left;"><?php _e('Futher information', 'woocommerce-eu-vat-compliance');?></th> 1504 </tr> 1467 1505 </thead> 1468 1506 <tbody> 1469 1507 <?php 1470 1508 1509 // N.B. This is duplicated in render_tab_readiness(); keep them in sync. 1471 1510 $opts = get_option('wceuvat_background_tests'); 1472 $email = empty($opts['email']) ? '' : (string)$opts['email']; 1473 1511 $email = empty($opts['email']) ? '' : (string) $opts['email']; 1474 1512 $default_bottom_blurb = '<p><a href="https://www.simbahosting.co.uk/s3/product/woocommerce-eu-vat-compliance/">'.esc_html__('To automatically run these tests daily, and notify yourself of any failed tests by email, use our Premium version.', 'woocommerce-eu-vat-compliance').'</a></p>'; 1475 1513 $bottom_blurb = apply_filters('wceuvat_readinesstests_bottom_section', $default_bottom_blurb, $email); 1476 1514 $premium_present = ($bottom_blurb == $default_bottom_blurb) ? false : true; 1477 1515 1478 1516 foreach ($results as $id => $res) { 1479 1517 if (!is_array($res)) continue; … … 1494 1532 } 1495 1533 $row_bg = 'color:'.$col; 1496 1534 1497 1535 $checked = (is_array($opts) && empty($opts['tests'][$id])) ? false : true; 1498 1536 1499 1537 ?> 1500 1501 <tr style="<?php echo $row_bg;?>">1502 <td style="vertical-align:top;"><?php1503 if ($premium_present) { ?>1504 <input type="checkbox" id="wceuvat_test_<?php echo esc_attr($id);?>" name="wceuvat_test_<?php echo esc_attr($id);?>" value="1" <?php if ($checked) echo 'checked="checked"'; ?>>1538 1539 <tr style="<?php echo esc_attr($row_bg);?>"> 1540 <td style="vertical-align:top;"><?php 1541 if ($premium_present) { ?> 1542 <input type="checkbox" id="wceuvat_test_<?php echo esc_attr($id);?>" name="wceuvat_test_<?php echo esc_attr($id);?>" value="1" <?php if ($checked) echo 'checked="checked"'; ?>> 1505 1543 <?php } ?> 1506 1544 </td> … … 1508 1546 <td style="vertical-align:top;"><?php echo $result_descriptions[$res['result']];?></td> 1509 1547 <td style="vertical-align:top;"><?php echo $res['info'];?></td> 1510 </tr>1511 <?php1512 } 1513 1548 </tr> 1549 <?php 1550 } 1551 1514 1552 ?> 1515 1553 </tbody> 1516 1554 </table> 1555 1517 1556 <?php 1518 1519 echo $bottom_blurb; 1520 1521 echo '</div>'; 1522 1523 } 1524 1557 } 1558 1525 1559 /** 1526 1560 * Called by the WP action admin_footer when on our settings page … … 1532 1566 $nonce = wp_create_nonce("wc_eu_vat_nonce"); 1533 1567 $response = esc_js(__('Response:', 'woocommerce-eu-vat-compliance')); 1534 $loading = esc_js(__(' Loading...', 'woocommerce-eu-vat-compliance'));1568 $loading = esc_js(__('Running readiness tests...', 'woocommerce-eu-vat-compliance')); 1535 1569 $error = esc_js(__('Error', 'woocommerce-eu-vat-compliance')); 1536 1570 … … 1669 1703 $('#wceuvat-navtab-'+id.substring(15)+'-content').show(); 1670 1704 // This is not yet ready 1671 //$('#wceuvat_tabs').trigger('show_'+id.substring(15));1705 $('#wceuvat_tabs').trigger('show_'+id.substring(15)); 1672 1706 } 1673 1707 return false; 1674 1708 }); 1675 1709 1676 var content_loaded = false; 1677 $('#wceuvat_tabs').on('show_reports', function() { 1678 if (content_loaded) return; 1679 content_loaded = true; 1680 $('#wceuvat-navtab-reports-content').html('$loading'); 1710 var readiness_content_loaded = false; 1711 1712 $('#wceuvat_tabs').on('show_readiness', function() { 1713 1714 if (readiness_content_loaded) return; 1715 1716 readiness_content_loaded = true; 1717 1718 jQuery.blockUI({ message: "<h1>$loading</h1>" }); 1719 1720 $('#wcvat_readiness_results_table_container').html('$loading'); 1721 1681 1722 $.post(ajaxurl, { 1682 1723 action: "wc_eu_vat_cc", 1683 subaction: 'load_re ports_tab',1724 subaction: 'load_readiness_tab', 1684 1725 _wpnonce: '$nonce' 1685 1726 }, function(response) { 1686 1727 resp = JSON.parse(response); 1687 1728 if (resp.result == 'ok') { 1688 $('#wc euvat-navtab-reports-content').html(resp.content);1729 $('#wcvat_readiness_results_table_container').html(resp.content); 1689 1730 } else { 1690 $('#wc euvat-navtab-reports-content').html('$error');1731 $('#wcvat_readiness_results_table_container').html('$error'); 1691 1732 console.log(resp); 1692 1733 } 1734 jQuery.unblockUI(); 1693 1735 }); 1694 1736 }); -
woocommerce-eu-vat-compliance/trunk/data/rates.json
r3277213 r3339144 1 1 { 2 "last_updated": "2025-0 3-06T21:00:00Z",2 "last_updated": "2025-08-04T12:00:00Z", 3 3 "disclaimer": "This data is compiled from official European Commission sources to be as accurate as possible, however no guarantee of accuracy is provided. Use at your own risk. Don't trust random people on the internet without doing your own research.", 4 4 "rates": { … … 62 62 "EE": { 63 63 "country": "Estonia", 64 "standard_rate": 2 2.00,65 "standard_rate_by_time": { "0": 20.00, "1704063600": 22.00 },64 "standard_rate": 24.00, 65 "standard_rate_by_time": { "0": 20.00, "1704063600": 22.00, "1751324400": 24.00 }, 66 66 "reduced_rate": 9.00, 67 67 "reduced_rate_alt": false, … … 206 206 "RO": { 207 207 "country": "Romania", 208 "standard_rate": 19.00, 209 "reduced_rate": 9.00, 210 "reduced_rate_alt": 5.00, 208 "standard_rate": 21.00, 209 "standard_rate_by_time": { "0": 19.00, "1754002800": 21.00 }, 210 "reduced_rate": 11.00, 211 "reduced_rate_by_time": { "0": 9.00, "1754002800": 11.00 }, 212 "reduced_rate_alt": false, 211 213 "super_reduced_rate": false, 212 214 "parking_rate": false -
woocommerce-eu-vat-compliance/trunk/eu-vat-compliance.php
r3277213 r3339144 4 4 Plugin URI: https://www.simbahosting.co.uk/s3/product/woocommerce-eu-vat-compliance/ 5 5 Description: Provides features to assist WooCommerce with European VAT compliance 6 Version: 1.3 4.06 Version: 1.35.5 7 7 Text Domain: woocommerce-eu-vat-compliance 8 8 Domain Path: /languages … … 11 11 License: GNU General Public License v3.0 12 12 License URI: https://www.gnu.org/licenses/gpl-3.0.html 13 WC requires at least: 4. 5.014 WC tested up to: 9.8.013 WC requires at least: 4.8.0 14 WC tested up to: 10.0.0 15 15 // N.B. WooCommerce doesn't check the minor version. So, '3.9.0' means 'the entire 3.9 series' 16 16 Copyright: 2014- David Anderson -
woocommerce-eu-vat-compliance/trunk/nusoap/class.soap_parser.php
r2988486 r3339144 101 101 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 102 102 xml_parser_set_option($this->parser, XML_OPTION_TARGET_ENCODING, $this->xml_encoding); 103 // Set the object for the parser.104 xml_set_object($this->parser, $this);105 103 // Set the element handlers for the parser. 106 xml_set_element_handler($this->parser, 'start_element','end_element');107 xml_set_character_data_handler($this->parser, 'character_data');104 xml_set_element_handler($this->parser, array($this, 'start_element'), array($this, 'end_element')); 105 xml_set_character_data_handler($this->parser, array($this, 'character_data')); 108 106 109 107 // Parse the XML file. -
woocommerce-eu-vat-compliance/trunk/nusoap/class.wsdl.php
r2988486 r3339144 75 75 * @access public 76 76 */ 77 function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){77 public function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ 78 78 parent::__construct(); 79 79 $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); … … 274 274 // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); 275 275 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 276 // Set the object for the parser.277 xml_set_object($this->parser, $this);278 276 // Set the element handlers for the parser. 279 xml_set_element_handler($this->parser, 'start_element', 'end_element');280 xml_set_character_data_handler($this->parser, 'character_data');277 xml_set_element_handler($this->parser, array($this, 'start_element'), array($this, 'end_element')); 278 xml_set_character_data_handler($this->parser, array($this, 'character_data')); 281 279 // Parse the XML file. 282 280 if (!xml_parse($this->parser, $wsdl_string, true)) { … … 307 305 * start-element handler 308 306 * 309 * @param string$parser XML parser object307 * @param object $parser XML parser object 310 308 * @param string $name element name 311 309 * @param string $attrs associative array of attributes … … 521 519 * end-element handler 522 520 * 523 * @param string$parser XML parser object521 * @param object $parser XML parser object 524 522 * @param string $name element name 525 523 * @access private … … 555 553 * @access private 556 554 */ 557 function character_data($parser, $data)555 public function character_data($parser, $data) 558 556 { 559 557 $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; -
woocommerce-eu-vat-compliance/trunk/nusoap/class.xmlschema.php
r1607044 r3339144 120 120 xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); 121 121 122 // Set the object for the parser.123 xml_set_object($this->parser, $this);124 125 122 // Set the element handlers for the parser. 126 123 if($type == "schema"){ 127 xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement');128 xml_set_character_data_handler($this->parser, 'schemaCharacterData');124 xml_set_element_handler($this->parser, array($this, 'schemaStartElement'), array($this, 'schemaEndElement')); 125 xml_set_character_data_handler($this->parser, array($this, 'schemaCharacterData')); 129 126 } elseif($type == "xml"){ 130 xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement');131 xml_set_character_data_handler($this->parser, 'xmlCharacterData');127 xml_set_element_handler($this->parser, array($this, 'xmlStartElement'), array($this, 'xmlEndElement')); 128 xml_set_character_data_handler($this->parser, array($this, 'xmlCharacterData')); 132 129 } 133 130 -
woocommerce-eu-vat-compliance/trunk/preselect-country.php
r3277213 r3339144 246 246 $is_checkout_rest = $is_rest_request && in_array($this->current_rest_route, array('/wc/store/v1/cart/update-customer', '/wc/store/v1/checkout')); 247 247 248 // wc-ajax=ppc-create-order : call made by https://wordpress.org/plugins/woocommerce-paypal-payments/ ; on the back-end it uses the PayPal API to create an order, and returns the ID back to the front-end, which can then access a PayPal pop-up for that order. Thus it has to be treated as a checkout-context. 249 $is_checkout_request = $is_checkout_rest || (isset($_REQUEST['wc-ajax']) && in_array($_REQUEST['wc-ajax'], array('ppc-create-order'))); 250 248 251 // $state = $address[1]; $postcode = $address[2]; $city = $address[3]; 249 252 $country = isset($address[0]) ? $address[0] : ''; … … 261 264 262 265 // Checkout or cart context? 263 if ($is_checkout_re st || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart()) || defined('WOOCOMMERCE_CHECKOUT') || defined('WOOCOMMERCE_CART')) {266 if ($is_checkout_request || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart()) || defined('WOOCOMMERCE_CHECKOUT') || defined('WOOCOMMERCE_CART')) { 264 267 265 268 // Processing of checkout form activity - get from session only 266 269 $allow_from_widget_or_request = (!defined('WOOCOMMERCE_CHECKOUT') || !WOOCOMMERCE_CHECKOUT) && (!function_exists('is_checkout') || !is_checkout()) ? true : false; 267 if ($is_checkout_re st) $allow_from_widget_or_request = false;270 if ($is_checkout_request) $allow_from_widget_or_request = false; 268 271 269 272 // This excludes the final checkout processing case - i.e. includes only the pages 270 $allow_default = ($is_checkout_re st || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart())) && (!defined('WOOCOMMERCE_CHECKOUT') || !WOOCOMMERCE_CHECKOUT);273 $allow_default = ($is_checkout_request || (function_exists('is_checkout') && is_checkout()) || (function_exists('is_cart') && is_cart())) && (!defined('WOOCOMMERCE_CHECKOUT') || !WOOCOMMERCE_CHECKOUT); 271 274 272 275 // On the cart or checkout, don't use a GeoIP lookup; don't allow use of the widget on the checkout … … 276 279 return array($vat_country, $vat_state, '', ''); 277 280 } 281 278 282 return $address; 279 283 } … … 285 289 return array($vat_country, $vat_state, '', ''); 286 290 } 287 291 288 292 return $address; 289 293 -
woocommerce-eu-vat-compliance/trunk/readiness-tests.php
r3277213 r3339144 92 92 protected function res($result, $info) { 93 93 if (is_bool($result)) { 94 if ($result) { 95 $rescode = 'pass'; 96 } else { 97 $rescode = 'fail'; 98 } 94 $rescode = $result ? 'pass' : 'fail'; 99 95 } else { 100 96 $rescode = 'unknown'; … … 115 111 $minimum_supported_wc_version = '3.8'; 116 112 117 $result = (defined('WOOCOMMERCE_VERSION') && version_compare(WOOCOMMERCE_VERSION, $minimum_supported_wc_version, '>='));113 $result = defined('WOOCOMMERCE_VERSION') && version_compare(WOOCOMMERCE_VERSION, $minimum_supported_wc_version, '>='); 118 114 if ($result) { 119 115 // translators: a version number -
woocommerce-eu-vat-compliance/trunk/readme.txt
r3277213 r3339144 3 3 Requires at least: 5.3 4 4 Tested up to: 6.8 5 Stable tag: 1.3 4.05 Stable tag: 1.35.5 6 6 Requires PHP: 7.1 7 7 Tags: woocommerce, eu vat, vat compliance, iva, moss … … 131 131 == Changelog == 132 132 133 = 1.35.5 - 2025-08-04 = 134 135 * TWEAK: Update VAT rates for Romania 136 137 = 1.35.4 - 2025-08-01 = 138 139 * TWEAK: When pre-filling the checkout page, if the VAT number was stored with a double-prefix, then fix it 140 * TWEAK: Update VAT rate for Estonia 141 142 = 1.35.3 - 2025-07-09 = 143 144 * TWEAK: Use WC_Order::save_meta_data() instead of WC_Order::save() in WC_EU_VAT_Compliance_Record_Order_Details to avoid unnecessary database updates 145 146 = 1.35.2 - 2025-06-25 = 147 148 * FIX: Invalidate the cart total calcuation cache if the cart hash has changed, fixing the issue of "exemption based upon value" calculations on the shortcode-based 'cart' page being based upon the pre-updated cart during an update operation 149 * TWEAK: Run readiness tests upon loading of the 'Readiness Report' tab instead of upon page loading, for quicker page loading and avoidance of unnecessary network calls. 150 * TWEAK: In the order and settings exports, include information on whether the designated cart page uses the cart shortcode 151 152 = 1.35.1 - 2025-06-17 = 153 154 * FIX: Fix incorrect reference to customer object during PayPal official extension off-site checkout 155 * TWEAK: In the order and settings exports, include information on whether the designated checkout page uses the checkout shortcode 156 * TWEAK: In the settings export, rename woocommerce_default_country to woocommerce_base_country and wc_eu_vat_compliance to wc_vat_compliance 157 158 = 1.35.0 - 2025-06-11 = 159 160 * FIX: Fix regression on the block checkout by which changes to the VAT number field were not feeding back to the "Order Review" section 161 * TWEAK: Provide more information in some cases of WSDL layer setup failure 162 * TWEAK: Replace use of xml_set_object() in nusoap code to resolve PHP 8.4 deprecations 163 * TWEAK: Mark as supporting WooCommerce 4.8+ (nothing has been changed to stop supporting previous versions; but this is now the official support requirement) 164 165 = 1.34.3 - 2025-04-30 = 166 167 * FIX: A further fix for the official WooCommerce PayPal extension; customer VAT exemptions were not applied on the non-standard AJAX call 168 169 = 1.34.2 - 2025-04-26 = 170 171 * FIX: The official WooCommerce PayPal extension uses a non-standard AJAX call when calculating order totals, resulting in possible incorrect context-dependent identification of taxation country 172 173 = 1.34.1 - 2025-04-22 = 174 175 * TWEAK: In the "VAT compliance information" meta-box, the status had regressed to being shown where the VAT number should have been displaying 176 133 177 = 1.34.0 - 2025-04-19 = 134 178 135 * FEATURE: When performing VAT number validations upon subscription renewal, exempt from taxes (requires Subscri ptio0.12.11 or later) if the user is still VAT exempt based upon a fresh look-up179 * FEATURE: When performing VAT number validations upon subscription renewal, exempt from taxes (requires Subscriben 0.12.11 or later) if the user is still VAT exempt based upon a fresh look-up 136 180 * TWEAK: When performing VAT number validations upon subscription renewal, prefer the most recent VAT number, trust the previous order's look-up less, record unsuccessful results with more detail, and do not retain information from previous lookups 137 181 * TWEAK: Prevent a PHP notice upon order placement if using the block checkout with no shipping required … … 1737 1781 1738 1782 == Upgrade Notice == 1739 * 1.3 4.0 Various improvements and fixes relating to the block checkout and handling of tax changes between a subscription renewal order and prior order. Also - since 1.32.1, the Premium version now uses version 2.0 of the HMRC (UK) VAT number lookup service, which is the only version available from January - if you are using it, you must go into the plugin settings and go through the authentication procedure. Other minor tweaks and improvements. A recommended update for all.1783 * 1.35.5 - Update VAT rates. N.B. Since 1.32.1, the Premium version now uses version 2.0 of the HMRC (UK) VAT number lookup service, which is the only version available from January - if you are using it, you must go into the plugin settings and go through the authentication procedure. Other minor tweaks and improvements. A recommended update for all. -
woocommerce-eu-vat-compliance/trunk/record-order-details.php
r3277213 r3339144 276 276 $order->update_meta_data('wceuvat_conversion_rates', $conversion_rates); 277 277 278 $order->save ();278 $order->save_meta_data(); 279 279 280 280 return $conversion_rates; … … 337 337 if ($save_in_order) { 338 338 $order->update_meta_data('vat_compliance_vat_paid', $vat_paid); 339 $order->save ();339 $order->save_meta_data(); 340 340 } 341 341 … … 398 398 399 399 $order->update_meta_data('vat_compliance_country_info', apply_filters('wc_eu_vat_compliance_meta_country_info', $country_info, $order)); 400 $order->save ();400 $order->save_meta_data(); 401 401 402 402 echo ' '.__("The following information is based upon looking up the customer's IP address now.", 'woocommerce-eu-vat-compliance'); … … 616 616 $status = __('entered, but invalid', 'woocommerce-eu-vat-compliance'); 617 617 // translators: a status message and a VAT number 618 echo '<p><strong>'.sprintf(esc_html__('VAT number (%1$s): % 1$s', 'woocommerce-eu-vat-compliance'), $status, '</strong>'.$vat_number)."</p>\n";618 echo '<p><strong>'.sprintf(esc_html__('VAT number (%1$s): %2$s', 'woocommerce-eu-vat-compliance'), $status, '</strong>'.$vat_number)."</p>\n"; 619 619 } 620 620
Note: See TracChangeset
for help on using the changeset viewer.