From 54b999ae2ada5f252f2558cf0b48af08b4c830ca Mon Sep 17 00:00:00 2001 From: Stephen Early Date: Tue, 16 Jan 2024 15:45:22 +0000 Subject: [PATCH] Use datatable for deliveries on supplier detail page --- .../templates/tillweb/deliverylist.html | 33 ------------- .../tillweb/templates/tillweb/supplier.html | 48 ++++++++++++++++--- quicktill/tillweb/views.py | 3 -- 3 files changed, 41 insertions(+), 43 deletions(-) delete mode 100644 quicktill/tillweb/templates/tillweb/deliverylist.html diff --git a/quicktill/tillweb/templates/tillweb/deliverylist.html b/quicktill/tillweb/templates/tillweb/deliverylist.html deleted file mode 100644 index 46b99e0a..00000000 --- a/quicktill/tillweb/templates/tillweb/deliverylist.html +++ /dev/null @@ -1,33 +0,0 @@ -{% if pager.items %} -
- - - - - -{% if exclude_column != "supplier" %}{% endif %} - - - - - -{% for d in pager.items %} - - - -{% if exclude_column != "supplier" %} - -{% endif %} - - -{% endfor %} - -
IDDateSupplierDocumentConfirmed?
{{d.id}}{{d.date}}{{d.supplier.name}}{{d.docnumber}}{{d.checked|yesno:"Yes,No"}}
- -
-{{pager.as_html}} -{% endif %} diff --git a/quicktill/tillweb/templates/tillweb/supplier.html b/quicktill/tillweb/templates/tillweb/supplier.html index dafdb364..f859ffbb 100644 --- a/quicktill/tillweb/templates/tillweb/supplier.html +++ b/quicktill/tillweb/templates/tillweb/supplier.html @@ -28,13 +28,47 @@

Deliveries

-{% with exclude_column="supplier" %} -{% if pager.items %} -{% include "tillweb/deliverylist.html" %} -{% else %} -

There have not been any deliveries from this supplier.

-{% endif %} -{% endwith %} + + + + + + + + + + +
IDDateDocumentConfirmed?
+ + {% if supplier.logs %}

Log entries

diff --git a/quicktill/tillweb/views.py b/quicktill/tillweb/views.py index ba6ba1f3..f2ac69ff 100644 --- a/quicktill/tillweb/views.py +++ b/quicktill/tillweb/views.py @@ -1018,7 +1018,6 @@ def supplier(request, info, supplierid): raise Http404 deliveries = td.s.query(Delivery)\ - .order_by(desc(Delivery.id))\ .filter(Delivery.supplier == s) form = None @@ -1060,12 +1059,10 @@ def supplier(request, info, supplierid): else: form = SupplierForm(initial=initial) - pager = Pager(request, deliveries) return ('supplier.html', { 'tillobject': s, 'supplier': s, 'form': form, - 'pager': pager, 'can_delete': can_delete, })