From 5b91c13b857ab74157ba8f46a1da177e0ef579aa Mon Sep 17 00:00:00 2001 From: Kartik Sharma Date: Wed, 19 Nov 2025 09:46:41 +0530 Subject: [PATCH] adding list view in advance payment list. --- .../AdvancePayment/AdvancePaymentList1.jsx | 105 +++++++++++++++++- .../RecurringExpense/RecurringExpenseList.jsx | 2 +- .../AdvancePayment/AdvancePaymentPage1.jsx | 21 +++- 3 files changed, 119 insertions(+), 9 deletions(-) diff --git a/src/components/AdvancePayment/AdvancePaymentList1.jsx b/src/components/AdvancePayment/AdvancePaymentList1.jsx index 9e5fb3e5..eb35942c 100644 --- a/src/components/AdvancePayment/AdvancePaymentList1.jsx +++ b/src/components/AdvancePayment/AdvancePaymentList1.jsx @@ -1,15 +1,108 @@ import React from 'react' import { useExpenseAllTransactionsList } from '../../hooks/useExpense'; -const AdvancePaymentList1 = ({searchString}) => { +const AdvancePaymentList1 = ({ searchString }) => { const { data, isError, isLoading, error, isFetching } = - useExpenseAllTransactionsList(); - return ( -
-
+ useExpenseAllTransactionsList(searchString); + console.log("Kartik", data) + const recurringExpenseColumns = [ + { + key: "date", + label: ( + <> + Date + + ), + align: "text-start", + }, + { key: "description", label: "Description", align: "text-start" }, + { + key: "credit", + label: ( + <> + Credit + + ), + align: "text-end", + }, + { + key: "debit", + label: ( + <> + Debit + + ), + align: "text-end", + }, + + { + key: "balance", + label: ( + <> + Balance + + ), + align: "text-end fw-bold", + }, + + ]; + return ( +
+
+ {/* {Array.isArray(data) && data.length > 0 && ( */} + + + + {recurringExpenseColumns.map((col) => ( + + ))} + + + + + {data?.length > 0 ? ( + data?.map((recurringExpense) => ( + + {recurringExpenseColumns.map((col) => ( + + ))} + + + )) + ) : ( + + + + )} + +
+ {col.label} +
+ {col?.customRender + ? col?.customRender(recurringExpense) + : col?.getValue(recurringExpense)} +
+ {/* )} */} + {/* {!data || + data.length === 0 + && ( +
+ {isError ? (

{error.message}

) : (

No Recurring Expense Found

)} +
+ )} */} +
-
) } diff --git a/src/components/RecurringExpense/RecurringExpenseList.jsx b/src/components/RecurringExpense/RecurringExpenseList.jsx index 338a3f38..a4c45fba 100644 --- a/src/components/RecurringExpense/RecurringExpenseList.jsx +++ b/src/components/RecurringExpense/RecurringExpenseList.jsx @@ -166,7 +166,7 @@ const RecurringExpenseList = ({ search, filterStatuses }) => { } ); }; - +console.log("Tanish",filteredData) return ( <> {IsDeleteModalOpen && ( diff --git a/src/pages/AdvancePayment/AdvancePaymentPage1.jsx b/src/pages/AdvancePayment/AdvancePaymentPage1.jsx index 1d1b457a..0a35dd44 100644 --- a/src/pages/AdvancePayment/AdvancePaymentPage1.jsx +++ b/src/pages/AdvancePayment/AdvancePaymentPage1.jsx @@ -2,6 +2,7 @@ import React from 'react' import Breadcrumb from '../../components/common/Breadcrumb' import AdvancePaymentList1 from '../../components/AdvancePayment/AdvancePaymentList1' import { useForm } from 'react-hook-form'; +import EmployeeSearchInput from '../../components/common/EmployeeSearchInput'; const AdvancePaymentPage1 = () => { const { control, reset, watch } = useForm({ @@ -19,9 +20,25 @@ const AdvancePaymentPage1 = () => { { label: "Advance Payment" }, ]} /> -
- +
+
+
+
+ +
+
+ +
+ + +
) }