feat(dds): upgrade DDS UI - agent, party, daily entry, approvals, product view
- Agent master: tabbed layout, customer search dialog, GL dropdown, account card, view page - Party master: tabbed layout, expected party code, nominee cards, relation from code values - Daily transaction entry: compact style, collections popup, Apply DDS Receipt placement - Approvals: new review modal, Agent Approval tab, DDS routing into product/pending account - DDS product: view page and list buttons; drop Auto Interest Post Day Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
|
||||
/** Custom Components */
|
||||
import { DayCollectionDialogComponent } from './day-collection-dialog/day-collection-dialog.component';
|
||||
import { NoticeDialogComponent } from './notice-dialog/notice-dialog.component';
|
||||
import { CollectionsDialogComponent } from './collections-dialog/collections-dialog.component';
|
||||
import {
|
||||
ApplyDdsReceiptDialogComponent,
|
||||
EntryDay,
|
||||
@@ -152,6 +153,8 @@ export class DailyTransactionEntryComponent implements OnInit {
|
||||
accountNo: '',
|
||||
guarantor1: '',
|
||||
guarantor2: '',
|
||||
// Every guarantor the agent has, by name - the panel lists as many as there are rather than two fixed lines.
|
||||
guarantors: [] as string[],
|
||||
currentBalance: 0
|
||||
};
|
||||
|
||||
@@ -505,6 +508,34 @@ export class DailyTransactionEntryComponent implements OnInit {
|
||||
* agent still has outstanding. Its own screen, like Apply Additional Shares, so the list above stays
|
||||
* what it is - what to take from the agent - and the applying is done in one deliberate place.
|
||||
*/
|
||||
/**
|
||||
* Opens what the agent wrote down up to the chosen day, in a window of its own and paged - it used to
|
||||
* run down the page, where a long round pushed everything else out of sight. A line clicked there
|
||||
* shows that customer in the Party Information panel.
|
||||
*/
|
||||
openCollections(): void {
|
||||
this.dialog
|
||||
.open(CollectionsDialogComponent, {
|
||||
width: '820px',
|
||||
maxWidth: '96vw',
|
||||
autoFocus: false,
|
||||
data: {
|
||||
agentName: this.agentInfo.name,
|
||||
dateText: this.dateUtils.formatDate(this.entryForm.get('transactionDate')?.value, 'dd MMMM yyyy'),
|
||||
entries: () => this.pendingEntries,
|
||||
total: () => this.pendingTotal,
|
||||
loading: () => this.pendingLoading,
|
||||
refresh: () => this.loadPendingEntries()
|
||||
}
|
||||
})
|
||||
.afterClosed()
|
||||
.subscribe((entry: any) => {
|
||||
if (entry) {
|
||||
this.showPartyOfEntry(entry);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
openApplyReceipt(): void {
|
||||
const agentId = this.entryForm.get('agentId')?.value;
|
||||
if (!agentId) {
|
||||
@@ -513,7 +544,7 @@ export class DailyTransactionEntryComponent implements OnInit {
|
||||
const picked = this.agents.find((agent: any) => agent.id === agentId);
|
||||
this.dialog
|
||||
.open(ApplyDdsReceiptDialogComponent, {
|
||||
width: '780px',
|
||||
width: '700px',
|
||||
maxWidth: '96vw',
|
||||
panelClass: 'apply-collection-dialog-panel',
|
||||
data: {
|
||||
@@ -799,6 +830,7 @@ export class DailyTransactionEntryComponent implements OnInit {
|
||||
accountNo: agent.agentSavingAccountNo || '',
|
||||
guarantor1: guarantors[0]?.guarantorName || '',
|
||||
guarantor2: guarantors[1]?.guarantorName || '',
|
||||
guarantors: guarantors.map((guarantor: any) => guarantor?.guarantorName).filter((name: any) => !!name),
|
||||
currentBalance: agent.agentCurrentBalance || 0
|
||||
};
|
||||
this.agentGlCode = agent.glAccountCode || null;
|
||||
@@ -813,6 +845,7 @@ export class DailyTransactionEntryComponent implements OnInit {
|
||||
accountNo: '',
|
||||
guarantor1: '',
|
||||
guarantor2: '',
|
||||
guarantors: [],
|
||||
currentBalance: 0
|
||||
};
|
||||
}
|
||||
@@ -890,11 +923,29 @@ export class DailyTransactionEntryComponent implements OnInit {
|
||||
row.get('balanceAfterTransaction')?.setValue(current + amount, { emitEvent: false });
|
||||
}
|
||||
|
||||
/**
|
||||
* The entry in the collections list the Party Information panel is showing, if one was clicked. The
|
||||
* agent writes the round down on their own screen now, so there is no row here to key a party into -
|
||||
* the panel is filled from the line the clerk is looking at instead.
|
||||
*/
|
||||
selectedEntry: any = null;
|
||||
|
||||
/** Shows whose account a written-down entry is, and what its balance becomes with the entry on it. */
|
||||
showPartyOfEntry(entry: any): void {
|
||||
this.selectedEntry = entry;
|
||||
this.activeRow = -1;
|
||||
this.partyInfo = this.agentParties.find((party) => String(party.partyCode) === String(entry?.partyCode)) || null;
|
||||
}
|
||||
|
||||
/** The balance the party panel shows - live against whatever the active row currently holds. */
|
||||
get partyBalanceAfter(): number {
|
||||
if (!this.partyInfo || this.activeRow < 0) {
|
||||
if (!this.partyInfo) {
|
||||
return 0;
|
||||
}
|
||||
if (this.activeRow < 0) {
|
||||
// No keyed row: it is the entry picked from the list that is being added to the balance.
|
||||
return Number(this.partyInfo.currentBalance || 0) + Number(this.selectedEntry?.amount || 0);
|
||||
}
|
||||
const row = this.collections.at(this.activeRow);
|
||||
return Number(this.partyInfo.currentBalance || 0) + Number(row?.get('amount')?.value || 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user