Alpha4 polish griglie e login
This commit is contained in:
@@ -22,6 +22,7 @@ from gestione_scarico import move_pallet_async
|
||||
from locale_text import load_locale_catalog, text as loc_text
|
||||
from tooltips import WidgetToolTip, load_tooltip_catalog, tooltip_text
|
||||
from ui_theme import theme_color, theme_font, theme_section, theme_value
|
||||
from ui_tables import merge_tags, style_treeview, zebra_tag
|
||||
from version_info import module_version, versioned_title
|
||||
from window_placement import place_window_fullsize_below_parent_later
|
||||
|
||||
@@ -510,6 +511,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
self.tree.column("col2", width=250, anchor="w")
|
||||
self.tree.column("col3", width=120, anchor="w")
|
||||
self.tree.column("col4", width=260, anchor="w")
|
||||
style_treeview(self.tree, style_name="MultiUDC.Treeview", rowheight=24)
|
||||
y = ttk.Scrollbar(frame, orient="vertical", command=self.tree.yview)
|
||||
x = ttk.Scrollbar(frame, orient="horizontal", command=self.tree.xview)
|
||||
self.tree.configure(yscrollcommand=y.set, xscrollcommand=x.set)
|
||||
@@ -545,6 +547,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
):
|
||||
self.sum_tbl.heading(key, text=title)
|
||||
self.sum_tbl.column(key, width=width, anchor=anchor)
|
||||
style_treeview(self.sum_tbl, style_name="MultiUDCSummary.Treeview", rowheight=24)
|
||||
y2 = ttk.Scrollbar(inner, orient="vertical", command=self.sum_tbl.yview)
|
||||
x2 = ttk.Scrollbar(inner, orient="horizontal", command=self.sum_tbl.xview)
|
||||
self.sum_tbl.configure(yscrollcommand=y2.set, xscrollcommand=x2.set)
|
||||
@@ -663,7 +666,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
"""Populate root tree nodes after the aisle query completes."""
|
||||
rows = _json_obj(res).get("rows", [])
|
||||
_log_dataset("multi_udc_corsie", rows)
|
||||
for row in rows:
|
||||
for index, row in enumerate(rows):
|
||||
corsia = row.get("Corsia")
|
||||
if not corsia:
|
||||
continue
|
||||
@@ -675,7 +678,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
text=self._format_corsia_text(corsia),
|
||||
values=("", "", ""),
|
||||
open=False,
|
||||
tags=("corsia",),
|
||||
tags=merge_tags(zebra_tag(index), "corsia"),
|
||||
)
|
||||
self.tree.insert(node_id, "end", iid=f"{node_id}::lazy", text="...", values=("", "", ""))
|
||||
|
||||
@@ -727,7 +730,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
if not rows:
|
||||
self.tree.insert(parent_iid, "end", text="(nessuna cella con >1 UDC)", values=("", "", ""))
|
||||
return
|
||||
for row in rows:
|
||||
for index, row in enumerate(rows):
|
||||
idc = row["IDCella"]
|
||||
ubi = row["Ubicazione"]
|
||||
corsia = row.get("Corsia")
|
||||
@@ -744,7 +747,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
text=label,
|
||||
values=(f"IDCella {idc}", "", ""),
|
||||
open=False,
|
||||
tags=("cella", f"corsia:{corsia}"),
|
||||
tags=merge_tags(zebra_tag(index), "cella", f"corsia:{corsia}"),
|
||||
)
|
||||
if not any(child.endswith("::lazy") for child in self.tree.get_children(node_id)):
|
||||
self.tree.insert(node_id, "end", iid=f"{node_id}::lazy", text="...", values=("", "", ""))
|
||||
@@ -784,7 +787,7 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
idcella_txt = self.tree.item(parent_iid, "values")[0]
|
||||
idcella_num = int(idcella_txt.split()[-1]) if idcella_txt else None
|
||||
|
||||
for row in rows:
|
||||
for index, row in enumerate(rows):
|
||||
pallet = row.get("Pallet", "")
|
||||
desc = row.get("Descrizione", "")
|
||||
lotto = row.get("Lotto", "")
|
||||
@@ -816,7 +819,13 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
iid=leaf_id,
|
||||
text=self._format_pallet_text(str(pallet), leaf_id in self.selected_udc_keys),
|
||||
values=(desc, lotto, causale),
|
||||
tags=("pallet", f"corsia:{corsia_val}", f"ubicazione:{cella_ubi}", f"idcella:{idcella_num}"),
|
||||
tags=merge_tags(
|
||||
zebra_tag(index),
|
||||
"pallet",
|
||||
f"corsia:{corsia_val}",
|
||||
f"ubicazione:{cella_ubi}",
|
||||
f"idcella:{idcella_num}",
|
||||
),
|
||||
)
|
||||
|
||||
@_log_call()
|
||||
@@ -990,11 +999,12 @@ class CelleMultipleWindow(ctk.CTkToplevel):
|
||||
_log_dataset("multi_udc_riepilogo", rows)
|
||||
for item in self.sum_tbl.get_children():
|
||||
self.sum_tbl.delete(item)
|
||||
for row in rows:
|
||||
for index, row in enumerate(rows):
|
||||
self.sum_tbl.insert(
|
||||
"",
|
||||
"end",
|
||||
values=(row.get("Corsia"), row.get("TotCelle", 0), row.get("CelleMultiple", 0), f"{row.get('Percentuale', 0):.2f}"),
|
||||
tags=(zebra_tag(index),),
|
||||
)
|
||||
|
||||
def expand_all(self):
|
||||
|
||||
Reference in New Issue
Block a user