feat(investment): share investment screens on live data
This commit is contained in:
@@ -43,6 +43,7 @@ import { exportWorkbook, ExportSheetSpec } from '../investment-export';
|
||||
import {
|
||||
InvestmentGlAccount,
|
||||
InvestmentService,
|
||||
SHARE_INSTITUTION_TYPES,
|
||||
apiErrorMessage,
|
||||
awaitingApproval,
|
||||
sentForApproval,
|
||||
@@ -138,6 +139,7 @@ export class InvestmentMastersComponent implements OnInit {
|
||||
readonly slrTypeOptions = SLR_TYPE_OPTIONS;
|
||||
readonly ratingOptions = RATING_OPTIONS;
|
||||
readonly ratingAgencyOptions = RATING_AGENCY_OPTIONS;
|
||||
readonly shareInstitutionTypes = SHARE_INSTITUTION_TYPES;
|
||||
/** Investment GLs (under the 100700 INVESTMENTS head) a party or script can be mapped to — not loans, banks or test GLs. */
|
||||
investmentGlOptions: InvestmentGlAccount[] = [];
|
||||
/** Income GLs under 400400 INCOME FROM INVESTMENTS, for an FD bank's interest. */
|
||||
@@ -227,6 +229,15 @@ export class InvestmentMastersComponent implements OnInit {
|
||||
this.toast('Enter the TDS rate (%) this bank deducts on FD interest.');
|
||||
return;
|
||||
}
|
||||
const share = f.bondType === 'SHARE';
|
||||
if (share && !f.institutionType) {
|
||||
this.toast('Select the Institution Type of this share institution.');
|
||||
return;
|
||||
}
|
||||
if (share && f.institutionType === 'OTHER_COOP_SOCIETY' && !(Number(f.subscribedCapital) > 0)) {
|
||||
this.toast('Enter the subscribed share capital of the society (the 5% limit on one society).');
|
||||
return;
|
||||
}
|
||||
const body = {
|
||||
bondType: f.bondType,
|
||||
partyName: f.partyName,
|
||||
@@ -249,7 +260,13 @@ export class InvestmentMastersComponent implements OnInit {
|
||||
cpBranchName: f.cpBranchName ?? '',
|
||||
cpAccountNo: f.cpAccountNo ?? '',
|
||||
cpIfsc: f.cpIfsc ?? '',
|
||||
// Shares only: who issued them (only co-operative / membership shares may be held), and what values them.
|
||||
institutionType: share ? f.institutionType : '',
|
||||
subscribedCapital: share && f.subscribedCapital ? Number(f.subscribedCapital) : null,
|
||||
lastBalanceSheetDate: share ? (f.lastBalanceSheetDate ?? '') : '',
|
||||
inLiquidation: share && !!f.inLiquidation,
|
||||
active: f.status !== 'INACTIVE',
|
||||
dateFormat: 'dd-MM-yyyy',
|
||||
locale: 'en'
|
||||
};
|
||||
const request = f.id ? this.investmentService.updateParty(f.id, body) : this.investmentService.createParty(body);
|
||||
|
||||
Reference in New Issue
Block a user