You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

625 lines
34 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="general_ledger">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="account_financial_report.internal_layout">
<t t-call="account_financial_report.report_general_ledger_base"/>
</t>
</t>
</t>
</template>
<template id="report_general_ledger_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="foreign_currency" t-value="foreign_currency"/>
<!-- Defines global variables used by internal layout -->
<t t-set="title">General Ledger - <t t-raw="company_name"/> - <t t-raw="currency_name"/></t>
<div class="page">
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'" style="text-align: center;"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_general_ledger_filters"/>
<t t-foreach="general_ledger" t-as="account">
<div class="page_break">
<!-- Display account header -->
<div class="act_as_table list_table" style="margin-top: 10px;"/>
<div class="act_as_caption account_title"
style="width: 100%">
<span t-esc="o._get_atr_from_dict(account['id'], accounts_data, 'code')"/> -
<span t-esc="o._get_atr_from_dict(account['id'], accounts_data, 'name')"/>
</div>
<t t-if="not account['partners']">
<!-- Display account move lines without partner regroup -->
<t t-set="type" t-value='"account_type"'/>
<t t-call="account_financial_report.report_general_ledger_lines">
<t t-set="account_or_partner_object" t-value="account"/>
</t>
</t>
<t t-if="account['partners']">
<!-- Display account partners -->
<t t-if="not centralize">
<t t-foreach="account['list_partner']" t-as="partner">
<t t-set="type" t-value='"partner_type"'/>
<div class="page_break">
<!-- Display partner header -->
<div class="act_as_caption account_title">
<span
t-esc="o._get_atr_from_dict(partner['id'], partners_data, 'name')"/>
</div>
<!-- Display partner move lines -->
<t t-call="account_financial_report.report_general_ledger_lines">
<t t-set="account_or_partner_object" t-value="partner"/>
</t>
<!-- Display partner footer -->
<t t-call="account_financial_report.report_general_ledger_ending_cumul">
<t t-set="account_or_partner_object" t-value="partner"/>
<t t-set="type" t-value='"partner_type"'/>
</t>
</div>
</t>
</t>
</t>
<!-- Display account footer -->
<t t-if="not account['partners']" t-call="account_financial_report.report_general_ledger_ending_cumul">
<t t-set="account_or_partner_object" t-value="account"/>
<t t-set="type" t-value='"account_type"'/>
</t>
</div>
</t>
</div>
</template>
<template id="account_financial_report.report_general_ledger_filters">
<div class="act_as_table data_table" style="width: 100%;">
<div class="act_as_row labels">
<div class="act_as_cell">Date range filter</div>
<div class="act_as_cell">Target moves filter</div>
<div class="act_as_cell">Account balance at 0 filter</div>
<div class="act_as_cell">Centralize filter</div>
<div class="act_as_cell">Show analytic tags</div>
</div>
<div class="act_as_row">
<div class="act_as_cell">
From: <span t-esc="date_from"/> To: <span t-esc="date_to"/>
</div>
<div class="act_as_cell">
<t t-if="only_posted_moves">All posted entries</t>
<t t-if="not only_posted_moves">All entries</t>
</div>
<div class="act_as_cell">
<t t-if="hide_account_at_0">Hide</t>
<t t-if="not hide_account_at_0">Show</t>
</div>
<div class="act_as_cell">
<t t-if="centralize">Yes</t>
<t t-if="not centralize">No</t>
</div>
<div class="act_as_cell">
<t t-if="show_analytic_tags">Yes</t>
<t t-if="not show_analytic_tags">No</t>
</div>
</div>
</div>
</template>
<template id="account_financial_report.report_general_ledger_lines">
<div class="act_as_table data_table" style="width: 100%;">
<!-- Display table headers for lines -->
<div class="act_as_thead">
<div class="act_as_row labels">
<!--## date-->
<div class="act_as_cell first_column" style="width: 3.51%;">
Date</div>
<!--## move-->
<div class="act_as_cell" style="width: 8.03%">Entry</div>
<!--## journal-->
<div class="act_as_cell" style="width: 4.13%;">Journal</div>
<!--## account code-->
<div class="act_as_cell" style="width: 4.75%;">Account</div>
<!--## account code-->
<div class="act_as_cell" style="width: 8.89%;">Taxes</div>
<!--## partner-->
<div class="act_as_cell" style="width: 12.01%;">Partner
</div>
<!--## ref - label-->
<div class="act_as_cell" style="width: 22.9%;">Ref -
Label</div>
<t t-if="show_cost_center">
<!--## cost_center-->
<div class="act_as_cell" style="width: 8.03%;">Cost
center</div>
</t>
<t t-if="show_analytic_tags">
<!--## analytic tags-->
<div class="act_as_cell" style="width: 4.75%;">Tags</div>
</t>
<!--## matching_number-->
<div class="act_as_cell" style="width: 2.41%;">Rec.</div>
<!--## debit-->
<div class="act_as_cell amount" style="width: 6.02%;">Debit</div>
<!--## credit-->
<div class="act_as_cell amount" style="width: 6.02%;">Credit</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="width: 6.02%;">Cumul. Bal.</div>
<t t-if="foreign_currency">
<!--## currency_name-->
<div class="act_as_cell" style="width: 2.08%;">Cur.</div>
<!--## amount_currency-->
<div class="act_as_cell amount" style="width: 5.19%;">Amount cur.</div>
</t>
</div>
</div>
<!-- Display first line with initial balance -->
<div class="act_as_row lines">
<!--## date-->
<div class="act_as_cell"/>
<!--## move-->
<div class="act_as_cell"/>
<!--## journal-->
<div class="act_as_cell"/>
<!--## account code-->
<div class="act_as_cell"/>
<!--## taxes-->
<div class="act_as_cell"/>
<!--## partner-->
<div class="act_as_cell"/>
<!--## ref - label-->
<div class="act_as_cell amount">Initial balance</div>
<t t-if="show_cost_center">
<!--## cost_center-->
<div class="act_as_cell"/>
</t>
<t t-if="show_analytic_tags">
<!--## analytic tags-->
<div class="act_as_cell"></div>
</t>
<!--## matching_number-->
<div class="act_as_cell"/>
<!--## debit-->
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('date', '&lt;', date_from),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t t-raw="account_or_partner_object['init_bal']['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('partner_id', '=', partner['id']),
('date', '&lt;', date_from),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t t-raw="account_or_partner_object['init_bal']['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## credit-->
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('date', '&lt;', date_from),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t
t-raw="account_or_partner_object['init_bal']['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('partner_id', '=', partner['id']),
('date', '&lt;', date_from),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t
t-raw="account_or_partner_object['init_bal']['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('date', '&lt;', date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t
t-raw="account_or_partner_object['init_bal']['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('partner_id', '=', partner['id']),
('date', '&lt;', date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t t-raw="account_or_partner_object['init_bal']['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<t t-if="foreign_currency">
<t t-if="o._get_atr_from_dict(account['id'], accounts_data, 'currency_id')">
<div class="act_as_cell amount" style="width: 2.08%;">
<span t-field="o._get_atr_from_dict(account['id'], accounts_data, 'currency_name')"/>
</div>
<div class="act_as_cell amount" style="width: 5.19%;">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t
t-raw="account_or_partner_object['init_bal']['bal_curr']" t-options="{'widget': 'monetary', 'display_currency': account.account_id.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('partner_id', '=', partner['id']),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t t-raw="account_or_partner_object['init_bal']['bal_curr']" t-options="{'widget': 'monetary', 'display_currency': account.account_id.currency_id}"/></a>
</span>
</t>
</div>
</t>
<t t-if="not o._get_atr_from_dict(account['id'], accounts_data, 'currency_id')">
<div class="act_as_cell" style="width: 2.08%;"/>
<div class="act_as_cell" style="width: 5.19%;"/>
</t>
</t>
</div>
<!-- Display each lines -->
<t t-foreach="account_or_partner_object['move_lines']" t-as="line">
<!-- # lines or centralized lines -->
<div class="act_as_row lines">
<!--## date-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<t t-if="line['id']">
<a t-att-data-active-id="line['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<!--## We don't use t-field because it throws an error on click -->
<t t-esc="line['date']" t-options="{'widget': 'date'}"/></a>
</t>
<t t-if="not line['id']">
<a class="o_account_financial_reports_web_action"
style="color: black;">
<!--## We don't use t-field because it throws an error on click -->
<t t-esc="line['date']" t-options="{'widget': 'date'}"/></a>
</t>
</span>
</div>
<!--## move-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.move'"/>
<t t-if="line['entry_id']">
<span>
<a t-att-data-active-id="line['entry_id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line['entry']"/></a>
</span>
</t>
</div>
<!--## journal-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.journal'"/>
<span>
<a t-att-data-active-id="line['journal_id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="o._get_atr_from_dict(line['journal_id'], journals_data, 'code')"/></a>
</span>
</div>
<!--## account code-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.account'"/>
<span>
<a t-att-data-active-id="account['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="o._get_atr_from_dict(account['id'], accounts_data, 'code')"/></a>
</span>
</div>
<!--## taxes-->
<div class="act_as_cell left">
<t t-if="taxes_data and line['tax_ids']">
<t t-foreach="line['tax_ids']" t-as="tax_id">
<span t-esc="o._get_atr_from_dict(tax_id, taxes_data, 'amount')"/> <span t-esc="o._get_atr_from_dict(tax_id, taxes_data, 'string')"/>
</t>
</t>
</div>
<!--## partner-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'res.partner'"/>
<span t-if="line['partner_id']">
<a t-att-data-active-id="line['partner_id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;"><t
t-raw="line['partner_name']"/></a>
</span>
</div>
<!--## ref - label-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.move.line'"/>
<t t-if="line['id']">
<span>
<a t-att-data-active-id="line['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line['ref']"/></a>
</span>
</t>
<t t-if="not line['id']">
<span>
<a class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line['ref']"/></a>
</span>
</t>
</div>
<!--## cost_center-->
<t t-if="show_cost_center">
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.analytic.account'"/>
<span t-if="line.cost_center">
<a t-att-data-active-id="line.move_line_id.analytic_account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;"><t t-raw="line.cost_center"/></a>
</span>
</div>
</t>
<t t-if="show_analytic_tags">
<!--## analytic tags-->
<div class="act_as_cell left">
<t t-if="line['tag_ids']">
<t t-foreach="line['tag_ids']" t-as="tag_id">
<span t-esc="o._get_atr_from_dict(tag_id, tags_data, 'name')"/>
</t>
</t>
</div>
</t>
<!--## matching_number-->
<div class="act_as_cell">
<t t-set="res_model" t-value="'account.full.reconcile'"/>
<span t-if="line['rec_id']">
<a t-att-data-active-id="line['rec_id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;"><t t-raw="line['rec_name']"/></a>
</span>
</div>
<!--## debit-->
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<t t-if="line['id']">
<span>
<a t-att-data-active-id="line['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action_monetary"
style="color: black;">
<t t-raw="line['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="not line['id']">
<span>
<a class="o_account_financial_reports_web_action_monetary"
style="color: black;">
<t t-raw="line['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## credit-->
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<t t-if="line['id']">
<span>
<a t-att-data-active-id="line['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action_monetary"
style="color: black;">
<t t-raw="line['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="not line['id']">
<span>
<a class="o_account_financial_reports_web_action_monetary"
style="color: black;">
<t t-raw="line['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<t t-if="line['id']">
<span>
<a t-att-data-active-id="line['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action_monetary"
style="color: black;">
<t t-raw="line['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="not line['id']">
<span>
<a class="o_account_financial_reports_web_action_monetary"
style="color: black;">
<t t-raw="line['balance']"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<t t-if="foreign_currency">
<t t-if="line['currency_id']">
<!--## currency_name-->
<div class="act_as_cell amount" style="width: 2.08%;">
<span t-esc="line['currency_id'][1]"/>
</div>
<!--## amount_currency-->
<div class="act_as_cell amount" style="width: 5.19%;">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line['id']"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line['bal_curr']"/></a>
</span>
</div>
</t>
<t t-if="not line['currency_id']">
<!--## currency_name-->
<div class="act_as_cell amount" style="width: 2.08%;"/>
<!--## amount_currency-->
<div class="act_as_cell amount" style="width: 5.19%;"/>
</t>
</t>
</div>
</t>
</div>
</template>
<template id="account_financial_report.report_general_ledger_ending_cumul">
<!-- Display ending balance line for account or partner -->
<div class="act_as_table list_table" style="width: 100%;">
<div class="act_as_row labels" style="font-weight: bold;">
<!--## date-->
<t t-if='type == "account_type"'>
<div class="act_as_cell first_column"
style="width: 41.32%;"><span
t-esc="o._get_atr_from_dict(account['id'], accounts_data, 'code')"/> - <span t-esc="o._get_atr_from_dict(account['id'], accounts_data, 'name')"/></div>
<div class="act_as_cell right"
style="width: 22.9%;">Ending balance</div>
</t>
<t t-if='type == "partner_type"'>
<div class="act_as_cell first_column" style="width: 41.32%;"/>
<div class="act_as_cell right" style="width: 22.9%;">Partner ending balance</div>
</t>
<t t-if="show_cost_center">
<!--## cost_center-->
<div class="act_as_cell" style="width: 8.03%"/>
</t>
<t t-if="show_analytic_tags">
<!--## analytic tags-->
<div class="act_as_cell" style="width: 4.75%;"></div>
</t>
<!--## matching_number-->
<div class="act_as_cell" style="width: 2.41%;"/>
<!--## debit-->
<div class="act_as_cell amount" style="width: 6.02%;">
<span
t-esc="account_or_partner_object['fin_bal']['debit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## credit-->
<div class="act_as_cell amount" style="width: 6.02%;">
<span
t-esc="account_or_partner_object['fin_bal']['credit']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="width: 6.02%;">
<span t-esc="account_or_partner_object['fin_bal']['balance']" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## currency_name + amount_currency-->
<t t-if="foreign_currency">
<t t-if="o._get_atr_from_dict(account['id'], accounts_data, 'currency_id')">
<div class="act_as_cell amount" style="width: 2.08%;">
<span t-field="o._get_atr_from_dict(account['id'], accounts_data, 'currency_name')"/>
</div>
<div class="act_as_cell amount" style="width: 5.19%;">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account['id']),
('date', '&lt;', date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t
t-raw="account_or_partner_object['fin_bal']['bal_curr']" t-options="{'widget': 'monetary', 'display_currency': account_or_partner_object.account_id.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain" t-value="[('account_id', '=', account['id']),
('partner_id', '=', partner['id']),
('date', '&lt;', date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_monetary_multi"
style="color: black;">
<t t-raw="account_or_partner_object['fin_bal']['bal_curr']" t-options="{'widget': 'monetary', 'display_currency': account_or_partner_object.report_account_id.currency_id}"/></a>
</span>
</t>
</div>
</t>
<t t-if="not o._get_atr_from_dict(account['id'], accounts_data, 'currency_id')">
<div class="act_as_cell amount" style="width: 2.08%;"/>
<div class="act_as_cell amount" style="width: 5.19%;"/>
</t>
</t>
</div>
</div>
</template>
</odoo>