From 346ef0174b4a5545e3dab7888da27bf480d6b1da Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Tue, 4 Nov 2025 11:42:43 +0530 Subject: [PATCH 1/3] Rearranging the fields of Payment Request Popup. --- .../PaymentRequest/ManagePaymentRequest.jsx | 181 +++++++++--------- 1 file changed, 94 insertions(+), 87 deletions(-) diff --git a/src/components/PaymentRequest/ManagePaymentRequest.jsx b/src/components/PaymentRequest/ManagePaymentRequest.jsx index b9cc5927..55f18cf0 100644 --- a/src/components/PaymentRequest/ManagePaymentRequest.jsx +++ b/src/components/PaymentRequest/ManagePaymentRequest.jsx @@ -11,8 +11,8 @@ import { formatFileSize, localToUtc } from '../../utils/appUtils'; import { defaultPaymentRequest, PaymentRequestSchema } from './PaymentRequestSchema'; function ManagePaymentRequest({ closeModal, requestToEdit = null }) { - const {data,isLoading,isError,error:requestError}= usePaymentRequestDetail(requestToEdit) -// const data = {} + const { data, isLoading, isError, error: requestError } = usePaymentRequestDetail(requestToEdit) + // const data = {} const { projectNames, loading: projectLoading, error, isError: isProjectError, } = useProjectName(); @@ -25,7 +25,7 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) { loading: ExpenseLoading, error: ExpenseError, } = useExpenseCategory(); - + const schema = PaymentRequestSchema(ExpenseTypes); const { register, control, watch, handleSubmit, setValue, reset, formState: { errors }, } = useForm({ resolver: zodResolver(schema), @@ -158,6 +158,7 @@ function ManagePaymentRequest({ closeModal, requestToEdit = null }) { {requestToEdit ? "Update Payment Request " : "Create Payment Request"}
+ {/* Project and Category */}
-
-
- - - - {errors.dueDate && ( - - {errors.dueDate.message} - - )} -
- -
- - - {errors.amount && ( - {errors.amount.message} - )} -
-
- -
-
- - - {errors.payee && ( - - {errors.payee.message} - - )} -
- -
- - - {errors.currencyId && ( - {errors.currencyId.message} - )} -
- -
- + {/* Title and Advance Payment */}
+ + {/* Date and Amount */} +
+
+ + + + {errors.dueDate && ( + + {errors.dueDate.message} + + )} +
+ +
+ + + {errors.amount && ( + {errors.amount.message} + )} +
+
+ + {/* Payee and Currency */} +
+
+ + + {errors.payee && ( + + {errors.payee.message} + + )} +
+ +
+ + + {errors.currencyId && ( + {errors.currencyId.message} + )} +
+ +
+ + {/* Description */}
+ {/* Upload Document */}
-
+
{/* Description */}
diff --git a/src/components/PaymentRequest/PaymentRequestSchema.js b/src/components/PaymentRequest/PaymentRequestSchema.js index 927baa3b..07b21d0e 100644 --- a/src/components/PaymentRequest/PaymentRequestSchema.js +++ b/src/components/PaymentRequest/PaymentRequestSchema.js @@ -1,4 +1,5 @@ import { boolean, z } from "zod"; +import { INR_CURRENCY_CODE } from "../../utils/constants"; const MAX_FILE_SIZE = 5 * 1024 * 1024; // 5MB const ALLOWED_TYPES = [ "application/pdf", diff --git a/src/utils/constants.jsx b/src/utils/constants.jsx index 5a1f816d..0739e894 100644 --- a/src/utils/constants.jsx +++ b/src/utils/constants.jsx @@ -100,6 +100,7 @@ export const VERIFY_DOCUMENT = "13a1f30f-38d1-41bf-8e7a-b75189aab8e0"; // 1 - Expense Manage export const EXPENSE_MANAGEMENT = "a4e25142-449b-4334-a6e5-22f70e4732d7"; +export const INR_CURRENCY_CODE = "78e96e4a-7ce0-4164-ae3a-c833ad45ec2c"; export const TENANT_STATUS = [ { id: "62b05792-5115-4f99-8ff5-e8374859b191", name: "Active" }, From 5bf5e18c6b868f770b795cf678da735a819319e1 Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Tue, 4 Nov 2025 12:06:59 +0530 Subject: [PATCH 3/3] Adding some gap in Amout and Currency at PaymentRequestList. --- .../PaymentRequest/PaymentRequestList.jsx | 105 +++++++++--------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/src/components/PaymentRequest/PaymentRequestList.jsx b/src/components/PaymentRequest/PaymentRequestList.jsx index 3c823f92..8e522a15 100644 --- a/src/components/PaymentRequest/PaymentRequestList.jsx +++ b/src/components/PaymentRequest/PaymentRequestList.jsx @@ -14,14 +14,14 @@ import ConfirmModal from "../common/ConfirmModal"; import { useNavigate } from "react-router-dom"; import { useSelector } from "react-redux"; -const PaymentRequestList = ({filters, groupBy = "submittedBy", search }) => { - const { setManageRequest,setVieRequest } = usePaymentRequestContext(); +const PaymentRequestList = ({ filters, groupBy = "submittedBy", search }) => { + const { setManageRequest, setVieRequest } = usePaymentRequestContext(); const navigate = useNavigate(); const [IsDeleteModalOpen, setIsDeleteModalOpen] = useState(false); const [deletingId, setDeletingId] = useState(null); - const SelfId = useSelector( - (store) => store?.globalVariables?.loginUser?.employeeInfo?.id - ); + const SelfId = useSelector( + (store) => store?.globalVariables?.loginUser?.employeeInfo?.id + ); const groupByField = (items, field) => { return items.reduce((acc, item) => { let key; @@ -122,8 +122,11 @@ const PaymentRequestList = ({filters, groupBy = "submittedBy", search }) => { label: " Amount", align: "text-start", getValue: (e) => ( - <>{formatCurrency(e?.amount, e.currency.currencyCode)} + <> + {formatCurrency(e?.amount)} {e.currency.currencyCode} + ), + align: "text-end px-3", }, { @@ -279,52 +282,52 @@ const PaymentRequestList = ({filters, groupBy = "submittedBy", search }) => { }) } > - {canDetetExpense(paymentRequest) && - canEditExpense(paymentRequest) && ( -
- -
    -
  • - setManageRequest({ - IsOpen: true, - RequestId: paymentRequest.id, - }) - } - > - - - Modify - -
  • + {canDetetExpense(paymentRequest) && + canEditExpense(paymentRequest) && ( +
    + +
      +
    • + setManageRequest({ + IsOpen: true, + RequestId: paymentRequest.id, + }) + } + > + + + Modify + +
    • -
    • { - setIsDeleteModalOpen(true); - setDeletingId(paymentRequest.id); - }} - > - - - Delete - -
    • -
    -
    )} +
  • { + setIsDeleteModalOpen(true); + setDeletingId(paymentRequest.id); + }} + > + + + Delete + +
  • +
+
)}