From 6ea9b5cf63cecedc0fa5c187777be97957a6184e Mon Sep 17 00:00:00 2001 From: Stephen Early Date: Thu, 18 Jan 2024 20:04:12 +0000 Subject: [PATCH] Add pages showing sales and payments independently of sessions --- .../tillweb/templates/tillweb/payments.html | 70 ++++++++++++ .../tillweb/templates/tillweb/tillweb.html | 2 + .../tillweb/templates/tillweb/translines.html | 108 ++++++++++++++++++ quicktill/tillweb/urls.py | 2 + quicktill/tillweb/views.py | 19 +++ 5 files changed, 201 insertions(+) create mode 100644 quicktill/tillweb/templates/tillweb/payments.html create mode 100644 quicktill/tillweb/templates/tillweb/translines.html diff --git a/quicktill/tillweb/templates/tillweb/payments.html b/quicktill/tillweb/templates/tillweb/payments.html new file mode 100644 index 0000000..b2b806b --- /dev/null +++ b/quicktill/tillweb/templates/tillweb/payments.html @@ -0,0 +1,70 @@ +{% extends "tillweb/tillweb.html" %} + +{% block title %}{{till}} — payments{% endblock %} + +{% block tillcontent %} + + + + + + + + + + + + + + + + +
IDTransactionMethodDescriptionAmountTimeSourcePending?User
+ + + +{% endblock %} diff --git a/quicktill/tillweb/templates/tillweb/tillweb.html b/quicktill/tillweb/templates/tillweb/tillweb.html index bf5e03e..62a5ab7 100644 --- a/quicktill/tillweb/templates/tillweb/tillweb.html +++ b/quicktill/tillweb/templates/tillweb/tillweb.html @@ -135,6 +135,8 @@ diff --git a/quicktill/tillweb/templates/tillweb/translines.html b/quicktill/tillweb/templates/tillweb/translines.html new file mode 100644 index 0000000..d4821dc --- /dev/null +++ b/quicktill/tillweb/templates/tillweb/translines.html @@ -0,0 +1,108 @@ +{% extends "tillweb/tillweb.html" %} + +{% block title %}{{till}} — sales{% endblock %} + +{% block tillcontent %} + +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + +
IDTransactionDescriptionDepartmentItemsPriceDiscountDiscount typeTotalTimeSourceUser
+ + + +{% endblock %} diff --git a/quicktill/tillweb/urls.py b/quicktill/tillweb/urls.py index 22309e0..b204843 100644 --- a/quicktill/tillweb/urls.py +++ b/quicktill/tillweb/urls.py @@ -21,9 +21,11 @@ path('transaction//', views.transaction, name="tillweb-transaction"), + path('transline/', views.translines, name="tillweb-translines"), path('transline//', views.transline, name="tillweb-transline"), + path('payment/', views.payments, name="tillweb-payments"), path('payment//', views.payment, name="tillweb-payment"), diff --git a/quicktill/tillweb/views.py b/quicktill/tillweb/views.py index dc8ed2a..4072705 100644 --- a/quicktill/tillweb/views.py +++ b/quicktill/tillweb/views.py @@ -743,6 +743,17 @@ def transaction(request, info, transid): }) +@tillweb_view +def translines(request, info): + departments = td.s.query(Department).order_by(Department.id).all() + + return ('translines.html', { + 'departments': departments, + 'nav': [("Sales", + info.reverse('tillweb-translines'))], + }) + + @tillweb_view def transline(request, info, translineid): tl = td.s.query(Transline)\ @@ -755,6 +766,14 @@ def transline(request, info, translineid): return ('transline.html', {'tl': tl, 'tillobject': tl}) +@tillweb_view +def payments(request, info): + return ('payments.html', { + 'nav': [("Payments", + info.reverse('tillweb-payments'))], + }) + + @tillweb_view def payment(request, info, paymentid): payment = td.s.query(Payment)\