feat: unify currency display to toman across the application

This commit is contained in:
hamed
2026-07-03 10:31:16 +03:30
parent 79f7df2e4d
commit 5bec4848a2
8 changed files with 116 additions and 12 deletions
+2 -1
View File
@@ -6,6 +6,7 @@ import { removeToken } from "@/utils";
import { cookies } from "next/headers";
import { redirect } from "next/navigation";
import { fetchReq } from "@/lib/req";
import { rialToToman } from "@/lib/money";
import { safeJsonParse } from "@/lib/sanitize";
import { buildPatientUser } from "@/lib/representationAdapters";
import { getServerAccessToken } from "@/lib/serverToken";
@@ -44,7 +45,7 @@ export default async function Dashboard({ searchParams }) {
const totalRials = payments
.filter((p) => p.status === "success")
.reduce((sum, p) => sum + (Number(p.amount_rials) || 0), 0);
const totalTransactions = Math.round(totalRials / 10); // ریال → تومان
const totalTransactions = rialToToman(totalRials); // ریال → تومان
const extras = {
mobile: userInfo?.mobile_number ?? "",