<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="aged_receivable_report" model="account.report">
        <field name="name">Aged Receivable</field>
        <field name="filter_date_range" eval="False"/>
        <field name="filter_unfold_all" eval="True"/>
        <field name="filter_partner" eval="True"/>
        <field name="filter_period_comparison" eval="False"/>
        <field name="filter_account_type">receivable</field>
        <field name="filter_hierarchy">never</field>
        <field name="filter_show_draft" eval="False"/>
        <field name="filter_multi_company">selector</field>
        <field name="default_opening_date_filter">today</field>
        <field name="custom_handler_model_id" ref="model_account_aged_receivable_report_handler"/>
        <field name="column_ids">
            <record id="aged_receivable_report_invoice_date" model="account.report.column">
                <field name="name">Invoice Date</field>
                <field name="expression_label">invoice_date</field>
                <field name="figure_type">date</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_amount_currency" model="account.report.column">
                <field name="name">Amount Currency</field>
                <field name="expression_label">amount_currency</field>
            </record>
            <record id="aged_receivable_report_currency" model="account.report.column">
                <field name="name">Currency</field>
                <field name="expression_label">currency</field>
                <field name="figure_type">string</field>
            </record>
            <record id="aged_receivable_report_account_name" model="account.report.column">
                <field name="name">Account</field>
                <field name="expression_label">account_name</field>
                <field name="figure_type">string</field>
            </record>
            <record id="aged_receivable_report_period0" model="account.report.column">
                <field name="name">At Date</field>
                <field name="expression_label">period0</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_period1" model="account.report.column">
                <field name="name">Period 1</field>
                <field name="expression_label">period1</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_period2" model="account.report.column">
                <field name="name">Period 2</field>
                <field name="expression_label">period2</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_period3" model="account.report.column">
                <field name="name">Period 3</field>
                <field name="expression_label">period3</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_period4" model="account.report.column">
                <field name="name">Period 4</field>
                <field name="expression_label">period4</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_period5" model="account.report.column">
                <field name="name">Older</field>
                <field name="expression_label">period5</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_receivable_report_total" model="account.report.column">
                <field name="name">Total</field>
                <field name="expression_label">total</field>
                <field name="sortable" eval="True"/>
            </record>
        </field>
        <field name="line_ids">
          <record id="aged_receivable_line" model="account.report.line">
              <field name="name">Aged Receivable</field>
              <field name="groupby">partner_id, id</field>
              <field name="expression_ids">
                  <record id="aged_receivable_line_invoice_date" model="account.report.expression">
                      <field name="label">invoice_date</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">invoice_date</field>
                      <field name="auditable" eval="False"/>
                  </record>
                  <record id="aged_receivable_line_amount_currency" model="account.report.expression">
                      <field name="label">amount_currency</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">amount_currency</field>
                      <field name="auditable" eval="False"/>
                  </record>
                  <record id="aged_receivable_line_amount_currency_forced_currency" model="account.report.expression">
                      <field name="label">_currency_amount_currency</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">currency_id</field>
                  </record>
                  <record id="aged_receivable_line_currency" model="account.report.expression">
                      <field name="label">currency</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">currency</field>
                      <field name="auditable" eval="False"/>
                  </record>
                  <record id="aged_receivable_line_account_name" model="account.report.expression">
                      <field name="label">account_name</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">account_name</field>
                      <field name="auditable" eval="False"/>
                  </record>
                  <record id="aged_receivable_line_period0" model="account.report.expression">
                      <field name="label">period0</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">period0</field>
                      <field name="auditable" eval="True"/>
                  </record>
                  <record id="aged_receivable_line_period1" model="account.report.expression">
                      <field name="label">period1</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">period1</field>
                      <field name="auditable" eval="True"/>
                  </record>
                  <record id="aged_receivable_line_period2" model="account.report.expression">
                      <field name="label">period2</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">period2</field>
                      <field name="auditable" eval="True"/>
                  </record>
                  <record id="aged_receivable_line_period3" model="account.report.expression">
                      <field name="label">period3</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">period3</field>
                      <field name="auditable" eval="True"/>
                  </record>
                  <record id="aged_receivable_line_period4" model="account.report.expression">
                      <field name="label">period4</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">period4</field>
                      <field name="auditable" eval="True"/>
                  </record>
                  <record id="aged_receivable_line_period5" model="account.report.expression">
                      <field name="label">period5</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">period5</field>
                      <field name="auditable" eval="True"/>
                  </record>
                  <record id="aged_receivable_line_total" model="account.report.expression">
                      <field name="label">total</field>
                      <field name="engine">custom</field>
                      <field name="formula">_report_custom_engine_aged_receivable</field>
                      <field name="subformula">total</field>
                      <field name="auditable" eval="True"/>
                  </record>
              </field>
          </record>
        </field>
    </record>

    <record id="aged_payable_report" model="account.report">
        <field name="name">Aged Payable</field>
        <field name="filter_date_range" eval="False"/>
        <field name="filter_unfold_all" eval="True"/>
        <field name="filter_partner" eval="True"/>
        <field name="filter_period_comparison" eval="False"/>
        <field name="filter_account_type">payable</field>
        <field name="filter_hierarchy">never</field>
        <field name="filter_show_draft" eval="False"/>
        <field name="filter_multi_company">selector</field>
        <field name="default_opening_date_filter">today</field>
        <field name="custom_handler_model_id" ref="model_account_aged_payable_report_handler"/>
        <field name="column_ids">
            <record id="aged_payable_report_invoice_date" model="account.report.column">
                <field name="name">Invoice Date</field>
                <field name="expression_label">invoice_date</field>
                <field name="figure_type">date</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_amount_currency" model="account.report.column">
                <field name="name">Amount Currency</field>
                <field name="expression_label">amount_currency</field>
            </record>
            <record id="aged_payable_report_currency" model="account.report.column">
                <field name="name">Currency</field>
                <field name="expression_label">currency</field>
                <field name="figure_type">string</field>
            </record>
            <record id="aged_payable_report_account_name" model="account.report.column">
                <field name="name">Account</field>
                <field name="expression_label">account_name</field>
                <field name="figure_type">string</field>
            </record>
            <record id="aged_payable_report_period0" model="account.report.column">
                <field name="name">At Date</field>
                <field name="expression_label">period0</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_period1" model="account.report.column">
                <field name="name">Period 1</field>
                <field name="expression_label">period1</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_period2" model="account.report.column">
                <field name="name">Period 2</field>
                <field name="expression_label">period2</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_period3" model="account.report.column">
                <field name="name">Period 3</field>
                <field name="expression_label">period3</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_period4" model="account.report.column">
                <field name="name">Period 4</field>
                <field name="expression_label">period4</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_period5" model="account.report.column">
                <field name="name">Older</field>
                <field name="expression_label">period5</field>
                <field name="sortable" eval="True"/>
            </record>
            <record id="aged_payable_report_total" model="account.report.column">
                <field name="name">Total</field>
                <field name="expression_label">total</field>
                <field name="sortable" eval="True"/>
            </record>
        </field>
        <field name="line_ids">
            <record id="aged_payable_line" model="account.report.line">
                <field name="name">Aged Payable</field>
                <field name="groupby">partner_id, id</field>
                <field name="expression_ids">
                    <record id="aged_payable_line_invoice_date" model="account.report.expression">
                        <field name="label">invoice_date</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">invoice_date</field>
                        <field name="auditable" eval="False"/>
                    </record>
                    <record id="aged_payable_line_amount_currency" model="account.report.expression">
                        <field name="label">amount_currency</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">amount_currency</field>
                        <field name="auditable" eval="False"/>
                    </record>
                    <record id="aged_payable_line_amount_currency_forced_currency" model="account.report.expression">
                        <field name="label">_currency_amount_currency</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">currency_id</field>
                    </record>
                    <record id="aged_payable_line_currency" model="account.report.expression">
                        <field name="label">currency</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">currency</field>
                        <field name="auditable" eval="False"/>
                    </record>
                    <record id="aged_payable_line_account_name" model="account.report.expression">
                        <field name="label">account_name</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">account_name</field>
                        <field name="auditable" eval="False"/>
                    </record>
                    <record id="aged_payable_line_period0" model="account.report.expression">
                        <field name="label">period0</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">period0</field>
                        <field name="auditable" eval="True"/>
                    </record>
                    <record id="aged_payable_line_period1" model="account.report.expression">
                        <field name="label">period1</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">period1</field>
                        <field name="auditable" eval="True"/>
                    </record>
                    <record id="aged_payable_line_period2" model="account.report.expression">
                        <field name="label">period2</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">period2</field>
                        <field name="auditable" eval="True"/>
                    </record>
                    <record id="aged_payable_line_period3" model="account.report.expression">
                        <field name="label">period3</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">period3</field>
                        <field name="auditable" eval="True"/>
                    </record>
                    <record id="aged_payable_line_period4" model="account.report.expression">
                        <field name="label">period4</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">period4</field>
                        <field name="auditable" eval="True"/>
                    </record>
                    <record id="aged_payable_line_period5" model="account.report.expression">
                        <field name="label">period5</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">period5</field>
                        <field name="auditable" eval="True"/>
                    </record>
                    <record id="aged_payable_line_total" model="account.report.expression">
                        <field name="label">total</field>
                        <field name="engine">custom</field>
                        <field name="formula">_report_custom_engine_aged_payable</field>
                        <field name="subformula">total</field>
                        <field name="auditable" eval="True"/>
                    </record>
                </field>
            </record>
        </field>
    </record>
</odoo>
