Skip to content

Commit d4a459e

Browse files
committed
fix: show tax breakup in print format
1 parent 09d41a4 commit d4a459e

File tree

2 files changed

+48
-35
lines changed

2 files changed

+48
-35
lines changed

erpnext/accounts/print_format/print_format_sales_invoice/print_format_sales_invoice.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,8 @@
285285
</table>
286286
</div>
287287

288-
<div class="highlight-bg" style="border-radius: 12px; clear: both">
289-
<table style="width: 100%; border-collapse: collapse">
288+
<div style="border-bottom: 1px solid #ededed;">
289+
<table class="highlight-bg" style="width: 100%; border-collapse: collapse; border-radius: 12px; margin-bottom: 10px;">
290290
<tr>
291291
<td class="text-left mw-400">
292292
<div class="text-capitalize">

erpnext/accounts/print_format/sales_invoice_print_format/sales_invoice_print_format.html

Lines changed: 46 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ <h4 style="margin: 0px">{{ _("CANCELLED") }}</h4>
118118
.pb-8 {
119119
padding-bottom: 8px;
120120
}
121+
.amount-width {
122+
width: 110px;
123+
}
121124

122125
.totals-table {
123126
border-radius: 5px;
@@ -216,8 +219,8 @@ <h4 style="margin: 0px">{{ _("CANCELLED") }}</h4>
216219
<table class="items-table mt-15" style="width: 100%">
217220
<colgroup>
218221
<col style="width: 5%" />
219-
<col style="width: 45%" />
220-
<col style="width: 10%" />
222+
<col style="width: 40%" />
223+
<col style="width: 15%" />
221224
<col style="width: 20%" />
222225
<col style="width: 20%" />
223226
</colgroup>
@@ -246,47 +249,57 @@ <h4 style="margin: 0px">{{ _("CANCELLED") }}</h4>
246249
</table>
247250

248251
<!-- Totals Section -->
249-
<div class="row section-break mt-20">
250-
<div class="col-xs-7">
251-
<div class="mt-80">
252-
<p class="title">{{ _("Total in words") }}</p>
253-
<div class="words-box text-uppercase">{{ doc.in_words }}</div>
254-
</div>
255-
</div>
256-
<div class="col-xs-5">
252+
<table style="width:100%; margin-top: 15px">
253+
<td style="vertical-align: bottom !important;">
254+
<p class="title">{{ _("Total in words") }}</p>
255+
<div class="words-box text-uppercase">{{ doc.in_words }}</div>
256+
</td>
257+
<td>
257258
<table class="totals-table">
258259
<tr>
259260
<td class="text-right text-muted">{{ _("Sub Total:") }}</td>
260-
<td class="text-right">{{ doc.get_formatted("total", doc) }}</td>
261+
<td class="text-right amount-width">{{ doc.get_formatted("total", doc) }}</td>
261262
</tr>
262-
<tr>
263-
<td class="text-right text-muted">
264-
{{ _("Discount") }} ({{ doc.additional_discount_percentage }}%):
265-
</td>
266-
<td class="text-right">{{ doc.get_formatted("discount_amount", doc) }}</td>
267-
</tr>
268-
{% set tax_rate = doc.taxes | selectattr("tax_amount") | sum(attribute="rate") %} {% if
269-
tax_rate > 0 %}
270-
<tr>
271-
<td class="text-right text-muted">{{ _("Tax") }} ({{ tax_rate }}%):</td>
272-
<td class="text-right">{{ doc.get_formatted("total_taxes_and_charges", doc) }}</td>
273-
</tr>
274-
{% endif %}
263+
{%- if doc.apply_discount_on == "Net Total" -%}
264+
<tr>
265+
<td class="text-right text-muted">
266+
{{ _("Discount") }} ({{ doc.additional_discount_percentage }}%):
267+
</td>
268+
<td class="text-right amount-width">{{ doc.get_formatted("discount_amount", doc) }}</td>
269+
</tr>
270+
{%- endif -%}
271+
{%- for tax in doc.taxes -%}
272+
{%- if (tax.tax_amount or print_settings.print_taxes_with_zero_amount) and (not tax.included_in_print_rate or doc.flags.show_inclusive_tax_in_print) -%}
273+
<tr>
274+
<td class="text-right text-muted">{{ tax.get_formatted("description") }} ({{ tax.get_formatted("rate") }}%):</td>
275+
<td class="text-right amount-width">{{ tax.get_formatted("tax_amount") }}</td>
276+
</tr>
277+
{%- endif -%}
278+
{%- endfor -%}
279+
{%- if doc.apply_discount_on == "Grand Total" -%}
280+
<tr>
281+
<td class="text-right text-muted">
282+
{{ _("Discount") }} ({{ doc.additional_discount_percentage }}%):
283+
</td>
284+
<td class="text-right amount-width">{{ doc.get_formatted("discount_amount", doc) }}</td>
285+
</tr>
286+
{%- endif -%}
275287
<tr class="grand-total">
276288
<td class="text-right">{{ _("Grand Total:") }}</td>
277-
<td class="text-right">{{ doc.get_formatted("grand_total", doc) }}</td>
289+
<td class="text-right amount-width">{{ doc.get_formatted("grand_total", doc) }}</td>
278290
</tr>
279291
</table>
280-
</div>
281-
</div>
292+
</td>
293+
</table>
282294

283295
<!-- Terms -->
284-
{% if doc.terms %}
285-
<div class="info-card mt-40">
286-
<div>{{ _("Terms and Conditions") }}</div>
287-
{{ doc.terms}}
288-
</div>
289-
{% endif %}
296+
<div class="terms-section">
297+
{% if doc.terms %}
298+
<div class="info-card mt-40">
299+
<div>{{ _("Terms and Conditions") }}</div>
300+
{{ doc.terms}}
301+
</div>
302+
{% endif %}
290303
</div>
291304
</div>
292305
{% endfor %}

0 commit comments

Comments
 (0)