<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="l10n_ie_tr" model="account.report">
        <field name="name">Tax Report</field>
        <field name="root_report_id" ref="account.generic_tax_report"/>
        <field name="country_id" ref="base.ie"/>
        <field name="allow_foreign_vat" eval="True"/>
        <field name="availability_condition">country</field>
        <field name="column_ids">
            <record id="l10n_ie_tr_balance" model="account.report.column">
                <field name="name">Balance</field>
                <field name="expression_label">balance</field>
            </record>
        </field>
        <field name="line_ids">
            <record id="l10n_ie_tr_T1" model="account.report.line">
                <field name="name">T1: VAT on Sales</field>
                <field name="code">l10n_ie_tr_T1</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_T1_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">-T1</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_T2" model="account.report.line">
                <field name="name">T2: VAT on Purchases</field>
                <field name="code">l10n_ie_tr_T2</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_T2_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">T2</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_T3" model="account.report.line">
                <field name="name">T3: VAT payable</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_T3_aggregation" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">aggregation</field>
                        <field name="formula">l10n_ie_tr_T1.balance - l10n_ie_tr_T2.balance</field>
                        <field name="subformula">if_above(EUR(0))</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_T4" model="account.report.line">
                <field name="name">T4: VAT repayable</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_T4_aggregation" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">aggregation</field>
                        <field name="formula">l10n_ie_tr_T2.balance - l10n_ie_tr_T1.balance</field>
                        <field name="subformula">if_above(EUR(0))</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_E1" model="account.report.line">
                <field name="name">E1: intra-EU supplies of goods</field>
                <field name="code">l10n_ie_tr_E1</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_E1_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">-E1</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_E2" model="account.report.line">
                <field name="name">E2: intra-EU acquisitions of goods</field>
                <field name="code">l10n_ie_tr_E2</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_E2_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">E2</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_ES1" model="account.report.line">
                <field name="name">ES1: intra-EU supply of service</field>
                <field name="code">l10n_ie_tr_ES1</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_ES1_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">-ES1</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_ES2" model="account.report.line">
                <field name="name">ES2: intra-EU acquisition of services</field>
                <field name="code">l10n_ie_tr_ES2</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_ES2_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">ES2</field>
                    </record>
                </field>
            </record>
            <record id="l10n_ie_tr_PA1" model="account.report.line">
                <field name="name">PA1: postponed accounting</field>
                <field name="code">l10n_ie_tr_PA1</field>
                <field name="expression_ids">
                    <record id="l10n_ie_tr_PA1_tag" model="account.report.expression">
                        <field name="label">balance</field>
                        <field name="engine">tax_tags</field>
                        <field name="formula">PA1</field>
                    </record>
                </field>
            </record>
        </field>
    </record>
</odoo>
