From 053a1891da06b2641bdae1daabe60194942519f1 Mon Sep 17 00:00:00 2001 From: FrederikBaerentsen Date: Fri, 26 Apr 2024 17:04:10 +0200 Subject: [PATCH] Fixed an issue where part id would be different and then not count total missing parts correctly --- app.py | 2 +- templates/missing.html | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index cff8523..6336380 100644 --- a/app.py +++ b/app.py @@ -368,7 +368,7 @@ def new_set(set_num): def missing(): conn = sqlite3.connect('app.db') cursor = conn.cursor() - cursor.execute('SELECT id, part_num, color_id, element_id, part_img_url_id, SUM(quantity) AS total_quantity FROM missing GROUP BY id, part_num, color_id, element_id;') + cursor.execute('SELECT part_num, color_id, element_id, part_img_url_id, SUM(quantity) AS total_quantity FROM missing GROUP BY part_num, color_id, element_id;') results = cursor.fetchall() missing_list = [list(i) for i in results] diff --git a/templates/missing.html b/templates/missing.html index 116d619..9aeabe0 100644 --- a/templates/missing.html +++ b/templates/missing.html @@ -101,7 +101,6 @@ - id part_num color_id element_id @@ -112,15 +111,14 @@ {% for brick in missing_list %} {% if brick[4] == 'nil' %} - {{ brick[0] }} + {{ brick[3] }} {% else %} - {{ brick[0] }} + {{ brick[3] }} {% endif %} {{ brick[0] }} {{ brick[1] }} {{ brick[2] }} - {{ brick[3] }} - {{ brick[5] }} + {{ brick[4] }} {% endfor %}