diff --git a/src/components/PaymentRequest/ManagePaymentRequest.jsx b/src/components/PaymentRequest/ManagePaymentRequest.jsx
index 8232d3aa..8365a66d 100644
--- a/src/components/PaymentRequest/ManagePaymentRequest.jsx
+++ b/src/components/PaymentRequest/ManagePaymentRequest.jsx
@@ -392,10 +392,7 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) {
error={errors.payee?.message}
/>
- {errors.payee && (
-
- )}
-
+
{/* Checkbox below input */}
{
}),
billAttachments: z
- .array(
- z.object({
- fileName: z.string().min(1, { message: "Filename is required" }),
- base64Data: z.string().nullable(),
- contentType: z
- .string()
- .refine((val) => ALLOWED_TYPES.includes(val), {
- message: "Only PDF, PNG, JPG, or JPEG files are allowed",
- }),
- documentId: z.string().optional(),
- fileSize: z.number().max(MAX_FILE_SIZE, {
- message: "File size must be less than or equal to 5MB",
- }),
- description: z.string().optional(),
- isActive: z.boolean().default(true),
- })
- ).refine((data)=>{
- if(isItself){
- payee.z.string().optional();
- }
- }),
+ .array(
+ z.object({
+ fileName: z.string().min(1, { message: "Filename is required" }),
+ base64Data: z.string().nullable(),
+ contentType: z
+ .string()
+ .refine((val) => ALLOWED_TYPES.includes(val), {
+ message: "Only PDF, PNG, JPG, or JPEG files are allowed",
+ }),
+ documentId: z.string().optional(),
+ fileSize: z.number().max(MAX_FILE_SIZE, {
+ message: "File size must be less than or equal to 5MB",
+ }),
+ description: z.string().optional(),
+ isActive: z.boolean().default(true),
+ })
+ )
+ ,
})
};
diff --git a/src/components/PaymentRequest/PaymentStatusLogs.jsx b/src/components/PaymentRequest/PaymentStatusLogs.jsx
new file mode 100644
index 00000000..9abb3fa5
--- /dev/null
+++ b/src/components/PaymentRequest/PaymentStatusLogs.jsx
@@ -0,0 +1,93 @@
+import { useState, useMemo } from "react";
+import Avatar from "../common/Avatar";
+import { formatUTCToLocalTime } from "../../utils/dateUtils";
+import Timeline from "../common/TimeLine";
+import moment from "moment";
+import { getColorNameFromHex } from "../../utils/appUtils";
+const PaymentStatusLogs = ({ data }) => {
+ const [visibleCount, setVisibleCount] = useState(4);
+
+ const sortedLogs = useMemo(() => {
+ if (!data?.updateLogs) return [];
+ return [...data.updateLogs].sort(
+ (a, b) => new Date(b.updatedAt) - new Date(a.updatedAt)
+ );
+ }, [data?.updateLogs]);
+
+ const logsToShow = useMemo(
+ () => sortedLogs.slice(0, visibleCount),
+ [sortedLogs, visibleCount]
+ );
+
+ const timelineData = useMemo(() => {
+ return logsToShow.map((log, index) => ({
+ id: index + 1,
+ title: log.nextStatus?.name || "Status Updated",
+ description: log.nextStatus?.description || "",
+ timeAgo: log.updatedAt,
+ color: getColorNameFromHex(log.nextStatus?.color) || "primary",
+ users: log.updatedBy
+ ? [
+ {
+ firstName: log.updatedBy.firstName || "",
+ lastName: log?.updatedBy?.lastName || "",
+ role: log.updatedBy.jobRoleName || "",
+ avatar: log.updatedBy.photo,
+ },
+ ]
+ : [],
+ }));
+ }, [logsToShow]);
+
+ const handleShowMore = () => {
+ setVisibleCount((prev) => prev + 4);
+ };
+
+ return (
+
+ {/*
+ {logsToShow.map((log) => (
+
+
+
+
+
+
+ {`${log.updatedBy.firstName} ${log.updatedBy.lastName}`}
+
+ {log.action}
+
+
+ {formatUTCToLocalTime(log.updateAt, true)}
+
+
+
+ {log.comment}
+
+
+
+
+ ))}
+
+
+ {sortedLogs.length > visibleCount && (
+
+
+
+ )} */}
+
+
+
+ );
+};
+
+export default PaymentStatusLogs;
diff --git a/src/components/PaymentRequest/ViewPaymentRequest.jsx b/src/components/PaymentRequest/ViewPaymentRequest.jsx
index 27447d0a..85b0e8f9 100644
--- a/src/components/PaymentRequest/ViewPaymentRequest.jsx
+++ b/src/components/PaymentRequest/ViewPaymentRequest.jsx
@@ -34,6 +34,8 @@ import {
REVIEW_EXPENSE,
} from "../../utils/constants";
import Label from "../common/Label";
+import { FilelistView } from "../Expenses/Filelist";
+import PaymentStatusLogs from "./PaymentStatusLogs";
const ViewPaymentRequest = ({ requestId }) => {
const { data, isLoading, isError, error, isFetching } =
@@ -125,7 +127,7 @@ const ViewPaymentRequest = ({ requestId }) => {