Improve label print calibration and polish Lithium Label UI.

Align print/calibrate fields to the reference PDF (including bottom-row offset), fix partial box weights and page padding, and rename branding to Lithium Label Manager with Vazirmatn for Persian.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-01 21:38:28 +03:30
parent cbb1030641
commit 69ddfe4b60
15 changed files with 161 additions and 126 deletions

View File

@@ -1,6 +1,6 @@
import math
from django.shortcuts import render, redirect, get_object_or_404
from .models import Product, Order
from .print_layout import build_print_pages
def index(request):
@@ -27,31 +27,7 @@ def print_queue(request):
def print_page(request, order_id):
order = get_object_or_404(Order.objects.select_related('product'), id=order_id)
pages = []
# 1. Canister Labels
remaining_canisters = order.canister_count
for _ in range(order.canister_pages):
slips_on_page = min(4, remaining_canisters)
pages.append({
'type': 'Canister',
'weight': order.canister_weight,
'slips': range(slips_on_page),
})
remaining_canisters -= slips_on_page
# 2. Box Labels
remaining_boxes = order.box_count
box_weight = order.canister_weight * order.canisters_per_box
for _ in range(order.box_pages):
slips_on_page = min(4, remaining_boxes)
pages.append({
'type': 'Box',
'weight': box_weight,
'slips': range(slips_on_page),
})
remaining_boxes -= slips_on_page
pages = build_print_pages(order)
return render(request, 'slips/print_page.html', {
'order': order,