• Resolved ahokainen

    (@ahokainen)


    For some reason I can’t get VIES-reports… It shows that I have no sales falling under VIES scheme within a certain time frame even though I know I have… What could be wrong?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter ahokainen

    (@ahokainen)

    For some reason the store hasn’t saved all VAT-related information.

    Customers VAT country N/A
    VAT number validated N/A

    However, when customers has checked out their VAT-numbers have been accepted and they have been able to buy without VAT as they should. VAT-numbers have been saved.

    What could be the problem?

    Plugin Author Diego

    (@daigo75)

    A few days ago we spotted a condition in which the VAT exemption data was not saved against the order meta (it would appear as “N/A” as you indicated). Your case might be the same.

    We haven’t released the version that contains that fix yet, but if you would like to give it a try, you can find it here: EU VAT Assistant 1.7.9.170602 – Development version (temporary link).

    As the link indicates, the fix will be part of version 1.7.9.170602.

    Thread Starter ahokainen

    (@ahokainen)

    Thanks but unfortunately this new version didn’t make any difference… the report still shows only a small part of these sales…

    Plugin Author Diego

    (@daigo75)

    If the data wasn’t collected, the reports won’t show it. The fix we applied is to ensure that the data will be collected for future, but the plugin won’t go through past order to update the missing VAT data. That will have to be done manually.

    If you want to amend the orders, you can find the data in wp_postmeta table, with meta key _eu_vat_evidence. The data is a multi-dimensional array of data, the VAT number data is in the ‘exemption’ key.

    Here’s an example of how you can update the VAT evidence with the VAT number data for order 123. You can use this script in a loop to update multiple orders:

    // Get an order ID. Replace it with the appropriate ID
    $order_id = 123;
    // Load the order
    $order = new \Aelia\WC\EU_VAT_Assistant\Order($order_id);
    
    // Retrieve the VAT evidence
    $vat_evidence = $order->get_vat_evidence();
    
    // Store customer's VAT number, VAT country and VAT number validation status
    $vat_evidence['exemption']['vat_number'] = $order->get_customer_vat_number();
    $vat_evidence['exemption']['vat_country'] = get_post_meta($order_id, '_vat_country', true);
    $vat_evidence['exemption']['vat_number_validated'] = get_post_meta($order_id, '_vat_number_validated', true);
    
    // Update VAT evidence meta
    update_post_meta($order_id, '_eu_vat_evidence', $vat_evidence);

    Once the VAT evidence data has been updated, the VIES report will pick it up automatically.

    Important
    The above script is an example, provided as is, without guarantees. It makes permanent changes to orders meta, therefore we recommend that you test it on a staging copy of your site before running it on a live site.

    • This reply was modified 7 years, 9 months ago by Diego.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘VIES reporting’ is closed to new replies.