Merge pull request #42681 from barredterra/psa-translatability

This commit is contained in:
Raffael Meyer
2024-08-27 16:55:51 +02:00
committed by GitHub
2 changed files with 356 additions and 349 deletions

View File

@@ -13,7 +13,7 @@
</div> </div>
{% endif %} {% endif %}
</div> </div>
<h2 class="text-center">{{ _("STATEMENTS OF ACCOUNTS") }}</h2> <h2 class="text-center">{{ _("STATEMENT OF ACCOUNTS") }}</h2>
<div> <div>
{% if filters.party[0] == filters.party_name[0] %} {% if filters.party[0] == filters.party_name[0] %}
<h5 style="float: left;">{{ _("Customer: ") }} <b>{{ filters.party_name[0] }}</b></h5> <h5 style="float: left;">{{ _("Customer: ") }} <b>{{ filters.party_name[0] }}</b></h5>
@@ -22,10 +22,10 @@
<h5 style="float: left; margin-left:15px">{{ _("Customer Name: ") }} <b>{{filters.party_name[0] }}</b></h5> <h5 style="float: left; margin-left:15px">{{ _("Customer Name: ") }} <b>{{filters.party_name[0] }}</b></h5>
{% endif %} {% endif %}
<h5 style="float: right;"> <h5 style="float: right;">
{{ _("Date: ") }} {{ _("Date: {0} to {1}").format(
<b>{{ frappe.format(filters.from_date, 'Date')}} frappe.format(filters.from_date, "Date"),
{{ _("to") }} frappe.format(filters.to_date, 'Date')
{{ frappe.format(filters.to_date, 'Date')}}</b> ) }}
</h5> </h5>
</div> </div>
<br> <br>
@@ -54,7 +54,7 @@
<br> <br>
{% endif %} {% endif %}
<br>{{ _("Remarks") }}: {{ row.remarks }} <br>{{ _("Remarks:") }} {{ row.remarks }}
{% if row.bill_no %} {% if row.bill_no %}
<br>{{ _("Supplier Invoice No") }}: {{ row.bill_no }} <br>{{ _("Supplier Invoice No") }}: {{ row.bill_no }}
{% endif %} {% endif %}
@@ -83,17 +83,20 @@
</table> </table>
<br> <br>
{% if ageing %} {% if ageing %}
<h4 class="text-center">{{ _("Ageing Report based on ") }} {{ ageing.ageing_based_on }} <h4 class="text-center">
{{ _("up to " ) }} {{ frappe.format(filters.to_date, 'Date')}} {{ _("Ageing Report based on {0} up to {1}").format(
ageing.ageing_based_on,
frappe.format(filters.to_date, "Date")
) }}
</h4> </h4>
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th style="width: 20%">0 - 30 Days</th> <th style="width: 20%">{{ _("0 - 30 Days") }}</th>
<th style="width: 20%">30 - 60 Days</th> <th style="width: 20%">{{ _("30 - 60 Days") }}</th>
<th style="width: 20%">60 - 90 Days</th> <th style="width: 20%">{{ _("60 - 90 Days") }}</th>
<th style="width: 20%">90 - 120 Days</th> <th style="width: 20%">{{ _("90 - 120 Days") }}</th>
<th style="width: 20%">Above 120 Days</th> <th style="width: 20%">{{ _("Above 120 Days") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>

View File

@@ -6,52 +6,53 @@
.print-format td { .print-format td {
vertical-align:middle !important; vertical-align:middle !important;
} }
</style> </style>
<div id="header-html" class="hidden-pdf"> <div id="header-html" class="hidden-pdf">
{% if letter_head.content %} {% if letter_head.content %}
<div class="letter-head text-center">{{ letter_head.content }}</div> <div class="letter-head text-center">{{ letter_head.content }}</div>
<hr style="height:2px;border-width:0;color:black;background-color:black;"> <hr style="height:2px;border-width:0;color:black;background-color:black;">
{% endif %} {% endif %}
</div> </div>
<div id="footer-html" class="visible-pdf"> <div id="footer-html" class="visible-pdf">
{% if letter_head.footer %} {% if letter_head.footer %}
<div class="letter-head-footer"> <div class="letter-head-footer">
<hr style="border-width:0;color:black;background-color:black;padding-bottom:2px;"> <hr style="border-width:0;color:black;background-color:black;padding-bottom:2px;">
{{ letter_head.footer }} {{ letter_head.footer }}
</div> </div>
{% endif %} {% endif %}
</div> </div>
<h2 class="text-center" style="margin-top:0">{{ _(report.report_name) }}</h2> <h2 class="text-center" style="margin-top:0">{{ _(report.report_name) }}</h2>
<h4 class="text-center"> <h4 class="text-center">
{{ filters.customer_name }} {{ filters.customer_name }}
</h4> </h4>
<h6 class="text-center"> <h6 class="text-center">
{% if (filters.tax_id) %} {% if (filters.tax_id) %}
{{ _("Tax Id: ") }}{{ filters.tax_id }} {{ _("Tax Id: {0}").format(filters.tax_id) }}
{% endif %} {% endif %}
</h6> </h6>
<h5 class="text-center"> <h5 class="text-center">
{{ _(filters.ageing_based_on) }} {{ _("{0} until {1}").format(
{{ _("Until") }} _(filters.ageing_based_on),
{{ frappe.format(filters.report_date, 'Date') }} frappe.format(filters.report_date, 'Date')
</h5> ) }}
</h5>
<div class="clearfix"> <div class="clearfix">
<div class="pull-left"> <div class="pull-left">
{% if(filters.payment_terms) %} {% if(filters.payment_terms) %}
<strong>{{ _("Payment Terms") }}:</strong> {{ filters.payment_terms }} <strong>{{ _("Payment Terms:") }}</strong> {{ filters.payment_terms }}
{% endif %} {% endif %}
</div> </div>
<div class="pull-right"> <div class="pull-right">
{% if(filters.credit_limit) %} {% if(filters.credit_limit) %}
<strong>{{ _("Credit Limit") }}:</strong> {{ frappe.utils.fmt_money(filters.credit_limit) }} <strong>{{ _("Credit Limit:") }}</strong> {{ frappe.utils.fmt_money(filters.credit_limit) }}
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% if(filters.show_future_payments) %} {% if(filters.show_future_payments) %}
{% set balance_row = data.slice(-1).pop() %} {% set balance_row = data.slice(-1).pop() %}
{% for i in report.columns %} {% for i in report.columns %}
{% if i.fieldname == 'age' %} {% if i.fieldname == 'age' %}
@@ -68,7 +69,7 @@
{% if(balance_row) %} {% if(balance_row) %}
<table class="table table-bordered table-condensed"> <table class="table table-bordered table-condensed">
<caption class="text-right">(Amount in {{ data[0]["currency"] ~ "" }})</caption> <caption class="text-right">{{ _("Amount in {0}").format(data[0]["currency"] ~ "") }}</caption>
<colgroup> <colgroup>
<col style="width: 30mm;"> <col style="width: 30mm;">
<col style="width: 18mm;"> <col style="width: 18mm;">
@@ -142,8 +143,8 @@
</table> </table>
{% endif %} {% endif %}
{% endif %} {% endif %}
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>
<tr> <tr>
{% if(report.report_name == "Accounts Receivable" or report.report_name == "Accounts Payable") %} {% if(report.report_name == "Accounts Receivable" or report.report_name == "Accounts Payable") %}
@@ -170,9 +171,9 @@
<th style="width: 10%; text-align: right">{{ _("Paid Amount") }}</th> <th style="width: 10%; text-align: right">{{ _("Paid Amount") }}</th>
<th style="width: 10%; text-align: right"> <th style="width: 10%; text-align: right">
{% if report.report_name == "Accounts Receivable" %} {% if report.report_name == "Accounts Receivable" %}
{{ _('Credit Note') }} {{ _("Credit Note") }}
{% else %} {% else %}
{{ _('Debit Note') }} {{ _("Debit Note") }}
{% endif %} {% endif %}
</th> </th>
{% endif %} {% endif %}
@@ -197,9 +198,9 @@
<th style="width: 15%">{{ _("Total Paid Amount") }}</th> <th style="width: 15%">{{ _("Total Paid Amount") }}</th>
<th style="width: 15%"> <th style="width: 15%">
{% if report.report_name == "Accounts Receivable Summary" %} {% if report.report_name == "Accounts Receivable Summary" %}
{{ _('Credit Note Amount') }} {{ _("Credit Note Amount") }}
{% else %} {% else %}
{{ _('Debit Note Amount') }} {{ _("Debit Note Amount") }}
{% endif %} {% endif %}
</th> </th>
<th style="width: 15%">{{ _("Total Outstanding Amount") }}</th> <th style="width: 15%">{{ _("Total Outstanding Amount") }}</th>
@@ -331,20 +332,23 @@
<td style="text-align: right"><b>{{ frappe.utils.fmt_money(data|sum(attribute="credit_note"), currency=data[0]["currency"]) }}</b></td> <td style="text-align: right"><b>{{ frappe.utils.fmt_money(data|sum(attribute="credit_note"), currency=data[0]["currency"]) }}</b></td>
<td style="text-align: right"><b>{{ frappe.utils.fmt_money(data|sum(attribute="outstanding"), currency=data[0]["currency"]) }}</b></td> <td style="text-align: right"><b>{{ frappe.utils.fmt_money(data|sum(attribute="outstanding"), currency=data[0]["currency"]) }}</b></td>
</tbody> </tbody>
</table> </table>
<br> <br>
{% if ageing %} {% if ageing %}
<h4 class="text-center">{{ _("Ageing Report based on ") }} {{ ageing.ageing_based_on }} <h4 class="text-center">
{{ _("up to " ) }} {{ frappe.format(filters.report_date, 'Date')}} {{ _("Ageing Report based on {0} up to {1}").format(
</h4> ageing.ageing_based_on,
<table class="table table-bordered"> frappe.format(filters.report_date, "Date")
) }}
</h4>
<table class="table table-bordered">
<thead> <thead>
<tr> <tr>
<th style="width: 25%">0 - 30 Days</th> <th style="width: 25%">{{ _("0 - 30 Days") }}</th>
<th style="width: 25%">30 - 60 Days</th> <th style="width: 25%">{{ _("30 - 60 Days") }}</th>
<th style="width: 25%">60 - 90 Days</th> <th style="width: 25%">{{ _("60 - 90 Days") }}</th>
<th style="width: 25%">90 - 120 Days</th> <th style="width: 25%">{{ _("90 - 120 Days") }}</th>
<th style="width: 20%">Above 120 Days</th> <th style="width: 20%">{{ _("Above 120 Days") }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@@ -356,11 +360,11 @@
<td>{{ frappe.utils.fmt_money(ageing.range5, currency=filters.presentation_currency) }}</td> <td>{{ frappe.utils.fmt_money(ageing.range5, currency=filters.presentation_currency) }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
{% endif %} {% endif %}
{% if terms_and_conditions %} {% if terms_and_conditions %}
<div> <div>
{{ terms_and_conditions }} {{ terms_and_conditions }}
</div> </div>
{% endif %} {% endif %}
<p class="text-right text-muted">{{ _("Printed On ") }}{{ frappe.utils.now() }}</p> <p class="text-right text-muted">{{ _("Printed on {0}").format(frappe.utils.now()) }}</p>