diff --git a/app.py b/app.py index 581ba32..ea24953 100644 --- a/app.py +++ b/app.py @@ -58,7 +58,7 @@ def save_number(tmp): elif number == '0': for idx,i in enumerate(json_file['unit'][int(index)]['bricks']['missing']): if i['brick']['ID'] == part_num and i['brick']['is_spare'] == is_spare and i['brick']['color_name'] == color: - json_file['unit'][int(index)]['bricks']['missing'].pop(0) + json_file['unit'][int(index)]['bricks']['missing'].pop(idx) else: found = False diff --git a/templates/bootstrap_table.html b/templates/bootstrap_table.html index 4bce6d6..b190785 100644 --- a/templates/bootstrap_table.html +++ b/templates/bootstrap_table.html @@ -67,17 +67,17 @@
| img | -element_id | -part_num | -name | -color | -qty | ++ + + | Color | +Qty | {% for i in json_file['unit'] %} -Missing ({{ loop.index }}) | +Missing ({{ loop.index }}) | {% endfor %}||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
- {% else %}
- ![]() |
- {% endif %}
- {{ brick.element_id }} | -{{ brick.part.part_num }} | -{{ brick.part.name }} | + {% if brick.element_id == None %} +![]() |
+ {% else %}
+ ![]() |
+ {% endif %}
+ {{ brick.part.part_num }} | +{{ brick.part.name }} | {{ brick.color.name }} | -{{ brick.quantity }} | - {% for i in json_file['unit'] %} +{{ brick.quantity }} | + {% for i in json_file['unit'] %} -- {% set ns = namespace(count='') %} - |