changed column paidby to submitted by
This commit is contained in:
parent
1d2cb7b1f7
commit
a87d3fb20a
@ -23,11 +23,11 @@ const ExpenseFilterPanel = ({ onApply, handleGroupBy }) => {
|
|||||||
const groupByList = useMemo(() => [
|
const groupByList = useMemo(() => [
|
||||||
{ id: "transactionDate", name: "Transaction Date" },
|
{ id: "transactionDate", name: "Transaction Date" },
|
||||||
{ id: "status", name: "Status" },
|
{ id: "status", name: "Status" },
|
||||||
{ id: "paidBy", name: "Paid By" },
|
{ id: "submittedBy", name: "Submitted By" },
|
||||||
{ id: "project", name: "Project" },
|
{ id: "project", name: "Project" },
|
||||||
{ id: "paymentMode", name: "Payment Mode" },
|
{ id: "paymentMode", name: "Payment Mode" },
|
||||||
{ id: "expensesType", name: "Expense Type" },
|
{ id: "expensesType", name: "Expense Type" },
|
||||||
{id: "createdAt",name:"Submitted"}
|
{id: "createdAt",name:"Submitted Date"}
|
||||||
], []);
|
], []);
|
||||||
|
|
||||||
const [selectedGroup, setSelectedGroup] = useState(groupByList[0]);
|
const [selectedGroup, setSelectedGroup] = useState(groupByList[0]);
|
||||||
|
|||||||
@ -4,7 +4,11 @@ import Avatar from "../common/Avatar";
|
|||||||
import { useExpenseContext } from "../../pages/Expense/ExpensePage";
|
import { useExpenseContext } from "../../pages/Expense/ExpensePage";
|
||||||
import { formatDate, formatUTCToLocalTime } from "../../utils/dateUtils";
|
import { formatDate, formatUTCToLocalTime } from "../../utils/dateUtils";
|
||||||
import Pagination from "../common/Pagination";
|
import Pagination from "../common/Pagination";
|
||||||
import { APPROVE_EXPENSE, EXPENSE_DRAFT, EXPENSE_REJECTEDBY } from "../../utils/constants";
|
import {
|
||||||
|
APPROVE_EXPENSE,
|
||||||
|
EXPENSE_DRAFT,
|
||||||
|
EXPENSE_REJECTEDBY,
|
||||||
|
} from "../../utils/constants";
|
||||||
import { getColorNameFromHex, useDebounce } from "../../utils/appUtils";
|
import { getColorNameFromHex, useDebounce } from "../../utils/appUtils";
|
||||||
import { ExpenseTableSkeleton } from "./ExpenseSkeleton";
|
import { ExpenseTableSkeleton } from "./ExpenseSkeleton";
|
||||||
import ConfirmModal from "../common/ConfirmModal";
|
import ConfirmModal from "../common/ConfirmModal";
|
||||||
@ -62,9 +66,9 @@ const ExpenseList = ({ filters, groupBy = "transactionDate",searchText }) => {
|
|||||||
case "status":
|
case "status":
|
||||||
key = item.status?.displayName || "Unknown";
|
key = item.status?.displayName || "Unknown";
|
||||||
break;
|
break;
|
||||||
case "paidBy":
|
case "submittedBy":
|
||||||
key = `${item.paidBy?.firstName ?? ""} ${
|
key = `${item.createdBy?.firstName ?? ""} ${
|
||||||
item.paidBy?.lastName ?? ""
|
item.createdBy?.lastName ?? ""
|
||||||
}`.trim();
|
}`.trim();
|
||||||
break;
|
break;
|
||||||
case "project":
|
case "project":
|
||||||
@ -102,23 +106,23 @@ const ExpenseList = ({ filters, groupBy = "transactionDate",searchText }) => {
|
|||||||
align: "text-start",
|
align: "text-start",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "paidBy",
|
key: "Submitted By",
|
||||||
label: "Paid By",
|
label: "Submitted By",
|
||||||
align: "text-start",
|
align: "text-start",
|
||||||
getValue: (e) =>
|
getValue: (e) =>
|
||||||
`${e.paidBy?.firstName ?? ""} ${e.paidBy?.lastName ?? ""}`.trim() ||
|
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""}`.trim() ||
|
||||||
"N/A",
|
"N/A",
|
||||||
customRender: (e) => (
|
customRender: (e) => (
|
||||||
<div className="d-flex align-items-center">
|
<div className="d-flex align-items-center">
|
||||||
<Avatar
|
<Avatar
|
||||||
size="xs"
|
size="xs"
|
||||||
classAvatar="m-0"
|
classAvatar="m-0"
|
||||||
firstName={e.paidBy?.firstName}
|
firstName={e.createdBy?.firstName}
|
||||||
lastName={e.paidBy?.lastName}
|
lastName={e.createdBy?.lastName}
|
||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
{`${e.paidBy?.firstName ?? ""} ${
|
{`${e.createdBy?.firstName ?? ""} ${
|
||||||
e.paidBy?.lastName ?? ""
|
e.createdBy?.lastName ?? ""
|
||||||
}`.trim() || "N/A"}
|
}`.trim() || "N/A"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -173,9 +177,10 @@ const canEditExpense = (expense) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const canDetetExpense = (expense) => {
|
const canDetetExpense = (expense) => {
|
||||||
return (expense.status.id === EXPENSE_DRAFT && expense.createdBy.id === SelfId )
|
return (
|
||||||
}
|
expense.status.id === EXPENSE_DRAFT && expense.createdBy.id === SelfId
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -288,7 +293,6 @@ const canDetetExpense = (expense)=>{
|
|||||||
}}
|
}}
|
||||||
></i>
|
></i>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -113,9 +113,6 @@ const ViewExpense = ({ ExpenseId }) => {
|
|||||||
<hr />
|
<hr />
|
||||||
</div>
|
</div>
|
||||||
<div className="text-start mb-2">
|
<div className="text-start mb-2">
|
||||||
{/* <label className="form-label me-2 mb-0 fw-semibold">
|
|
||||||
Description :
|
|
||||||
</label> */}
|
|
||||||
<div className="text-muted">{data?.description}</div>
|
<div className="text-muted">{data?.description}</div>
|
||||||
</div>
|
</div>
|
||||||
{/* Row 1 */}
|
{/* Row 1 */}
|
||||||
@ -275,92 +272,8 @@ const ViewExpense = ({ ExpenseId }) => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{/* {data.reviewedBy && (
|
|
||||||
<div className="col-md-6 mb-3 text-start">
|
|
||||||
<div className="d-flex align-items-center">
|
|
||||||
<label
|
|
||||||
className="form-label me-2 mb-0 fw-semibold"
|
|
||||||
style={{ minWidth: "130px" }}
|
|
||||||
>
|
|
||||||
Reviewed By :
|
|
||||||
</label>
|
|
||||||
<div className="d-flex align-items-center">
|
|
||||||
<Avatar
|
|
||||||
size="xs"
|
|
||||||
classAvatar="m-0"
|
|
||||||
firstName={data.reviewedBy?.firstName}
|
|
||||||
lastName={data.reviewedBy?.lastName}
|
|
||||||
/>
|
|
||||||
<span className="text-muted">
|
|
||||||
{`${data.reviewedBy?.firstName ?? ""} ${
|
|
||||||
data.reviewedBy?.lastName ?? ""
|
|
||||||
}`.trim() || "N/A"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{data.approvedBy && (
|
|
||||||
<div className="col-md-6 mb-3 text-start">
|
|
||||||
<div className="d-flex align-items-center">
|
|
||||||
<label
|
|
||||||
className="form-label me-2 mb-0 fw-semibold"
|
|
||||||
style={{ minWidth: "130px" }}
|
|
||||||
>
|
|
||||||
Approved By :{" "}
|
|
||||||
</label>
|
|
||||||
<div className="d-flex align-items-center">
|
|
||||||
<Avatar
|
|
||||||
size="xs"
|
|
||||||
classAvatar="m-0"
|
|
||||||
firstName={data.approvedBy?.firstName}
|
|
||||||
lastName={data.approvedBy?.lastName}
|
|
||||||
/>
|
|
||||||
<span className="text-muted">
|
|
||||||
{`${data.approvedBy?.firstName ?? ""} ${
|
|
||||||
data.approvedBy?.lastName ?? ""
|
|
||||||
}`.trim() || "N/A"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
{data.processedBy && (
|
|
||||||
<div className="col-md-6 mb-3 text-start">
|
|
||||||
<div className="d-flex align-items-center">
|
|
||||||
<label
|
|
||||||
className="form-label me-2 mb-0 fw-semibold"
|
|
||||||
style={{ minWidth: "130px" }}
|
|
||||||
>
|
|
||||||
Processed By :{" "}
|
|
||||||
</label>
|
|
||||||
<div className="d-flex align-items-center">
|
|
||||||
<Avatar
|
|
||||||
size="xs"
|
|
||||||
classAvatar="m-0"
|
|
||||||
firstName={data.processedBy?.firstName}
|
|
||||||
lastName={data.processedBy?.lastName}
|
|
||||||
/>
|
|
||||||
<span className="text-muted">
|
|
||||||
{`${data.processedBy?.firstName ?? ""} ${
|
|
||||||
data.processedBy?.lastName ?? ""
|
|
||||||
}`.trim() || "N/A"}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)} */}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{/* <div className="text-start">
|
|
||||||
<label className="form-label me-2 mb-0 fw-semibold">
|
|
||||||
Description :
|
|
||||||
</label>
|
|
||||||
<div className="text-muted">{data?.description}</div>
|
|
||||||
</div> */}
|
|
||||||
<div className="col-12 text-start">
|
<div className="col-12 text-start">
|
||||||
<label className="form-label me-2 mb-0 fw-semibold">Attachment :</label>
|
<label className="form-label me-2 mb-0 fw-semibold">Attachment :</label>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user