Monolista: correggi date SAM e soglie delle picking list

This commit is contained in:
2026-11-06 10:05:00 +01:00
parent 9d87b07648
commit 1553427c21
9 changed files with 98 additions and 13 deletions

View File

@@ -147,8 +147,8 @@ def _format_date(value: Any) -> str:
return value.strftime("%d/%m/%Y")
if isinstance(value, (int, float)):
try:
# SQL Server numeric datetime: CAST(datetime AS int), day 0 = 1900-01-01.
return (datetime(1900, 1, 1) + timedelta(days=int(value))).strftime("%d/%m/%Y")
# DATDOC is a SAM day serial; its fractional part is not a new day.
return (date(1899, 12, 30) + timedelta(days=int(value))).strftime("%d/%m/%Y")
except Exception:
return str(value)
text = str(value).strip()