fix: better sub total section with tax breakup

This commit is contained in:
khushi8112
2025-09-29 23:10:02 +05:30
parent 2db327bf0c
commit 5360aebe12

View File

@@ -251,45 +251,41 @@ print_heading_template=None) -%}
</tbody> </tbody>
</table> </table>
<table class="totals mt-16" style="width: 100%"> <div class="test" style="float: right; margin-top: 15px; margin-bottom: 5px;">
<tr>
<td style="width: 65%">&nbsp;</td>
<td
style="
width: 35%;
vertical-align: top;
text-align: right;
padding: 0px 0px 6px 0px !important;
"
>
<table style="width: 100%; border-collapse: collapse"> <table style="width: 100%; border-collapse: collapse">
<tr class="row-divider"> <tr class="row-divider">
<td class="text-right title">{{ _("Sub Total:") }}</td> <td class="text-right text-muted" style="padding-right: 30px !important;">{{ _("Sub Total:") }}</td>
<td class="text-right">{{ doc.get_formatted("total", doc) }}</td> <td class="text-right">{{ doc.get_formatted("total", doc) }}</td>
</tr> </tr>
{%- if doc.apply_discount_on == "Net Total" -%}
<tr class="row-divider"> <tr class="row-divider">
<td class="text-right title"> <td class="text-right text-muted" style="padding-right: 30px !important;">
{{ _("Discount") }} ({{ doc.additional_discount_percentage or 0 }}%): {{ _("Discount") }} ({{ doc.additional_discount_percentage }}%):
</td> </td>
<td class="text-right">{{ doc.get_formatted("discount_amount", doc) }}</td> <td class="text-right">{{ doc.get_formatted("discount_amount", doc) }}</td>
</tr> </tr>
{% set tax_rate = doc.taxes | selectattr("tax_amount") | sum(attribute="rate") %} {% {%- endif -%}
if tax_rate > 0 %} {%- for tax in doc.taxes -%}
{%- 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) -%}
<tr class="row-divider"> <tr class="row-divider">
<td class="text-right title">{{ _("Tax") }} ({{ tax_rate }}%):</td> <td class="text-right text-muted" style="padding-right: 30px !important;">{{ tax.get_formatted("description") }} ({{ tax.get_formatted("rate") }}%):</td>
<td class="text-right"> <td class="text-right">{{ tax.get_formatted("tax_amount") }}</td>
{{ doc.get_formatted("total_taxes_and_charges", doc) }}
</td>
</tr> </tr>
{% endif %} {%- endif -%}
{%- endfor -%}
{%- if doc.apply_discount_on == "Grand Total" -%}
<tr class="row-divider">
<td class="text-right text-muted" style="padding-right: 30px !important;">
{{ _("Discount") }} ({{ doc.additional_discount_percentage }}%):
</td>
<td class="text-right">{{ doc.get_formatted("discount_amount", doc) }}</td>
</tr>
{%- endif -%}
</table> </table>
</td> </div>
</tr>
<tr style="border-bottom: 1px solid #ededed"> <div class="highlight-bg" style="border-radius: 12px; clear: both">
<td colspan="2" style="padding: 0 0 6px 0 !important">
<div class="highlight-bg" style="border-radius: 12px">
<table style="width: 100%; border-collapse: collapse"> <table style="width: 100%; border-collapse: collapse">
<tr> <tr>
<td class="text-left mw-400"> <td class="text-left mw-400">
@@ -306,9 +302,7 @@ print_heading_template=None) -%}
</tr> </tr>
</table> </table>
</div> </div>
</td>
</tr>
</table>
<!-- Terms --> <!-- Terms -->
{% if doc.terms %} {% if doc.terms %}