Remove "Amount Credited" and "Balance Due" from invoice Template

Hi guys.

I have put a screenshot of my invoice theme above. I am trying to remove the “Amount Credited” and “Balance Due” lines from the invoice, but I am not able to do it. I don’t want those lines to show on the printed invoices. The Lines only appear after I have received money for those invoices, and the only way to hide those lines is to delete the receive money entry, print the invoice or save it in PDF format and later on make the receive money entry again. Kindly help me out with this as it becomes a long process to delete and remake the receive money entry each and every time. The code for the invoice is given below.

Any help will be appreciated. Thanks in advance. Have a good day.

Regards,
Taher R

I searched the forums but couldn’t find the related topic, sorry if this is a duplicate. Kindly point me towards the correct topic.

<table style="padding: 20px">
<thead>
<tr>
<td colspan="99">
<table style="margin-bottom: 5px; padding-top: 5px"><tr>
{% if business.logo != null %}<td style="text-align: left"><img src="{{ business.logo }}" style="max-height: 150px; max-width: 300px"></td>{% endif %}
<td style="padding-left: 20px; padding-top: 5px; padding-bottom: 5px; width: 250px">
<div style="text-ALIGN:left;background-color:#FFFFFFF;font-weight: bold;color:#000000; font-size: 32px; white-space: nowrap;text-transform: uppercase;">{{ title }}</div>
<p style="color:#ffffff;">.</p>
<div style="text-transform: uppercase;font-size: 16px; text-align:LEFT;font-weight: bold">{{ business.name }}</div>
<div style="text-align:LEFT;font-weight: bold">{{ business.address | newline_to_br }}</div>
<div style="text-align:LEFT;font-weight: bold">{{ business.identifier }}</div>
</td>
<tr></tr>
<tr></tr>
<tr><td colspan="99">
<div style="border-top-width: 1px; border-color: #cfd1d3; background-color: #cfd1d3; color: #ffffff">
</div>
</td></tr>
</tr></table>
<table style="margin-bottom: 5px"><tr>
<td style="padding-left: 30px">
<div style="font-weight: bold"><p>Consignee: {{ recipient.name }}</p></div>
<div>{{ recipient.address | newline_to_br }}</div>
<div>{{ recipient.identifier }}</div>
</td>
<td style="padding-right: 30px; font-size: 15px; text-align: right">
{% for field in fields %}
{% if (field.label != 'Invoice number') %}{% continue %}{% endif %}
<div><b>{{ field.label }}:</b> {{ field.text }}</div>
{% endfor %}
{% for field in fields %}
{% if (field.label == 'Invoice number') %}{% continue %}{% endif %}
<div><b>{{ field.label }}:</b> {{ field.text }}</div>
{% endfor %}
</td>
</tr></table>
<tr><td colspan="99">
<div style="border-top-width: 1px; border-color: #cfd1d3; background-color: #cfd1d3; color: #ffffff">
</div>
</td></tr>
<tr>
        <td colspan="99"> 
            <table>
                <tr>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Shipper') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-left: 30px"><b>{{ field.label }}: </b>{{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Commodity') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-left: 30px; text-align: left"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Port') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-left: 30px; text-align:left"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                </tr>
                <tr>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Container Number') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-left: 30px; text-align:left"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Quantity') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-left: 30px; text-align: left"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>   
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Declaration Number') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-left: 30px; text-align:left"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                </tr>
                <tr>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='MBL/MAWB') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-bottom: 5px; Text-align: left; padding-left: 30px;"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
    
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Gross Weight') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-bottom: 5px; padding-left: 30px; text-align:left"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                    <td>
                        {% for field in custom_fields %}
                        {% if (field.label !='Type') %}{% continue %}{% endif %}
                        <div style="padding-top: 5px; padding-bottom: 5px; padding-left: 30px;"><b>{{ field.label }}: </b> {{ field.text | newline_to_br}}</div>
                        {% endfor %}
                    </td>
                </tr>
            </table></td></tr>
            
        
        <tr><td colspan="99">
                <div style="border-top-width: 1px; border-color: #cfd1d3; background-color: #A9A9A9; color: #ffffff"></div>
        </td></tr>
      
