+ | ${t.date} |
${t.name} |
- ${t.date} |
${parseFloat(t.amount).toLocaleString("en-IN", {
@@ -38,20 +27,34 @@ export const generatePDF = (
`
);
+ // Content for first page
const content = `
- ${headerHTML}
- Account Statement
+
+
+ 
+ The Kangra Central Co Operative Bank
+
+
+ Report generated: ${dayjs().format("DD/MM/YYYY HH:mm")}
+
+
+
+
+ Account Statement
Account No: ${accountNo}
- Available Balance: ₹ ${parseFloat(
- balance
- ).toLocaleString("en-IN", { minimumFractionDigits: 2 })}
-
+ Account Holder: ${customerName}
+ Statement Period: ${periodFrom} to ${periodTo}
+ Available Balance: ₹ ${parseFloat(balance).toLocaleString(
+ "en-IN",
+ { minimumFractionDigits: 2 }
+ )}
+
- | Name |
- Date |
+ Date |
+ Description |
Amount (₹) |
@@ -59,15 +62,12 @@ export const generatePDF = (
${rows.join("")}
-
-
`;
- // PDF options
const opt = {
- margin: [10, 10, 20, 10], // bottom margin for page count
- filename: `AccountStatement_${accountNo}.pdf`,
+ margin: [20, 10, 20, 10],
+ filename: `AccountStatement_${accountNo}_${dayjs().format("DD/MM/YYYY HH:mm")}.pdf`,
image: { type: "jpeg", quality: 0.98 },
html2canvas: { scale: 2 },
jsPDF: { unit: "mm", format: "a4", orientation: "portrait" },
@@ -81,12 +81,29 @@ export const generatePDF = (
.get("pdf")
.then((pdf: any) => {
const totalPages = pdf.internal.getNumberOfPages();
- for (let i = 1; i <= totalPages; i++) {
+ const pageWidth = pdf.internal.pageSize.getWidth();
+
+ for (let i = 2; i <= totalPages; i++) {
pdf.setPage(i);
pdf.setFontSize(10);
+
+ // ✅ Left side Account No
+ pdf.setFont("helvetica", "bold");
+ // pdf.text(`Account No: ${accountNo}`, 15, 18);
+
+ // ✅ Centered Statement Period
+ pdf.text(
+ `Statement Period: ${periodFrom} to ${periodTo}`,
+ pageWidth / 2,
+ 18,
+ { align: "center" }
+ );
+
+ // Footer page numbers
+ pdf.setFontSize(9);
pdf.text(
`Page ${i} of ${totalPages}`,
- pdf.internal.pageSize.getWidth() - 40,
+ pageWidth - 40,
pdf.internal.pageSize.getHeight() - 10
);
}
diff --git a/src/app/administrator/home/ViewUserConfiguration.tsx b/src/app/administrator/home/ViewUserConfiguration.tsx
index 0e5e7bf..2dc4bf8 100644
--- a/src/app/administrator/home/ViewUserConfiguration.tsx
+++ b/src/app/administrator/home/ViewUserConfiguration.tsx
@@ -126,7 +126,7 @@ export default function ViewUserRights() {
{new Date(userData.created_at).toLocaleString()}
- User Active Status:
+ User Status:
Active
|