Add order count edit, remove, and undo-done
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -114,16 +114,36 @@
|
||||
</thead>
|
||||
<tbody id="orders-body">
|
||||
{% for o in orders %}
|
||||
<tr>
|
||||
<tr id="order-row-{{ o.id }}">
|
||||
<td class="mono">{{ o.id }}</td>
|
||||
<td>{{ o.product.code }}</td>
|
||||
<td class="mono">{{ o.batch_number }}</td>
|
||||
<td>{{ o.canister_count }}</td>
|
||||
<td>{{ o.box_count }}</td>
|
||||
<td>
|
||||
{% if o.status == 'pending' %}
|
||||
<div class="count-stepper">
|
||||
<button type="button" class="stepper-btn" onclick="adjustCount({{ o.id }}, 'canister_count', -1)" aria-label="-">−</button>
|
||||
<span id="cc-{{ o.id }}">{{ o.canister_count }}</span>
|
||||
<button type="button" class="stepper-btn" onclick="adjustCount({{ o.id }}, 'canister_count', 1)" aria-label="+">+</button>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ o.canister_count }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if o.status == 'pending' %}
|
||||
<div class="count-stepper">
|
||||
<button type="button" class="stepper-btn" onclick="adjustCount({{ o.id }}, 'box_count', -1)" aria-label="-">−</button>
|
||||
<span id="bc-{{ o.id }}">{{ o.box_count }}</span>
|
||||
<button type="button" class="stepper-btn" onclick="adjustCount({{ o.id }}, 'box_count', 1)" aria-label="+">+</button>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ o.box_count }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td><span class="badge badge-{{ o.status }}">{{ o.get_status_display }}</span></td>
|
||||
<td>
|
||||
{% if o.status == 'pending' %}
|
||||
<button class="btn btn-ghost btn-sm btn-danger" onclick="deleteOrder({{ o.id }})" data-i18n="cancel">Cancel</button>
|
||||
<button class="btn btn-ghost btn-sm btn-danger" onclick="deleteOrder({{ o.id }})" data-i18n="remove">Remove</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -34,17 +34,12 @@
|
||||
<span class="label" data-i18n="date">Date:</span>
|
||||
<span class="value">{{ o.production_date|date:"d/m/Y" }}</span>
|
||||
</div>
|
||||
<div class="detail-col">
|
||||
<span class="label" data-i18n="total_weight">Total:</span>
|
||||
<span class="value">{{ o.total_weight }} kg</span>
|
||||
</div>
|
||||
<div class="detail-col">
|
||||
<span class="label" data-i18n="next_control">Next:</span>
|
||||
<span class="value">{{ o.next_control_date|date:"d/m/Y" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="print-meta">
|
||||
<span class="badge badge-neutral">{{ o.canister_count }} <span data-i18n="canisters_unit">Canisters</span> | {{ o.box_count }} <span data-i18n="boxes_unit">Boxes</span></span>
|
||||
<span class="badge badge-accent">{{ o.canister_pages|add:o.box_pages }} <span data-i18n="pages_unit">Page(s)</span></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -81,6 +76,7 @@
|
||||
<th data-i18n="batch_number">Batch</th>
|
||||
<th data-i18n="total_pages">Pages</th>
|
||||
<th data-i18n="printed_at">Printed At</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="history-body">
|
||||
@@ -91,9 +87,12 @@
|
||||
<td class="mono">{{ o.batch_number }}</td>
|
||||
<td>{{ o.canister_pages|add:o.box_pages }}</td>
|
||||
<td>{{ o.printed_at|date:"d/m/Y H:i" }}</td>
|
||||
<td>
|
||||
<button class="btn btn-ghost btn-sm" onclick="undoDone({{ o.id }})" data-i18n="undo_done">Undo</button>
|
||||
</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="5" class="empty-state" data-i18n="no_history">No print history</td></tr>
|
||||
<tr><td colspan="6" class="empty-state" data-i18n="no_history">No print history</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user