From ab8f1a75afcb074c7bdb969a52998d81a67cd3e9 Mon Sep 17 00:00:00 2001 From: bashmak Date: Mon, 27 Feb 2017 14:06:30 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D1=91=D1=81=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D1=81=D1=87=D1=91=D1=82=D0=B0,=20=D0=B4=D0=BE=D0=BB=D0=B3?= =?UTF-8?q?=D0=B8=20=D0=B8=20=D0=B8=D1=81=D1=82=D0=BE=D1=80=D0=B8=D1=8E=20?= =?UTF-8?q?=D0=BF=D0=BB=D0=B0=D1=82=D0=B5=D0=B6=D0=B5=D0=B9=20=D0=BD=D0=B0?= =?UTF-8?q?=20=D0=BE=D0=B1=D1=89=D1=83=D1=8E=20=D0=B2=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=BA=D1=83=20=D1=81=20=D1=84=D0=B8=D0=BD=D0=B0=D0=BD?= =?UTF-8?q?=D1=81=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- abonapp/templates/abonapp/abonamount.html | 38 ------ abonapp/templates/abonapp/ext.htm | 14 +-- .../templates/abonapp/invoiceForPayment.html | 117 ++++++++++-------- .../templates/abonapp/modal_abonamount.html | 31 +++++ abonapp/templates/abonapp/payHistory.html | 18 ++- abonapp/urls_abon.py | 2 +- abonapp/views.py | 5 +- 7 files changed, 118 insertions(+), 107 deletions(-) delete mode 100644 abonapp/templates/abonapp/abonamount.html create mode 100644 abonapp/templates/abonapp/modal_abonamount.html diff --git a/abonapp/templates/abonapp/abonamount.html b/abonapp/templates/abonapp/abonamount.html deleted file mode 100644 index 7e9bb95..0000000 --- a/abonapp/templates/abonapp/abonamount.html +++ /dev/null @@ -1,38 +0,0 @@ -{% extends request.is_ajax|yesno:'nullcont.htm,abonapp/ext.htm' %} -{% load i18n %} -{% block content %} - - - {% trans 'Additional sum' %} - - -
-
-
{% csrf_token %} - -
- - -
- - -
-
-
- -
- - -
- -
-
-
- -{% endblock %} \ No newline at end of file diff --git a/abonapp/templates/abonapp/ext.htm b/abonapp/templates/abonapp/ext.htm index 86acafc..a1ca865 100644 --- a/abonapp/templates/abonapp/ext.htm +++ b/abonapp/templates/abonapp/ext.htm @@ -38,21 +38,9 @@ {% endif %} - {% if perms.abonapp.can_add_ballance %} - {% url 'abonapp:abon_amount' abon_group.id abon.id as abamount %} - - {% trans 'Fill account' %} - - {% endif %} - - {% url 'abonapp:abon_debts' abon_group.id abon.id as abondebts %} - - {% trans 'Debts' %} - - {% url 'abonapp:abon_phistory' abon_group.id abon.id as abphist %} - {% trans 'Payment history' %} + {% trans 'Payments' %} {% url 'abonapp:task_log' abon_group.id abon.id as abtasklog %} diff --git a/abonapp/templates/abonapp/invoiceForPayment.html b/abonapp/templates/abonapp/invoiceForPayment.html index 231a398..92ff0d4 100644 --- a/abonapp/templates/abonapp/invoiceForPayment.html +++ b/abonapp/templates/abonapp/invoiceForPayment.html @@ -1,57 +1,72 @@ -{% extends request.is_ajax|yesno:'nullcont.htm,abonapp/ext.htm' %} +{% extends 'base.html' %} {% load i18n %} -{% block content %} +{% block main %} - - - - - - - - - - - - - - {% for inv in invoices %} - - - - - - - - - - {% empty %} - - - - {% endfor %} - - {% if perms.abonapp.add_invoiceforpayment %} - + + + {% include 'message_block.html' %} + +

{% trans 'Debtor' %} {{ abon.fio }}

