Statement Reports
diff --git a/src/app/core/shell/shell.component.scss b/src/app/core/shell/shell.component.scss
index 3e6eb1510..0452ec107 100644
--- a/src/app/core/shell/shell.component.scss
+++ b/src/app/core/shell/shell.component.scss
@@ -538,6 +538,18 @@ $gray-700: #334155;
}
}
+/* Reconciliation Mega Panel — 5 columns, teal accent to match the icon palette */
+.reconciliation-grid {
+ grid-template-columns: repeat(5, minmax(190px, 1fr));
+ min-width: 1040px;
+ max-width: 96vw;
+
+ .deposit-group-title {
+ color: #0d9488;
+ border-bottom-color: #0d9488;
+ }
+}
+
/* General Ledger Mega Menu */
.gl-backdrop {
position: fixed;
diff --git a/src/app/core/shell/shell.component.ts b/src/app/core/shell/shell.component.ts
index 2b36d5041..4609ae038 100644
--- a/src/app/core/shell/shell.component.ts
+++ b/src/app/core/shell/shell.component.ts
@@ -26,6 +26,7 @@ import { ContentComponent } from './content/content.component';
import { FooterComponent } from '../../shared/footer/footer.component';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { MatMenuModule } from '@angular/material/menu';
+import { MatDividerModule } from '@angular/material/divider';
import { MatTooltipModule } from '@angular/material/tooltip';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@@ -50,6 +51,7 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
AsyncPipe,
FaIconComponent,
MatMenuModule,
+ MatDividerModule,
MatTooltipModule
]
})
diff --git a/src/app/letter-mgmt/certificates/balance-certificate/balance-certificate.component.ts b/src/app/letter-mgmt/certificates/balance-certificate/balance-certificate.component.ts
index ccfd806e5..b2b2b29e0 100644
--- a/src/app/letter-mgmt/certificates/balance-certificate/balance-certificate.component.ts
+++ b/src/app/letter-mgmt/certificates/balance-certificate/balance-certificate.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadBalanceCertificatePdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type BalanceAccountType = 'SAVINGS' | 'CURRENT' | 'FIXED_DEPOSIT' | 'RD' | 'NRE' | 'NRO';
@@ -60,6 +61,7 @@ export interface BalanceCertificateRecord {
export class BalanceCertificateComponent implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
// ── Filters ──
search = '';
@@ -126,8 +128,14 @@ export class BalanceCertificateComponent implements OnInit {
}
downloadCertificate(r: BalanceCertificateRecord): void {
- downloadBalanceCertificatePdf(r, this.asOnDate);
- this.snack.open(`Balance Certificate (${r.accountNo}) downloaded.`, 'OK', { duration: 2400 });
+ this.dscSign.promptThenDownload(
+ {
+ title: 'Balance Certificate',
+ reference: `${r.accountNo} · ${r.customerName} · as on ${this.asOnDate}`,
+ filename: `Balance-Certificate-${r.accountNo}-${this.asOnDate}.pdf`
+ },
+ (dsc) => downloadBalanceCertificatePdf(r, this.asOnDate, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/certificates/certificate-pdf.ts b/src/app/letter-mgmt/certificates/certificate-pdf.ts
index cbdcba191..939a556e5 100644
--- a/src/app/letter-mgmt/certificates/certificate-pdf.ts
+++ b/src/app/letter-mgmt/certificates/certificate-pdf.ts
@@ -15,6 +15,8 @@
import { jsPDF } from 'jspdf';
+import { BankUserDsc } from 'app/users/dsc/dsc.model';
+
import { FyInterestBreakup, LoanInterestRecord } from './loan-interest/loan-interest.component';
import { ShareCertificateRecord } from './share-certificate/share-certificate.component';
import { BalanceCertificateRecord } from './balance-certificate/balance-certificate.component';
@@ -394,6 +396,73 @@ function newCtx(accent: [number, number, number]): PdfCtx {
};
}
+/**
+ * Paint a "Digitally Signed" stamp + auditor footer line on the final page of
+ * the given doc. Stamp = green-bordered rounded box on the bottom-right with
+ * a ✓ icon, the signer's common name, masked DSC serial, and signing time.
+ * Audit line = thin teal strip under the existing footer with the same info
+ * in monospace, so the certificate also reads cleanly when printed in B/W.
+ *
+ * Call this just before `doc.save(...)` — it doesn't add a new page.
+ */
+export function paintDscSignatureStamp(doc: jsPDF, dsc: BankUserDsc): void {
+ const pageW = doc.internal.pageSize.getWidth();
+ const pageH = doc.internal.pageSize.getHeight();
+ const margin = 20;
+ const signedAt = new Date();
+ const pad = (n: number) => String(n).padStart(2, '0');
+ const ts = `${signedAt.getFullYear()}-${pad(signedAt.getMonth() + 1)}-${pad(signedAt.getDate())} ${pad(signedAt.getHours())}:${pad(signedAt.getMinutes())}:${pad(signedAt.getSeconds())}`;
+
+ // ── Bottom-right rounded green stamp ──
+ const sW = 68;
+ const sH = 22;
+ const sX = pageW - margin - sW;
+ const sY = pageH - margin - sH - 4;
+
+ // Tint background + green border (slight rounding gives it a "stamped" feel)
+ doc.setFillColor(220, 252, 231); // green-100
+ doc.setDrawColor(21, 128, 61); // green-700
+ doc.setLineWidth(0.6);
+ doc.roundedRect(sX, sY, sW, sH, 2, 2, 'FD');
+
+ // ✓ icon + heading
+ doc.setFont('helvetica', 'bold');
+ doc.setFontSize(9);
+ doc.setTextColor(21, 128, 61);
+ doc.text('✓ DIGITALLY SIGNED', sX + 3, sY + 5);
+
+ // Signer name (Common Name)
+ doc.setFont('helvetica', 'bold');
+ doc.setFontSize(8.5);
+ doc.setTextColor(15, 23, 42);
+ doc.text(dsc.commonName, sX + 3, sY + 10);
+
+ // DSC serial (masked) + type
+ doc.setFont('courier', 'normal');
+ doc.setFontSize(7);
+ doc.setTextColor(71, 85, 105);
+ doc.text(`DSC ${dsc.dscSerialNoMasked}`, sX + 3, sY + 14);
+
+ doc.setFont('helvetica', 'normal');
+ doc.setFontSize(6.5);
+ doc.setTextColor(100, 116, 139);
+ doc.text(dsc.dscType, sX + 3, sY + 17.5);
+ doc.text(`Signed at ${ts}`, sX + 3, sY + 20.5);
+
+ // ── Audit footer line (thin teal strip just below the existing footer) ──
+ const fY = pageH - margin + 2;
+ doc.setFillColor(204, 251, 241); // teal-100
+ doc.rect(margin, fY, pageW - margin * 2, 4, 'F');
+ doc.setFont('courier', 'normal');
+ doc.setFontSize(7);
+ doc.setTextColor(13, 148, 136); // teal-600
+ doc.text(
+ `[SIGNED] ${dsc.commonName} · DSC ${dsc.dscSerialNoMasked} · Issued by ${dsc.issuedBy.slice(0, 38)} · ${ts}`,
+ margin + 2,
+ fY + 2.8
+ );
+}
+
// ───────────────────── Loan Interest Certificate ─────────────────────
export function buildLoanInterestPdf(record: LoanInterestRecord, fy: FyInterestBreakup): jsPDF {
const c = newCtx(ACCENT_BLUE);
@@ -467,8 +536,9 @@ export function buildLoanInterestPdf(record: LoanInterestRecord, fy: FyInterestB
return c.doc;
}
-export function downloadLoanInterestPdf(record: LoanInterestRecord, fy: FyInterestBreakup): void {
+export function downloadLoanInterestPdf(record: LoanInterestRecord, fy: FyInterestBreakup, dsc?: BankUserDsc): void {
const doc = buildLoanInterestPdf(record, fy);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`Interest-Certificate-${record.accountNo}-${fy.fy.replace(/\s+/g, '')}.pdf`);
}
@@ -552,8 +622,9 @@ export function buildShareCertificatePdf(r: ShareCertificateRecord): jsPDF {
return c.doc;
}
-export function downloadShareCertificatePdf(r: ShareCertificateRecord): void {
+export function downloadShareCertificatePdf(r: ShareCertificateRecord, dsc?: BankUserDsc): void {
const doc = buildShareCertificatePdf(r);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`Share-Certificate-${r.certificateNo}.pdf`);
}
@@ -645,8 +716,9 @@ export function buildBalanceCertificatePdf(r: BalanceCertificateRecord, asOnDate
return c.doc;
}
-export function downloadBalanceCertificatePdf(r: BalanceCertificateRecord, asOnDate: string): void {
+export function downloadBalanceCertificatePdf(r: BalanceCertificateRecord, asOnDate: string, dsc?: BankUserDsc): void {
const doc = buildBalanceCertificatePdf(r, asOnDate);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`Balance-Certificate-${r.accountNo}-${asOnDate}.pdf`);
}
@@ -736,8 +808,9 @@ export function buildForm60Pdf(r: Form60Record): jsPDF {
return c.doc;
}
-export function downloadForm60Pdf(r: Form60Record): void {
+export function downloadForm60Pdf(r: Form60Record, dsc?: BankUserDsc): void {
const doc = buildForm60Pdf(r);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`Form-60-${r.customerId}.pdf`);
}
@@ -830,8 +903,9 @@ export function buildForm15ghPdf(r: Form15ghRecord, kind: Form15Kind): jsPDF {
return c.doc;
}
-export function downloadForm15ghPdf(r: Form15ghRecord, kind: Form15Kind): void {
+export function downloadForm15ghPdf(r: Form15ghRecord, kind: Form15Kind, dsc?: BankUserDsc): void {
const doc = buildForm15ghPdf(r, kind);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`Form-${kind}-${r.customerId}-${r.fy.replace(/\s+/g, '')}.pdf`);
}
@@ -922,8 +996,9 @@ export function buildHypothecationPdf(r: HypothecationRecord): jsPDF {
return c.doc;
}
-export function downloadHypothecationPdf(r: HypothecationRecord): void {
+export function downloadHypothecationPdf(r: HypothecationRecord, dsc?: BankUserDsc): void {
const doc = buildHypothecationPdf(r);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`Hypothecation-${r.certificateNo}.pdf`);
}
@@ -1052,7 +1127,8 @@ export function buildNocPdf(r: NocRecord): jsPDF {
return c.doc;
}
-export function downloadNocPdf(r: NocRecord): void {
+export function downloadNocPdf(r: NocRecord, dsc?: BankUserDsc): void {
const doc = buildNocPdf(r);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`NOC-${r.nocNo}.pdf`);
}
diff --git a/src/app/letter-mgmt/certificates/form-15gh/form-15gh.component.ts b/src/app/letter-mgmt/certificates/form-15gh/form-15gh.component.ts
index ac158ee14..c6d96840c 100644
--- a/src/app/letter-mgmt/certificates/form-15gh/form-15gh.component.ts
+++ b/src/app/letter-mgmt/certificates/form-15gh/form-15gh.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadForm15ghPdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type Form15Kind = '15G' | '15H';
export type Form15Status = 'FILED' | 'PENDING';
@@ -60,6 +61,7 @@ export interface Form15ghRecord {
export class Form15ghComponent implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
// ── Filters ──
search = '';
@@ -141,8 +143,15 @@ export class Form15ghComponent implements OnInit {
}
downloadCertificate(r: Form15ghRecord): void {
- downloadForm15ghPdf(r, this.formKind(r));
- this.snack.open(`Form ${this.formKind(r)} for ${r.customerName} downloaded.`, 'OK', { duration: 2400 });
+ const kind = this.formKind(r);
+ this.dscSign.promptThenDownload(
+ {
+ title: `Form ${kind} Declaration`,
+ reference: `${r.customerId} · ${r.customerName} · ${r.fy}`,
+ filename: `Form-${kind}-${r.customerId}-${r.fy.replace(/\s+/g, '')}.pdf`
+ },
+ (dsc) => downloadForm15ghPdf(r, kind, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/certificates/form-60/form-60.component.ts b/src/app/letter-mgmt/certificates/form-60/form-60.component.ts
index 335cdc762..5c297b747 100644
--- a/src/app/letter-mgmt/certificates/form-60/form-60.component.ts
+++ b/src/app/letter-mgmt/certificates/form-60/form-60.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadForm60Pdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type Form60IdProofType = 'AADHAAR' | 'VOTER_ID' | 'DRIVING_LICENSE' | 'PASSPORT' | 'RATION';
@@ -59,6 +60,7 @@ export interface Form60Record {
export class Form60Component implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
// ── Filters ──
search = '';
@@ -142,8 +144,14 @@ export class Form60Component implements OnInit {
});
return;
}
- downloadForm60Pdf(r);
- this.snack.open(`Form 60 for ${r.customerName} downloaded.`, 'OK', { duration: 2400 });
+ this.dscSign.promptThenDownload(
+ {
+ title: 'Form 60 Declaration',
+ reference: `${r.customerId} · ${r.customerName}`,
+ filename: `Form60-${r.customerId}.pdf`
+ },
+ (dsc) => downloadForm60Pdf(r, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/certificates/hypothecation/hypothecation.component.ts b/src/app/letter-mgmt/certificates/hypothecation/hypothecation.component.ts
index 28f664fcf..5d6df098a 100644
--- a/src/app/letter-mgmt/certificates/hypothecation/hypothecation.component.ts
+++ b/src/app/letter-mgmt/certificates/hypothecation/hypothecation.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadHypothecationPdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type HypoAssetType = 'VEHICLE' | 'PLANT_MACHINERY' | 'STOCK_DEBTORS' | 'GOLD' | 'EQUIPMENT';
export type HypoStatus = 'ACTIVE' | 'CLOSED' | 'NOC_ISSUED';
@@ -63,6 +64,7 @@ export interface HypothecationRecord {
export class HypothecationCertificateComponent implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
search = '';
assetFilter: '' | HypoAssetType = '';
@@ -133,10 +135,14 @@ export class HypothecationCertificateComponent implements OnInit {
}
downloadCertificate(r: HypothecationRecord): void {
- downloadHypothecationPdf(r);
- this.snack.open(`Hypothecation Certificate ${r.certificateNo} downloaded.`, 'OK', {
- duration: 2400
- });
+ this.dscSign.promptThenDownload(
+ {
+ title: 'Hypothecation Certificate',
+ reference: `${r.certificateNo} · ${r.accountNo} · ${r.customerName}`,
+ filename: `Hypothecation-Certificate-${r.certificateNo}.pdf`
+ },
+ (dsc) => downloadHypothecationPdf(r, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/certificates/loan-interest/loan-interest.component.ts b/src/app/letter-mgmt/certificates/loan-interest/loan-interest.component.ts
index d3af41347..cb43edc01 100644
--- a/src/app/letter-mgmt/certificates/loan-interest/loan-interest.component.ts
+++ b/src/app/letter-mgmt/certificates/loan-interest/loan-interest.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadLoanInterestPdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type LoanProductType = 'HOUSING' | 'PERSONAL' | 'AUTO' | 'EDUCATION' | 'GOLD' | 'BUSINESS';
@@ -62,6 +63,7 @@ export interface LoanInterestRecord {
export class LoanInterestCertificateComponent implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
// ── Filters ──
search = '';
@@ -161,8 +163,14 @@ export class LoanInterestCertificateComponent implements OnInit {
this.snack.open('No interest data on file for the selected financial year.', 'OK', { duration: 2500 });
return;
}
- downloadLoanInterestPdf(l, fy);
- this.snack.open(`Interest Certificate (${fy.fy}) downloaded.`, 'OK', { duration: 2400 });
+ this.dscSign.promptThenDownload(
+ {
+ title: 'Interest Certificate',
+ reference: `${l.accountNo} · ${l.customerName} · ${fy.fy}`,
+ filename: `Interest-Certificate-${l.accountNo}-${fy.fy.replace(/\s+/g, '')}.pdf`
+ },
+ (dsc) => downloadLoanInterestPdf(l, fy, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/certificates/noc/noc.component.ts b/src/app/letter-mgmt/certificates/noc/noc.component.ts
index 7221e6d04..0bfb0922b 100644
--- a/src/app/letter-mgmt/certificates/noc/noc.component.ts
+++ b/src/app/letter-mgmt/certificates/noc/noc.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadNocPdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type NocLoanType = 'AUTO' | 'HOUSING' | 'PERSONAL' | 'EDUCATION' | 'GOLD' | 'BUSINESS' | 'CC' | 'OD';
@@ -67,6 +68,7 @@ export interface NocRecord {
export class NocCertificateComponent implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
// ── Filters ──
search = '';
@@ -158,8 +160,14 @@ export class NocCertificateComponent implements OnInit {
);
return;
}
- downloadNocPdf(r);
- this.snack.open(`NOC ${r.nocNo} downloaded.`, 'OK', { duration: 2400 });
+ this.dscSign.promptThenDownload(
+ {
+ title: 'No-Objection Certificate (NOC)',
+ reference: `${r.nocNo} · ${r.accountNo} · ${r.customerName}`,
+ filename: `NOC-${r.nocNo}.pdf`
+ },
+ (dsc) => downloadNocPdf(r, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/certificates/share-certificate/share-certificate.component.ts b/src/app/letter-mgmt/certificates/share-certificate/share-certificate.component.ts
index bccc5c0fc..7dc0e3dd4 100644
--- a/src/app/letter-mgmt/certificates/share-certificate/share-certificate.component.ts
+++ b/src/app/letter-mgmt/certificates/share-certificate/share-certificate.component.ts
@@ -20,6 +20,7 @@ import {
CertificatePreviewDialogData
} from '../certificate-preview-dialog/certificate-preview-dialog.component';
import { downloadShareCertificatePdf } from '../certificate-pdf';
+import { DscSignService } from '../../dsc-sign-dialog/dsc-sign.service';
export type ShareClass = 'ORDINARY' | 'PREFERENCE';
@@ -58,6 +59,7 @@ export interface ShareCertificateRecord {
export class ShareCertificateComponent implements OnInit {
private dialog = inject(MatDialog);
private snack = inject(MatSnackBar);
+ private dscSign = inject(DscSignService);
// ── Filters ──
search = '';
@@ -132,8 +134,14 @@ export class ShareCertificateComponent implements OnInit {
}
downloadCertificate(r: ShareCertificateRecord): void {
- downloadShareCertificatePdf(r);
- this.snack.open(`Share Certificate ${r.certificateNo} downloaded.`, 'OK', { duration: 2400 });
+ this.dscSign.promptThenDownload(
+ {
+ title: 'Share Certificate',
+ reference: `${r.certificateNo} · Folio ${r.folioNo} · ${r.memberName}`,
+ filename: `Share-Certificate-${r.certificateNo}.pdf`
+ },
+ (dsc) => downloadShareCertificatePdf(r, dsc)
+ );
}
}
diff --git a/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.html b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.html
new file mode 100644
index 000000000..38665591a
--- /dev/null
+++ b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.html
@@ -0,0 +1,209 @@
+
+
+
+
+
+
+
+
+
Sign & Download
+
{{ data.title }} · {{ data.reference }}
+
+
+
+
+
+
+ {{ displayName }}
+ @{{ username }}
+
+
+
+
+
+
+
+ @if (loading) {
+
+
+
+
+ Checking DSC mapping…
+
+ Looking up the certificate mapped to {{ username }}.
+
+
+
+ }
+
+
+ @if (!loading && dscMapped && dsc) {
+
+
+
+
+ DSC Mapped
+
+ Your DSC is ready to digitally sign this document.
+
+
+
+
+
+
+
+
{{ dsc.commonName }}
+
{{ dsc.dscType }}
+
+
+ {{ dsc.certStatus }}
+
+
+
+
+
+ Issued To
+ {{ dsc.issuedTo }}
+
+
+ Issued By
+ {{ dsc.issuedBy }}
+
+
+ Serial No.
+ {{ dsc.dscSerialNoMasked }}
+
+
+ Mapped On
+ {{ dsc.dateOfSubmission | date: 'd MMM y' }}
+
+
+ Expires On
+
+ {{ dsc.dscExpiryDate | date: 'd MMM y' }}
+ @if (daysToExpiry > 0) {
+
+ {{ daysToExpiry }} days left
+
+ } @else {
+ Expired
+ }
+
+
+
+
+
+
+
+
+
+
File to sign & download
+
{{ data.filename }}
+
+
+
+
+
+
+
+
+
+ }
+
+
+ @if (!loading && !dscMapped) {
+
+
+
+
+ DSC Not Mapped
+
+
+ No active Digital Signature Certificate is mapped to {{ displayName }} (@{{ username }}).
+
+
+
+
+
+
+
+
+
+
{{ displayName }}
+
+ @{{ username }}
+ ·
+ Signed-in operator
+
+ @if (inactiveDsc) {
+
+
+ Last DSC on file: {{ inactiveDsc.commonName }}
+ ({{ inactiveDsc.dscSerialNoMasked }})
+ — {{ inactiveDsc.certStatus }}
+ @if (inactiveDsc.dscExpiryDate) {
+ on {{ inactiveDsc.dscExpiryDate | date: 'd MMM y' }}
+ }
+
+ }
+
+
+
+
+
+
+
Why map a DSC?
+
+ A digitally signed PDF carries cryptographic proof of authorship and tamper-evidence for regulators,
+ auditors, and customers. Map your Class 3 Individual DSC once — then sign every certificate / notice
+ you issue from this terminal.
+
+
+
+
+
+
+
+
+
+ }
+
diff --git a/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.scss b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.scss
new file mode 100644
index 000000000..ec99aab49
--- /dev/null
+++ b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.scss
@@ -0,0 +1,609 @@
+/**
+ * Copyright since 2025 Mifos Initiative
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+:host {
+ --dsd-blue: #1d4ed8;
+ --dsd-blue-d: #1e40af;
+ --dsd-blue-l: #eff6ff;
+ --dsd-blue-tint: #dbeafe;
+ --dsd-green: #15803d;
+ --dsd-green-l: #dcfce7;
+ --dsd-amber: #d97706;
+ --dsd-amber-l: #fef3c7;
+ --dsd-red: #b91c1c;
+ --dsd-red-l: #fee2e2;
+ --dsd-red-tint: #fecaca;
+ --dsd-purple: #6d28d9;
+ --dsd-purple-l: #ede9fe;
+ --dsd-g50: #f8fafc;
+ --dsd-g100: #f1f5f9;
+ --dsd-g200: #e2e8f0;
+ --dsd-g300: #cbd5e1;
+ --dsd-g500: #64748b;
+ --dsd-g700: #334155;
+ --dsd-g900: #0f172a;
+
+ display: block;
+}
+
+.dsd-root {
+ background: #fff;
+ padding: 16px 20px 18px;
+ width: 100%;
+ max-width: 580px;
+ max-height: 90vh;
+ display: flex;
+ flex-direction: column;
+ gap: 16px;
+ overflow: hidden;
+}
+
+.mono {
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
+}
+
+/* ───────── Header ───────── */
+.dsd-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 14px;
+ padding-bottom: 12px;
+ border-bottom: 1px solid var(--dsd-g200);
+}
+
+.dsd-head-l {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.dsd-head-ic {
+ width: 40px;
+ height: 40px;
+ flex-shrink: 0;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 12px;
+ background: var(--dsd-purple);
+ color: #fff;
+ font-size: 17px;
+}
+
+.dsd-head-t {
+ margin: 0;
+ font-size: 16px;
+ font-weight: 800;
+ color: var(--dsd-g900);
+ line-height: 1.2;
+}
+
+.dsd-head-s {
+ margin-top: 3px;
+ font-size: 11.5px;
+ color: var(--dsd-g500);
+}
+
+.dsd-head-r {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-shrink: 0;
+}
+
+.dsd-who {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ padding: 5px 10px 5px 7px;
+ border-radius: 999px;
+ background: var(--dsd-blue-l);
+ border: 1px solid var(--dsd-blue-tint);
+ max-width: 200px;
+}
+
+.dsd-who-ic {
+ width: 24px;
+ height: 24px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 50%;
+ background: var(--dsd-blue-d);
+ color: #fff;
+ font-size: 11px;
+ flex-shrink: 0;
+}
+
+.dsd-who-txt {
+ display: flex;
+ flex-direction: column;
+ line-height: 1.1;
+ min-width: 0;
+}
+
+.dsd-who-name {
+ font-size: 11.5px;
+ font-weight: 700;
+ color: var(--dsd-g900);
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.dsd-who-uname {
+ font-size: 10px;
+ color: var(--dsd-blue-d);
+ margin-top: 1px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.dsd-x {
+ width: 32px;
+ height: 32px;
+ border-radius: 999px;
+ border: 1px solid var(--dsd-g200);
+ background: #fff;
+ color: var(--dsd-g500);
+ cursor: pointer;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ font-size: 13px;
+ flex-shrink: 0;
+ transition: all 0.12s ease;
+
+ &:hover {
+ background: var(--dsd-red-l);
+ color: var(--dsd-red);
+ border-color: var(--dsd-red-tint);
+ }
+}
+
+/* ───────── Body ───────── */
+.dsd-body {
+ display: flex;
+ flex-direction: column;
+ gap: 14px;
+ overflow-y: auto;
+ padding-right: 2px;
+}
+
+/* Status row at the top of body */
+.dsd-status-row {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ flex-wrap: wrap;
+}
+
+.dsd-status-pill {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ padding: 4px 11px;
+ border-radius: 999px;
+ font-size: 11px;
+ font-weight: 800;
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+
+ fa-icon {
+ font-size: 10px;
+ }
+
+ &--ok {
+ background: var(--dsd-green-l);
+ color: var(--dsd-green);
+ border: 1px solid #bbf7d0;
+ }
+
+ &--warn {
+ background: var(--dsd-amber-l);
+ color: var(--dsd-amber);
+ border: 1px solid #fde68a;
+ }
+
+ &--muted {
+ background: var(--dsd-blue-l);
+ color: var(--dsd-blue-d);
+ border: 1px solid var(--dsd-blue-tint);
+ }
+}
+
+.dsd-status-meta {
+ font-size: 12px;
+ color: var(--dsd-g500);
+}
+
+/* ───────── DSC details card ───────── */
+.dsd-card {
+ border: 1px solid var(--dsd-g200);
+ border-radius: 12px;
+ background: linear-gradient(180deg, #fafbff 0%, #fff 60%);
+ overflow: hidden;
+}
+
+.dsd-card-h {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 12px 14px;
+ border-bottom: 1px solid var(--dsd-g200);
+ background: var(--dsd-purple-l);
+}
+
+.dsd-card-h-ic {
+ width: 32px;
+ height: 32px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 9px;
+ background: var(--dsd-purple);
+ color: #fff;
+ font-size: 14px;
+ flex-shrink: 0;
+}
+
+.dsd-card-name {
+ font-size: 14px;
+ font-weight: 800;
+ color: var(--dsd-g900);
+ line-height: 1.2;
+}
+
+.dsd-card-type {
+ font-size: 11px;
+ color: var(--dsd-g500);
+ margin-top: 2px;
+}
+
+.dsd-cert-pill {
+ margin-left: auto;
+ padding: 3px 10px;
+ border-radius: 999px;
+ font-size: 10px;
+ font-weight: 800;
+ letter-spacing: 0.05em;
+ text-transform: uppercase;
+ background: var(--dsd-g100);
+ color: var(--dsd-g700);
+
+ &--ok {
+ background: var(--dsd-green-l);
+ color: var(--dsd-green);
+ }
+
+ &--warn {
+ background: var(--dsd-amber-l);
+ color: var(--dsd-amber);
+ }
+
+ &--bad {
+ background: var(--dsd-red-l);
+ color: var(--dsd-red);
+ }
+}
+
+.dsd-card-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 10px 14px;
+ padding: 12px 14px;
+}
+
+.dsd-span-2 {
+ grid-column: 1 / -1;
+}
+
+.dsd-card-l {
+ display: block;
+ font-size: 9.5px;
+ font-weight: 700;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ color: var(--dsd-g500);
+ margin-bottom: 2px;
+}
+
+.dsd-card-v {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ font-size: 12.5px;
+ font-weight: 600;
+ color: var(--dsd-g900);
+ word-break: break-word;
+}
+
+.dsd-expiry-chip {
+ padding: 2px 8px;
+ border-radius: 999px;
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.04em;
+ text-transform: uppercase;
+
+ &--ok {
+ background: var(--dsd-green-l);
+ color: var(--dsd-green);
+ }
+
+ &--warn {
+ background: var(--dsd-amber-l);
+ color: var(--dsd-amber);
+ }
+
+ &--bad {
+ background: var(--dsd-red-l);
+ color: var(--dsd-red);
+ }
+}
+
+/* ───────── File chip ───────── */
+.dsd-file-chip {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ padding: 10px 14px;
+ border-radius: 10px;
+ background: var(--dsd-blue-l);
+ border: 1px solid var(--dsd-blue-tint);
+}
+
+.dsd-file-ic {
+ width: 32px;
+ height: 32px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 9px;
+ background: var(--dsd-blue-d);
+ color: #fff;
+ font-size: 13px;
+ flex-shrink: 0;
+}
+
+.dsd-file-info {
+ min-width: 0;
+ flex: 1;
+}
+
+.dsd-file-l {
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.06em;
+ text-transform: uppercase;
+ color: var(--dsd-blue-d);
+}
+
+.dsd-file-v {
+ font-size: 12.5px;
+ font-weight: 700;
+ color: var(--dsd-g900);
+ word-break: break-all;
+ margin-top: 2px;
+}
+
+/* ───────── Empty (not-mapped) state ───────── */
+.dsd-empty {
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+ padding: 14px 16px;
+ border: 1px dashed var(--dsd-g300);
+ border-radius: 10px;
+ background: var(--dsd-g50);
+ color: var(--dsd-g700);
+
+ p {
+ margin: 6px 0 0;
+ font-size: 12.5px;
+ color: var(--dsd-g500);
+ line-height: 1.5;
+ }
+}
+
+.dsd-empty-ic {
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ background: var(--dsd-purple-l);
+ color: var(--dsd-purple);
+ font-size: 16px;
+ flex-shrink: 0;
+}
+
+/* ───────── Footer actions ───────── */
+.dsd-actions {
+ display: flex;
+ justify-content: flex-end;
+ gap: 10px;
+ padding-top: 6px;
+}
+
+.dsd-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ height: 38px;
+ padding: 0 18px;
+ border-radius: 9px;
+ border: 1px solid var(--dsd-g200);
+ background: #fff;
+ color: var(--dsd-g700);
+ font-size: 13px;
+ font-weight: 700;
+ letter-spacing: 0.01em;
+ cursor: pointer;
+ transition: all 0.12s ease;
+
+ fa-icon {
+ font-size: 12px;
+ }
+
+ &--ghost {
+ background: #fff;
+ color: var(--dsd-g700);
+ border-color: var(--dsd-g200);
+
+ fa-icon {
+ color: var(--dsd-g500);
+ }
+
+ &:hover {
+ background: var(--dsd-g50);
+ border-color: var(--dsd-g300);
+ color: var(--dsd-g900);
+ }
+ }
+
+ &--primary {
+ background: linear-gradient(135deg, var(--dsd-purple) 0%, var(--dsd-blue-d) 100%);
+ color: #fff;
+ border-color: var(--dsd-blue-d);
+ box-shadow: 0 2px 6px -2px rgb(29 78 216 / 35%);
+
+ fa-icon {
+ color: #fff;
+ }
+
+ &:hover {
+ background: linear-gradient(135deg, #5b21b6 0%, #1e3a8a 100%);
+ box-shadow: 0 4px 12px -3px rgb(29 78 216 / 45%);
+ }
+ }
+}
+
+/* ───────── Loading skeleton ───────── */
+.dsd-body--loading {
+ min-height: 120px;
+}
+
+.dsd-skeleton {
+ display: flex;
+ flex-direction: column;
+ gap: 10px;
+ padding: 4px 2px;
+}
+
+.dsd-skel {
+ height: 14px;
+ border-radius: 6px;
+ background: linear-gradient(90deg, var(--dsd-g100) 0%, var(--dsd-g200) 50%, var(--dsd-g100) 100%);
+ background-size: 200% 100%;
+ animation: dsd-shimmer 1.4s linear infinite;
+
+ &--h {
+ height: 28px;
+ border-radius: 8px;
+ width: 60%;
+ }
+}
+
+.dsd-skel-grid {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 8px 14px;
+
+ .dsd-skel {
+ height: 32px;
+ border-radius: 8px;
+ }
+}
+
+@keyframes dsd-shimmer {
+ 0% {
+ background-position: 200% 0;
+ }
+
+ 100% {
+ background-position: -200% 0;
+ }
+}
+
+/* ───────── Operator card (not-mapped state) ───────── */
+.dsd-op-card {
+ display: flex;
+ align-items: flex-start;
+ gap: 12px;
+ padding: 12px 14px;
+ border-radius: 12px;
+ background: linear-gradient(135deg, #eef2ff 0%, var(--dsd-blue-l) 100%);
+ border: 1px solid var(--dsd-blue-tint);
+}
+
+.dsd-op-avatar {
+ width: 38px;
+ height: 38px;
+ border-radius: 50%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ background: linear-gradient(135deg, var(--dsd-blue-d) 0%, var(--dsd-purple) 100%);
+ color: #fff;
+ font-size: 16px;
+ flex-shrink: 0;
+ box-shadow: 0 2px 6px -2px rgb(29 78 216 / 40%);
+}
+
+.dsd-op-body {
+ flex: 1;
+ min-width: 0;
+}
+
+.dsd-op-name {
+ font-size: 13.5px;
+ font-weight: 800;
+ color: var(--dsd-g900);
+ line-height: 1.2;
+}
+
+.dsd-op-meta {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ margin-top: 2px;
+ font-size: 11px;
+ color: var(--dsd-g500);
+ font-weight: 600;
+}
+
+.dsd-op-sep {
+ color: var(--dsd-g300);
+}
+
+.dsd-op-prev {
+ margin-top: 8px;
+ padding-top: 8px;
+ border-top: 1px dashed var(--dsd-blue-tint);
+ font-size: 11.5px;
+ color: var(--dsd-g700);
+
+ fa-icon {
+ color: var(--dsd-amber);
+ margin-right: 6px;
+ }
+
+ strong {
+ color: var(--dsd-g900);
+ }
+
+ em {
+ font-style: normal;
+ font-weight: 700;
+ color: var(--dsd-amber);
+ }
+}
diff --git a/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.ts b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.ts
new file mode 100644
index 000000000..ba4ffe905
--- /dev/null
+++ b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign-dialog.component.ts
@@ -0,0 +1,140 @@
+/**
+ * Copyright since 2025 Mifos Initiative
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+import { Component, inject, OnInit } from '@angular/core';
+import { CommonModule } from '@angular/common';
+import { FaIconComponent } from '@fortawesome/angular-fontawesome';
+import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
+import { MatTooltip } from '@angular/material/tooltip';
+import { MatSnackBar } from '@angular/material/snack-bar';
+import { Router } from '@angular/router';
+import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
+
+import { AuthenticationService } from 'app/core/authentication/authentication.service';
+import { DscService } from 'app/users/dsc/dsc.service';
+import { BankUserDsc } from 'app/users/dsc/dsc.model';
+
+export interface DscSignDialogData {
+ /** Short title shown in the dialog header, e.g. "Interest Certificate". */
+ title: string;
+ /** Reference line shown under the title, e.g. account no / customer ID. */
+ reference: string;
+ /** Filename that will be downloaded — shown so the user knows what they're getting. */
+ filename: string;
+}
+
+export type DscSignDialogAction = 'sign' | 'skip' | 'map' | 'cancel';
+
+export interface DscSignDialogResult {
+ action: DscSignDialogAction;
+ /** Populated when action === 'sign' — the DSC used for signing. */
+ dsc?: BankUserDsc;
+}
+
+@Component({
+ selector: 'mifosx-dsc-sign-dialog',
+ templateUrl: './dsc-sign-dialog.component.html',
+ styleUrls: ['./dsc-sign-dialog.component.scss'],
+ imports: [
+ ...STANDALONE_SHARED_IMPORTS,
+ CommonModule,
+ FaIconComponent,
+ MatTooltip
+ ]
+})
+export class DscSignDialogComponent implements OnInit {
+ private dialogRef = inject(MatDialogRef
);
+ private snack = inject(MatSnackBar);
+ private router = inject(Router);
+ private authService = inject(AuthenticationService);
+ private dscService = inject(DscService);
+ data: DscSignDialogData = inject(MAT_DIALOG_DATA);
+
+ /** Logged-in operator's username — shown on the "not mapped" state. */
+ username = '';
+
+ /** Operator's full name from credentials, if available. */
+ displayName = '';
+
+ /** Loading flag while we hit /v1/dsc/me. */
+ loading = true;
+
+ /** Active DSC on file for the current user — null if none / API error. */
+ dsc: BankUserDsc | null = null;
+
+ /** Most recent DSC if mapped but expired/revoked — shown as a hint. */
+ inactiveDsc: BankUserDsc | null = null;
+
+ ngOnInit(): void {
+ const creds = this.authService.getCredentials();
+ this.username = creds?.username || 'unknown user';
+ // Prefer the staff display name (e.g. "Aditya Sharma") over the bare username,
+ // falling back to the username when no staff record is linked to the user.
+ this.displayName = creds?.staffDisplayName?.trim() || this.username;
+
+ this.dscService.listMyDscs().subscribe({
+ next: (rows) => {
+ const active = (rows || []).find((r) => r.certStatus === 'ACTIVE');
+ const fallback = (rows || []).find((r) => !!r);
+ this.dsc = active || null;
+ this.inactiveDsc = active ? null : fallback || null;
+ this.loading = false;
+ },
+ error: () => {
+ // Endpoint missing / 404 / network — treat as "not mapped" so the user
+ // can still choose to download unsigned or kick off the map flow.
+ this.dsc = null;
+ this.inactiveDsc = null;
+ this.loading = false;
+ }
+ });
+ }
+
+ /** True once we know the answer AND there's an active DSC on file. */
+ get dscMapped(): boolean {
+ return !this.loading && this.dsc !== null;
+ }
+
+ /** Days remaining until the DSC expires (negative = already expired). */
+ get daysToExpiry(): number {
+ if (!this.dsc) return 0;
+ const exp = new Date(this.dsc.dscExpiryDate);
+ const today = new Date();
+ return Math.floor((exp.getTime() - today.getTime()) / (1000 * 60 * 60 * 24));
+ }
+
+ get isExpiringSoon(): boolean {
+ return this.daysToExpiry > 0 && this.daysToExpiry < 60;
+ }
+
+ // ── Actions ──
+ signAndDownload(): void {
+ if (!this.dsc) return;
+ this.dialogRef.close({ action: 'sign', dsc: this.dsc });
+ }
+
+ skipSign(): void {
+ this.dialogRef.close({ action: 'skip' });
+ }
+
+ mapDsc(): void {
+ this.snack.open('Opening DSC enrollment — please connect your DSC token.', 'OK', { duration: 3000 });
+ this.dialogRef.close({ action: 'map' });
+ // The DSC enrollment dialog lives under the user-profile / access-control flow.
+ // Best-effort navigation; silently ignore if the route isn't registered.
+ this.router.navigate(['/access-control']).catch(() => {
+ this.router.navigate(['/users']).catch(() => {
+ /* silent */
+ });
+ });
+ }
+
+ cancel(): void {
+ this.dialogRef.close({ action: 'cancel' });
+ }
+}
diff --git a/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign.service.ts b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign.service.ts
new file mode 100644
index 000000000..56c74e4e7
--- /dev/null
+++ b/src/app/letter-mgmt/dsc-sign-dialog/dsc-sign.service.ts
@@ -0,0 +1,74 @@
+/**
+ * Copyright since 2025 Mifos Initiative
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+import { inject, Injectable } from '@angular/core';
+import { MatDialog } from '@angular/material/dialog';
+import { MatSnackBar } from '@angular/material/snack-bar';
+
+import { BankUserDsc } from 'app/users/dsc/dsc.model';
+
+import { DscSignDialogComponent, DscSignDialogData, DscSignDialogResult } from './dsc-sign-dialog.component';
+
+/**
+ * Bridges every Letter-Mgmt download button → DSC sign-or-skip dialog → PDF
+ * download. Components pass the file context and a single callback that knows
+ * how to build the PDF (with the dsc passed through to the PDF builder if the
+ * user chose to sign).
+ */
+@Injectable({ providedIn: 'root' })
+export class DscSignService {
+ private dialog = inject(MatDialog);
+ private snack = inject(MatSnackBar);
+
+ /**
+ * Opens the DSC sign dialog. The callback fires with `{ dsc }` when the
+ * user signs, with `{ dsc: undefined }` when they skip, and is NEVER called
+ * for cancel / map (we route map to the enrollment screen separately).
+ *
+ * Components call it like:
+ * this.dscSign.promptThenDownload(
+ * { title: 'Interest Certificate', reference: 'LN10029384 · FY 2024-25',
+ * filename: 'Interest-Certificate-LN10029384-FY2024-25.pdf' },
+ * (dsc) => downloadLoanInterestPdf(record, fy, dsc)
+ * );
+ */
+ promptThenDownload(ctx: DscSignDialogData, doDownload: (dsc?: BankUserDsc) => void): void {
+ const ref = this.dialog.open(
+ DscSignDialogComponent,
+ {
+ width: '620px',
+ maxWidth: '94vw',
+ maxHeight: '90vh',
+ autoFocus: false,
+ panelClass: 'dsd-dialog',
+ data: ctx
+ }
+ );
+
+ ref.afterClosed().subscribe((result) => {
+ if (!result) return;
+ switch (result.action) {
+ case 'sign':
+ doDownload(result.dsc);
+ this.snack.open(`Signed & downloaded · ${result.dsc?.commonName ?? 'DSC'} · ${ctx.filename}`, 'OK', {
+ duration: 3000
+ });
+ break;
+ case 'skip':
+ doDownload(undefined);
+ this.snack.open(`Downloaded unsigned · ${ctx.filename}`, 'OK', { duration: 2400 });
+ break;
+ case 'map':
+ case 'cancel':
+ default:
+ // Map handled inside the dialog; cancel = no-op.
+ break;
+ }
+ });
+ }
+}
diff --git a/src/app/letter-mgmt/letter-mgmt.module.ts b/src/app/letter-mgmt/letter-mgmt.module.ts
index 7ffbc06e6..20a063020 100644
--- a/src/app/letter-mgmt/letter-mgmt.module.ts
+++ b/src/app/letter-mgmt/letter-mgmt.module.ts
@@ -23,6 +23,7 @@ import { Form15ghComponent } from './certificates/form-15gh/form-15gh.component'
import { HypothecationCertificateComponent } from './certificates/hypothecation/hypothecation.component';
import { NocCertificateComponent } from './certificates/noc/noc.component';
import { CertificatePreviewDialogComponent } from './certificates/certificate-preview-dialog/certificate-preview-dialog.component';
+import { DscSignDialogComponent } from './dsc-sign-dialog/dsc-sign-dialog.component';
@NgModule({
imports: [
@@ -40,7 +41,8 @@ import { CertificatePreviewDialogComponent } from './certificates/certificate-pr
Form15ghComponent,
HypothecationCertificateComponent,
NocCertificateComponent,
- CertificatePreviewDialogComponent
+ CertificatePreviewDialogComponent,
+ DscSignDialogComponent
]
})
export class LetterMgmtModule {}
diff --git a/src/app/letter-mgmt/notice/notice.component.ts b/src/app/letter-mgmt/notice/notice.component.ts
index 65d899b67..f7997a303 100644
--- a/src/app/letter-mgmt/notice/notice.component.ts
+++ b/src/app/letter-mgmt/notice/notice.component.ts
@@ -15,8 +15,11 @@ import { MatMenu, MatMenuContent, MatMenuItem, MatMenuTrigger } from '@angular/m
import { MatSnackBar } from '@angular/material/snack-bar';
import { MatTooltip } from '@angular/material/tooltip';
import { jsPDF } from 'jspdf';
+import { BankUserDsc } from 'app/users/dsc/dsc.model';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
+import { paintDscSignatureStamp } from '../certificates/certificate-pdf';
+
import {
NoticeHistoryDialogComponent,
NoticeHistoryDialogData
@@ -26,6 +29,7 @@ import {
NoticePreviewDialogData
} from './notice-preview-dialog/notice-preview-dialog.component';
import { CallContactDialogComponent, CallContactDialogData } from './call-contact-dialog/call-contact-dialog.component';
+import { DscSignService } from '../dsc-sign-dialog/dsc-sign.service';
import {
SpeedPostDialogComponent,
SpeedPostDialogData,
@@ -140,6 +144,7 @@ export interface OverdueLoan {
export class NoticeComponent implements OnInit {
private snack = inject(MatSnackBar);
private dialog = inject(MatDialog);
+ private dscSign = inject(DscSignService);
// ─── Filters ───
search = '';
@@ -450,10 +455,16 @@ export class NoticeComponent implements OnInit {
this.downloadNoticeFile(loan, latest);
}
- /** Generates and downloads the notice PDF using jsPDF. */
+ /** Prompts for DSC signing, then generates and downloads the notice PDF. */
downloadNoticeFile(loan: OverdueLoan, notice: NoticeEvent): void {
- downloadNoticePdf(loan, notice);
- this.snack.open(`Notice ${notice.id} downloaded as PDF.`, 'OK', { duration: 2200 });
+ this.dscSign.promptThenDownload(
+ {
+ title: `${this.stageLabel(notice.stage)} Notice`,
+ reference: `${loan.accountNo} · ${loan.customerName}`,
+ filename: `${notice.id}-${loan.accountNo}-Notice.pdf`
+ },
+ (dsc) => downloadNoticePdf(loan, notice, dsc)
+ );
}
/**
@@ -1083,9 +1094,11 @@ function formatLongDate(iso: string): string {
return d.toLocaleDateString('en-IN', { day: 'numeric', month: 'long', year: 'numeric' });
}
-/** Convenience: build the PDF and trigger a download with a sensible filename. */
-export function downloadNoticePdf(loan: OverdueLoan, notice: NoticeEvent): void {
+/** Convenience: build the PDF and trigger a download with a sensible filename.
+ Pass a `dsc` to stamp the document with a DSC signature block. */
+export function downloadNoticePdf(loan: OverdueLoan, notice: NoticeEvent, dsc?: BankUserDsc): void {
const doc = buildNoticePdf(loan, notice);
+ if (dsc) paintDscSignatureStamp(doc, dsc);
doc.save(`${notice.id}-${loan.accountNo}-Notice.pdf`);
}
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index 746454811..435682c8d 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -246,7 +246,7 @@ export class LoginComponent implements OnInit, OnDestroy {
/** Subscription to alerts. */
alert$: Subscription;
logoPath = 'assets/images/cbsnexora-logo.png';
- logoPathDark = 'assets/images/white-mifos.png';
+ logoPathDark = 'assets/images/cbsnexora-logo.png';
/** Subscription to theme changes. */
theme$: Subscription;
@@ -421,7 +421,9 @@ export class LoginComponent implements OnInit, OnDestroy {
if (environment.tenantLogoUrlDark && environment.tenantLogoUrlDark.trim() !== '') {
this.logoPathDark = environment.tenantLogoUrlDark;
} else {
- this.logoPathDark = isTenantSpecific ? `assets/images/${tenant}_home_dark.png` : 'assets/images/white-mifos.png';
+ this.logoPathDark = isTenantSpecific
+ ? `assets/images/${tenant}_home_dark.png`
+ : 'assets/images/cbsnexora-logo.png';
}
}
@@ -430,6 +432,6 @@ export class LoginComponent implements OnInit, OnDestroy {
}
onLogoErrorDark(): void {
- this.logoPathDark = 'assets/images/white-mifos.png';
+ this.logoPathDark = 'assets/images/cbsnexora-logo.png';
}
}
diff --git a/src/app/organization/offices/offices.component.html b/src/app/organization/offices/offices.component.html
index 713500d70..6c7431acd 100644
--- a/src/app/organization/offices/offices.component.html
+++ b/src/app/organization/offices/offices.component.html
@@ -6,302 +6,273 @@
file, You can obtain one at http://mozilla.org/MPL/2.0/.
-->
-
-