feat(shares): add Share Withdrawal maker-checker workflow with GL settlement
Clerk submits a governed share redemption request (shares, Board Resolution No., Meeting Date, settlement Payment Type); Bank Manager reviews with a live backend-validated checklist (account/GL state, not just submit-time snapshot) before approving, which redeems the shares and settles the linked savings account in one transaction. Adds a Passbook tab to the Share Account view, a reusable search-select control, and a Savings Product "Map Payment Types to Specific Funds" fund-source override (only Loan Products had this before) so settlement can be GL-mapped correctly. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -56,14 +56,18 @@ export class TransactionsTabComponent implements OnInit {
|
||||
transactionsData: any;
|
||||
/** Data source for transactions table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
/** Columns to be displayed in transactions table. */
|
||||
/** Columns to be displayed in transactions table — a share account's passbook: every
|
||||
* purchase/redeem entry plus the running share balance and, for a withdrawal, the Board
|
||||
* Resolution Number / Date of Meeting that authorised it. */
|
||||
displayedColumns: string[] = [
|
||||
'transactionDate',
|
||||
'transactionType',
|
||||
'totalShares',
|
||||
'purchasedOrRedeemedPrice',
|
||||
'chargeAmount',
|
||||
'amountRecievedOrReturned'
|
||||
'amountRecievedOrReturned',
|
||||
'runningBalance',
|
||||
'resolutionMeeting'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -73,9 +77,19 @@ export class TransactionsTabComponent implements OnInit {
|
||||
constructor() {
|
||||
this.route.parent.data.subscribe((data: { sharesAccountData: any }) => {
|
||||
this.shareAccountData = data.sharesAccountData;
|
||||
this.transactionsData = this.shareAccountData.purchasedShares.filter(
|
||||
(transaction: any) => transaction.type.value !== 'Charge Payment'
|
||||
);
|
||||
this.transactionsData = this.shareAccountData.purchasedShares
|
||||
.filter((transaction: any) => transaction.type.value !== 'Charge Payment')
|
||||
.slice()
|
||||
.sort((a: any, b: any) => new Date(a.purchasedDate).getTime() - new Date(b.purchasedDate).getTime());
|
||||
|
||||
let runningBalance = 0;
|
||||
this.transactionsData.forEach((transaction: any) => {
|
||||
const shares = Number(transaction.numberOfShares) || 0;
|
||||
runningBalance += transaction.type.value === 'Redeem' ? -shares : shares;
|
||||
transaction.runningBalance = runningBalance;
|
||||
});
|
||||
// Passbook reads newest-first.
|
||||
this.transactionsData.reverse();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user