Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • AlekSIS/onboarding/AlekSIS-App-Tezor
  • sunweaver/AlekSIS-App-Tezor
  • 3lisvequii/AlekSIS-App-Tezor
3 results
Show changes
Commits on Source (4)
from django.utils.translation import gettext_lazy as _
MENUS = {
"NAV_MENU_CORE": [
{
"name": _("Tezor"),
"url": "empty",
"root": True,
"validators": [
"menu_generator.validators.is_authenticated",
"aleksis.core.util.core_helpers.has_person",
],
"submenu": [],
}
]
}
from django.utils.translation import gettext_lazy as _
import django_tables2 as tables
class PurchasedItemsTable(tables.Table):
sku = tables.Column()
name = tables.Column()
tax_rate = tables.Column()
quantity = tables.Column()
price = tables.Column()
currency = tables.Column()
sku = tables.Column(verbose_name=_("Art. No."))
name = tables.Column(verbose_name=_("Item"), attrs={"td": {"class": "hero-col"}})
tax_rate = tables.TemplateColumn(
verbose_name=_("Tax Rate"),
template_code="{{value}} %",
attrs={"td": {"class": "right-align"}},
)
quantity = tables.Column(verbose_name=_("Qty."), attrs={"td": {"class": "right-align"}})
price = tables.TemplateColumn(
verbose_name=_("Gross"),
template_code="{{value|floatformat:2}} {{record.currency}}",
attrs={"td": {"class": "right-align"}},
)
class Meta:
orderable = False
class TotalsTable(tables.Table):
name = tables.Column()
value = tables.Column()
currency = tables.Column()
name = tables.Column(attrs={"td": {"class": "right-align hero-col"}})
value = tables.TemplateColumn(
template_code="{{value|floatformat:2}} {{record.currency}}",
attrs={"td": {"class": "right-align"}},
)
class Meta:
show_header = False
orderable = False
......@@ -3,6 +3,6 @@ from django.urls import include, path
from . import views
urlpatterns = [
path("empty", views.empty, name="empty"),
path("payments/", include("payments.urls")),
path("invoice/<int:pk>/print", views.GetInvoicePDF.as_view(), name="get_invoice_by_pk")
]
from django.contrib.auth.decorators import login_required
from django.http import HttpRequest, HttpResponse
from django.views.generic import View
from django.shortcuts import render
from rules.contrib.views import PermissionRequiredMixin
@login_required
def empty(request: HttpRequest) -> HttpResponse:
context = {}
from aleksis.core.views import RenderPDFView
return render(request, "tezor/empty.html", context)
from .models.invoice import Invoice
class GetInvoicePDF(PermissionRequiredMixin, RenderPDFView):
permission_required = "tezor.can_print_invoice"
def get_context_data(self, *args, **kwargs):
context = super().get_context_data(*args, **kwargs)
invoice = Invoice.objects.get(id=self.kwargs["pk"])
self.template_name = invoice.group.template_name
context["invoice"] = invoice
print(invoice.group.__dict__)
return context
......@@ -32,7 +32,6 @@ secondary = true
python = "^3.9"
aleksis-core = "^2.7"
django-payments = "^0.15.0"
pycountry = "22.1.10"
[tool.poetry.dev-dependencies]
aleksis-builddeps = "*"
......