feat: unify currency display to toman across the application
This commit is contained in:
@@ -4,6 +4,7 @@ import ArrowLeftB from "@/components/icons/ArrowLeftB";
|
||||
import { Button, MenuItem, Select, FormControl, InputLabel } from "@mui/material";
|
||||
import ButtonFixed from "./ButtonFixed";
|
||||
import { request } from "@/services/response";
|
||||
import { formatToman } from "@/lib/money";
|
||||
|
||||
const PAYMENT_TTL = 900;
|
||||
|
||||
@@ -44,7 +45,7 @@ function Paying({ setStep, appointmentId, expiresAt, doctor, data, isForAnother,
|
||||
return `${m}:${s.toString().padStart(2, "0")}`;
|
||||
};
|
||||
|
||||
const rials = feeRials != null ? feeRials.toLocaleString("fa-IR") : "—";
|
||||
const toman = feeRials != null ? formatToman(feeRials) : "—";
|
||||
const patientName = isForAnother
|
||||
? [data?.name?.value, data?.family?.value].filter(Boolean).join(" ").trim()
|
||||
: data?.name?.value;
|
||||
@@ -105,7 +106,7 @@ function Paying({ setStep, appointmentId, expiresAt, doctor, data, isForAnother,
|
||||
مبلغ قابل پرداخت
|
||||
</span>
|
||||
<span className="text-[#3B3B3B] text-[18px] md:text-[20px] font-bold">
|
||||
{rials} <span className="text-[14px] font-normal text-[#616161]">ریال</span>
|
||||
{toman} <span className="text-[14px] font-normal text-[#616161]">تومان</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -203,7 +204,7 @@ function Paying({ setStep, appointmentId, expiresAt, doctor, data, isForAnother,
|
||||
}
|
||||
>
|
||||
<span className={`text-[#FFF] text-[16px] font-medium ${loading ? "opacity-0" : ""}`}>
|
||||
{testMode ? "پرداخت آزمایشی" : `پرداخت ${rials} ریال`}
|
||||
{testMode ? "پرداخت آزمایشی" : `پرداخت ${toman} تومان`}
|
||||
</span>
|
||||
{!loading && <ArrowLeftB />}
|
||||
</Button>
|
||||
|
||||
@@ -48,7 +48,7 @@ function Head({ user }) {
|
||||
<div className="flex flex-col gap-[8px] items-start justify-start">
|
||||
<p className="text-[#3B3B3B] text-nowrap text-[16px] font-medium">
|
||||
{Number(user?.total_transactions || 0).toLocaleString("fa-IR")}{" "}
|
||||
<span className="text-[12px]">ریال</span>
|
||||
<span className="text-[12px]">تومان</span>
|
||||
</p>
|
||||
<h1 className="text-[#616161] text-nowrap text-[14px] font-normal">
|
||||
مجموع تراکنش ها
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import TextLoading from "@/app/component/loading/Text";
|
||||
import { convertTimestampToJalali } from "@/helper";
|
||||
import { formatToman } from "@/lib/money";
|
||||
import Link from "next/link";
|
||||
|
||||
const PAYMENT_STATUS = {
|
||||
@@ -62,7 +63,7 @@ function Card({ data, loading }) {
|
||||
</TextLoading>
|
||||
<TextLoading loading={loading} width={80} height={18}>
|
||||
<p className="text-[#616161] text-[14px] font-medium">
|
||||
{data.amount_rials ? Number(data.amount_rials).toLocaleString("fa-IR") : "--"} ریال
|
||||
{data.amount_rials ? formatToman(data.amount_rials) : "--"} تومان
|
||||
</p>
|
||||
</TextLoading>
|
||||
</li>
|
||||
|
||||
@@ -6,6 +6,7 @@ import TextLoading from "@/app/component/loading/Text";
|
||||
import CustomLoading from "@/app/component/loading/Custom";
|
||||
import CircularLoading from "@/app/component/loading/Circular";
|
||||
import { convertTimestampToJalali } from "@/helper";
|
||||
import { formatToman } from "@/lib/money";
|
||||
import Pagination from "@/app/component/Pagination";
|
||||
import Link from "next/link";
|
||||
|
||||
@@ -25,7 +26,7 @@ const TYPE_LABELS = {
|
||||
|
||||
function List({ payments, loading, page, totalPages, onPageChange }) {
|
||||
const rows = Array.isArray(payments) ? payments : [];
|
||||
const tableHead = ["ردیف", "شناسه پرداخت", "نوع", "تاریخ", "مبلغ (ریال)", "وضعیت"];
|
||||
const tableHead = ["ردیف", "شناسه پرداخت", "نوع", "تاریخ", "مبلغ (تومان)", "وضعیت"];
|
||||
const centerTable = [0, 4, 5];
|
||||
|
||||
if (!loading && rows.length === 0) {
|
||||
@@ -80,7 +81,7 @@ function List({ payments, loading, page, totalPages, onPageChange }) {
|
||||
align="right"
|
||||
>
|
||||
<TextLoading width={50} height={18} loading={loading}>
|
||||
{row.amount_rials ? Number(row.amount_rials).toLocaleString("fa-IR") : "--"}
|
||||
{row.amount_rials ? formatToman(row.amount_rials) : "--"}
|
||||
</TextLoading>
|
||||
</TableCell>
|
||||
<TableCell className="!pr-[18px] !text-nowrap" align="right">
|
||||
|
||||
Reference in New Issue
Block a user