<tr>
{% for column in table.columns %} 
<td style="font-weight: bold; font-size:14px; color: #FFFFFF; background-color: #cfd1d3; border-color: #cfd1d3; padding: 10px; text-align: {{ column.align }}{% if forloop.first %}; padding-left: 30px{% endif %}{% if forloop.last %}; padding-right: 30px{% endif %}{% if column.nowrap %}; white-space: nowrap; width: 80px{% endif %}">{{ column.label }}</td>
{% endfor %}
</tr>
</td></tr></thead>
<tbody>
{% for row in table.rows %}
<tr>
{% for cell in row.cells %}
<td style="padding: 7px; font-size:14px; text-align: {{ table.columns[forloop.index0].align }}; border-color: #cfd1d3; border-bottom-width: 2px{% if forloop.first %}; padding-left: 30px{% endif %}{% if forloop.last %}; padding-right: 30px{% endif %}{% if table.columns[forloop.index0].nowrap %}; white-space: nowrap; width:3px;{% endif %}">{{ cell.text | newline_to_br }}</td>
{% endfor %}
</tr>
{% endfor %}
{% for total in table.totals %}
<tr>
<td colspan="{{ table.columns | size | minus:1 }}" style="padding: 20px; text-align: right{% if total.emphasis == true %}; font-weight: bold; font-size: 14px{% endif %}">{{ total.label }}</td>
<td style="border-bottom-width: 1px; border-color: #C2CBCE; white-space: nowrap; padding: 10px; padding-left: 30px; text-align: right; padding-right: 30px{% if total.emphasis == true %}; font-weight: bold; color: #fff; background-color: #cfd1d3; font-size: 14px{% endif %}">{{ total.text }}</td>
</tr>
{% endfor %}
<tr></tr>
<tr></tr>
<tfoot>
<tr><td colspan="99">
<div style="margin-top: 50px; margin-bottom: 3px; border-top-width: 0px; border-color: #cfd1d3; font-size: 11px; padding: 2px 4px; background-color: #cfd1d3; color: #ffffff">
</div>
</td></tr>
<tr>
<td colspan="99">
<div>
<div style="margin-left: 30px;font-size: 9px;MARGIN-TOP: 3PX; font-weight: bold; text-align: Left">Payment Information:</div>
<div style="margin-left: 30px;font-size: 9px; text-align: Left">All cheques and drafts to be made payable to AL BURHANI SHIPPING LLC</div>
<div style="margin-left: 30px;font-size: 9px; text-align: left">Descripancies, if any, should be notified to us in writing within 7 days from the invoice date</div>
<div style="margin-left: 30px;font-size: 9px; text-align: left">All business transactions subject to the companies terms & conditions<div></div>
<div style="font-size: 9px;text-align: left">This receipt will be invalid if it contains manual amendments not signed by authorized personnel</div>
<div>&nbsp;</div>
<div style="TEXT-ALIGN:RIGHT;font-size: 12px; font-weight: bold;padding-left:0px;">_____________________________</div>
<div style="TEXT-ALIGN:RIGHT;font-size: 12px; font-weight: bold;padding-RIGHT:8px;">AL BURHANI SHIPPING LLC</div>
<div style="font-size: 9px;text-align: left">Prepared by: Kutbuddin</div>
<div style="font-size: 9px;text-align: left; MARGIN-BOTTOM: 3PX">E & O.E.</div>
</div>
</div></td>
</tr>
<tr><td colspan="99">
<div style="border-top-width: 0px; border-color: #cfd1d3; font-size: 11px; padding: 2px 4px; background-color: #cfd1d3; color: #ffffff">
</div>
</td></tr>
</tfoot></tbody></table>
1 Like

This portion of your code loops through totals:

{% for total in table.totals %}
<tr>
<td colspan="{{ table.columns | size | minus:1 }}" style="padding: 20px; text-align: right{% if total.emphasis == true %}; font-weight: bold; font-size: 14px{% endif %}">{{ total.label }}</td>
<td style="border-bottom-width: 1px; border-color: #C2CBCE; white-space: nowrap; padding: 10px; padding-left: 30px; text-align: right; padding-right: 30px{% if total.emphasis == true %}; font-weight: bold; color: #fff; background-color: #cfd1d3; font-size: 14px{% endif %}">{{ total.text }}</td>
</tr>
{% endfor %}

So you might need to add some condition to test whether {{ total.label }} variable contains “Amount Credited” or “Balance Due” and if yes, then skip it.

E.g.

{% if (total.label == 'Balance Due') %}{% continue %}{% endif %}
{% if (total.label == 'Amount Credited') %}{% continue %}{% endif %}

2 Likes

Hey man.

Thanks for the super-quick reply.

Can you elaborate a little more on how I can solve it? You see, I am not into coding stuff and I didnt understand what you just said…

(Though I did learn HTML basic in school 8 years back, I never studied it after leaving school)

This isn’t a coding forum, @TaherR. The developer has pointed you toward the right section of code and the nature of changes you need to make. If you don’t personally have the skills, you should hire someone to do the job for you.

1 Like

@TaherR, your theme looks heavily customized from what I can see. So I have assumed you know coding. How did you make your theme so far?

1 Like

The theme I am using right now was uploaded by a user on this forums only…

The only customization made was the placing of custom fields… a user on the forums helped me with that as well…

I think it’s important to actually understand what your theme is doing rather than just blindly copy pasting.

Anyway… find in your theme code where it loops through totals:

{% for total in table.totals %}
<tr>
<td colspan="{{ table.columns | size | minus:1 }}" style="padding: 20px; text-align: right{% if total.emphasis == true %}; font-weight: bold; font-size: 14px{% endif %}">{{ total.label }}</td>
<td style="border-bottom-width: 1px; border-color: #C2CBCE; white-space: nowrap; padding: 10px; padding-left: 30px; text-align: right; padding-right: 30px{% if total.emphasis == true %}; font-weight: bold; color: #fff; background-color: #cfd1d3; font-size: 14px{% endif %}">{{ total.text }}</td>
</tr>
{% endfor %}

And insert after the first line these lines:

{% if (total.label == 'Balance due') %}{% continue %}{% endif %}
{% if (total.label == 'Amount credited') %}{% continue %}{% endif %}

so the result should be:

{% for total in table.totals %}
{% if (total.label == 'Balance due') %}{% continue %}{% endif %}
{% if (total.label == 'Amount credited') %}{% continue %}{% endif %}
<tr>
<td colspan="{{ table.columns | size | minus:1 }}" style="padding: 20px; text-align: right{% if total.emphasis == true %}; font-weight: bold; font-size: 14px{% endif %}">{{ total.label }}</td>
<td style="border-bottom-width: 1px; border-color: #C2CBCE; white-space: nowrap; padding: 10px; padding-left: 30px; text-align: right; padding-right: 30px{% if total.emphasis == true %}; font-weight: bold; color: #fff; background-color: #cfd1d3; font-size: 14px{% endif %}">{{ total.text }}</td>
</tr>
{% endfor %}

This means when it loops through totals to skip any total with label “Balance due” or “Amount credited”

2 Likes

Thanks Man, really appreciate it…

@TaherR Your template has been copied by me and edited to create a perfect template for a client.

Thanks for sharing

2 Likes

I am glad you found it useful.