+
+
{% trans 'Pay status' %}{% trans 'Month' %}{% trans 'Sum' %}{% trans 'Comment' %}{% trans 'Date of make' %}{% trans 'Date of payment' %}{% trans 'Author of payment' %}
{% if inv.status %} - - {% else %} - - {% endif %}{{ inv.date_create|date:"F" }}{{ inv.amount }}{{ inv.comment }}{{ inv.date_create|date:"D d E Y H:i:s" }} - {% if inv.date_pay %} - {{ inv.date_pay|date:"D d M Y H:i:s" }} - {% else %} - {{ inv.status|yesno:_('Created paid,Not yet paid') }} - {% endif %} - {{ inv.author.username }}
{% trans 'Receipts not found' %}
+ - + + + + + + + - - {% endif %} -
- - {% trans 'Add debt' %} - - {% trans 'Pay status' %}{% trans 'Month' %}{% trans 'Sum' %}{% trans 'Comment' %}{% trans 'Date of make' %}{% trans 'Date of payment' %}{% trans 'Author of payment' %}
+ + + {% for inv in invoices %} + + {% if inv.status %} + + {% else %} + + {% endif %} + {{ inv.date_create|date:"F" }} + {{ inv.amount }} + {{ inv.comment }} + {{ inv.date_create|date:"D d E Y H:i:s" }} + + {% if inv.date_pay %} + {{ inv.date_pay|date:"D d M Y H:i:s" }} + {% else %} + {{ inv.status|yesno:_('Created paid,Not yet paid') }} + {% endif %} + + {{ inv.author.username }} + + {% empty %} + + {% trans 'Receipts not found' %} + + {% endfor %} + + {% if perms.abonapp.add_invoiceforpayment %} + + + + + {% trans 'Add debt' %} + + + + + {% endif %} + + + + {% include 'toolbar_page.html' with pag=invoices %} {% endblock %} diff --git a/abonapp/templates/abonapp/modal_abonamount.html b/abonapp/templates/abonapp/modal_abonamount.html new file mode 100644 index 0000000..f2defbe --- /dev/null +++ b/abonapp/templates/abonapp/modal_abonamount.html @@ -0,0 +1,31 @@ +{% load i18n %} + +
{% csrf_token %} + + + + +
diff --git a/abonapp/templates/abonapp/payHistory.html b/abonapp/templates/abonapp/payHistory.html index a353427..f81a128 100644 --- a/abonapp/templates/abonapp/payHistory.html +++ b/abonapp/templates/abonapp/payHistory.html @@ -15,10 +15,10 @@ {% for ph in pay_history %} - {{ ph.abon.username }} + {{ ph.abon.username }} {{ ph.amount }} {{ ph.date|date:'d F Y, H:i:s' }} - {{ ph.author.username }} + {{ ph.author.username }} {{ ph.comment }} {% empty %} @@ -27,6 +27,20 @@ {% endfor %} + + + + {% if perms.abonapp.can_add_ballance %} + + {% trans 'Fill account' %} + + {% endif %} + + {% trans 'Debts' %} + + + + diff --git a/abonapp/urls_abon.py b/abonapp/urls_abon.py index 98e31c4..4182ff2 100644 --- a/abonapp/urls_abon.py +++ b/abonapp/urls_abon.py @@ -10,7 +10,7 @@ urlpatterns = [ url(r'^(?P\d+)/services$', views.abon_services, name='abon_services'), url(r'^(?P\d+)/amount', views.abonamount, name='abon_amount'), url(r'^(?P\d+)/debts', views.invoice_for_payment, name='abon_debts'), - url(r'^(?P\d+)/pay_history', views.pay_history, name='abon_phistory'), + url(r'^(?P\d+)/pay', views.pay_history, name='abon_phistory'), url(r'^(?P\d+)/addinvoice$', views.add_invoice, name='add_invoice'), url(r'^(?P\d+)/pick$', views.pick_tariff, name='pick_tariff'), diff --git a/abonapp/views.py b/abonapp/views.py index 7a9440e..3f59699 100644 --- a/abonapp/views.py +++ b/abonapp/views.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- from json import dumps +from django.contrib.gis.shortcuts import render_to_text from django.core.exceptions import PermissionDenied from django.db import IntegrityError from django.db.models import Count @@ -180,10 +181,10 @@ def abonamount(request, gid, uid): messages.error(request, e) except NasFailedResult as e: messages.error(request, e) - return render(request, 'abonapp/abonamount.html', { + return render_to_text('abonapp/modal_abonamount.html', { 'abon': abon, 'abon_group': get_object_or_404(models.AbonGroup, id=gid) - }) + }, request=request) @login_required