Spaces:
Sleeping
Sleeping
Download frontend/src/lib/lumberDisplay.js from Caner7/Muhasebe: direct link, hf CLI and curl.
- Browser
- Download file 699 Bytes
-
https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/lib/lumberDisplay.js
- Command line
-
hf download hf://spaces/Caner7/Muhasebe/frontend/src/lib/lumberDisplay.js
-
curl -L -o lumberDisplay.js https://huggingface.co/spaces/Caner7/Muhasebe/resolve/main/frontend/src/lib/lumberDisplay.js
699 Bytes
| /** Kereste tür etiketleri ve tablo satırları (GET /api/lumber/rules yanıtı). */ | |
| export function lumberKindLabelFromRules(rules, key) { | |
| if (!rules || !rules.kinds) return key || ""; | |
| const row = rules.kinds.find((x) => x.key === key); | |
| return row ? row.label : key; | |
| } | |
| export function formatLumberQuantityDisplay(kind, qty) { | |
| const q = Number(qty); | |
| if (!Number.isFinite(q)) return "-"; | |
| if (kind === "serit") return String(Math.round(q)); | |
| return String(q); | |
| } | |
| export function getLumberKindTiers(rules, kind) { | |
| if (!rules || !Array.isArray(rules.kinds)) return []; | |
| const row = rules.kinds.find((x) => x.key === kind); | |
| return row && Array.isArray(row.tiers) ? row.tiers : []; | |
| } | |