Changing Date in Expense list grouping.
This commit is contained in:
parent
6531eb7576
commit
2e49a61aab
@ -77,7 +77,7 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
|
|
||||||
switch (field) {
|
switch (field) {
|
||||||
case "transactionDate":
|
case "transactionDate":
|
||||||
key = item?.transactionDate?.split("T")[0];
|
key = formatUTCToLocalTime(item?.transactionDate);
|
||||||
displayField = "Transaction Date";
|
displayField = "Transaction Date";
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
@ -85,9 +85,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
displayField = "Status";
|
displayField = "Status";
|
||||||
break;
|
break;
|
||||||
case "submittedBy":
|
case "submittedBy":
|
||||||
key = `${item?.createdBy?.firstName ?? ""} ${
|
key = `${item?.createdBy?.firstName ?? ""} ${item.createdBy?.lastName ?? ""
|
||||||
item.createdBy?.lastName ?? ""
|
}`.trim();
|
||||||
}`.trim();
|
|
||||||
displayField = "Submitted By";
|
displayField = "Submitted By";
|
||||||
break;
|
break;
|
||||||
case "project":
|
case "project":
|
||||||
@ -145,9 +144,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
label: "Submitted By",
|
label: "Submitted By",
|
||||||
align: "text-start",
|
align: "text-start",
|
||||||
getValue: (e) =>
|
getValue: (e) =>
|
||||||
`${e.createdBy?.firstName ?? ""} ${
|
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
|
||||||
e.createdBy?.lastName ?? ""
|
}`.trim() || "N/A",
|
||||||
}`.trim() || "N/A",
|
|
||||||
customRender: (e) => (
|
customRender: (e) => (
|
||||||
<div
|
<div
|
||||||
className="d-flex align-items-center cursor-pointer"
|
className="d-flex align-items-center cursor-pointer"
|
||||||
@ -160,9 +158,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
lastName={e.createdBy?.lastName}
|
lastName={e.createdBy?.lastName}
|
||||||
/>
|
/>
|
||||||
<span className="text-truncate">
|
<span className="text-truncate">
|
||||||
{`${e.createdBy?.firstName ?? ""} ${
|
{`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""
|
||||||
e.createdBy?.lastName ?? ""
|
}`.trim() || "N/A"}
|
||||||
}`.trim() || "N/A"}
|
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
@ -194,9 +191,8 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
align: "text-center",
|
align: "text-center",
|
||||||
getValue: (e) => (
|
getValue: (e) => (
|
||||||
<span
|
<span
|
||||||
className={`badge bg-label-${
|
className={`badge bg-label-${getColorNameFromHex(e?.status?.color) || "secondary"
|
||||||
getColorNameFromHex(e?.status?.color) || "secondary"
|
}`}
|
||||||
}`}
|
|
||||||
>
|
>
|
||||||
{e.status?.name || "Unknown"}
|
{e.status?.name || "Unknown"}
|
||||||
</span>
|
</span>
|
||||||
@ -312,26 +308,22 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
(col.isAlwaysVisible || groupBy !== col.key) && (
|
(col.isAlwaysVisible || groupBy !== col.key) && (
|
||||||
<td
|
<td
|
||||||
key={col.key}
|
key={col.key}
|
||||||
className={`d-table-cell ml-2 ${
|
className={`d-table-cell ml-2 ${col.align ?? ""
|
||||||
col.align ?? ""
|
} `}
|
||||||
} `}
|
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className={`d-flex px-2 ${
|
className={`d-flex px-2 ${col.key === "status"
|
||||||
col.key === "status"
|
|
||||||
? "justify-content-center"
|
? "justify-content-center"
|
||||||
: ""
|
: ""
|
||||||
}
|
}
|
||||||
${
|
${col.key === "amount"
|
||||||
col.key === "amount"
|
? "justify-content-end"
|
||||||
? "justify-content-end"
|
: ""
|
||||||
: ""
|
}
|
||||||
}
|
${col.key === "submitted"
|
||||||
${
|
? "justify-content-center"
|
||||||
col.key === "submitted"
|
: ""
|
||||||
? "justify-content-center"
|
}
|
||||||
: ""
|
|
||||||
}
|
|
||||||
`}
|
`}
|
||||||
>
|
>
|
||||||
{col.customRender
|
{col.customRender
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user