diff --git a/src/components/collections/AddPayment.jsx b/src/components/collections/AddPayment.jsx index d3e01146..1093728c 100644 --- a/src/components/collections/AddPayment.jsx +++ b/src/components/collections/AddPayment.jsx @@ -11,12 +11,19 @@ import { formatFigure, localToUtc } from "../../utils/appUtils"; import { formatUTCToLocalTime } from "../../utils/dateUtils"; import Avatar from "../common/Avatar"; import { PaymentHistorySkeleton } from "./CollectionSkeleton"; +import { usePaymentType } from "../../hooks/masterHook/useMaster"; const AddPayment = ({ onClose }) => { const { addPayment } = useCollectionContext(); const { data, isLoading, isError, error } = useCollection( addPayment?.invoiceId ); + const { + data: paymentTypes, + isLoading: isPaymentTypeLoading, + isError: isPaymentTypeError, + error: paymentError, + } = usePaymentType(true); const methods = useForm({ resolver: zodResolver(paymentSchema), defaultValues: defaultPayment, @@ -37,7 +44,6 @@ const AddPayment = ({ onClose }) => { paymentReceivedDate: localToUtc(formData.paymentReceivedDate), invoiceId: addPayment.invoiceId, }; - AddPayment(payload); }; const handleClose = (formData) => { @@ -78,6 +84,38 @@ const AddPayment = ({ onClose }) => { )} +
- Transaction ID:{" "} - {payment.transactionId} -
-{payment?.comment}
++ + Transaction ID: + {" "} + {payment.transactionId} +
++ {payment?.comment} +
+Loading...
; + if (isLoading) return{error.message}
; return ( @@ -183,27 +185,50 @@ const CollectionList = ({ fromDate, toDate, isPending, searchString }) => {
+ |
+ ))}
+
+ |
+
---|---|
+ |
+ ))}
+
+ |
+
{comment?.comment}
-No comments yet.
- )} - +{comment?.comment}
No comments yet.
+ )}Sr.No | Transaction ID | Received Date | +Payment Adjustment-Head | Amount | Updated By | {index + 1} | {payment.transactionId} | {formatUTCToLocalTime(payment.paymentReceivedDate)} | +{payment?.paymentAdjustmentHead?.name ?? "--"} | {formatFigure(payment.amount, { type: "currency", @@ -32,12 +34,8 @@ const PaymentHistoryTable = ({data}) => { })} |
-
-
+
{payment.createdBy?.firstName}{" "}
{payment.createdBy?.lastName}
diff --git a/src/components/collections/ViewCollection.jsx b/src/components/collections/ViewCollection.jsx
index be1749fe..8f572801 100644
--- a/src/components/collections/ViewCollection.jsx
+++ b/src/components/collections/ViewCollection.jsx
@@ -6,9 +6,11 @@ import { formatFigure, getIconByFileType } from "../../utils/appUtils";
import Avatar from "../common/Avatar";
import PaymentHistoryTable from "./PaymentHistoryTable";
import Comment from "./Comment";
+import { CollectionDetailsSkeleton } from "./CollectionSkeleton";
const ViewCollection = ({ onClose }) => {
- const { viewCollection, setCollection , setDocumentView} = useCollectionContext();
+ const { viewCollection, setCollection, setDocumentView } =
+ useCollectionContext();
const { data, isLoading, isError, error } = useCollection(viewCollection);
const handleEdit = () => {
@@ -16,18 +18,25 @@ const ViewCollection = ({ onClose }) => {
onClose();
};
- if (isLoading) return isLoading... ;
+ if (isLoading) return {error.message} ;
return (
Collection Details -
-
-
- {data?.title} +
+
+
+
+
- {data?.project?.name}
+
-
+ {" "}
{
>
{data?.isActive ? "Active" : "Inactive"}
- {!data?.receivedInvoicePayments && (
-
- )}
+ {!data?.receivedInvoicePayments && (
+
+
+
+ )}
-
- Project: {" "} - {data?.project?.name} +
+
-
+
Title :
+ {data?.title}
-
-
- Invoice Number: {" "} - {data?.invoiceNumber} -
- E-Invoice Number: {" "} - {data?.eInvoiceNumber} +
+
-
-
+
Invoice Number:
+ {data?.invoiceNumber}
-
-
- Invoice Date: {" "} - {formatUTCToLocalTime(data?.invoiceDate)} -
- Client Submitted Date: {" "} - {formatUTCToLocalTime(data?.clientSubmitedDate)} + {/* Row 2: E-Invoice Number + Project */} +
+
-
-
+
E-Invoice Number:
+ {data?.eInvoiceNumber}
-
-
- Expected Payment Date: {" "} - {formatUTCToLocalTime(data?.exceptedPaymentDate)} -
- Mark as Completed: {" "} - {data?.markAsCompleted ? "Yes" : "No"} + + {/* Row 3: Invoice Date + Client Submitted Date */} +
+
-
-
+
Invoice Date:
+
+ {formatUTCToLocalTime(data?.invoiceDate)}
+
-
-
- Basic Amount: {" "} - {formatFigure(data?.basicAmount, { - type: "currency", - currency: "INR", - })} -
- Tax Amount: {" "} - {formatFigure(data?.taxAmount, { - type: "currency", - currency: "INR", - })} +
+
-
-
+
Client Submitted Date:
+
+ {formatUTCToLocalTime(data?.clientSubmitedDate)}
+
-
-
- Balance Amount: {" "} - {formatFigure(data?.balanceAmount, { - type: "currency", - currency: "INR", - })} -
- Created At: {" "} - {formatUTCToLocalTime(data?.createdAt)} + {/* Row 4: Expected Payment Date + Mark as Completed */} +
+
-
-
+
Expected Payment Date:
+
+ {formatUTCToLocalTime(data?.exceptedPaymentDate)}
+
-
+
-
Created By: {" "} -
+
+ {/* Row 5: Basic Amount + Tax Amount */}
+
+ {/* Description */}
+
+
+
+
+ Basic Amount :
+
+ {formatFigure(data?.basicAmount, {
+ type: "currency",
+ currency: "INR",
+ })}
+
+
+
+ {/* Row 6: Balance Amount + Created At */}
+
+
+ Tax Amount :
+
+ {formatFigure(data?.taxAmount, {
+ type: "currency",
+ currency: "INR",
+ })}
+
+
+
+
+
+ Balance Amount :
+
+ {formatFigure(data?.balanceAmount, {
+ type: "currency",
+ currency: "INR",
+ })}
+
+
+
+ {/* Row 7: Created By */}
+
+
+ Created At :
+ {formatUTCToLocalTime(data?.createdAt)}
+
+
+
-
- Created By :
+
-
Description : - {data?.description} + + {data?.createdBy?.firstName} {data?.createdBy?.lastName} + +
+
+
+ Description :
+
+ {data?.description}
+
-
);
- })}
+ }) ?? "No Attachment"}
{/* Tabs Navigation */}
-
+
+
+
@@ -99,7 +101,7 @@ const CollectionPage = () => {
-
+
{" "}
{
)}
{viewCollection && (
-
diff --git a/src/repositories/MastersRepository.jsx b/src/repositories/MastersRepository.jsx
index 3e9fac8f..abe1a213 100644
--- a/src/repositories/MastersRepository.jsx
+++ b/src/repositories/MastersRepository.jsx
@@ -124,10 +124,13 @@ export const MasterRespository = {
api.put(`/api/Master/activity-group/edit/${serviceId}`, data),
getActivitesByGroup: (activityGroupId) =>
api.get(`api/master/activities?activityGroupId=${activityGroupId}`),
- deleteActivityGroup:(id)=>api.delete(`/api/Master/activity-group/delete/${id}`),
+ deleteActivityGroup: (id) =>
+ api.delete(`/api/Master/activity-group/delete/${id}`),
-
- deleteActivity:(id)=>api.delete(`/api/Master/activity/delete/${id}`),
+ deleteActivity: (id) => api.delete(`/api/Master/activity/delete/${id}`),
getOrganizationType: () => api.get("/api/Master/organization-type/list"),
+
+ getPaymentType: (isActive) =>
+ api.get(`/api/Master/payment-adjustment-head/list?isActive=${isActive}`),
};
|
---|