<?xml version="1.0"?>
<!--
/**
 * Avalara_AvaTax
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/osl-3.0.php
 *
 * @copyright  Copyright (c) 2016 Avalara, Inc.
 * @license    http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
 */
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
    <group id="cross_border" translate="label comment" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="40">
        <label>Transaction outside of US</label>
        <frontend_model>Avalara\AvaTax\Block\Adminhtml\System\Config\ExpandedFieldSet</frontend_model>
        <field id="use_business_identification_number" translate="label comment" type="select" sortOrder="3050" showInDefault="0" showInWebsite="0" showInStore="0">
            <config_path>tax/avatax/use_business_identification_number</config_path>
            <label>Send Business VAT IDs to Avalara</label>
            <frontend_model>submitVatEnabledToggle</frontend_model>
            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            <tooltip><![CDATA[The VAT number is sent to the Business identification number field in Avalara. If the user has a VAT number set on the Adobe Commerce shipping address, that number is used. If not, the tax or VAT Number from the customer record is used. Nothing is sent if there is no VAT number present.]]></tooltip>
        </field>
        <field id="enabled" translate="label" type="select" sortOrder="10" showInDefault="0" showInWebsite="0" showInStore="0">
            <config_path>tax/avatax_customs/enabled</config_path>
            <label>Calculate customs duties</label>
            <frontend_model>customDutyEnabledToggle</frontend_model>
            <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            <tooltip><![CDATA[
                Duty include duties, fees and taxes relevant to cross border shipments.
                This feature must be enabled in your Avalara account. Note that the proper use of this feature requires appropriate
                configuration of <strong>Cross Border Classes</strong> (see Stores > AvaTax > Cross Border Classes) and assignment
                of <strong>Cross Border Types</strong> to products.
            ]]></tooltip>
        </field>
        <field id="vat_transport" translate="label" sortOrder="3055" showInDefault="1" showInWebsite="1" showInStore="1">
            <config_path>tax/avatax_general/vat_transport</config_path>
            <label>Submit VAT Transport</label>
            <frontend_model>Avalara\AvaTax\Block\Adminhtml\Form\Field\Transport</frontend_model>
            <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model>
        </field>
        <depends>
            <field id="tax/avatax_configuration/enabled">1</field>
            <field id="tax/avatax_configuration/crossborder_hidden">1</field>
        </depends>
    </group>
</include>