summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/TODO2
-rw-r--r--app/income/admin.py5
-rw-r--r--design/templates/admin/income_month.html34
3 files changed, 38 insertions, 3 deletions
diff --git a/app/TODO b/app/TODO
index ed6720c..6a32a83 100644
--- a/app/TODO
+++ b/app/TODO
@@ -16,8 +16,6 @@ revamp notes to be like my own personal instagram
income app:
-- Add pitched stories as possibilities below total, t
-- show totals alongside how much we need to live.
- add pay_turnaround field for each publisher and show in admin
---
diff --git a/app/income/admin.py b/app/income/admin.py
index 02c01ef..c4e858a 100644
--- a/app/income/admin.py
+++ b/app/income/admin.py
@@ -60,6 +60,11 @@ class GigAdmin(OSMGeoAdmin):
created__month=month,
status__in=[1, 2, 3]
)
+ context['pitched'] = self.model.objects.filter(
+ created__year=year,
+ created__month=month,
+ status=0
+ )
context['date'] = datetime.datetime.now()
context['billed'] = qs.filter(payment_status=1)
context['billed_total'] = qs.filter(payment_status=1).aggregate(total_payment=Sum('payment'))
diff --git a/design/templates/admin/income_month.html b/design/templates/admin/income_month.html
index e34cdbf..9f1742a 100644
--- a/design/templates/admin/income_month.html
+++ b/design/templates/admin/income_month.html
@@ -28,7 +28,7 @@
&rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ app_label|capfirst|escape }}</a>
&rsaquo; {% if has_change_permission %}<a href="{% url opts|admin_urlname:'changelist' %}">
{{ opts.verbose_name_plural|capfirst }}</a>{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %}
- &rsaquo; {% trans 'Upload' %}
+ &rsaquo; {% trans 'Income for' %} {{date|date:"F Y"}}
</div>
{% endblock %}
@@ -112,6 +112,38 @@
</table>
</div>
<h2>{% trans "Total Outstanding:" %} ${{total_outstanding.total_payment}}</h2>
+<h4 style="margin-top: 3em;">Also have these stories pitched, but not accepted</h4>
+<div class="results">
+<table id="result_list_2">
+<thead>
+<tr>
+
+<th scope="col" class="sortable column-title">
+ <div class="text"><a href="?o=1">Title</a></div>
+ <div class="clear"></div>
+</th>
+<th scope="col" class="sortable column-status">
+ <div class="text"><a href="?o=5">Amount</a></div>
+ <div class="clear"></div>
+</th>
+<th scope="col" class="sortable column-status">
+ <div class="text"><a href="?o=5">Source</a></div>
+ <div class="clear"></div>
+</th>
+</tr>
+</thead>
+<tbody>
+
+{% for gig in pitched %}
+
+<tr class="{% cycle 'row1' 'row2' %}"><th class="field-title">{{gig.title}}</th><td class="field-status">${{gig.payment}}</td><td class="field-payment_status">{{gig.publisher}}</td></tr>
+{%endfor%}
+</tbody>
+</table>
+</div>
+
+<h2>{% trans "" %} {% with total_outstanding.total_payment|add:"-2000" as underover %}{% if underover > 0 %}${{underover}} more that budget{%else%}Need to generate another ${{underover|cut:"-"}} to cover expenses{%endif%}{%endwith%}</h2>
+
</div>
<div style="float:left; margin-left: 4em;">