fixed perfoma amt and delivery charge validation

This commit is contained in:
pramod.mahajan 2025-11-28 10:26:26 +05:30
parent 2b4f086318
commit 9234253c97
4 changed files with 10 additions and 18 deletions

View File

@ -120,7 +120,6 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
CreateInvoice(formData);
}
};
return (
<div
id="wizard-property-listing"

View File

@ -64,12 +64,7 @@ const PurchasePartyDetails = () => {
{/* Organization */}
<div className="col-12 col-md-6">
{/* <input
id="organizationId"
type="text"
className={`form-control form-control-md `}
{...register("organizationId")}
/> */}
<AppFormController
name="organizationId"
control={control}
@ -109,14 +104,12 @@ const PurchasePartyDetails = () => {
labelKey="name"
useFetchHook={useGlobaleOrganizations}
hookParams={[ITEMS_PER_PAGE,1]}
errors={errors?.organizationId}
errors={errors.supplierId}
/>
)}
/>
{errors?.supplierId && (
<div className="danger-text">{errors.supplierId.message}</div>
)}
</div>
{/* Billing Address */}
@ -209,8 +202,8 @@ const PurchasePartyDetails = () => {
<Label htmlFor="proformaInvoiceAmountt">Proforma Amount</Label>
<input
id="proformaInvoiceAmount"
type="text"
className={`form-control `}
type="number"
className={`form-control form-control-md`}
{...register("proformaInvoiceAmount")}
/>

View File

@ -93,7 +93,7 @@ const PurchasePaymentDetails = () => {
id="transportCharges"
type="number"
className="form-control form-control-md"
{...register("transportCharges")}
{...register("transportCharges",{ valueAsNumber: true })}
/>
{errors?.transportCharges && (

View File

@ -49,7 +49,7 @@ export const PurchaseSchema = z.object({
proformaInvoiceNumber: z.string().nullable(),
proformaInvoiceDate: z.coerce.date().nullable(),
proformaInvoiceAmount: z.number().optional(),
proformaInvoiceAmount: z.coerce.number().optional(),
invoiceNumber: z.string().nullable(),
invoiceDate: z.coerce.date().nullable(),
@ -66,7 +66,7 @@ export const PurchaseSchema = z.object({
transportCharges: z.number().nullable(),
description: z.string().min(1, { message: "Description is required" }),
attachments: z.array(AttachmentSchema([], 25)).optional(),
// attachments: z.array(AttachmentSchema([], 25)).optional(),
});
// deliveryChallanNo: z
@ -88,7 +88,7 @@ export const defaultPurchaseValue = {
proformaInvoiceNumber: null,
proformaInvoiceDate: null,
proformaInvoiceAmount: null,
proformaInvoiceAmount: 0,
invoiceNumber: null,
invoiceDate: null,
@ -105,7 +105,7 @@ export const defaultPurchaseValue = {
transportCharges: null,
description: "",
attachments: [],
// attachments: [],
};
export const getStepFields = (stepIndex) => {