brotherton-erpnext/erpnext/accounts/report/general_ledger/general_ledger.html
tundebabzy c89782502c Report presentation currency (#12670)
* Add new Select to filters

* get the currencies from database rather than hardcoded

* label report columns:
- If presentation currency is available in filters, use it or
- If company is available in filters, use it or
- use default company currency

* add new function - get_currency

* tweak new function `get_currency`

* add new function `convert` to convert a value to another currency

* add new function `convert_to_presentation_currency`

* clean up `get_currency` first pass

* memoise the exchange rates

* limit fetched GL entries to to_date

* check if account type is p&l or not and use appropriate exchange rate based on that

* change EXCHANGE RATE to a dict, use for memoisation

* rename EXCHANGE_RATE

* cache exchange rates and use them as needed

* add docstrings

* add presentation currency logic to financial statement reports

* move new functions from `general_ledger.py` to new module

* clean up

* PEP 8 clean up

* move function to util.py

* PEP 8 clean up

* remove presentation currency option from cashflow

* adjust currency as needed

* allow users to save presentation currency in Accounts Settings

* add new function `get_presentation_currency_list`

* refactor query_report modules with no promises

* Revert "allow users to save presentation currency in Accounts Settings"

This reverts commit 3b58a6296cf3f7b4d80ac55b03f9d5d4887b796b.

* show print page in correct currency

* Update utils.py
2018-02-12 15:04:50 +05:30

70 lines
2.3 KiB
HTML

<h2 class="text-center">{%= __("Statement of Account") %}</h2>
<h4 class="text-center">
{% if (filters.party_name) { %}
{%= filters.party_name %}
{% } else if (filters.party) { %}
{%= filters.party %}
{% } else if (filters.account) { %}
{%= filters.account %}
{% } %}
</h4>
<h5 class="text-center">
{%= dateutil.str_to_user(filters.from_date) %}
{%= __("to") %}
{%= dateutil.str_to_user(filters.to_date) %}
</h5>
<hr>
<table class="table table-bordered">
<thead>
<tr>
<th style="width: 12%">{%= __("Date") %}</th>
<th style="width: 15%">{%= __("Ref") %}</th>
<th style="width: 25%">{%= __("Party") %}</th>
<th style="width: 15%">{%= __("Debit") %}</th>
<th style="width: 15%">{%= __("Credit") %}</th>
<th style="width: 18%">{%= __("Balance (Dr - Cr)") %}</th>
</tr>
</thead>
<tbody>
{% for(var i=0, l=data.length; i<l; i++) { %}
<tr>
{% if(data[i].posting_date) { %}
<td>{%= dateutil.str_to_user(data[i].posting_date) %}</td>
<td>{%= data[i].voucher_type %}
<br>{%= data[i].voucher_no %}</td>
<td>
{% if(!(filters.party || filters.account)) { %}
{%= data[i].party || data[i].account %}
<br>
{% } %}
{{ __("Against") }}: {%= data[i].against %}
<br>{%= __("Remarks") %}: {%= data[i].remarks %}
{% if(data[i].bill_no) { %}
<br>{%= __("Supplier Invoice No") %}: {%= data[i].bill_no %}
{% } %}
</td>
<td style="text-align: right">
{%= format_currency(data[i].debit, filters.presentation_currency) %}</td>
<td style="text-align: right">
{%= format_currency(data[i].credit, filters.presentation_currency) %}</td>
{% } else { %}
<td></td>
<td></td>
<td><b>{%= frappe.format(data[i].account, {fieldtype: "Link"}) || "&nbsp;" %}</b></td>
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].debit, filters.presentation_currency) %}
</td>
<td style="text-align: right">
{%= data[i].account && format_currency(data[i].credit, filters.presentation_currency) %}
</td>
{% } %}
<td style="text-align: right">
{%= format_currency(data[i].balance, filters.presentation_currency) %}
</td>
</tr>
{% } %}
</tbody>
</table>
<p class="text-right text-muted">Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>