feat(oa): format money fields in print and related-approval summary
Show formatted amount with optional uppercase on print; summary uses numeric text. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
8e98ffe950
commit
b5c4ba4c4f
2 files changed
+34
No files matched your search
@@ -116,6 +116,17 @@ def _format_value(typ: str, raw: Any) -> Tuple[str, bool]:
|
||||
if isinstance(raw, dict):
|
||||
return str(raw.get("name") or "").strip(), False
|
||||
return "", False
|
||||
if typ == "money":
|
||||
if raw is None or raw == "":
|
||||
return "", False
|
||||
try:
|
||||
if isinstance(raw, bool):
|
||||
return "", False
|
||||
v = float(str(raw).replace(",", "").strip())
|
||||
except (TypeError, ValueError):
|
||||
return str(raw), False
|
||||
text = f"{v:,.2f}"
|
||||
return text, False
|
||||
if isinstance(raw, list):
|
||||
text = "、".join(str(x) for x in raw if x is not None and str(x) != "")
|
||||
elif isinstance(raw, dict):
|
||||
|
||||
Reference in new issue
Block a user