removed fuature validation for date, because added flatepick that not allow to select feature date

This commit is contained in:
pramod mahajan 2025-08-01 10:26:39 +05:30
parent 35f221038d
commit b7c4c841e6
3 changed files with 4 additions and 39 deletions

View File

@ -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"],
});
}
}
});
};

View File

@ -364,7 +364,7 @@ const ManageExpense = ({ closeModal, expenseToEdit = null }) => {
<div className="row my-2">
<div className="col-md-6">
<label htmlFor="supplerName" className="form-label ">
Supplier Name
Supplier Name/Transporter/Other
</label>
<input
type="text"

View File

@ -432,7 +432,7 @@ const ViewExpense = ({ ExpenseId }) => {
{Array.isArray(data?.nextStatus) && data.nextStatus.length > 0 && (
<>
{IsPaymentProcess && (
{(IsPaymentProcess && nextStatusWithPermission?.length > 0) && (
<div className="row">
<div className="col-12 col-md-6 text-start">
<label className="form-label">Transaction Id </label>
@ -461,7 +461,7 @@ const ViewExpense = ({ ExpenseId }) => {
<EmployeeSearchInput
control={control}
name="reimburseById"
projectId={data?.project?.id}
projectId={null}
/>
</div>
</div>