diff --git a/apps/web/src/components/person-assets/PersonAssetsPanel.vue b/apps/web/src/components/person-assets/PersonAssetsPanel.vue index 16a6638..7784986 100644 --- a/apps/web/src/components/person-assets/PersonAssetsPanel.vue +++ b/apps/web/src/components/person-assets/PersonAssetsPanel.vue @@ -131,6 +131,14 @@ function formatMandehAmount(amount: string | number, unit: string) { return abs.toLocaleString('fa-IR', { maximumFractionDigits: 3 }); } +/** ته‌حساب گاهی رشتهٔ "null" می‌فرستد؛ ?? کافی نیست */ +function dash(v: unknown, fallback = '—'): string { + if (v == null) return fallback; + const s = String(v).trim(); + if (!s || s === 'null' || s === 'undefined' || s === 'NaN') return fallback; + return s; +} + /** تبدیل تاریخ محلی میلادی به شمسی YYYY-MM-DD برای API ته‌حساب */ function toShamsiYmd(localIso: string): string | null { const d = parseLocalInput(localIso); @@ -558,24 +566,24 @@ onMounted(async () => { class="sanad-card card" >
- شماره سند: {{ item.Sh_Factor ?? item.Sh_factor ?? '—' }} - تاریخ: {{ item.Tarikh ?? '—' }} + شماره سند: {{ dash(item.Sh_Factor ?? item.Sh_factor) }} + تاریخ: {{ dash(item.Tarikh) }}
نوع - {{ item.NO ?? '—' }} + {{ dash(item.NO) }}
وزن / عیار - {{ item.Vazn ?? '—' }} / {{ item.Ayar ?? '—' }} + {{ dash(item.Vazn) }} / {{ dash(item.Ayar) }}
مالی - {{ item.Mali ?? '—' }} + {{ dash(item.Mali) }}
شرح - {{ item.Sharh1 ?? item.Sharh ?? '—' }} + {{ dash(item.Sharh1 ?? item.Sharh) }}