diff --git a/fixtures/sitetree.json b/fixtures/sitetree.json
index 4b128d68dc6cfc7ee0c33be497b282aa9c6a79bd..a57075d54391b9c11f57060cae9d3ddd75ccd8b2 100644
--- a/fixtures/sitetree.json
+++ b/fixtures/sitetree.json
@@ -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": []
}
},
diff --git a/pinaxcon/templates/registrasion/invoice/details.html b/pinaxcon/templates/registrasion/invoice/details.html
index 886f514dfbf2c9c6c0a5739464125b7c6dfcb635..c22eae6ea6e6f55fd59edfba010833cff06cef4e 100644
--- a/pinaxcon/templates/registrasion/invoice/details.html
+++ b/pinaxcon/templates/registrasion/invoice/details.html
@@ -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 %}
+
+ Includes donation eligible for tax deduction in the USA: |
+ ${{ donation }} |
+
+ {% endif %}
{% endblock %}
{% block contact_info %}
Direct inquiries to spam@northbaypython.org
- North Bay Python is run by North Bay and Bay Area locals, as a member project of Software Freedom Conservancy, a 501(c)(3) public charity registered in New York.
+ North Bay Python is run by North Bay and Bay Area locals, as a member project of Software Freedom Conservancy, a 501(c)(3) not-for-profit public charity registered in New York. Software Freedom Conservancy's federal tax-exempt EIN is 41-2203632.
Mailing Address
diff --git a/pinaxcon/templates/static_pages/news.html b/pinaxcon/templates/static_pages/news.html
index a85c498a1c3c1cf8cd92f52b8ebc451c7543743b..ca0663f46951b223602adecabb14e636464c8cd7 100644
--- a/pinaxcon/templates/static_pages/news.html
+++ b/pinaxcon/templates/static_pages/news.html
@@ -13,7 +13,7 @@
Tickets now on sale for North Bay Python 2017
-Tuesday, October 3, 2017—We are excited to announce that tickets are now on sale for North Bay Python 2017. With just two months until the conference we have a few key dates coming up:
+Thursday, October 5, 2017—We are excited to announce that tickets are now on sale for North Bay Python 2017. With just two months until the conference we have a few key dates coming up:
- Tickets are available at a discount until Friday, October 20.
diff --git a/pinaxcon/templates/static_pages/program/call_for_proposals.md b/pinaxcon/templates/static_pages/program/call_for_proposals.md
index 9eca0acf4cfc3e82620125198473e87c028afd72..a5acacea03b273eacc39b4aac2129fc9ee3d7768 100644
--- a/pinaxcon/templates/static_pages/program/call_for_proposals.md
+++ b/pinaxcon/templates/static_pages/program/call_for_proposals.md
@@ -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:
diff --git a/pinaxcon/templatetags/__init__.py b/pinaxcon/templatetags/__init__.py
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/pinaxcon/templatetags/nbpy_tags.py b/pinaxcon/templatetags/nbpy_tags.py
new file mode 100644
index 0000000000000000000000000000000000000000..16af7568bad8cef98121d1c661f82d59c9f43498
--- /dev/null
+++ b/pinaxcon/templatetags/nbpy_tags.py
@@ -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'))