Compare commits
No commits in common. "a87d3fb20aedb335f55f5aebe46ea889c9443936" and "0c8c954b9cb3e4d0a477474eaadcdf9c84e4bde0" have entirely different histories.
a87d3fb20a
...
0c8c954b9c
@ -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: "submittedBy", name: "Submitted By" },
|
{ id: "paidBy", name: "Paid 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 Date"}
|
{id: "createdAt",name:"Submitted"}
|
||||||
], []);
|
], []);
|
||||||
|
|
||||||
const [selectedGroup, setSelectedGroup] = useState(groupByList[0]);
|
const [selectedGroup, setSelectedGroup] = useState(groupByList[0]);
|
||||||
|
|||||||
@ -4,11 +4,7 @@ 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 {
|
import { APPROVE_EXPENSE, EXPENSE_DRAFT, EXPENSE_REJECTEDBY } from "../../utils/constants";
|
||||||
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";
|
||||||
@ -66,9 +62,9 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
case "status":
|
case "status":
|
||||||
key = item.status?.displayName || "Unknown";
|
key = item.status?.displayName || "Unknown";
|
||||||
break;
|
break;
|
||||||
case "submittedBy":
|
case "paidBy":
|
||||||
key = `${item.createdBy?.firstName ?? ""} ${
|
key = `${item.paidBy?.firstName ?? ""} ${
|
||||||
item.createdBy?.lastName ?? ""
|
item.paidBy?.lastName ?? ""
|
||||||
}`.trim();
|
}`.trim();
|
||||||
break;
|
break;
|
||||||
case "project":
|
case "project":
|
||||||
@ -106,23 +102,23 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
align: "text-start",
|
align: "text-start",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: "Submitted By",
|
key: "paidBy",
|
||||||
label: "Submitted By",
|
label: "Paid By",
|
||||||
align: "text-start",
|
align: "text-start",
|
||||||
getValue: (e) =>
|
getValue: (e) =>
|
||||||
`${e.createdBy?.firstName ?? ""} ${e.createdBy?.lastName ?? ""}`.trim() ||
|
`${e.paidBy?.firstName ?? ""} ${e.paidBy?.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.createdBy?.firstName}
|
firstName={e.paidBy?.firstName}
|
||||||
lastName={e.createdBy?.lastName}
|
lastName={e.paidBy?.lastName}
|
||||||
/>
|
/>
|
||||||
<span>
|
<span>
|
||||||
{`${e.createdBy?.firstName ?? ""} ${
|
{`${e.paidBy?.firstName ?? ""} ${
|
||||||
e.createdBy?.lastName ?? ""
|
e.paidBy?.lastName ?? ""
|
||||||
}`.trim() || "N/A"}
|
}`.trim() || "N/A"}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -177,10 +173,9 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const canDetetExpense = (expense)=>{
|
const canDetetExpense = (expense)=>{
|
||||||
return (
|
return (expense.status.id === EXPENSE_DRAFT && expense.createdBy.id === SelfId )
|
||||||
expense.status.id === EXPENSE_DRAFT && expense.createdBy.id === SelfId
|
}
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -293,6 +288,7 @@ const ExpenseList = ({ filters, groupBy = "transactionDate", searchText }) => {
|
|||||||
}}
|
}}
|
||||||
></i>
|
></i>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -113,6 +113,9 @@ 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 */}
|
||||||
@ -272,8 +275,92 @@ 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>
|
||||||
|
|
||||||
|
|||||||
@ -60,13 +60,6 @@
|
|||||||
"available": true,
|
"available": true,
|
||||||
"link": "/directory"
|
"link": "/directory"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"text": "Expense",
|
|
||||||
"icon": "bx bx-receipt",
|
|
||||||
"available": true,
|
|
||||||
"link": "/expenses"
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
"text": "Image Gallary",
|
"text": "Image Gallary",
|
||||||
"icon": "bx bx-images",
|
"icon": "bx bx-images",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user