Factors the display of an invoice into _invoice_details.html for reuse in e-mail bits.
This commit is contained in:
		
							parent
							
								
									2cda70ed44
								
							
						
					
					
						commit
						f42aeb707e
					
				
					 2 changed files with 47 additions and 44 deletions
				
			
		
							
								
								
									
										46
									
								
								pinaxcon/templates/registrasion/_invoice_details.html
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										46
									
								
								pinaxcon/templates/registrasion/_invoice_details.html
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,46 @@ | |||
| {% load registrasion_tags %} | ||||
| 
 | ||||
| <h2>Invoice</h2> | ||||
| 
 | ||||
| {% with invoice_user=invoice.cart.user %} | ||||
|   <ul> | ||||
|     <li><strong>Invoice number:</strong> {{ invoice.id }} | ||||
|     <li><strong>Invoice status:</strong> {{ invoice.get_status_display }}</li> | ||||
|     <li><strong>Issue date:</strong> {{ invoice.issue_time|date:"DATE_FORMAT" }} | ||||
|     {% if not invoice.is_void %} | ||||
|       <li><strong>Due:</strong> {{ invoice.due_time|date:"DATETIME_FORMAT"}}</li> | ||||
|     {% endif %} | ||||
|     <li><strong>Recipient:</strong> {{ invoice_user.attendee.attendeeprofilebase.invoice_recipient|linebreaksbr}}</li> | ||||
|   </ul> | ||||
| {% endwith %} | ||||
| 
 | ||||
| <p>This invoice has been issued as a result of an application to attend (conference name).</p> | ||||
| 
 | ||||
| 
 | ||||
| <table class="table table-striped"> | ||||
|   <tr> | ||||
|     <th>Description</th> | ||||
|     <th class="text-right">Quantity</th> | ||||
|     <th class="text-right">Price/Unit</th> | ||||
|     <th class="text-right">Total</th> | ||||
|   </tr> | ||||
|   {% for line_item in invoice.lineitem_set.all %} | ||||
|     <tr> | ||||
|       <td>{{ line_item.description }}</td> | ||||
|       <td class="text-right">{{ line_item.quantity }}</td> | ||||
|       <td class="text-right">${{ line_item.price }}</td> | ||||
|       <td class="text-right">${{ line_item.price|multiply:line_item.quantity }}</td> | ||||
|     </tr> | ||||
|   {% endfor %} | ||||
|   <tr> | ||||
|     <th>TOTAL</th> | ||||
|     <td></td> | ||||
|     <td></td> | ||||
|     <td class="text-right">${{ invoice.value }}</td> | ||||
|   </tr> | ||||
| </table> | ||||
| 
 | ||||
| {% if invoice.paymentbase_set.all %} | ||||
| <h4>Payments received</h4> | ||||
| {% include "registrasion/payment_list.html" with payments=invoice.paymentbase_set.all %} | ||||
| {% endif %} | ||||
|  | @ -34,49 +34,6 @@ | |||
| 
 | ||||
| <hr /> | ||||
| 
 | ||||
| <h2>Invoice</h2> | ||||
| 
 | ||||
| {% with invoice_user=invoice.cart.user %} | ||||
|   <ul> | ||||
|     <li><strong>Invoice number:</strong> {{ invoice.id }} | ||||
|     <li><strong>Invoice status:</strong> {{ invoice.get_status_display }}</li> | ||||
|     <li><strong>Issue date:</strong> {{ invoice.issue_time|date:"DATE_FORMAT" }} | ||||
|     {% if not invoice.is_void %} | ||||
|       <li><strong>Due:</strong> {{ invoice.due_time|date:"DATETIME_FORMAT"}}</li> | ||||
|     {% endif %} | ||||
|     <li><strong>Recipient:</strong> {{ invoice_user.attendee.attendeeprofilebase.invoice_recipient|linebreaksbr}}</li> | ||||
|   </ul> | ||||
| {% endwith %} | ||||
| 
 | ||||
| <p>This invoice has been issued as a result of an application to attend (conference name).</p> | ||||
| 
 | ||||
| 
 | ||||
| <table class="table table-striped"> | ||||
|   <tr> | ||||
|     <th>Description</th> | ||||
|     <th class="text-right">Quantity</th> | ||||
|     <th class="text-right">Price/Unit</th> | ||||
|     <th class="text-right">Total</th> | ||||
|   </tr> | ||||
|   {% for line_item in invoice.lineitem_set.all %} | ||||
|     <tr> | ||||
|       <td>{{ line_item.description }}</td> | ||||
|       <td class="text-right">{{ line_item.quantity }}</td> | ||||
|       <td class="text-right">${{ line_item.price }}</td> | ||||
|       <td class="text-right">${{ line_item.price|multiply:line_item.quantity }}</td> | ||||
|     </tr> | ||||
|   {% endfor %} | ||||
|   <tr> | ||||
|     <th>TOTAL</th> | ||||
|     <td></td> | ||||
|     <td></td> | ||||
|     <td class="text-right">${{ invoice.value }}</td> | ||||
|   </tr> | ||||
| </table> | ||||
| 
 | ||||
| {% if invoice.paymentbase_set.all %} | ||||
| <h4>Payments received</h4> | ||||
| {% include "registrasion/payment_list.html" with payments=invoice.paymentbase_set.all %} | ||||
| {% endif %} | ||||
| {% include "registrasion/_invoice_details.html" %} | ||||
| 
 | ||||
| {% endblock %} | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer