Fix missing 'missing' and 'quantity' badges for minifigure in a part card

This commit is contained in:
Gregoo 2025-01-17 16:28:43 +01:00
parent 00310e0235
commit 7999572cf1
3 changed files with 25 additions and 1 deletions

View File

@ -1,5 +1,15 @@
{% extends 'minifigure/base/select.sql' %}
{% block total_missing %}
SUM(IFNULL(missing.quantity, 0)) AS total_missing,
{% endblock %}
{% block join %}
LEFT JOIN missing
ON minifigures.fig_num IS NOT DISTINCT FROM missing.set_num
AND minifigures.u_id IS NOT DISTINCT FROM missing.u_id
{% endblock %}
{% block where %}
WHERE minifigures.fig_num IN (
SELECT
@ -13,3 +23,8 @@ WHERE minifigures.fig_num IN (
GROUP BY missing.set_num
)
{% endblock %}
{% block group %}
GROUP BY
minifigures.fig_num
{% endblock %}

View File

@ -1,5 +1,9 @@
{% extends 'minifigure/base/select.sql' %}
{% block total_quantity %}
SUM(minifigures.quantity) AS total_quantity,
{% endblock %}
{% block where %}
WHERE minifigures.fig_num IN (
SELECT
@ -13,3 +17,8 @@ WHERE minifigures.fig_num IN (
GROUP BY inventory.set_num
)
{% endblock %}
{% block group %}
GROUP BY
minifigures.fig_num
{% endblock %}

View File

@ -10,8 +10,8 @@
{{ badge.set(item.fields.set_num, solo=solo, last=last, id=item.fields.u_id) }}
{{ badge.quantity(item.fields.quantity, solo=solo, last=last) }}
{% endif %}
{{ badge.quantity(item.fields.total_quantity, solo=solo, last=last) }}
{{ badge.total_sets(using | length, solo=solo, last=last) }}
{{ badge.total_quantity(item.fields.total_quantity, solo=solo, last=last) }}
{{ badge.total_missing(item.fields.total_missing, solo=solo, last=last) }}
{% if not last %}
{{ badge.rebrickable(item, solo=solo, last=last) }}