diff --git a/src/components/MoneyInput.vue b/src/components/MoneyInput.vue index 03c2b8b..c7dbcf7 100644 --- a/src/components/MoneyInput.vue +++ b/src/components/MoneyInput.vue @@ -1,7 +1,16 @@ diff --git a/src/pages/PluginTenantPage.vue b/src/pages/PluginTenantPage.vue index a913232..29853a4 100644 --- a/src/pages/PluginTenantPage.vue +++ b/src/pages/PluginTenantPage.vue @@ -351,8 +351,8 @@ onMounted(loadDetail) - - + + @@ -397,8 +397,8 @@ onMounted(loadDetail) - - + + @@ -466,8 +466,8 @@ onMounted(loadDetail) - - + + diff --git a/src/pages/ServerTenantPage.vue b/src/pages/ServerTenantPage.vue index c55f64a..f7afd50 100644 --- a/src/pages/ServerTenantPage.vue +++ b/src/pages/ServerTenantPage.vue @@ -377,8 +377,8 @@ onMounted(loadDetail) - - + + @@ -426,8 +426,8 @@ onMounted(loadDetail) - - + + diff --git a/src/pages/SmsPanelPage.vue b/src/pages/SmsPanelPage.vue index 20d0afd..80637fc 100644 --- a/src/pages/SmsPanelPage.vue +++ b/src/pages/SmsPanelPage.vue @@ -122,7 +122,7 @@ onMounted(loadTenants) :class="{ active: toneFilter === 'healthy' }" @click="toggleToneFilter('healthy')" > - بالای ۱۰۰٬۰۰۰ — سبز + بالای ۱۰٬۰۰۰ — سبز diff --git a/src/pages/SmsTenantPage.vue b/src/pages/SmsTenantPage.vue index f760ab6..0ef455f 100644 --- a/src/pages/SmsTenantPage.vue +++ b/src/pages/SmsTenantPage.vue @@ -422,11 +422,11 @@ onMounted(async () => { موجودی کیف پول ارسال مسدود - {{ formatNumber(summary.balanceRials) }} ریال + {{ formatMoney(summary.balanceRials) }}
قیمت هر پارت - {{ formatNumber(summary.perPartRials) }} ریال + {{ formatMoney(summary.perPartRials) }}
امروز @@ -458,7 +458,7 @@ onMounted(async () => { diff --git a/src/pages/SupportTenantPage.vue b/src/pages/SupportTenantPage.vue index 1209874..df90a10 100644 --- a/src/pages/SupportTenantPage.vue +++ b/src/pages/SupportTenantPage.vue @@ -396,8 +396,8 @@ onMounted(loadDetail) - - + +

دوره رایگان فعال است — مبلغ صفر می‌شود. مدت ۱ / ۳ / ۶ / ۱۲ ماه می‌تواند رایگان باشد. @@ -448,8 +448,8 @@ onMounted(loadDetail) - - + +

دوره رایگان — مبلغ صفر. مدت ۱ / ۳ / ۶ / ۱۲ ماه می‌تواند رایگان باشد. @@ -523,8 +523,8 @@ onMounted(loadDetail) - - + +

دوره رایگان — مبلغ صفر. مدت ۱ / ۳ / ۶ / ۱۲ ماه می‌تواند رایگان باشد. diff --git a/src/utils/money.ts b/src/utils/money.ts index 006cdb3..f62b6da 100644 --- a/src/utils/money.ts +++ b/src/utils/money.ts @@ -1,4 +1,21 @@ -/** Display/parse helpers for rial money inputs with thousand separators. */ +/** + * SuperAdmin money helpers. + * + * Storage / product remote APIs use integer **rials**. + * SuperAdmin UI displays and accepts **tomans** (rial ÷ 10). + */ + +/** Convert stored rial amount to toman for display/input. */ +export function rialToToman(value: number | null | undefined) { + if (value == null || Number.isNaN(Number(value))) return 0 + return Math.trunc(Number(value) / 10) +} + +/** Convert UI toman amount to stored rial. */ +export function tomanToRial(value: number | null | undefined) { + if (value == null || Number.isNaN(Number(value))) return 0 + return Math.trunc(Number(value)) * 10 +} export function toGroupedDisplay(value: number | null | undefined) { if (value == null || Number.isNaN(Number(value))) return '' @@ -23,7 +40,8 @@ export function formatNumber(value: number | null | undefined) { return new Intl.NumberFormat('fa-IR').format(value) } +/** Format a **rial** storage value as toman for SuperAdmin UI. */ export function formatMoney(value: number | null | undefined) { if (value == null) return '—' - return `${formatNumber(value)} ریال` + return `${formatNumber(rialToToman(value))} تومان` }