• Resolved aengus123

    (@aengus123)


    We have the plugin set up to accept any VAT id entered as valid, and this generally works well and most users enter VAT number without issue. However, in some cases, we might need to update or change the VAT number after order has been placed. This is fine, but the issue we face is that the VIES report shows the original VAT number entered. Is there any way to edit or force an update of the VAT number so our VIES report is accurate?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Diego

    (@daigo75)

    Before answering your question, we must clarify that modifying the data recorded by the EU VAT Assistant is not an officially supported operation. In some jurisdictions, it’s also not allowed by law to change the details of an invoice that has already been generated. Due to that, we strongly advise to contact your tax consultant before making any modifications.

    Technical details
    The EU VAT Assistant stored a set of data in the following custom meta:
    1. _eu_vat_data. This meta is an array that contains the details of the tax applied to an order.
    2. _eu_vat_evidence. This meta is an array that contains evidence about customer’s location and VAT number.
    3. vat_number. This is a copy of the VAT number stored in the _eu_vat_evidence. This copy is stored to make it easier for 3rd parties or custom code to access it.

    If you wish to change the VAT number used by the EU VAT Assistant for the reports, you will have to modify it in two places:

    1. You will need to modify the _eu_vat_evidence meta. Something like the following could work:

    
    $eu_vat_evidence = $order->get_meta('_eu_vat_evidence');
    $eu_vat_evidence['exemption']['vat_number'] = '<NEW VAT NUMBER>';
    $order->update_meta_data('_eu_vat_evidence', $eu_vat_evidence);
    $order->save_meta_data();
    

    This is not an officially supported operation, therefore we can’t guarantee that it will work as you expect.

    2. You will need to modify the vat_number meta, to keep it in sync with the evidence, which is the one that actually matters:

    
    $order->update_meta_data('var_number', '<NEW VAT NUMBER>');
    $order->save_meta_data();
    

    The above will replace the data in the database, and the new data will be used by the reports.

    Important
    Please keep in mind that this won’t apply a VAT exemption on an order, nor will it refund any VAT that has been paid. Due to that, to have a cleaner status, it might be better to simply cancel the order and create a new one with the correct VAT number.

    • This reply was modified 2 years, 10 months ago by Diego. Reason: Formatting
    Thread Starter aengus123

    (@aengus123)

    Hi Diego,
    Thank you as always for your detailed and helpful reply – cancelling the previous order and creating a new one with the ‘correct’ VAT number certainly seems like the best way to deal with the scenario ??
    Thanks

    Plugin Author Diego

    (@daigo75)

    Indeed, having a clean order is always the best course of action, as it prevents issues that could be caused by human errors occurring during the “tweaking” of the underlying data.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘change vat number after order placed’ is closed to new replies.