fix(clients): stale signature bug, monthly turnover/annual income fields, senior citizen/PWD classification
- Fix signature-document reads picking the oldest upload instead of the latest across 7 call sites (CKYC tab, view/delete-signature dialogs, edit-wizard preview, cashier transaction entry, signatory service, record-master) by sorting on document id instead of an unsorted find(). - Add Monthly Turnover and Annual Income fields alongside the renamed Yearly Turnover field. - Add Senior Citizen (auto-detected from DOB) and Person with Disability classification, with a required disability-certificate upload gate before client creation can proceed. - Add Graduate and Diploma as distinct Education Levels, with diploma-specific degree options. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -394,7 +394,12 @@ export class JointHolderDialogComponent implements OnInit {
|
||||
this.kyc = kycArr[0] ?? null;
|
||||
this.photo = photo ?? null;
|
||||
const docs: any[] = Array.isArray(documents) ? documents : [];
|
||||
const sigDoc = docs.find((d: any) => d.name === 'clientSignature' || d.name?.toLowerCase().includes('signature'));
|
||||
// Multiple 'clientSignature' documents can exist for clients who re-cropped/replaced their
|
||||
// signature before uploads became single-slot, so pick the highest id (latest) rather than
|
||||
// the first unordered match.
|
||||
const sigDoc = docs
|
||||
.filter((d: any) => d.name === 'clientSignature' || d.name?.toLowerCase().includes('signature'))
|
||||
.sort((a: any, b: any) => b.id - a.id)[0];
|
||||
this.loading = false;
|
||||
if (sigDoc) {
|
||||
this.http
|
||||
@@ -1868,7 +1873,12 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
|
||||
this.clientAddresses = Array.isArray(r.addresses) ? r.addresses : [];
|
||||
this.clientPhotoUrl = r.photo ?? null;
|
||||
const docs: any[] = Array.isArray(r.documents) ? r.documents : [];
|
||||
const sigDoc = docs.find((d: any) => d.name === 'clientSignature' || d.name?.toLowerCase().includes('signature'));
|
||||
// Multiple 'clientSignature' documents can exist for clients who re-cropped/replaced their
|
||||
// signature before uploads became single-slot, so pick the highest id (latest) rather than
|
||||
// the first unordered match.
|
||||
const sigDoc = docs
|
||||
.filter((d: any) => d.name === 'clientSignature' || d.name?.toLowerCase().includes('signature'))
|
||||
.sort((a: any, b: any) => b.id - a.id)[0];
|
||||
if (sigDoc) {
|
||||
this.http
|
||||
.get(`/clients/${clientId}/documents/${sigDoc.id}/attachment`, { responseType: 'blob' })
|
||||
|
||||
Reference in New Issue
Block a user