KYC management: stage-wise notices, pagination, RD base chart
This commit is contained in:
@@ -25,6 +25,9 @@ interface CreditEntry {
|
||||
accountType: string;
|
||||
amount: number;
|
||||
dbCr?: string;
|
||||
/** The branch the account is held at; absent for a GL leg or when the server could not resolve it. */
|
||||
officeId?: number | null;
|
||||
officeName?: string | null;
|
||||
}
|
||||
|
||||
@Component({
|
||||
@@ -167,6 +170,19 @@ export class DisbursementReviewComponent implements OnInit {
|
||||
return this.creditEntries.filter((e) => e.dbCr !== 'Dr');
|
||||
}
|
||||
|
||||
/**
|
||||
* True when the accounts in this request are held at more than one branch, so money moves between branches. The
|
||||
* approver has to see that before approving: it is booked in each branch's own books.
|
||||
*/
|
||||
get isInterBranch(): boolean {
|
||||
return new Set(this.creditEntries.filter((e) => e.officeId != null).map((e) => e.officeId)).size > 1;
|
||||
}
|
||||
|
||||
/** Distinct branch names among the given legs, in order, e.g. for "Head Office" or "Head Office, bhopal". */
|
||||
branchNames(entries: CreditEntry[]): string {
|
||||
return [...new Set(entries.map((e) => e.officeName).filter((name): name is string => !!name))].join(', ');
|
||||
}
|
||||
|
||||
totalCreditAmount(): number {
|
||||
const entries = this.isCollectionMode ? this.drEntries : this.crEntries;
|
||||
return entries.reduce((sum, e) => sum + (e.amount ?? 0), 0);
|
||||
|
||||
Reference in New Issue
Block a user