fix: Print Auditing print format
diff --git a/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html
index 2eadb2a..06f77b0 100644
--- a/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html
+++ b/erpnext/accounts/print_format/bank_and_cash_payment_voucher/bank_and_cash_payment_voucher.html
@@ -31,9 +31,28 @@
<th>Amount</th>
</tr>
<tr>
+ <td class="top-bottom" colspan="5"><strong>Debit</strong></td>
+ </tr>
+ {% for entries in doc.gl_entries %}
+ {% if entries.credit == 0.0 %}
+ <tr>
+ <td class="right top-bottom">{{ entries.account }}</td>
+ <td class="right left top-bottom">{{ entries.party_type }}</td>
+ <td class="right left top-bottom">{{ entries.party }}</td>
+ <td class="left top-bottom">{{ entries.debit }}</td>
+ </tr>
+ <tr>
+ <td class="top-bottom"colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ <tr>
+ <td class="right" colspan="3" ><strong>Total (debit) </strong></td>
+ <td class="left" >{{ doc.gl_entries | sum(attribute='debit') }}</td>
+ </tr>
+ <tr>
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
</tr>
- {% set total_credit = 0 -%}
{% for entries in doc.gl_entries %}
{% if entries.debit == 0.0 %}
<tr>
@@ -41,42 +60,16 @@
<td class="right left top-bottom">{{ entries.party_type }}</td>
<td class="right left top-bottom">{{ entries.party }}</td>
<td class="left top-bottom">{{ entries.credit }}</td>
- {% set total_credit = total_credit + entries.credit -%}
</tr>
<tr>
<td class="top-bottom" colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
</tr>
+ {% endif %}
+ {% endfor %}
<tr>
<td class="right" colspan="3"><strong>Total (credit) </strong></td>
- <td class="left" >{{total_credit}}</td>
+ <td class="left" >{{ doc.gl_entries | sum(attribute='credit') }}</td>
</tr>
- {% endif %}
- {% endfor %}
- <tr>
- <td class="top-bottom" colspan="4"> </td>
- </tr>
- <tr>
- <td class="top-bottom" colspan="5"><strong>Debit</strong></td>
- </tr>
- {% set total_debit = 0 -%}
- {% for entries in doc.gl_entries %}
- {% if entries.credit == 0.0 %}
- <tr>
- <td class="right top-bottom">{{ entries.account }}</td>
- <td class="right left top-bottom">{{ entries.party_type }}</td>
- <td class="right left top-bottom">{{ entries.party }}</td>
- {% set total_debit = total_debit + entries.debit -%}
- <td class="left top-bottom">{{ entries.debit }}</td>
- </tr>
- <tr>
- <td class="top-bottom"colspan="4"><strong> Narration </strong><br>{{ entries.remarks }}</td>
- </tr>
- <tr>
- <td class="right" colspan="3" ><strong>Total (debit) </strong></td>
- <td class="left" >{{total_debit}}</td>
- </tr>
- {% endif %}
- {% endfor %}
</table>
<div>
</div>
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html b/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html
index 4565559..566d444 100644
--- a/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html
+++ b/erpnext/accounts/print_format/journal_auditing_voucher/journal_auditing_voucher.html
@@ -3,14 +3,12 @@
.table-bordered td.top-bottom {border-top: none !important;border-bottom: none !important;}
.table-bordered td.right{border-right: none !important;}
.table-bordered td.left{border-left: none !important;}
-
-
</style>
<div class="page-break">
{%- if not doc.get("print_heading") and not doc.get("select_print_heading")
and doc.set("select_print_heading", _("Journal Entry")) -%}{%- endif -%}
{{ add_header(0, 1, doc, letter_head, no_letterhead, print_settings) }}
- <div class="row margin-bottom">
+ <div class="row">
<div class="col-sm-6">
<table>
<tr><td><strong>Voucher No: </strong></td><td>{{ doc.name }}</td></tr>
@@ -22,7 +20,7 @@
</table>
</div>
</div>
- <div class="margin-top">
+ <div>
<table class="table table-bordered table-condensed">
<tr>
<th>Account</th>
@@ -31,9 +29,25 @@
<th>Amount</th>
</tr>
<tr>
+ <td class="top-bottom" colspan="5"><strong>Debit</strong></td>
+ </tr>
+ {% for entries in doc.gl_entries %}
+ {% if entries.credit == 0.0 %}
+ <tr>
+ <td class="right top-bottom">{{ entries.account }}</td>
+ <td class="right left top-bottom">{{ entries.party_type }}</td>
+ <td class="right left top-bottom">{{ entries.party }}</td>
+ <td class="left top-bottom">{{ entries.debit }}</td>
+ </tr>
+ {% endif %}
+ {% endfor %}
+ <tr>
+ <td class="right" colspan="3" ><strong>Total (debit) </strong></td>
+ <td class="left" >{{ doc.gl_entries | sum(attribute='debit') }}</td>
+ </tr>
+ <tr>
<td class="top-bottom" colspan="5"><strong>Credit</strong></td>
</tr>
- {% set total_credit = 0 -%}
{% for entries in doc.gl_entries %}
{% if entries.debit == 0.0 %}
<tr>
@@ -41,36 +55,16 @@
<td class="right left top-bottom">{{ entries.party_type }}</td>
<td class="right left top-bottom">{{ entries.party }}</td>
<td class="left top-bottom">{{ entries.credit }}</td>
- {% set total_credit = total_credit + entries.credit -%}
- </tr>
- <tr>
- <td class="right" colspan="3"><strong>Total (credit) </strong></td>
- <td class="left" >{{total_credit}}</td>
</tr>
{% endif %}
{% endfor %}
<tr>
- <td class="top-bottom" colspan="4"> </td>
+ <td class="right" colspan="3"><strong>Total (credit) </strong></td>
+ <td class="left" >{{ doc.gl_entries | sum(attribute='credit') }}</td>
</tr>
<tr>
- <td class="top-bottom" colspan="5"><strong>Debit</strong></td>
+ <td class="top-bottom" colspan="5"><b>Narration: </b>{{ doc.gl_entries[0].remarks }}</td>
</tr>
- {% set total_debit = 0 -%}
- {% for entries in doc.gl_entries %}
- {% if entries.credit == 0.0 %}
- <tr>
- <td class="right top-bottom">{{ entries.account }}</td>
- <td class="right left top-bottom">{{ entries.party_type }}</td>
- <td class="right left top-bottom">{{ entries.party }}</td>
- {% set total_debit = total_debit + entries.debit -%}
- <td class="left top-bottom">{{ entries.debit }}</td>
- </tr>
- <tr>
- <td class="right" colspan="3" ><strong>Total (debit) </strong></td>
- <td class="left" >{{total_debit}}</td>
- </tr>
- {% endif %}
- {% endfor %}
</table>
<div>
</div>
\ No newline at end of file
diff --git a/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html b/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html
index 35852e1..342ce22 100644
--- a/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html
+++ b/erpnext/accounts/print_format/purchase_auditing_voucher/purchase_auditing_voucher.html
@@ -60,10 +60,16 @@
<table>
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
{% for tax in doc.taxes %}
- <tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
+ {% if tax.tax_amount_after_discount_amount!= 0 %}
+ <tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
+
{% endfor %}
+ {% if doc.taxes_and_charges_added!= 0 %}
<tr><td><strong> Taxes and Charges Added: </strong></td><td>{{ doc.taxes_and_charges_added }}</td></tr>
+ {% endif %}
+ {% if doc.taxes_and_charges_deducted!= 0 %}
<tr><td><strong> Taxes and Charges Deducted: </strong></td><td>{{ doc.taxes_and_charges_deducted }}</td></tr>
+ {% endif %}
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
</table>
@@ -76,8 +82,8 @@
<th>Account</th>
<th>Party Type</th>
<th>Party</th>
- <th>Credit Amount</th>
<th>Debit Amount</th>
+ <th>Credit Amount</th>
</tr>
{% for entries in doc.gl_entries %}
<tr>
@@ -85,8 +91,8 @@
<td>{{ entries.account }}</td>
<td>{{ entries.party_type }}</td>
<td>{{ entries.party }}</td>
- <td>{{ entries.credit }}</td>
<td>{{ entries.debit }}</td>
+ <td>{{ entries.credit }}</td>
</tr>
{% endfor %}
<tr>
diff --git a/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html b/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html
index 04de83d..4dc4b8a 100644
--- a/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html
+++ b/erpnext/accounts/print_format/sales_auditing_voucher/sales_auditing_voucher.html
@@ -56,7 +56,9 @@
<table>
<tr><td><strong>Tax and Charges: </strong></td><td>{{doc.taxes_and_charges}}</td></tr>
{% for tax in doc.taxes %}
- <tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
+ {% if tax.tax_amount_after_discount_amount!= 0 %}
+ <tr><td><strong>{{ tax.account_head }}: </strong></td><td>{{ tax.tax_amount_after_discount_amount }}</td></tr>
+ {% endif %}
{% endfor %}
<tr><td><strong> Total Taxes and Charges: </strong></td><td>{{ doc.total_taxes_and_charges }}</td></tr>
<tr><td><strong> Net Payable: </strong></td><td>{{ doc.grand_total }}</td></tr>
@@ -70,8 +72,8 @@
<th>Account</th>
<th>Party Type</th>
<th>Party</th>
- <th>Credit Amount</th>
<th>Debit Amount</th>
+ <th>Credit Amount</th>
</tr>
{% for entries in doc.gl_entries %}
<tr>
@@ -79,8 +81,8 @@
<td>{{ entries.account }}</td>
<td>{{ entries.party_type }}</td>
<td>{{ entries.party }}</td>
- <td>{{ entries.credit }}</td>
<td>{{ entries.debit }}</td>
+ <td>{{ entries.credit }}</td>
</tr>
{% endfor %}
<tr>