diff --git a/alkator/urls.py b/alkator/urls.py index 75509a9..4f1c9ea 100644 --- a/alkator/urls.py +++ b/alkator/urls.py @@ -16,7 +16,7 @@ Including another URLconf """ from django.contrib import admin from django.urls import path -from alkatorapi.views import register, results, photos, payment_result, payment_state +from alkatorapi.views import register, results, photos, payment_result, payment_state, invoice urlpatterns = [ path('admin/', admin.site.urls), @@ -25,4 +25,5 @@ urlpatterns = [ path('api/photos', photos), path('api/payment_result', payment_result), path('api/payment_state', payment_state), + path('api/invoice', invoice), ] diff --git a/alkatorapi/templates/invoice.html b/alkatorapi/templates/invoice.html new file mode 100644 index 0000000..af2118b --- /dev/null +++ b/alkatorapi/templates/invoice.html @@ -0,0 +1,556 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Číslo faktury{{user.invoice_id}}
DodavatelOdběratel
JménoZhoor s.r.o.Jméno{{user.first_name}} {{user.last_name}}
AdresaAdam KrejsaAdresa{{user.address}}
Červenovodská 548
561 69, KrálíkyEmail:           {{user.email}}
Neplátce DPH
21244863
DIČXDIČ
BankaKomerční Banka - KB
Bankovní účet131-2219860207/0100Datum vystavení{{user.register_date|date:"d/m/Y"}}
Variabilní symbolČíslo fakturyDatum splatnosti{{user.register_date|date:"d/m/Y"}}
Způsob platbyPlatební bránouDatum zdan. plnění{{user.register_date|date:"d/m/Y"}}
Fakturovaná položkaMJCena za MJCena
Startovné do závodu - ALKATOR1690,00 Kč690,00 Kč
Celkem690,00 Kč
V obchodním rejstříku je zapsána pod spisovou značkou C 52475, Krajský soud v Hradci Králové.
\ No newline at end of file diff --git a/alkatorapi/views.py b/alkatorapi/views.py index 1ccaf82..72fc9ff 100644 --- a/alkatorapi/views.py +++ b/alkatorapi/views.py @@ -1,5 +1,6 @@ from django.shortcuts import render from django.http import HttpResponse +from django.template.response import TemplateResponse from django.views.decorators.csrf import csrf_exempt from datetime import date, datetime from urllib.parse import parse_qs @@ -85,7 +86,7 @@ def register(request): if result['code'][0] != '0': user.delete() - return HttpResponse('{"reason":"Chyba na straně platevní brány: ' + result['message'][0] + '"}', status=400, content_type='application/json') + return HttpResponse('{"reason":"Chyba na straně platební brány: ' + result['message'][0] + '"}', status=400, content_type='application/json') user.trans_id = result['transId'][0] user.save() @@ -149,4 +150,8 @@ def photos(request): 'original_width': img.width, 'original_height': img.height, }) - return HttpResponse(json.dumps(rtn), content_type='application/json') \ No newline at end of file + return HttpResponse(json.dumps(rtn), content_type='application/json') + + +def invoice(request): + return TemplateResponse(request, 'invoice.html', {'user': User.objects.get(invoice_id=request.GET['invoice_id'])})