Skip to content

Instantly share code, notes, and snippets.

@bouvyd
Created March 13, 2017 16:08
Show Gist options
  • Select an option

  • Save bouvyd/14ec5073a0598dbc4433c5e770c0991f to your computer and use it in GitHub Desktop.

Select an option

Save bouvyd/14ec5073a0598dbc4433c5e770c0991f to your computer and use it in GitHub Desktop.
Alternate general ledger for 8.0
<?xml version="1.0"?>
<t t-name="account.report_generalledger">
<t t-call="report.html_container">
<t t-set="data_report_margin_top" t-value="12"/>
<t t-set="data_report_header_spacing" t-value="9"/>
<t t-set="data_report_dpi" t-value="110"/>
<t t-foreach="docs" t-as="o">
<div class="page">
<h2><span t-esc="res_company.name"/>: General ledger</h2>
<div class="row mt32">
<div class="col-xs-3">
<strong>Chart of Accounts:</strong>
<p t-esc="get_account(data)"/>
</div>
<div class="col-xs-3">
<strong>Fiscal Year:</strong>
<p t-esc="get_fiscalyear(data)"/>
</div>
<div class="col-xs-3">
<strong>Journals:</strong>
<p t-esc="', '.join([ lt or '' for lt in get_journal(data) ])"/>
</div>
<div class="col-xs-3">
<strong>Display Account</strong>
<p>
<span t-if="data['form']['display_account'] == 'all'">All accounts'</span>
<span t-if="data['form']['display_account'] == 'movement'">With movements</span>
<span t-if="data['form']['display_account'] == 'not_zero'">With balance not equal to zero</span>
</p>
</div>
</div>
<div class="row mb32">
<div class="col-xs-3">
<strong>Filter By:</strong>
<p>
<span t-if="data['form']['filter'] == 'filter_no'">Not filtered</span>
<span t-if="data['form']['filter'] == 'filter_period'">Filtered by period</span>
<span t-if="data['form']['filter'] == 'filter_date'">Filtered by date</span>
<p t-if="data['form']['filter'] == 'filter_period'">
Start Period: <span t-esc="get_start_period(data)"/>
End Period: <span t-esc="get_end_period(data)"/>
</p>
<p t-if="data['form']['filter'] == 'filter_date'">
Date from : <span t-esc="formatLang(get_start_date(data), date=True)"/><br />
Date to : <span t-esc="formatLang(get_end_date(data), date=True)"/>
</p>
</p>
</div>
<div class="col-xs-3">
<strong>Sorted By:</strong>
<p t-esc="get_sortby(data)"/>
</div>
<div class="col-xs-3">
<strong>Target Moves:</strong>
<p t-esc="get_target_move(data)"/>
</div>
</div>
<t t-set="i" t-value="0"/>
<table class="table table-condensed">
<thead>
<tr class="text-center">
<th>Date</th>
<th>JRNL</th>
<th>Partner</th>
<th>Ref</th>
<th>Move</th>
<th>Entry Label</th>
<th>Counterpart</th>
<th>Debit</th>
<th>Credit</th>
<th>Balance</th>
<th t-if="data['form']['amount_currency']">Currency</th>
</tr>
</thead>
<tbody>
<t t-foreach="get_children_accounts(o)" t-as="childrenaccount">
<t t-set="i" t-value="i + 1"/>
<tr style="font-weight: bold;">
<td colspan="7">
<span style="color: white;" t-esc="'..'* (childrenaccount['level'] - 1)"/>
<span t-esc="childrenaccount['code']"/>
<span t-esc="childrenaccount['name']"/>
</td>
<td class="text-right">
<span t-esc="formatLang(sum_debit_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
</td>
<td class="text-right">
<span t-esc="formatLang(sum_credit_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
</td>
<td class="text-right">
<span t-esc="formatLang(sum_balance_account(childrenaccount), digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
</td>
<td class="text-right" t-if="data['form']['amount_currency']">
<span t-esc="formatLang(sum_currency_amount_account(childrenaccount), digits=get_digits(dp='Account')) if sum_currency_amount_account(childrenaccount) > 0.00 else ''"/>
</td>
</tr>
<t t-foreach="lines(childrenaccount)" t-as="line">
<t t-set="i" t-value="i + 1"/>
<tr>
<td><span t-esc="formatLang(line['ldate'], date=True)"/></td>
<td><span t-esc="line['lcode']"/></td>
<td><span t-esc="line['partner_name']"/></td>
<td><span t-if="line['lref']" t-esc="line['lref']"/></td>
<td><span t-esc="line['move']"/></td>
<td><span t-esc="line['lname']"/></td>
<td><span t-esc="line['line_corresp'].replace(',',', ')"/></td>
<td class="text-right">
<span t-esc="formatLang(line['debit'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
</td>
<td class="text-right">
<span t-esc="formatLang(line['credit'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
</td>
<td class="text-right">
<span t-esc="formatLang(line['progress'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"/>
</td>
<td class="text-right" t-if="data['form']['amount_currency']">
<span t-esc="formatLang(line['amount_currency'], digits=get_digits(dp='Account')) if line['amount_currency'] > 0.00 else ''"/>
<span t-esc="line['currency_code'] if line['amount_currency'] > 0.00 else ''"/>
</td>
</tr>
<t t-if="i > 500">
<t t-set="i" t-value="0"/>
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;div class="page"&gt;
&lt;table class="table table-condensed"&gt;
&lt;thead&gt;
&lt;tr class="text-center"&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;JRNL&lt;/th&gt;
&lt;th&gt;Partner&lt;/th&gt;
&lt;th&gt;Ref&lt;/th&gt;
&lt;th&gt;Move&lt;/th&gt;
&lt;th&gt;Entry Label&lt;/th&gt;
&lt;th&gt;Counterpart&lt;/th&gt;
&lt;th&gt;Debit&lt;/th&gt;
&lt;th&gt;Credit&lt;/th&gt;
&lt;th&gt;Balance&lt;/th&gt;
&lt;th t-if="data['form']['amount_currency']"&gt;Currency&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
</t>
</t>
</t>
</tbody>
</table>
</div>
</t>
</t>
</t>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment