{% sw_extends '@Storefront/storefront/component/address/address-personal.html.twig' %}
{% block component_address_personal_account_type_select %}
{% if (data and data.has('billingAddress') and data.get('billingAddress').has('company')) or formViolations.inputData.company %}
{% set accountType = constant('Shopware\\Core\\Checkout\\Customer\\CustomerEntity::ACCOUNT_TYPE_BUSINESS') %}
{% endif %}
{% if formViolations.inputData.company is not empty and data.get('company') is empty %}
{% do data.setCompany(formViolations.inputData.company) %}
{% endif %}
{% if formViolations.inputData.vatIds is not empty and data.get('vatIds') is empty %}
{% do data.setVatIds(formViolations.inputData.vatIds) %}
{% endif %}
{% if formViolations.inputData.customfields.acris_address_vat_id is not empty and data.customfields.acris_address_vat_id is empty %}
{% set customFields = data.customfields %}
{% if data.customfields is empty %}
{% set customFields = [] %}
{% endif %}
{% set customFields = customFields|merge({acris_address_vat_id: formViolations.inputData.customfields.acris_address_vat_id}) %}
{% do data.setCustomFields(customFields) %}
{% endif %}
{{ parent() }}
{% endblock %}