From bc6a935e950fbba55075123b64cf4911e89d91aa Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Mon, 10 Nov 2025 12:40:29 +0530 Subject: [PATCH] modify view of PR --- public/assets/css/core-extend.css | 3 + src/components/Expenses/ExpenseSkeleton.jsx | 2 +- src/components/Expenses/Filelist.jsx | 4 +- .../PaymentRequest/ActionPaymentRequest.jsx | 257 ++++++------ .../PaymentRequest/ManagePaymentRequest.jsx | 55 ++- .../PaymentRequest/PaymentRequestList.jsx | 2 +- .../PaymentRequest/PaymentStatusLogs.jsx | 53 +-- .../PaymentRequest/ViewPaymentRequest.jsx | 366 ++++++------------ .../PaymentRequest/PaymentRequestPage.jsx | 2 +- 9 files changed, 326 insertions(+), 418 deletions(-) diff --git a/public/assets/css/core-extend.css b/public/assets/css/core-extend.css index f009f1d4..8c410a8a 100644 --- a/public/assets/css/core-extend.css +++ b/public/assets/css/core-extend.css @@ -256,7 +256,10 @@ font-weight: normal; .h-48 { height: 12rem; } /* 192px */ .h-56 { height: 14rem; } /* 224px */ .h-64 { height: 16rem; } /* 256px */ +.h-70 { height: 20rem; } /* 256px */ +.h-74 { max-height: 35rem; } /* 256px */ .h-full { height: 100%; } + .h-screen{ height: 100vh; } /* ========================== diff --git a/src/components/Expenses/ExpenseSkeleton.jsx b/src/components/Expenses/ExpenseSkeleton.jsx index dbe1a5d7..4356eda0 100644 --- a/src/components/Expenses/ExpenseSkeleton.jsx +++ b/src/components/Expenses/ExpenseSkeleton.jsx @@ -154,7 +154,7 @@ export const ExpenseTableSkeleton = ({ groups = 3, rowsPerGroup = 3 }) => { -
Expense Type
+
Expense Categort
Payment Mode
diff --git a/src/components/Expenses/Filelist.jsx b/src/components/Expenses/Filelist.jsx index 81786057..bd9f7108 100644 --- a/src/components/Expenses/Filelist.jsx +++ b/src/components/Expenses/Filelist.jsx @@ -2,7 +2,7 @@ import React from "react"; import { formatFileSize, getIconByFileType } from "../../utils/appUtils"; import Tooltip from "../common/Tooltip"; -const Filelist = ({ files, removeFile, expenseToEdit }) => { +const Filelist = ({ files, removeFile, expenseToEdit,sm=6,md=4 }) => { return (
{files @@ -13,7 +13,7 @@ const Filelist = ({ files, removeFile, expenseToEdit }) => { return true; }) .map((file, idx) => ( -
+
{/* File icon and info */}
diff --git a/src/components/PaymentRequest/ActionPaymentRequest.jsx b/src/components/PaymentRequest/ActionPaymentRequest.jsx index e3f32ec4..8d2d9c96 100644 --- a/src/components/PaymentRequest/ActionPaymentRequest.jsx +++ b/src/components/PaymentRequest/ActionPaymentRequest.jsx @@ -171,126 +171,151 @@ const ActionPaymentRequest = ({ requestId }) => { {IsPaymentProcess && nextStatusWithPermission?.length > 0 && ( <> {isProccesed ? ( -
- {/* Expense Making */} -
- - + - )) - )} - - {errors.paymentModeId && ( - - {errors.paymentModeId.message} - - )} -
- -
- - - {errors.gstNumber && ( - - {errors.gstNumber.message} - - )} -
-
- - - {errors.location && ( - - {errors.location.message} - - )} -
-
-
- - -
- document.getElementById("billAttachments").click() - } - > - - - Click to select or click here to browse - - - (PDF, JPG, PNG, max 5MB) - - - { - onFileChange(e); - e.target.value = ""; - }} - /> + {PaymentModeLoading ? ( + + ) : ( + PaymentModes?.map((payment) => ( + + )) + )} + + {errors.paymentModeId && ( + + {errors.paymentModeId.message} + + )}
- {errors.billAttachments && ( - - {errors.billAttachments.message} - - )} - {files?.length > 0 && ( - - )} - {Array.isArray(errors.billAttachments) && - errors.billAttachments.map((fileError, index) => ( -
- { - (fileError?.fileSize?.message || - fileError?.contentType?.message || - fileError?.base64Data?.message, - fileError?.documentId?.message) +
+ + + {errors.gstNumber && ( + + {errors.gstNumber.message} + + )} +
+
+ + + {errors.location && ( + + {errors.location.message} + + )} +
+
+ + +
+ document.getElementById("billAttachments").click() } + > + + + Click to select or click here to browse + + + (PDF, JPG, PNG, max 5MB) + + + { + onFileChange(e); + e.target.value = ""; + }} + />
- ))} -
+ {errors.billAttachments && ( + + {errors.billAttachments.message} + + )} + {files?.length > 0 && ( + + )} + + {Array.isArray(errors.billAttachments) && + errors.billAttachments.map((fileError, index) => ( +
+ { + (fileError?.fileSize?.message || + fileError?.contentType?.message || + fileError?.base64Data?.message, + fileError?.documentId?.message) + } +
+ ))} +
+
+
) : ( @@ -321,11 +346,12 @@ const ActionPaymentRequest = ({ requestId }) => { {errors.paidAt.message} )}
-
+
@@ -380,6 +406,7 @@ const ActionPaymentRequest = ({ requestId }) => { {((nextStatusWithPermission?.length > 0 && !isRejectedRequest) || (isRejectedRequest && isCreatedBy)) && ( <> + diff --git a/src/components/PaymentRequest/ManagePaymentRequest.jsx b/src/components/PaymentRequest/ManagePaymentRequest.jsx index 764ab014..b740beef 100644 --- a/src/components/PaymentRequest/ManagePaymentRequest.jsx +++ b/src/components/PaymentRequest/ManagePaymentRequest.jsx @@ -1,8 +1,11 @@ -import React, { useEffect, useState } from "react"; +import React, { useEffect, useMemo, useState } from "react"; import { useProjectName } from "../../hooks/useProjects"; import Label from "../common/Label"; import { Controller, useForm } from "react-hook-form"; -import { useCurrencies, useExpenseCategory } from "../../hooks/masterHook/useMaster"; +import { + useCurrencies, + useExpenseCategory, +} from "../../hooks/masterHook/useMaster"; import DatePicker from "../common/DatePicker"; import { useCreatePaymentRequest, @@ -17,10 +20,15 @@ import { defaultPaymentRequest, PaymentRequestSchema, } from "./PaymentRequestSchema"; -import { INR_CURRENCY_CODE } from "../../utils/constants"; +import { + EXPENSE_DRAFT, + EXPENSE_STATUS, + INR_CURRENCY_CODE, +} from "../../utils/constants"; import Filelist from "../Expenses/Filelist"; import InputSuggestions from "../common/InputSuggestion"; import { useProfile } from "../../hooks/useProfile"; +import { blockUI } from "../../utils/blockUI"; function ManagePaymentRequest({ closeModal, requestToEdit = null }) { const { @@ -71,7 +79,14 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) { }); const [isItself, setisItself] = useState(false); - + const isDraft = useMemo(() => { + if (!data) return false; + return EXPENSE_STATUS.daft === data?.expenseStatus.id; + }, [data]); + const isProcessed = useMemo(() => { + if (!data) return false; + return EXPENSE_STATUS.payment_processed === data?.expenseStatus.id; + }, [data]); const files = watch("billAttachments"); const onFileChange = async (e) => { const newFiles = Array.from(e.target.files); @@ -211,7 +226,7 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) { setValue("payee", name); }; return ( -
+
{requestToEdit ? "Update Payment Request " : "Create Payment Request"}
@@ -225,6 +240,9 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) { - {errors.paidTransactionId && ( - - {errors.paidTransactionId.message} - - )} -
-
- - - {errors.paidAt && ( - - {errors.paidAt.message} - - )} -
-
- - -
-
- - - {errors.tdsPercentage && ( - - {errors.tdsPercentage.message} - - )} -
-
- - - {errors.baseAmount && ( - - {errors.baseAmount.message} - - )} -
-
- - - {errors.taxAmount && ( - - {errors.taxAmount.message} - - )} -
-
- )} -
- {((nextStatusWithPermission?.length > 0 && - !isRejectedRequest) || - (isRejectedRequest && isCreatedBy)) && ( - <> - -