feat(savings,shares): bidirectional savings/share account linking, new Migrate Cash Denomination screen
- Savings account creation shows a required "Default Share Account" picker once Share Linking is enabled, populated from the client's active share accounts; submits shareAccountId alongside it. - Fixes a real data-loss bug on Share Account creation: the Charges step re-seeded its table from the product's default charges on every ngOnChanges firing (e.g. stepping back to Details and forward again), silently discarding a charge the clerk had already added, edited, or removed - a pristine guard existed for exactly this but wasn't checked in ngOnChanges. Now it is. - Removes the hard "required" on Share Account creation's Default Savings Account field, matching the backend now accepting a share account with no linked savings account. - New /accounting/migrate-cash-denomination screen: counts a branch's opening cash into notes and coins, checks it against (or defines, if unset) the Cash GL account's balance, and opens the branch's first business day with that same count - the vault-side counterpart to Migrate Opening Balances, kept under Accounting rather than Branch Ops/Cashier so it isn't reachable by mistake. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -146,6 +146,13 @@ export class CreateSavingsAccountComponent {
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (detailsStep.shareLinkingEnabled && !detailsStep.shareAccountId) {
|
||||
this.alertService.alert({
|
||||
type: 'Error',
|
||||
message: 'Share Linking is enabled — please select the share account to link before submitting.'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const monthDayFormat = 'dd MMMM';
|
||||
@@ -208,6 +215,14 @@ export class CreateSavingsAccountComponent {
|
||||
type: 'Error',
|
||||
message: 'An account with this External ID already exists. Please use a unique External ID.'
|
||||
});
|
||||
} else if (
|
||||
errorCode === 'error.msg.savingsaccount.share.account.required' ||
|
||||
errorCode === 'error.msg.savingsaccount.share.account.not.active.for.client'
|
||||
) {
|
||||
this.alertService.alert({
|
||||
type: 'Error',
|
||||
message: 'Please select an active share account belonging to this client before submitting.'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user