From 35b3384dac19a5252b5867a2b3089cbebe5f8e3a Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Mon, 1 Dec 2025 11:39:34 +0530 Subject: [PATCH 01/10] At the time of Update in Purchase Automatically hit the sumit without click. --- src/components/purchase/ManagePurchase.jsx | 87 +++++++++++----------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/src/components/purchase/ManagePurchase.jsx b/src/components/purchase/ManagePurchase.jsx index 262238bf..89c1b1b3 100644 --- a/src/components/purchase/ManagePurchase.jsx +++ b/src/components/purchase/ManagePurchase.jsx @@ -127,8 +127,6 @@ const ManagePurchase = ({ onClose, purchaseId }) => { const onSubmit = useCallback( (formData) => { - if (activeTab !== 2) return; - if (purchaseId) { const payload = generatePatchOps(formData); updatePurchase({ purchaseId, payload }); @@ -136,7 +134,7 @@ const ManagePurchase = ({ onClose, purchaseId }) => { CreateInvoice(formData); } }, - [activeTab, purchaseId, generatePatchOps, updatePurchase, CreateInvoice] + [purchaseId, generatePatchOps, updatePurchase, CreateInvoice] ); return (
@@ -184,50 +182,53 @@ const ManagePurchase = ({ onClose, purchaseId }) => { {/* --- Form Content --- */}
-
{ - if (activeTab !== 2) { - e.preventDefault(); - e.stopPropagation(); - } - }} - onSubmit={purchaseOrder.handleSubmit(onSubmit)} - > - {stepsConfig[activeTab].component} + {activeTab !== 2 && ( +
+ {stepsConfig[activeTab].component} - {/* Buttons */} -
- +
+ -
- {activeTab < stepsConfig.length - 1 ? ( - - ) : ( - - )} +
- + )} + {activeTab === 2 && ( +
+ {stepsConfig[2].component} + +
+ + + +
+
+ )}
From ef3312523fc484e3b1efc87aa5c2f168d5377608 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Mon, 1 Dec 2025 12:32:46 +0530 Subject: [PATCH 02/10] added payment --- src/components/purchase/ManagePurchase.jsx | 12 +- src/components/purchase/PurchaseList.jsx | 34 ++- src/components/purchase/PurchasePayment.jsx | 298 ++++++++++++++++++++ src/components/purchase/PurchaseSchema.jsx | 49 ++-- src/hooks/usePurchase.jsx | 33 +++ src/pages/purchase/PurchasePage.jsx | 49 +++- src/repositories/PurchaseRepository.jsx | 4 + src/utils/constants.jsx | 21 +- 8 files changed, 446 insertions(+), 54 deletions(-) create mode 100644 src/components/purchase/PurchasePayment.jsx diff --git a/src/components/purchase/ManagePurchase.jsx b/src/components/purchase/ManagePurchase.jsx index 262238bf..b48a8056 100644 --- a/src/components/purchase/ManagePurchase.jsx +++ b/src/components/purchase/ManagePurchase.jsx @@ -28,21 +28,21 @@ const ManagePurchase = ({ onClose, purchaseId }) => { const stepsConfig = useMemo( () => [ { - name: "Party Details", + name: "Vendor & Project Details", icon: "bx bx-user bx-md", - subtitle: "Supplier & project information", + subtitle: "Vendor information and project association", component: , }, { - name: "Invoice & Transport", + name: "Invoice & Logistics", icon: "bx bx-receipt bx-md", - subtitle: "Invoice, eWay bill & transport info", + subtitle: "Invoice, e-Way bill, and logistics information", component: , }, { - name: "Payment Details", + name: "Invoice & Tax Amount", icon: "bx bx-credit-card bx-md", - subtitle: "Amount, tax & due date", + subtitle: "Payment terms, tax breakdown, and due dates", component: , }, ], diff --git a/src/components/purchase/PurchaseList.jsx b/src/components/purchase/PurchaseList.jsx index 39ed3352..24decac7 100644 --- a/src/components/purchase/PurchaseList.jsx +++ b/src/components/purchase/PurchaseList.jsx @@ -1,14 +1,15 @@ import React, { useState } from "react"; import { usePurchasesList } from "../../hooks/usePurchase"; -import { ITEMS_PER_PAGE } from "../../utils/constants"; +import { ADD_DELIVERY_CHALLAN, ITEMS_PER_PAGE } from "../../utils/constants"; import Pagination from "../common/Pagination"; import { PurchaseColumn } from "./Purchasetable"; import { SpinnerLoader } from "../common/Loader"; import { useDebounce } from "../../utils/appUtils"; import { usePurchaseContext } from "../../pages/purchase/PurchasePage"; +import { useHasUserPermission } from "../../hooks/useHasUserPermission"; const PurchaseList = ({ searchString }) => { - const { setViewPurchase, setManagePurchase, setChallan } = + const { setViewPurchase, setManagePurchase, setChallan, setAddPayment } = usePurchaseContext(); const [currentPage, setCurrentPage] = useState(1); const debounceSearch = useDebounce(searchString, 300); @@ -27,7 +28,7 @@ const PurchaseList = ({ searchString }) => { }; const visibleColumns = PurchaseColumn.filter((col) => !col.hidden); - + const canAddChallan = useHasUserPermission(ADD_DELIVERY_CHALLAN) return (
@@ -47,7 +48,7 @@ const PurchaseList = ({ searchString }) => { {/* LOADING */} {isLoading && ( - +
@@ -73,7 +74,7 @@ const PurchaseList = ({ searchString }) => { {col.render ? col.render(item) : item[col.key] || "NA"} ))} - +