<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="tax_report" 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.uy"/>
        <field name="filter_fiscal_position" eval="True"/>
        <field name="availability_condition">country</field>
        <field name="column_ids">
            <record id="tax_report_balance" model="account.report.column">
                <field name="name">Balance</field>
                <field name="expression_label">balance</field>
            </record>
        </field>
        <field name="line_ids">
            <record id="account_tax_report_base_impb" model="account.report.line">
                <field name="name">Base Imponible</field>
                <field name="aggregation_formula">BASE_IMPONIBLE_COMPRAS.balance + BASE_IMPONIBLE_VENTAS.balance</field>
                <field name="children_ids">
                    <record id="account_tax_report_base_impb_cmprs" model="account.report.line">
                        <field name="name">Base Imponible Compras</field>
                        <field name="code">BASE_IMPONIBLE_COMPRAS</field>
                        <field name="aggregation_formula">UYTAX_010101.balance + UYTAX_020101.balance + UYTAX_030101.balance + UYTAX_040101.balance</field>
                        <field name="children_ids">
                            <record id="account_tax_report_base_impb_cmprs_22" model="account.report.line">
                                <field name="name">Base Compras 22%</field>
                                <field name="code">UYTAX_010101</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_base_impb_cmprs_22_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Compras 22%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_base_impb_cmprs_10" model="account.report.line">
                                <field name="name">Base Compras 10%</field>
                                <field name="code">UYTAX_020101</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_base_impb_cmprs_10_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Compras 10%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_base_impb_cmprs_0" model="account.report.line">
                                <field name="name">Base Compras 0%</field>
                                <field name="code">UYTAX_030101</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_base_impb_cmprs_0_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Compras 0%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_impb_cmprs" model="account.report.line">
                                <field name="name">Base Imponible Compras</field>
                                <field name="code">UYTAX_040101</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_impb_cmprs_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Imponible Compras</field>
                                    </record>
                                </field>
                            </record>
                        </field>
                    </record>
                    <record id="account_tax_report_base_impb_vnts" model="account.report.line">
                        <field name="name">Base Imponible Ventas</field>
                        <field name="code">BASE_IMPONIBLE_VENTAS</field>
                        <field name="aggregation_formula">UYTAX_010201.balance + UYTAX_020201.balance + UYTAX_030201.balance + UYTAX_040201.balance</field>
                        <field name="children_ids">
                            <record id="account_tax_report_base_impb_vnts_22" model="account.report.line">
                                <field name="name">Base Ventas 22%</field>
                                <field name="code">UYTAX_010201</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_base_impb_vnts_22_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Ventas 22%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_base_impb_vnts_10" model="account.report.line">
                                <field name="name">Base Ventas 10%</field>
                                <field name="code">UYTAX_020201</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_base_impb_vnts_10_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Ventas 10%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_base_impb_vnts_0" model="account.report.line">
                                <field name="name">Base Ventas 0%</field>
                                <field name="code">UYTAX_030201</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_base_impb_vnts_0_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Ventas 0%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_impb_vnts" model="account.report.line">
                                <field name="name">Base Imponible Ventas</field>
                                <field name="code">UYTAX_040201</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_impb_vnts_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">Base Imponible Ventas</field>
                                    </record>
                                </field>
                            </record>
                        </field>
                    </record>
                </field>
            </record>
            <record id="account_tax_report_sldo_iva" model="account.report.line">
                <field name="name">Saldo de IVA</field>
                <field name="aggregation_formula">IVA_COMPRAS__PAGADO.balance + UYTAX_040102.balance + IVA_VENTAS__PERCIBIDO.balance</field>
                <field name="children_ids">
                    <record id="account_tax_report_iva_cmprs_pagdo" model="account.report.line">
                        <field name="name">IVA Compras - pagado</field>
                        <field name="code">IVA_COMPRAS__PAGADO</field>
                        <field name="aggregation_formula">UYTAX_010102.balance + UYTAX_020102.balance + COMPRAS_EXENTO_IVA.balance</field>
                        <field name="children_ids">
                            <record id="account_tax_report_iva_cmprs_22" model="account.report.line">
                                <field name="name">IVA Compras 22%</field>
                                <field name="code">UYTAX_010102</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_iva_cmprs_22_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">IVA Compras 22%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_iva_cmprs_10" model="account.report.line">
                                <field name="name">IVA Compras 10%</field>
                                <field name="code">UYTAX_020102</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_iva_cmprs_10_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">IVA Compras 10%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_cmprs_exnto_iva" model="account.report.line">
                                <field name="name">Compras Exento IVA</field>
                                <field name="code">COMPRAS_EXENTO_IVA</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_cmprs_exnto_iva_formula" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">external</field>
                                        <field name="formula">sum</field>
                                        <field name="subformula">editable;rounding=2</field>
                                    </record>
                                </field>
                            </record>
                        </field>
                    </record>
                    <record id="account_tax_report_cmprs_pagdo" model="account.report.line">
                        <field name="name">IVA Compras - pagado</field>
                        <field name="code">UYTAX_040102</field>
                        <field name="expression_ids">
                            <record id="account_tax_report_cmprs_pagdo_tag" model="account.report.expression">
                                <field name="label">balance</field>
                                <field name="engine">tax_tags</field>
                                <field name="formula">IVA Compras - pagado</field>
                            </record>
                        </field>
                    </record>
                    <record id="account_tax_report_iva_vnts_prcbdo" model="account.report.line">
                        <field name="name">IVA Ventas - percibido</field>
                        <field name="code">IVA_VENTAS__PERCIBIDO</field>
                        <field name="aggregation_formula">UYTAX_010202.balance + UYTAX_020202.balance + VENTAS_EXENTO_IVA.balance + UYTAX_040202.balance</field>
                        <field name="children_ids">
                            <record id="account_tax_report_iva_vnts_22" model="account.report.line">
                                <field name="name">IVA Ventas 22%</field>
                                <field name="code">UYTAX_010202</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_iva_vnts_22_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">IVA Ventas 22%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_iva_vnts_10" model="account.report.line">
                                <field name="name">IVA Ventas 10%</field>
                                <field name="code">UYTAX_020202</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_iva_vnts_10_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">IVA Ventas 10%</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_vnts_iva" model="account.report.line">
                                <field name="name">Ventas Exento IVA</field>
                                <field name="code">VENTAS_EXENTO_IVA</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_vnts_iva_formula" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">external</field>
                                        <field name="formula">sum</field>
                                        <field name="subformula">editable;rounding=2</field>
                                    </record>
                                </field>
                            </record>
                            <record id="account_tax_report_vnts_prcbdo" model="account.report.line">
                                <field name="name">IVA Ventas - percibido</field>
                                <field name="code">UYTAX_040202</field>
                                <field name="expression_ids">
                                    <record id="account_tax_report_vnts_prcbdo_tag" model="account.report.expression">
                                        <field name="label">balance</field>
                                        <field name="engine">tax_tags</field>
                                        <field name="formula">IVA Ventas - percibido</field>
                                    </record>
                                </field>
                            </record>
                        </field>
                    </record>
                </field>
            </record>
        </field>
    </record>
</odoo>
