From 84f8428a929b33c3e88214901f53a0f302d69be6 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Fri, 20 Nov 2015 22:08:30 -0500 Subject: added budget totals and prospects to monthly income views --- app/TODO | 2 -- app/income/admin.py | 5 +++++ design/templates/admin/income_month.html | 34 +++++++++++++++++++++++++++++++- 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 @@ › {{ app_label|capfirst|escape }} › {% if has_change_permission %} {{ opts.verbose_name_plural|capfirst }}{% else %}{{ opts.verbose_name_plural|capfirst }}{% endif %} - › {% trans 'Upload' %} + › {% trans 'Income for' %} {{date|date:"F Y"}} {% endblock %} @@ -112,6 +112,38 @@

{% trans "Total Outstanding:" %} ${{total_outstanding.total_payment}}

+

Also have these stories pitched, but not accepted

+
+ + + + + + + + + + + +{% for gig in pitched %} + + +{%endfor%} + +
+ +
+
+ +
+
+ +
+
{{gig.title}}${{gig.payment}}{{gig.publisher}}
+
+ +

{% 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%}

+
-- cgit v1.2.3