Merge branch 'master' into prod
This commit is contained in:
		
						commit
						f1262837b4
					
				
					 6 changed files with 61 additions and 5 deletions
				
			
		|  | @ -75,7 +75,7 @@ | |||
|         "access_restricted": false, | ||||
|         "access_perm_type": 1, | ||||
|         "parent": 24, | ||||
|         "sort_order": 4, | ||||
|         "sort_order": 32, | ||||
|         "access_permissions": [] | ||||
|     } | ||||
| }, | ||||
|  | @ -483,7 +483,7 @@ | |||
|         "access_restricted": false, | ||||
|         "access_perm_type": 1, | ||||
|         "parent": 24, | ||||
|         "sort_order": 32, | ||||
|         "sort_order": 4, | ||||
|         "access_permissions": [] | ||||
|     } | ||||
| }, | ||||
|  |  | |||
|  | @ -1,4 +1,7 @@ | |||
| {% extends "registrasion/invoice/details_.html" %} | ||||
| 
 | ||||
| {% load nbpy_tags %} | ||||
| 
 | ||||
| {% comment %} | ||||
|   Blocks that you can override: | ||||
| 
 | ||||
|  | @ -32,12 +35,21 @@ | |||
|   {% elif invoice.is_paid %} | ||||
|     This is a confirmed registration summary for North Bay Python 2017. | ||||
|   {% endif %} | ||||
| {% endblock %} | ||||
| 
 | ||||
| {% block extra_line_items_after_total %} | ||||
|   {% donation_income invoice as donation %} | ||||
|   {% if donation %} | ||||
|     <tr> | ||||
|       <td colspan="3">Includes donation eligible for tax deduction in the USA:</td> | ||||
|       <td class="text-right">${{ donation }}</td> | ||||
|     </tr> | ||||
|   {% endif %} | ||||
| {% endblock %} | ||||
| 
 | ||||
| {% block contact_info %} | ||||
|   <p>Direct inquiries to <a href="mailto:spam@northbaypython.org">spam@northbaypython.org</a></p> | ||||
|   <p>North Bay Python is run by North Bay and Bay Area locals, as a member project of <a href="https://sfconservancy.org">Software Freedom Conservancy</a>, a 501(c)(3) public charity registered in New York.</p> | ||||
|   <p>North Bay Python is run by North Bay and Bay Area locals, as a member project of <a href="https://sfconservancy.org">Software Freedom Conservancy</a>, a 501(c)(3) not-for-profit public charity registered in New York. Software Freedom Conservancy's federal tax-exempt EIN is 41-2203632.</p> | ||||
| 
 | ||||
|   <strong>Mailing Address</strong> | ||||
|   <address> | ||||
|  |  | |||
|  | @ -13,7 +13,7 @@ | |||
| <a name="3"></a> | ||||
| <h2>Tickets now on sale for North Bay Python 2017</h2> | ||||
| 
 | ||||
| <p><span class="date">Tuesday, October 3, 2017</span>—We are excited to announce that <a href="https://2017.northbaypython.org/tickets">tickets are now on sale</a> for North Bay Python 2017. With just two months until the conference we have a few key dates coming up:</p> | ||||
| <p><span class="date">Thursday, October 5, 2017</span>—We are excited to announce that <a href="https://2017.northbaypython.org/tickets">tickets are now on sale</a> for North Bay Python 2017. With just two months until the conference we have a few key dates coming up:</p> | ||||
| 
 | ||||
| <ul> | ||||
|   <li><a href="https://2017.northbaypython.org/tickets">Tickets</a> are available at a discount until Friday, October 20.</li> | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| ### The North Bay Python 2017 CFP is open! | ||||
| ### The North Bay Python 2017 CFP closed on September 29 | ||||
| 
 | ||||
| We've got lots of good information and resources below that you should read, but in case you've already read it and want to dive in now: | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										0
									
								
								pinaxcon/templatetags/__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								pinaxcon/templatetags/__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
								
								
									
										44
									
								
								pinaxcon/templatetags/nbpy_tags.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								pinaxcon/templatetags/nbpy_tags.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,44 @@ | |||
| from registrasion.models import commerce | ||||
| from registrasion.controllers.category import CategoryController | ||||
| from registrasion.controllers.item import ItemController | ||||
| 
 | ||||
| from decimal import Decimal | ||||
| from django import template | ||||
| from django.conf import settings | ||||
| from django.db.models import Sum | ||||
| from urllib import urlencode  # TODO: s/urllib/six.moves.urllib/ | ||||
| 
 | ||||
| register = template.Library() | ||||
| 
 | ||||
| 
 | ||||
| @register.simple_tag(takes_context=True) | ||||
| def donation_income(context, invoice): | ||||
|     ''' Calculates the donation income for a given invoice. | ||||
| 
 | ||||
|     Returns: | ||||
|         the donation income. | ||||
| 
 | ||||
|     ''' | ||||
| 
 | ||||
|     # 15% (FSA) goes to Conservancy; 85% is real goods | ||||
| 
 | ||||
|     fsa_rate = Decimal("0.85") | ||||
|     rbi_full_ticket = Decimal("68.00") | ||||
|     rbi_early_bird_discount = Decimal("-21.35") | ||||
|     rbi = [] | ||||
| 
 | ||||
|     for line in invoice.lineitem_set.all(): | ||||
|         if line.product.category.name == "Ticket": | ||||
|             if line.product.name.startswith("Unaffiliated Individual"): | ||||
|                 # Includes full price & discounts | ||||
|                 rbi.append(line.total_price * fsa_rate) | ||||
|             else: | ||||
|                 if line.total_price > 0: | ||||
|                     rbi.append(rbi_full_ticket) | ||||
|                 elif line.total_price < 0: | ||||
|                     rbi.append(rbi_early_bird_discount) | ||||
|         elif line.product.category.name == "T-Shirt": | ||||
|             rbi.append(line.total_price * fsa_rate) | ||||
| 
 | ||||
|     donation = (invoice.value - sum(rbi)) | ||||
|     return donation.quantize(Decimal('.01')) | ||||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Christopher Neugebauer
						Christopher Neugebauer