<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
    <system>
        <section id="zhik_portal" sortOrder="10" translate="label" showInDefault="1" showInWebsite="1" showInStore="1">
            <class>separator-top</class>
            <label>Dealer Portal</label>
            <tab>zhik_extensions</tab>
            <resource>Zhik_Portal::settings</resource>
            <group id="general" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" translate="label">
                <label>General</label>
                <field id="category" type="select" translate="label" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Portal Category</label>
                    <source_model>Zhik\Portal\Model\System\Config\Source\Categories</source_model>
                </field>
            </group>
            <group id="orders" type="text" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1" translate="label">
                <label>Ordering Settings</label>
                <field id="enable_prepayment" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable Prepayment checkbox</label>
                    <comment>Show prepayment option for dealers with postpaid terms</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="force_prepayment" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Force Prepayment</label>
                    <comment>Force prepayment for accounts with PREPAID terms</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="prepayment_threshold" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Prepayment threshold</label>
                    <validate>validate-number</validate>
                    <comment>Force prepayment for orders under this amount. Use 0 to disable</comment>
                </field>
                <field id="prepayment_discount" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Prepayment Discount %</label>
                    <validate>validate-number</validate>
                    <comment>Used to display discount on portal order form.</comment>
                </field>
                <field id="allowed_countries" translate="label" type="multiselect" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Allowed Countries</label>
                    <comment>By default, website allowed shipping countries are enabled, you can enable additional countries for dealer accounts here.</comment>
                    <source_model>\Magento\Directory\Model\Config\Source\Country</source_model>
                    <can_be_empty>1</can_be_empty>
                </field>
                <field id="myoba_pricing" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable MYOB Price Lists</label>
                    <comment>Use customer/class price list specific prices from MYOB</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="myoba_purchase" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enable MYOB Incoming Stocks</label>
                    <comment>Show purchase order information and earliest promised dates from MYOB (Purchase Items)</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <!--<field id="dropship_surcharge" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Dropship Surcharge</label>
                    <comment>Apply dropship surcharge for orders shipped to addressses other than the default MYOB shipping address.</comment>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>-->
            </group>
            <group id="payments" type="text" sortOrder="25" showInDefault="1" showInWebsite="1" showInStore="1" translate="label">
                <label>Payment Settings</label>
                <field id="enabled" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="10">
                    <label>Enabled</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="gateway" translate="label comment" type="select" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="15">
                    <label>Payment Gateway</label>
                    <source_model>Zhik\Portal\Model\Config\Source\PaymentGateway</source_model>
                    <comment>Select payment gateway for portal payments. Can be configured per store view.</comment>
                </field>
                <field id="surcharge" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1" sortOrder="20">
                    <label>Surcharge %</label>
                    <validate>validate-number</validate>
                    <comment>Apply surcharge to credit card payments.</comment>
                </field>
                <field id="notify_email" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Payment Notification Email</label>
                    <validate>validate-email</validate>
                </field>
            </group>
        </section>
        <section id="carriers" translate="label" showInDefault="1" showInWebsite="1" showInStore="1">
            <group id="zhik_portal" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1" translate="label">
                <label>Postpaid Shipping</label>
                <field id="active" translate="label" type="select" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Enabled</label>
                    <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
                </field>
                <field id="title" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Title</label>
                </field>
                <field id="methodtitle" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Method Title</label>
                </field>
                <field id="sort_order" translate="label" type="text" showInDefault="1" showInWebsite="1" showInStore="1">
                    <label>Sort Order</label>
                </field>
            </group>
        </section>
    </system>
</config>
