KYC management: stage-wise notices, pagination, RD base chart

This commit is contained in:
2026-10-20 17:23:42 +05:30
parent 3e5cc26e49
commit 357f666421
108 changed files with 15001 additions and 2721 deletions
@@ -26,6 +26,62 @@
</div>
</div>
<!-- One branch's part of a transfer between branches: say so, name both branches, link the other part -->
@if (interBranch) {
<div class="txn-interbranch">
<div class="txn-interbranch__icon"><fa-icon icon="link"></fa-icon></div>
<div class="txn-interbranch__body">
<div class="txn-interbranch__title">
Inter-branch transfer
<span class="txn-interbranch__voucher">{{ interBranch.voucherNo }}</span>
</div>
<div class="txn-interbranch__route">
<strong>{{ branchesOf(interBranch.from) }}</strong>
<span class="txn-interbranch__arrow">→</span>
<strong>{{ branchesOf(interBranch.to) }}</strong>
<span class="txn-interbranch__amount">{{ interBranch.amount | formatNumber }}</span>
</div>
<div class="txn-interbranch__text">
This is the <strong>{{ thisBranchPart?.branchName }}</strong> branch's part of the transfer. Each branch
posts its own part, and the two are joined through Liability Transfer Suspense (200901), so they cancel out
across the bank.
</div>
<div class="txn-interbranch__legs">
@for (leg of interBranch.from; track leg.accountNo) {
<span class="txn-interbranch__leg"
><b>From</b> {{ leg.accountNo }} · {{ leg.accountName }} ({{ leg.branchName }})</span
>
}
@for (leg of interBranch.to; track leg.accountNo) {
<span class="txn-interbranch__leg"
><b>To</b> {{ leg.accountNo }} · {{ leg.accountName }} ({{ leg.branchName }})</span
>
}
</div>
@if (interBranch.raisedBy) {
<div class="txn-interbranch__text">
Raised by <strong>{{ interBranch.raisedBy }}</strong> on {{ interBranch.raisedAt | datetimeFormat }},
approved by <strong>{{ interBranch.approvedBy }}</strong> on
{{ interBranch.approvedAt | datetimeFormat }}.
</div>
}
<div class="txn-interbranch__text">
@for (part of otherBranchParts; track part.transactionId) {
The <strong>{{ part.branchName }}</strong> part:
<button type="button" class="txn-interbranch__link" (click)="openTransaction(part.transactionId)">
{{ part.transactionId }}
</button>
}
</div>
<div class="txn-interbranch__warn">
<fa-icon icon="exclamation-triangle" class="m-r-6"></fa-icon>
Do not revert one branch's part on its own: the other branch's part would stay and the books would not
balance.
</div>
</div>
</div>
}
<!-- Transaction Info Cards -->
@if (isViewTransaction()) {
@if (dataSource) {
@@ -515,3 +515,95 @@ $shadow: 0 2px 12px rgb(0 0 0 / 8%);
text-overflow: ellipsis;
vertical-align: middle;
}
/* One branch's part of a transfer between branches. */
.txn-interbranch {
display: flex;
align-items: flex-start;
gap: 14px;
margin: 0 0 16px;
padding: 14px 18px;
border: 1px solid #fcd34d;
border-left: 4px solid #f59e0b;
border-radius: 10px;
background: #fffbeb;
color: #78350f;
&__icon {
flex-shrink: 0;
margin-top: 2px;
font-size: 18px;
color: #d97706;
}
&__body {
display: flex;
flex-direction: column;
gap: 6px;
min-width: 0;
}
&__title {
font-size: 13px;
font-weight: 800;
letter-spacing: 0.03em;
text-transform: uppercase;
}
&__voucher {
margin-left: 8px;
padding: 1px 8px;
border-radius: 10px;
background: #fde68a;
font-size: 11px;
letter-spacing: 0.02em;
}
&__route {
font-size: 17px;
}
&__arrow {
margin: 0 8px;
color: #d97706;
}
&__amount {
margin-left: 12px;
padding: 1px 10px;
border-radius: 10px;
background: #fde68a;
font-size: 14px;
font-weight: 700;
}
&__text {
font-size: 13px;
line-height: 1.5;
}
&__legs {
display: flex;
flex-direction: column;
gap: 2px;
font-size: 13px;
}
&__link {
padding: 0;
border: 0;
background: none;
color: #b45309;
font-family: monospace;
font-size: 13px;
font-weight: 700;
text-decoration: underline;
cursor: pointer;
}
&__warn {
font-size: 12.5px;
font-weight: 600;
color: #b91c1c;
}
}
@@ -9,7 +9,8 @@
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { ViewJournalEntryComponent } from '../view-journal-entry/view-journal-entry.component';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute } from '@angular/router';
import { ActivatedRoute, Router } from '@angular/router';
import { AccountingService } from 'app/accounting/accounting.service';
import { MatSort, MatSortHeader } from '@angular/material/sort';
import { MatPaginator } from '@angular/material/paginator';
import {
@@ -26,6 +27,8 @@ import {
MatRow
} from '@angular/material/table';
import { Location, NgClass } from '@angular/common';
import { catchError } from 'rxjs/operators';
import { of } from 'rxjs';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { DatetimeFormatPipe } from '../../../pipes/datetime-format.pipe';
@@ -63,7 +66,9 @@ import { MatTooltipModule } from '@angular/material/tooltip';
]
})
export class ViewJournalEntryTransactionComponent implements OnInit {
private accountingService = inject(AccountingService);
private route = inject(ActivatedRoute);
private router = inject(Router);
dialog = inject(MatDialog);
private location = inject(Location);
@@ -90,6 +95,8 @@ export class ViewJournalEntryTransactionComponent implements OnInit {
isJournalEntryLoaded = false;
isManualJournalEntry = false;
/** Set when this ledger transaction is one branch's part of a transfer between branches (the whole transfer, both branches). */
interBranch: any = null;
ngOnInit() {
this.route.data.subscribe((data: { title: string; transaction: any; transferJournalEntryData: any }) => {
@@ -101,6 +108,7 @@ export class ViewJournalEntryTransactionComponent implements OnInit {
this.isJournalEntryLoaded = true;
this.transactionId = data.transaction.pageItems[0].transactionId;
this.isManualJournalEntry = data.transaction.pageItems[0].manualEntry;
this.loadInterBranchTransfer();
}
} else if (this.isViewTransfer()) {
this.journalEntriesData = data.transferJournalEntryData.journalEntryData.content;
@@ -110,6 +118,36 @@ export class ViewJournalEntryTransactionComponent implements OnInit {
});
}
private loadInterBranchTransfer(): void {
this.interBranch = null;
this.accountingService
.getInterBranchTransfer(this.transactionId)
.pipe(catchError(() => of(null)))
.subscribe((transfer: any) => (this.interBranch = transfer?.interBranch ? transfer : null));
}
/** This transaction's own branch part of the inter-branch transfer. */
get thisBranchPart(): any {
return this.interBranch?.parts?.find((part: any) => part.transactionId === this.transactionId) ?? null;
}
/** The other branches' parts of the same transfer, each its own ledger transaction. */
get otherBranchParts(): any[] {
return (this.interBranch?.parts ?? []).filter((part: any) => part.transactionId !== this.transactionId);
}
/** Distinct branch names among the accounts on one side of the transfer. */
branchesOf(legs: any[]): string {
return [...new Set((legs ?? []).map((leg: any) => leg.branchName).filter((name: string) => !!name))].join(', ');
}
openTransaction(transactionId: string): void {
this.router.navigate([
'/accounting/journal-entries/transactions/view',
transactionId
]);
}
isViewTransaction(): boolean {
return this.title === 'View Transaction';
}