{% load base_filters %}
{% load invoice_tags %}
{% load i18n %}

<table width="100%">
      {% invoices_search_line_header request invoice '#003366' %}  
        
      {# display corporate membership info #} 
     
      <tr>
      	<td>{% trans "Corp. Memb. ID" %}</td>
      	<td>{% trans "Company Name" %}</td>
      	<td>{% trans "Date" %}</td>
      	<td>{% trans "Amount" %}</td>
      	<td>{% trans "Balance" %}</td>
      </tr>
    {% if obj %}
       <tr>
       	<td><a href="{% url corpmembership.view obj.id %}">{{obj.id}}</a></td>
       	<td>{{obj}}</td>
       	<td>{{obj.create_dt|date:'long'}}</td>
       	<td>{{invoice.total|format_currency}}</td>
       	<td><div {% if invoice.balance > 0 %}class="body-copy-yellow"{% endif %}>{{invoice.balance|format_currency}}</div></td>
       </tr> 
       {% if obj.renewal %}
            {% with  obj.indivmembershiprenewentry_set.all as indiv_memb_renew_entries %}
       		{% if indiv_memb_renew_entries %}
       			<tr><td colspan="5">&nbsp;</td></tr>
		       <tr>
		       	<td colspan="3"><b>{% trans "Individual memberships renewed in this transaction:" %}</b></td>
		       	<td colspan="2">&nbsp;</td>
		       </tr>
		       
		       {% for renew_entry in indiv_memb_renew_entries %}
					<tr>
					<td>&nbsp;</td>
					<td><a href="{% url profile renew_entry.membership.user.username %}">{{ renew_entry.membership.user.get_full_name }}</a></td>
					<td>{{ renew_entry.membership.member_number }}</td>
					<td colspan="2">&nbsp;</td>
					</tr>
				{% endfor %}
		       
	       {% endif %} 
	       {% endwith %}  
       {% endif %}   
   {% endif %}   
            
    </table>
