From b7c4c841e61754f2108a10ad2ef295791557263c Mon Sep 17 00:00:00 2001 From: pramod mahajan Date: Fri, 1 Aug 2025 10:26:39 +0530 Subject: [PATCH] removed fuature validation for date, because added flatepick that not allow to select feature date --- src/components/Expenses/ExpenseSchema.js | 37 +---------------------- src/components/Expenses/ManageExpense.jsx | 2 +- src/components/Expenses/ViewExpense.jsx | 4 +-- 3 files changed, 4 insertions(+), 39 deletions(-) diff --git a/src/components/Expenses/ExpenseSchema.js b/src/components/Expenses/ExpenseSchema.js index c3b84148..f1e6320b 100644 --- a/src/components/Expenses/ExpenseSchema.js +++ b/src/components/Expenses/ExpenseSchema.js @@ -20,18 +20,7 @@ export const ExpenseSchema = (expenseTypes) => { transactionDate: z .string() .min(1, { message: "Date is required" }) - .refine( - (val) => { - const selected = new Date(val); - const today = new Date(); - - selected.setHours(0, 0, 0, 0); - today.setHours(0, 0, 0, 0); - - return selected <= today; - }, - { message: "Future dates are not allowed" } - ), + , transactionId: z.string().optional(), description: z.string().min(1, { message: "Description is required" }), location: z.string().min(1, { message: "Location is required" }), @@ -87,30 +76,6 @@ export const ExpenseSchema = (expenseTypes) => { path: ["noOfPersons"], }); } - - if (isEndProcess) { - if (!data.reimburseTransactionId || data.reimburseTransactionId.trim() === "") { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: "Reimburse Transaction ID is required", - path: ["reimburseTransactionId"], - }); - } - if (!data.reimburseDate) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: "Reimburse Date is required", - path: ["reimburseDate"], - }); - } - if (!data.reimburseById) { - ctx.addIssue({ - code: z.ZodIssueCode.custom, - message: "Reimburse By is required", - path: ["reimburseById"], - }); - } - } }); }; diff --git a/src/components/Expenses/ManageExpense.jsx b/src/components/Expenses/ManageExpense.jsx index bda9dd8b..65f79fda 100644 --- a/src/components/Expenses/ManageExpense.jsx +++ b/src/components/Expenses/ManageExpense.jsx @@ -364,7 +364,7 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
{ {Array.isArray(data?.nextStatus) && data.nextStatus.length > 0 && ( <> - {IsPaymentProcess && ( + {(IsPaymentProcess && nextStatusWithPermission?.length > 0) && (
@@ -461,7 +461,7 @@ const ViewExpense = ({ ExpenseId }) => {