Incorrect Currency Symbol Displayed for USD in Payment Request Form
This commit is contained in:
parent
0d57da2b45
commit
afac22da23
@ -43,9 +43,8 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
|
||||
displayField = "Status";
|
||||
break;
|
||||
case "submittedBy":
|
||||
key = `${item?.createdBy?.firstName ?? ""} ${
|
||||
item.createdBy?.lastName ?? ""
|
||||
}`.trim();
|
||||
key = `${item?.createdBy?.firstName ?? ""} ${item.createdBy?.lastName ?? ""
|
||||
}`.trim();
|
||||
displayField = "Submitted By";
|
||||
break;
|
||||
case "project":
|
||||
@ -98,9 +97,8 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
|
||||
label: "Submitted By",
|
||||
align: "text-start",
|
||||
getValue: (e) =>
|
||||
`${e.createdBy?.firstName ?? ""} ${
|
||||
e.createdBy?.lastName ?? ""
|
||||
}`.trim() || "N/A",
|
||||
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
|
||||
}`.trim() || "N/A",
|
||||
customRender: (e) => (
|
||||
<div
|
||||
className="d-flex align-items-center cursor-pointer"
|
||||
@ -113,9 +111,8 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
|
||||
lastName={e.createdBy?.lastName}
|
||||
/>
|
||||
<span className="text-truncate">
|
||||
{`${e.createdBy?.firstName ?? ""} ${
|
||||
e.createdBy?.lastName ?? ""
|
||||
}`.trim() || "N/A"}
|
||||
{`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
|
||||
}`.trim() || "N/A"}
|
||||
</span>
|
||||
</div>
|
||||
),
|
||||
@ -128,15 +125,12 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
|
||||
},
|
||||
{
|
||||
key: "amount",
|
||||
label: " Amount",
|
||||
align: "text-start",
|
||||
getValue: (e) => (
|
||||
<>
|
||||
{formatCurrency(e?.amount)} {e.currency.currencyCode}
|
||||
</>
|
||||
),
|
||||
|
||||
align: "text-end px-3",
|
||||
label: "Amount",
|
||||
align: "text-end",
|
||||
getValue: (e) =>
|
||||
e?.amount
|
||||
? `${e?.currency?.symbol ? e.currency.symbol + " " : ""}${e.amount.toLocaleString()}`
|
||||
: "N/A",
|
||||
},
|
||||
{
|
||||
key: "expenseStatus",
|
||||
@ -144,9 +138,8 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
|
||||
align: "text-center",
|
||||
getValue: (e) => (
|
||||
<span
|
||||
className={`badge bg-label-${
|
||||
getColorNameFromHex(e?.expenseStatus?.color) || "secondary"
|
||||
}`}
|
||||
className={`badge bg-label-${getColorNameFromHex(e?.expenseStatus?.color) || "secondary"
|
||||
}`}
|
||||
>
|
||||
{e?.expenseStatus?.name || "Unknown"}
|
||||
</span>
|
||||
@ -180,14 +173,14 @@ const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => {
|
||||
];
|
||||
if (isLoading) return <ExpenseTableSkeleton headers={header} />;
|
||||
|
||||
const grouped = groupBy
|
||||
const grouped = groupBy
|
||||
? Object.fromEntries(
|
||||
Object.entries(groupByField(data?.data ?? [], groupBy)).sort(([keyA], [keyB]) =>
|
||||
keyA.localeCompare(keyB)
|
||||
)
|
||||
)
|
||||
: { All: data?.data ?? [] };
|
||||
|
||||
|
||||
const IsGroupedByDate = [
|
||||
{ key: "transactionDate", displayField: "Transaction Date" },
|
||||
{ key: "createdAt", displayField: "created Date" },
|
||||
|
||||
@ -68,7 +68,7 @@ const RecurringExpenseList = ({ search, filterStatuses }) => {
|
||||
align: "text-end",
|
||||
getValue: (e) =>
|
||||
e?.amount
|
||||
? `${e?.currency?.symbol || ""}${e.amount.toLocaleString()}`
|
||||
? `${e?.currency?.symbol ? e.currency.symbol + " " : ""}${e.amount.toLocaleString()}`
|
||||
: "N/A",
|
||||
},
|
||||
{
|
||||
@ -109,7 +109,7 @@ const RecurringExpenseList = ({ search, filterStatuses }) => {
|
||||
);
|
||||
|
||||
|
||||
const paginate = (page) => {
|
||||
const paginate = (page) => {
|
||||
if (page >= 1 && page <= (data?.totalPages ?? 1)) {
|
||||
setCurrentPage(page);
|
||||
}
|
||||
@ -277,11 +277,11 @@ const RecurringExpenseList = ({ search, filterStatuses }) => {
|
||||
</div>
|
||||
|
||||
{/* Pagination */}
|
||||
<Pagination
|
||||
currentPage={currentPage}
|
||||
totalPages={data?.totalPages}
|
||||
onPageChange={paginate}
|
||||
/>
|
||||
<Pagination
|
||||
currentPage={currentPage}
|
||||
totalPages={data?.totalPages}
|
||||
onPageChange={paginate}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user