From f91c7d6da173b6afbd2288425e6979e12c92b0b3 Mon Sep 17 00:00:00 2001 From: "pramod.mahajan" Date: Tue, 14 Oct 2025 13:42:21 +0530 Subject: [PATCH] rmoved console --- src/components/collections/ViewCollection.jsx | 133 +++++++++++++----- 1 file changed, 97 insertions(+), 36 deletions(-) diff --git a/src/components/collections/ViewCollection.jsx b/src/components/collections/ViewCollection.jsx index b1c9cd26..f12d9f75 100644 --- a/src/components/collections/ViewCollection.jsx +++ b/src/components/collections/ViewCollection.jsx @@ -1,20 +1,17 @@ -import React from 'react' -import { useCollectionContext } from '../../pages/collections/CollectionPage'; -import { useCollection } from '../../hooks/useCollections'; -import { formatUTCToLocalTime } from '../../utils/dateUtils'; -import { formatFigure } from '../../utils/appUtils'; -import Avatar from '../common/Avatar'; +import React from "react"; +import { useCollectionContext } from "../../pages/collections/CollectionPage"; +import { useCollection } from "../../hooks/useCollections"; +import { formatUTCToLocalTime } from "../../utils/dateUtils"; +import { formatFigure } from "../../utils/appUtils"; +import Avatar from "../common/Avatar"; const ViewCollection = () => { - const { viewCollection } = useCollectionContext(); - const { data, isLoading, isError, error } = useCollection( - viewCollection - ); - console.log(data) - if(isLoading) return
isLoading...
; - if(isError) return
{error.message}
; + const { viewCollection } = useCollectionContext(); + const { data, isLoading, isError, error } = useCollection(viewCollection); + if (isLoading) return
isLoading...
; + if (isError) return
{error.message}
; return ( -
+

Collection Details

@@ -23,47 +20,98 @@ const ViewCollection = () => {
-
Invoice Number: {data?.invoiceNumber}
-
E-Invoice Number: {data?.eInvoiceNumber}
+
+ Invoice Number: {data?.invoiceNumber} +
+
+ E-Invoice Number: {data?.eInvoiceNumber} +
-
Project: {data?.project?.name}
-
Status: {data?.isActive ? "Active" : "Inactive"}
+
+ Project: {data?.project?.name} +
+
+ Status: {data?.isActive ? "Active" : "Inactive"} +
-
Invoice Date: {formatUTCToLocalTime(data?.invoiceDate)}
-
Client Submitted Date: {formatUTCToLocalTime(data?.clientSubmitedDate)}
+
+ Invoice Date:{" "} + {formatUTCToLocalTime(data?.invoiceDate)} +
+
+ Client Submitted Date:{" "} + {formatUTCToLocalTime(data?.clientSubmitedDate)} +
-
Expected Payment Date: {formatUTCToLocalTime(data?.exceptedPaymentDate)}
-
Mark as Completed: {data?.markAsCompleted ? "Yes" : "No"}
+
+ Expected Payment Date:{" "} + {formatUTCToLocalTime(data?.exceptedPaymentDate)} +
+
+ Mark as Completed:{" "} + {data?.markAsCompleted ? "Yes" : "No"} +
-
Basic Amount: {formatFigure(data?.basicAmount, { type: "currency", currency: "INR" })}
-
Tax Amount: {formatFigure(data?.taxAmount, { type: "currency", currency: "INR" })}
+
+ Basic Amount:{" "} + {formatFigure(data?.basicAmount, { + type: "currency", + currency: "INR", + })} +
+
+ Tax Amount:{" "} + {formatFigure(data?.taxAmount, { + type: "currency", + currency: "INR", + })} +
-
Balance Amount: {formatFigure(data?.balanceAmount, { type: "currency", currency: "INR" })}
-
Created At: {formatUTCToLocalTime(data?.createdAt)}
+
+ Balance Amount:{" "} + {formatFigure(data?.balanceAmount, { + type: "currency", + currency: "INR", + })} +
+
+ Created At: {formatUTCToLocalTime(data?.createdAt)} +
-
Created By:
{data?.createdBy?.firstName} {data?.createdBy?.lastName} ({data?.createdBy?.jobRoleName})
+
+ Created By:{" "} +
+ + {data?.createdBy?.firstName} {data?.createdBy?.lastName} ( + {data?.createdBy?.jobRoleName}) +
{" "} +
{/*
Updated At: {data?.updatedAt ? formatUTCToLocalTime(data?.updatedAt) : "-"}
*/}
{data?.receivedInvoicePayments?.length > 0 && (
-
Received Payments
+

Received Payments

- + @@ -76,10 +124,23 @@ const ViewCollection = () => { - - + + ))} @@ -88,7 +149,7 @@ const ViewCollection = () => { )} - ) -} + ); +}; -export default ViewCollection +export default ViewCollection;
Sr,NoSr,No Transaction ID Received Date Amount{index + 1} {payment.transactionId} {formatUTCToLocalTime(payment.paymentReceivedDate)}{formatFigure(payment.amount, { type: "currency", currency: "INR" })}
- {payment.createdBy?.firstName} {payment.createdBy?.lastName} -
+ {formatFigure(payment.amount, { + type: "currency", + currency: "INR", + })} + +
+ + {payment.createdBy?.firstName}{" "} + {payment.createdBy?.lastName} +
+