<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>

        <!-- VAT Code Definitions -->

        <!-- Invoiced VAT -->

        <!-- Input VAT -->

        <record id="vat_code_chart_root" model="account.tax.code.template">
            <field name="name">Plan Fees UK</field>
        </record>

        <record id="vat_code_balance_net" model="account.tax.code.template">
            <field name="name">VAT Balance to Pay</field>
            <field name="parent_id" ref="vat_code_chart_root"/>
        </record>

        <record id="vat_code_input" model="account.tax.code.template">
            <field name="name">Input VAT</field>
            <field name="parent_id" ref="vat_code_balance_net"/>
            <field eval="-1" name="sign"/>
        </record>

        <record id="vat_code_input_S" model="account.tax.code.template">
            <field name="name">Input VAT Rate S (15%)</field>
            <field name="parent_id" ref="vat_code_input"/>
        </record>

        <record id="vat_code_input_R" model="account.tax.code.template">
            <field name="name">Input VAT Rate R (5%)</field>
            <field name="parent_id" ref="vat_code_input"/>
        </record>

        <!-- Output VAT -->

        <record id="vat_code_output" model="account.tax.code.template">
            <field name="name">Output VAT</field>
            <field name="parent_id" ref="vat_code_balance_net"/>
        </record>

        <record id="vat_code_output_S" model="account.tax.code.template">
            <field name="name">Output VAT Rate S (15%)</field>
            <field name="parent_id" ref="vat_code_output"/>
        </record>

        <record id="vat_code_output_R" model="account.tax.code.template">
            <field name="name">Output VAT Rate R (5%)</field>
            <field name="parent_id" ref="vat_code_output"/>
        </record>

        <!-- Invoiced Base of VAT -->

        <!-- Purchases -->

        <record id="vat_code_base_net" model="account.tax.code.template">
            <field name="name">Tax Bases</field>
            <field name="parent_id" ref="vat_code_chart_root"/>
        </record>

        <record id="vat_code_base_purchases" model="account.tax.code.template">
            <field name="name">Taxable Purchases Base</field>
            <field name="parent_id" ref="vat_code_base_net"/>
        </record>

        <record id="vat_code_purch_S" model="account.tax.code.template">
            <field name="name">Taxable Purchases Rated S (15%)</field>
            <field name="parent_id" ref="vat_code_base_purchases"/>
        </record>

        <record id="vat_code_purch_R" model="account.tax.code.template">
            <field name="name">Taxable Purchases Rated R (5%)</field>
            <field name="parent_id" ref="vat_code_base_purchases"/>
        </record>

        <record id="vat_code_purch_Z" model="account.tax.code.template">
            <field name="name">Taxable Purchases Rated Z (0%)</field>
            <field name="parent_id" ref="vat_code_base_purchases"/>
        </record>

        <record id="vat_code_purch_X" model="account.tax.code.template">
            <field name="name">Taxable Purchases Type X (Exempt)</field>
            <field name="parent_id" ref="vat_code_base_purchases"/>
        </record>

        <record id="vat_code_purch_O" model="account.tax.code.template">
            <field name="name">Taxable Purchases Type O (Out of scope)</field>
            <field name="parent_id" ref="vat_code_base_purchases"/>
        </record>

        <!-- Sales -->

        <record id="vat_code_base_sales" model="account.tax.code.template">
            <field name="name">Base of Taxable Sales</field>
            <field name="parent_id" ref="vat_code_base_net"/>
        </record>

        <record id="vat_code_sales_S" model="account.tax.code.template">
            <field name="name">Taxable Sales Rated S (15%)</field>
            <field name="parent_id" ref="vat_code_base_sales"/>
        </record>

        <record id="vat_code_sales_R" model="account.tax.code.template">
            <field name="name">Taxable Sales Rated R (5%)</field>
            <field name="parent_id" ref="vat_code_base_sales"/>
        </record>

        <record id="vat_code_sales_Z" model="account.tax.code.template">
            <field name="name">Taxable Sales Rated Z (0%)</field>
            <field name="parent_id" ref="vat_code_base_sales"/>
        </record>

        <record id="vat_code_sales_X" model="account.tax.code.template">
            <field name="name">Taxable Sales Type X (Exempt)</field>
            <field name="parent_id" ref="vat_code_base_sales"/>
        </record>

        <record id="vat_code_sales_O" model="account.tax.code.template">
            <field name="name">Taxable Sales Type O (Out of scope)</field>
            <field name="parent_id" ref="vat_code_base_sales"/>
        </record>

        <!-- Chart Template -->

        <record id="l10n_uk_chart_template" model="account.chart.template">
            <field name="name">UK Minimal Account Chart Template</field>
            <field name="account_root_id" ref="chart0"/>
            <field name="tax_code_root_id" ref="vat_code_chart_root"/>
          	<field name="bank_account_view_id" ref="bnk"/>
            <field name="property_account_receivable" ref="a_recv"/>
            <field name="property_account_payable" ref="a_pay"/>
            <field name="property_account_expense_categ" ref="a_expense"/>
            <field name="property_account_income_categ" ref="a_sale"/>
            <field name="property_reserve_and_surplus_account" ref="a_reserve_and_surplus"/>
        </record>

        <!-- VAT Codes -->
        <!-- Purchases + Input VAT -->

        <record id="ivats" model="account.tax.template">
       	 	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">IVAT S</field>
            <field eval="0.15" name="amount"/>
            <field name="type">percent</field>
            <field name="account_collected_id" ref="iva"/>
            <field name="account_paid_id" ref="iva"/>
            <field name="base_code_id" ref="vat_code_purch_S"/>
            <field name="tax_code_id" ref="vat_code_input_S"/>
            <field name="ref_base_code_id" ref="vat_code_purch_S"/>
            <field name="ref_tax_code_id" ref="vat_code_input_S"/>
            <field name="type_tax_use">purchase</field>
        </record>

        <record id="ivatr" model="account.tax.template">
       		<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">IVAT R</field>
            <field eval="0.05" name="amount"/>
            <field name="type">percent</field>
            <field name="account_collected_id" ref="iva"/>
            <field name="account_paid_id" ref="iva"/>
            <field name="base_code_id" ref="vat_code_purch_R"/>
            <field name="tax_code_id" ref="vat_code_input_R"/>
            <field name="ref_base_code_id" ref="vat_code_purch_R"/>
            <field name="ref_tax_code_id" ref="vat_code_input_R"/>
            <field name="type_tax_use">purchase</field>
        </record>

        <record id="ivatz" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">IVAT Z</field>
            <field eval="0.0" name="amount"/>
            <field name="type">percent</field>
            <field name="base_code_id" ref="vat_code_purch_Z"/>
            <field name="ref_base_code_id" ref="vat_code_purch_Z"/>
            <field name="type_tax_use">purchase</field>
        </record>

        <record id="ivatx" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">IVAT X</field>
            <field eval="0.0" name="amount"/>
            <field name="type">percent</field>
            <field name="base_code_id" ref="vat_code_purch_X"/>
            <field name="ref_base_code_id" ref="vat_code_purch_X"/>
            <field name="type_tax_use">purchase</field>
        </record>

        <record id="ivato" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">IVAT O</field>
            <field eval="0.0" name="amount"/>
            <field name="type">percent</field>
            <field name="base_code_id" ref="vat_code_purch_O"/>
            <field name="ref_base_code_id" ref="vat_code_purch_O"/>
            <field name="type_tax_use">purchase</field>
        </record>

        <!-- Sales + Output VAT -->

        <record id="ovats" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">OVAT S</field>
            <field eval="0.15" name="amount"/>
            <field name="type">percent</field>
            <field name="account_collected_id" ref="ova"/>
            <field name="account_paid_id" ref="ova"/>
            <field name="base_code_id" ref="vat_code_sales_S"/>
            <field name="tax_code_id" ref="vat_code_output_S"/>
            <field name="ref_base_code_id" ref="vat_code_sales_S"/>
            <field name="ref_tax_code_id" ref="vat_code_output_S"/>
            <field name="type_tax_use">sale</field>
        </record>

        <record id="ovatr" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">OVAT R</field>
            <field eval="0.05" name="amount"/>
            <field name="type">percent</field>
            <field name="account_collected_id" ref="ova"/>
            <field name="account_paid_id" ref="ova"/>
            <field name="base_code_id" ref="vat_code_sales_R"/>
            <field name="tax_code_id" ref="vat_code_output_R"/>
            <field name="ref_base_code_id" ref="vat_code_sales_R"/>
            <field name="ref_tax_code_id" ref="vat_code_output_R"/>
            <field name="type_tax_use">sale</field>
        </record>

        <record id="ovatz" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">OVAT Z</field>
            <field eval="0.0" name="amount"/>
            <field name="type">percent</field>
            <field name="base_code_id" ref="vat_code_sales_Z"/>
            <field name="ref_base_code_id" ref="vat_code_sales_Z"/>
            <field name="type_tax_use">sale</field>
        </record>

        <record id="ovatx" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">OVAT X</field>
            <field eval="0.0" name="amount"/>
            <field name="type">percent</field>
            <field name="base_code_id" ref="vat_code_sales_X"/>
            <field name="ref_base_code_id" ref="vat_code_sales_X"/>
            <field name="type_tax_use">sale</field>
        </record>

        <record id="ovato" model="account.tax.template">
        	<field name="chart_template_id" ref="l10n_uk_chart_template"/>
            <field name="name">OVAT O</field>
            <field eval="0.0" name="amount"/>
            <field name="type">percent</field>
            <field name="base_code_id" ref="vat_code_sales_O"/>
            <field name="ref_base_code_id" ref="vat_code_sales_O"/>
            <field name="type_tax_use">sale</field>
        </record>

    </data>
</openerp>
