From ef3312523fc484e3b1efc87aa5c2f168d5377608 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Mon, 1 Dec 2025 12:32:46 +0530 Subject: [PATCH] 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"} ))} - +