diff --git a/accounts_ext/models.py b/accounts_ext/models.py index 96b248f..05245f4 100644 --- a/accounts_ext/models.py +++ b/accounts_ext/models.py @@ -12,9 +12,10 @@ from django.utils.timezone import now as datetime_now from registration.signals import user_activated from core.models import ( - AbstractStatusModel, ActualOnlyManager, STATUS_ACTIVE, CaseInsensitiveQuerySet, - AbstractDateTimeModel, - City) + AbstractStatusModel, ActualOnlyManager, STATUS_ACTIVE, + CaseInsensitiveQuerySet, + City +) # Create your models here. @@ -102,6 +103,10 @@ class Profile(AbstractStatusModel): address = models.TextField(_('aдрес')) city = models.ForeignKey(City, on_delete=models.SET_NULL, verbose_name=_('город'), blank=True, null=True) + @property + def points(self): + return self.user.buying_set.get_buying_total_bonus_points(self.user) + @property def is_valid(self): return self.first_name and self.last_name and self.patronymic diff --git a/templates/400.html b/templates/400.html new file mode 100644 index 0000000..1239eaf --- /dev/null +++ b/templates/400.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} + +{% block content %} +
+
+
+
+

Простите, но вам доступ запрещен на данную страницу

+
+
+
+
+{% endblock content %} diff --git a/templates/403.html b/templates/403.html new file mode 100644 index 0000000..e69de29 diff --git a/templates/bootstrap/forms/product_filter.html b/templates/bootstrap/forms/product_filter.html new file mode 100644 index 0000000..80bb216 --- /dev/null +++ b/templates/bootstrap/forms/product_filter.html @@ -0,0 +1,32 @@ +{% load static %} +{% load crispy_forms_field %} +{% load products_filters %} + +{% spaceless %} + {% if field %} + {% if not 'price' in field.auto_id %} + + {% elif 'price' in field.auto_id %} +
+ от + + до + +
+
+ + {% else %} + {{ field }} + {% endif %} + {% endif %} +{% endspaceless %} diff --git a/templates/bootstrap/forms/product_search.html b/templates/bootstrap/forms/product_search.html index 8ff9168..5572733 100644 --- a/templates/bootstrap/forms/product_search.html +++ b/templates/bootstrap/forms/product_search.html @@ -2,9 +2,13 @@ {% load crispy_forms_field %} {% spaceless %} - {% if input.name == "search" %} - - {% else %} + {% if input %} + {% if input.name == "search" %} + + {% else %} + {{ input }} + {% endif %} + {% elif field %} {{ field }} {% endif %} {% endspaceless %} diff --git a/templates/bootstrap/forms/product_sorting.html b/templates/bootstrap/forms/product_sorting.html new file mode 100644 index 0000000..e6769a6 --- /dev/null +++ b/templates/bootstrap/forms/product_sorting.html @@ -0,0 +1,21 @@ +{% load static %} +{% load crispy_forms_field %} +{% load products_filters %} + +{% spaceless %} + {% if field %} + {% if "sort" in field.html_name %} + + {% else %} + {{ field }} + {% endif %} + {% endif %} +{% endspaceless %} diff --git a/templates/bootstrap/pdf/buyings.html b/templates/bootstrap/pdf/buyings.html new file mode 100644 index 0000000..800998a --- /dev/null +++ b/templates/bootstrap/pdf/buyings.html @@ -0,0 +1,121 @@ +{% load static %} + + + + + + Document + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
{{ bank }}БИК{{ BIK }}
Банк получателяСч. №{{ bank_acc }}
{{ name }}ИНН{{ INN }}
КПП{{ KPP }}
ПолучательСч. №{{ acc }}
+

+ Счет на оплату № {{ order.id }} от {{ order.created }} +

+ + + + + + + + + +
Поставщик:{{ sup_info }}
Покупатель:{{ order.customer_name }}
+ + + + + + + + + + + + + {% for item in order.items.all %} + + + + + + + + + {% endfor %} + + + + + + + + + + + + + +
Товары(работы/услуги)Кол-воЕд.ЦенаСумма
{{ forloop.counter }}{{ item.product.name }}{{ item.number }}шт{{ item.price_per_itom }}{{ item.total_price }}
Итого:{{ order.total_price }}
Без налога (НДС)-
Всего к оплате:{{ order.total_price }}
+

Всего наименований {{ order.items.count }} на сумму {{ order.total_price }} руб.

+

{{ verb_price }} {{ verb_cur }} 00 копеек

+ + +