- *ngIf="transactionData.note">
+
{{ transactionData.note }}
diff --git a/src/app/deposits/transaction.model.ts b/src/app/deposits/transaction.model.ts
new file mode 100644
index 000000000..f267d52b1
--- /dev/null
+++ b/src/app/deposits/transaction.model.ts
@@ -0,0 +1,5 @@
+export type TransactionCommand = 'deposit' | 'withdrawal';
+
+export type TransactionTypeFlags = {
+ [key in TransactionCommand]: boolean;
+};
diff --git a/src/app/groups/groups-view/group-actions/group-actions.component.ts b/src/app/groups/groups-view/group-actions/group-actions.component.ts
index 673630050..c0c6830f4 100644
--- a/src/app/groups/groups-view/group-actions/group-actions.component.ts
+++ b/src/app/groups/groups-view/group-actions/group-actions.component.ts
@@ -44,6 +44,8 @@ export class GroupActionsComponent {
) {
this.router.routeReuseStrategy.shouldReuseRoute = () => false;
const action = this.route.snapshot.params['action'];
- this.actions[action] = true;
+ if (action && action in this.actions) {
+ this.actions[action as keyof typeof this.actions] = true;
+ }
}
}
diff --git a/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts
index e25da19c3..59dbe4a50 100644
--- a/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts
+++ b/src/app/loans/loans-account-stepper/loans-account-datatable-step/loans-account-datatable-step.component.ts
@@ -85,7 +85,7 @@ export class LoansAccountDatatableStepComponent implements OnInit {
get payload(): any {
const dateFormat = this.settingsService.dateFormat;
const datatableDataValues = this.datatableForm.value;
- const data = {
+ const data: { [key: string]: any } = {
locale: this.settingsService.language.code
};
let existDate = false;
diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
index d6cba50a9..f58a51c21 100644
--- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
+++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
@@ -15,6 +15,12 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
import { Currency } from 'app/shared/models/general.model';
import { CodeName, OptionData } from 'app/shared/models/option-data.model';
+interface DisbursementData {
+ id?: number;
+ principal: number;
+ expectedDisbursementDate: string | Date;
+}
+
/**
* Create Loans Account Terms Step
*/
@@ -62,7 +68,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
/** Client Active Loan Data */
clientActiveLoanData: any;
/** Multi Disbursement Data */
- disbursementDataSource: {}[] = [];
+ disbursementDataSource: DisbursementData[] = [];
/** Loan repayment strategies */
transactionProcessingStrategyOptions: any = [];
repaymentStrategyDisabled = false;
diff --git a/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts b/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts
index 0e4658876..d976e710d 100644
--- a/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/edit-repayment-schedule/edit-repayment-schedule.component.ts
@@ -24,7 +24,9 @@ export class EditRepaymentScheduleComponent implements OnInit {
/** Indicates If the Schedule has been validated */
wasValidated = false;
/** Stores the Repayment Schedule data */
- repaymentScheduleDetails: any[] | null = null;
+ repaymentScheduleDetails: {
+ periods: { period?: number; dueDate: string; totalDueForPeriod?: number; changed?: boolean }[];
+ } | null = null;
/** Stores the Installments changed */
repaymentScheduleChanges: any = {};
diff --git a/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts b/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts
index 353ecf1ea..d7fc728ca 100644
--- a/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts
+++ b/src/app/loans/loans-view/reschedule-loan-tab/reschedule-loan-tab.component.ts
@@ -56,7 +56,12 @@ export class RescheduleLoanTabComponent {
if (response.confirm) {
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
- const payload = {
+ const payload: {
+ dateFormat: string;
+ locale: string;
+ approvedOnDate?: string;
+ rejectedOnDate?: string;
+ } = {
dateFormat,
locale
};
diff --git a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
index b708a56e2..7c2efbd14 100644
--- a/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
+++ b/src/app/loans/loans-view/transactions-tab/transactions-tab.component.ts
@@ -386,7 +386,7 @@ export class TransactionsTabComponent implements OnInit {
value: this.dateUtils.parseDate(transactionDate),
type: 'datetime-local',
required: true,
- minDate: transaction.date,
+ minDate: this.dateUtils.parseDate(transaction.date),
order: 1
}),
new InputBase({
diff --git a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.html b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.html
index 7ec42158c..a6bf74e23 100644
--- a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.html
+++ b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.html
@@ -43,8 +43,7 @@
-
- (click)="addPaymentDetails()">
+
{{ 'labels.inputs.Show Payment Details' | translate }}
diff --git a/src/app/notifications/notifications-page/notifications-page.component.html b/src/app/notifications/notifications-page/notifications-page.component.html
index 5fb2cd44f..4e3ad63a4 100644
--- a/src/app/notifications/notifications-page/notifications-page.component.html
+++ b/src/app/notifications/notifications-page/notifications-page.component.html
@@ -25,9 +25,7 @@
[routerLink]="[routeMap[row.objectType], row.objectId]"
>
- |
- You don't have any notifications
- |
+ You don't have any notifications |
diff --git a/src/app/organization/holidays/create-holiday/create-holiday.component.ts b/src/app/organization/holidays/create-holiday/create-holiday.component.ts
index fd255098a..e0f19b1ce 100644
--- a/src/app/organization/holidays/create-holiday/create-holiday.component.ts
+++ b/src/app/organization/holidays/create-holiday/create-holiday.component.ts
@@ -37,7 +37,7 @@ export class CreateHolidayComponent implements OnInit {
// Stores office data in a trie-like structure
officesTrie: any;
// Stores office data for access from DOM via Office ID
- officesDict = {};
+ officesDict: { [key: string]: any } = {};
// Angular Material Tree Configuration start ------------
@@ -100,7 +100,7 @@ export class CreateHolidayComponent implements OnInit {
});
}
constructOfficeHierarchy() {
- const trie = {};
+ const trie: Record
= {};
// Iterates over all the offices
this.officesData.forEach((office: any) => {
this.officesDict[office.id] = office;
@@ -114,7 +114,7 @@ export class CreateHolidayComponent implements OnInit {
// Temporary variable to store current object
- let root = trie;
+ let root: Record = trie;
if (hierarchy.length === 0) {
root[office.id] = {};
diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts
index 2d999311c..1ad5835ba 100644
--- a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts
+++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts
@@ -161,7 +161,7 @@ export class BusinessRuleParametersComponent implements OnInit, OnChanges {
formattedResponse[newKey] = value;
break;
case 'select':
- formattedResponse[newKey] = value['id'];
+ formattedResponse[newKey] = (value as { id: string | number })['id'];
break;
case 'date':
const dateFormat = this.settingsService.dateFormat;
diff --git a/src/app/pipes/status-lookup.pipe.ts b/src/app/pipes/status-lookup.pipe.ts
index 11e200d02..8cfbbb61c 100644
--- a/src/app/pipes/status-lookup.pipe.ts
+++ b/src/app/pipes/status-lookup.pipe.ts
@@ -48,6 +48,6 @@ export class StatusLookupPipe implements PipeTransform {
'smsCampaignStatus.closed': 'status-closed',
'purchasedSharesStatusType.applied': 'status-pending'
};
- return cssClassNameLookup[status];
+ return cssClassNameLookup[status as keyof typeof cssClassNameLookup] ?? 'status-unknown';
}
}
diff --git a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts
index a7766ee46..4212be182 100644
--- a/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts
+++ b/src/app/products/fixed-deposit-products/fixed-deposit-product-stepper/fixed-deposit-product-interest-rate-chart-step/fixed-deposit-product-interest-rate-chart-step.component.ts
@@ -91,7 +91,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
this.clientClassificationData = this.fixedDepositProductsTemplate.chartTemplate.clientClassificationOptions;
this.incentiveTypeData = this.fixedDepositProductsTemplate.chartTemplate.incentiveTypeOptions;
- if (!(this.fixedDepositProductsTemplate === undefined)) {
+ if (this.fixedDepositProductsTemplate) {
this.assignFormData();
}
}
@@ -145,7 +145,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
formArray.push(chartSlabInfo);
// Iterate for every slab in chartSlab
- const chartIncentiveControl = chartDetailControl.controls['chartSlabs']['controls'][j];
+ const chartIncentiveControl = (chartDetailControl.controls['chartSlabs'] as UntypedFormArray).controls[j];
// Iterate to input all the incentive for particular chart slab
this.chartsDetail[i].chartSlabs[j].incentives.forEach((chartIncentiveDetail: any) => {
@@ -158,8 +158,8 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
chartIncentiveDetail.attributeName,
Validators.required
],
- attribureValue: [
- chartIncentiveDetail.attribureValue,
+ attributeValue: [
+ chartIncentiveDetail.attributeValue,
Validators.required
],
conditionType: [
@@ -175,7 +175,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
Validators.required
]
});
- const newFormArray = chartIncentiveControl['controls']['incentives'] as UntypedFormArray;
+ const newFormArray = (chartIncentiveControl as UntypedFormGroup).controls['incentives'] as UntypedFormArray;
newFormArray.push(incentiveInfo);
});
});
@@ -183,8 +183,8 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
}
getChartsDetailsData() {
- this.chartDetailData.forEach((chartData: any) => {
- const chart = {
+ this.chartDetailData.forEach((chartData: ChartData) => {
+ const chart: Chart = {
endDate: chartData.endDate ? new Date(chartData.endDate) : '',
fromDate: chartData.fromDate ? new Date(chartData.fromDate) : '',
isPrimaryGroupingByAmount: chartData.isPrimaryGroupingByAmount,
@@ -193,7 +193,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
chartSlabs: this.getChartSlabsData(chartData)
};
if (chartData.id) {
- chart['id'] = chartData.id;
+ chart.id = chartData.id;
}
this.chartsDetail.push(chart);
});
@@ -213,7 +213,17 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
}
chartSlabData.forEach((eachChartSlabData: any) => {
- const chartSlab = {
+ const chartSlab: {
+ id?: any;
+ periodType: any;
+ amountRangeFrom: any;
+ amountRangeTo: any;
+ annualInterestRate: any;
+ description: any;
+ fromPeriod: any;
+ toPeriod: any;
+ incentives: any[];
+ } = {
periodType: eachChartSlabData.periodType.id,
amountRangeFrom: eachChartSlabData.amountRangeFrom,
amountRangeTo: eachChartSlabData.amountRangeTo,
@@ -221,7 +231,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
description: eachChartSlabData.description ? eachChartSlabData.description : '',
fromPeriod: eachChartSlabData.fromPeriod,
toPeriod: eachChartSlabData.toPeriod,
- incentives: this.getIncentivesData(chartSlabData)
+ incentives: this.getIncentivesData(eachChartSlabData)
};
if (eachChartSlabData.id) {
chartSlab['id'] = eachChartSlabData.id;
@@ -468,3 +478,28 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
return fixedDepositProductInterestRateChart;
}
}
+
+interface ChartData {
+ id?: number;
+ endDate?: string;
+ fromDate?: string;
+ isPrimaryGroupingByAmount: boolean;
+ name: string;
+ description: string;
+ chartSlabs: ChartSlab[];
+}
+
+interface ChartSlab {
+ periodType?: string;
+ fromPeriod?: number;
+ toPeriod?: number;
+ amountRangeFrom?: number;
+ amountRangeTo?: number;
+ annualInterestRate?: number;
+ description?: string;
+}
+
+interface Chart extends Omit {
+ endDate: Date | string;
+ fromDate: Date | string;
+}
diff --git a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html
index e2608f4f9..b2a573371 100644
--- a/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html
+++ b/src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html
@@ -378,7 +378,7 @@
{{ 'labels.inputs.Repayment Strategy' | translate }}:
- {{
+ {{
loanProduct.transactionProcessingStrategyName | translateKey: 'catalogs'
}}
@@ -563,7 +563,7 @@
{{ loanProduct.canUseForTopup | yesNo }}
- {{ 'labels.heading.Interest Recalculation' | translate }}
+ {{ 'labels.heading.Interest Recalculation' | translate }}
diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html
index 5ac74fcd1..4624d59d3 100644
--- a/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html
+++ b/src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html
@@ -212,7 +212,7 @@
-
+
{{ 'labels.inputs.Loan Charge-off behaviour' | translate }}
diff --git a/src/app/products/products.component.html b/src/app/products/products.component.html
index 775f6a21e..3c77d0000 100644
--- a/src/app/products/products.component.html
+++ b/src/app/products/products.component.html
@@ -21,14 +21,12 @@
diff --git a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts
index 8b32812ec..c259f582d 100644
--- a/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts
+++ b/src/app/products/recurring-deposit-products/recurring-deposit-product-stepper/recurring-deposit-product-interest-rate-chart-step/recurring-deposit-product-interest-rate-chart-step.component.ts
@@ -145,7 +145,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On
formArray.push(chartSlabInfo);
// Iterate for every slab in chartSlab
- const chartIncentiveControl = chartDetailControl.controls['chartSlabs']['controls'][j];
+ const chartIncentiveControl = (chartDetailControl.controls['chartSlabs'] as UntypedFormArray).controls[j];
// Iterate to input all the incentive for particular chart slab
this.chartsDetail[i].chartSlabs[j].incentives.forEach((chartIncentiveDetail: any) => {
@@ -175,7 +175,7 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On
Validators.required
]
});
- const newFormArray = chartIncentiveControl['controls']['incentives'] as UntypedFormArray;
+ const newFormArray = (chartIncentiveControl as UntypedFormGroup).controls['incentives'] as UntypedFormArray;
newFormArray.push(incentiveInfo);
});
});
@@ -184,7 +184,14 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On
getChartsDetailsData() {
this.chartDetailData.forEach((chartData: any) => {
- const chart = {
+ const chart: {
+ id?: any;
+ endDate: string | Date;
+ fromDate: string | Date;
+ isPrimaryGroupingByAmount: any;
+ name: any;
+ chartSlabs: any[];
+ } = {
endDate: chartData.endDate ? new Date(chartData.endDate) : '',
fromDate: chartData.fromDate ? new Date(chartData.fromDate) : '',
isPrimaryGroupingByAmount: chartData.isPrimaryGroupingByAmount,
@@ -212,7 +219,17 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On
}
chartSlabData.forEach((eachChartSlabData: any) => {
- const chartSlab = {
+ const chartSlab: {
+ id?: any;
+ periodType: any;
+ amountRangeFrom: any;
+ amountRangeTo: any;
+ annualInterestRate: any;
+ description: any;
+ fromPeriod: any;
+ toPeriod: any;
+ incentives: any[];
+ } = {
periodType: eachChartSlabData.periodType.id,
amountRangeFrom: eachChartSlabData.amountRangeFrom,
amountRangeTo: eachChartSlabData.amountRangeTo,
diff --git a/src/app/reports/run-report/run-report.component.ts b/src/app/reports/run-report/run-report.component.ts
index 359b02990..8a3476757 100644
--- a/src/app/reports/run-report/run-report.component.ts
+++ b/src/app/reports/run-report/run-report.component.ts
@@ -13,7 +13,7 @@ import { SelectOption } from '../common-models/select-option.model';
import { Dates } from 'app/core/utils/dates';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
-import * as XLSX from 'xlsx';
+import * as ExcelJS from 'exceljs';
import { AlertService } from 'app/core/alert/alert.service';
/**
@@ -251,7 +251,7 @@ export class RunReportComponent implements OnInit {
formattedResponse[newKey] = value;
break;
case 'select':
- formattedResponse[newKey] = value['id'];
+ formattedResponse[newKey] = (value as { id: string | number })['id'];
break;
case 'date':
if (this.isTableReport()) {
@@ -339,18 +339,46 @@ export class RunReportComponent implements OnInit {
});
}
- exportToXLS(reportName: string, csvData: any, displayedColumns: string[]): void {
+ async exportToXLS(reportName: string, csvData: any, displayedColumns: string[]): Promise
{
const fileName = `${reportName}.xlsx`;
+
+ // Format data for ExcelJS
const data = csvData.map((object: any) => {
- const row = {};
+ const row: Record = {};
for (let i = 0; i < displayedColumns.length; i++) {
row[displayedColumns[i]] = object.row[i];
}
return row;
});
- const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data, { header: displayedColumns });
- const wb: XLSX.WorkBook = XLSX.utils.book_new();
- XLSX.utils.book_append_sheet(wb, ws, 'report');
- XLSX.writeFile(wb, fileName);
+
+ // Create workbook and worksheet
+ const workbook = new ExcelJS.Workbook();
+ const worksheet = workbook.addWorksheet('report');
+
+ // Add header
+ worksheet.addRow(displayedColumns);
+
+ // Add data rows
+ data.forEach((rowObj: any) => {
+ worksheet.addRow(displayedColumns.map((col) => rowObj[col]));
+ });
+
+ // Write to buffer and trigger download
+ const buffer = await workbook.xlsx.writeBuffer();
+ const blob = new Blob([buffer], {
+ type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
+ });
+
+ // Native download logic (no FileSaver)
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = fileName;
+ document.body.appendChild(a);
+ a.click();
+ setTimeout(() => {
+ document.body.removeChild(a);
+ URL.revokeObjectURL(url);
+ }, 0);
}
}
diff --git a/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts b/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts
index 65017e395..e20128ff9 100644
--- a/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts
+++ b/src/app/reports/run-report/table-and-sms/table-and-sms.component.ts
@@ -14,7 +14,7 @@ import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.componen
import { environment } from 'environments/environment';
import { ProgressBarService } from 'app/core/progress-bar/progress-bar.service';
-import * as XLSX from 'xlsx';
+import * as ExcelJS from 'exceljs';
/**
* Table and SMS Component
@@ -143,16 +143,33 @@ export class TableAndSmsComponent implements OnChanges {
exportToXLS(): void {
const fileName = `${this.dataObject.report.name}.xlsx`;
const data = this.csvData.map((object: any) => {
- const row = {};
+ const row: { [key: string]: any } = {};
for (let i = 0; i < this.displayedColumns.length; i++) {
row[this.displayedColumns[i]] = object.row[i];
}
return row;
});
- const ws: XLSX.WorkSheet = XLSX.utils.json_to_sheet(data, { header: this.displayedColumns });
- const wb: XLSX.WorkBook = XLSX.utils.book_new();
- XLSX.utils.book_append_sheet(wb, ws, 'Report');
- XLSX.writeFile(wb, fileName);
+
+ const workbook = new ExcelJS.Workbook();
+ const worksheet = workbook.addWorksheet('Report');
+
+ // Add header row
+ worksheet.addRow(this.displayedColumns);
+
+ // Add data rows
+ data.forEach((rowObj: any) => {
+ worksheet.addRow(this.displayedColumns.map((col) => rowObj[col]));
+ });
+
+ workbook.xlsx.writeBuffer().then((buffer: any) => {
+ const blob = new Blob([buffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = 'filename.xlsx';
+ a.click();
+ URL.revokeObjectURL(url);
+ });
}
/**
diff --git a/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts b/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts
index 6748c9e01..d4ef8e4da 100644
--- a/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/manage-savings-account/manage-savings-account.component.ts
@@ -7,6 +7,15 @@ import { SettingsService } from 'app/settings/settings.service';
import { Currency } from 'app/shared/models/general.model';
import { SystemService } from 'app/system/system.service';
+type TransactionCommandType = 'holdamount' | 'blockaccount' | 'blockdeposit' | 'blockwithdrawal';
+
+interface TransactionType {
+ holdamount: boolean;
+ blockaccount: boolean;
+ blockdeposit: boolean;
+ blockwithdrawal: boolean;
+}
+
@Component({
selector: 'mifosx-manage-savings-account',
templateUrl: './manage-savings-account.component.html',
@@ -22,16 +31,11 @@ export class ManageSavingsAccountComponent implements OnInit {
manageSavingsAccountForm: UntypedFormGroup;
/** Savings Account Id */
savingAccountId: string;
- transactionCommand: string;
+ transactionCommand: TransactionCommandType;
reasonOptions: any = [];
- transactionType: {
- holdamount: boolean;
- blockaccount: boolean;
- blockdeposit: boolean;
- blockwithdrawal: boolean;
- } = {
+ transactionType: TransactionType = {
holdamount: false,
blockaccount: false,
blockdeposit: false,
@@ -130,7 +134,7 @@ export class ManageSavingsAccountComponent implements OnInit {
submit() {
let command = '';
- let payload = {};
+ let payload: { transactionAmount?: number; [key: string]: any } = {};
if (this.transactionType.holdamount) {
const manageSavingsAccountFormData = this.manageSavingsAccountForm.value;
diff --git a/src/app/savings/saving-account-actions/saving-account-actions.component.ts b/src/app/savings/saving-account-actions/saving-account-actions.component.ts
index 91b666437..1b29ad5c0 100644
--- a/src/app/savings/saving-account-actions/saving-account-actions.component.ts
+++ b/src/app/savings/saving-account-actions/saving-account-actions.component.ts
@@ -68,7 +68,9 @@ export class SavingAccountActionsComponent {
this.currency = data.savingsAccountActionData.currency;
}
});
- const name = this.route.snapshot.params['name'];
- this.actions[name] = true;
+ const name = this.route.snapshot.params['name'] as string;
+ if (name in this.actions) {
+ this.actions[name as keyof typeof this.actions] = true;
+ }
}
}
diff --git a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts
index 388baf9b8..2403793cf 100644
--- a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts
+++ b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts
@@ -66,7 +66,7 @@ export class SavingsAccountTransactionsComponent implements OnInit {
}
});
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase();
- this.transactionType[this.transactionCommand] = true;
+ this.transactionType[this.transactionCommand as 'deposit' | 'withdrawal'] = true;
this.savingAccountId = this.route.snapshot.params['savingAccountId'];
}
diff --git a/src/app/savings/savings-account-view/savings-account-view.component.ts b/src/app/savings/savings-account-view/savings-account-view.component.ts
index 674201d68..a72795e57 100644
--- a/src/app/savings/savings-account-view/savings-account-view.component.ts
+++ b/src/app/savings/savings-account-view/savings-account-view.component.ts
@@ -85,7 +85,7 @@ export class SavingsAccountViewComponent implements OnInit {
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
});
}
- if (this.savingsAccountData.externalId && environment.interbankTransfers === 'true') {
+ if (this.savingsAccountData.externalId && environment.interbankTransfers) {
this.buttonConfig.addOption({
name: 'Interbank Transfer',
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
diff --git a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.html b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.html
index dba16dfa1..cf2ec09f1 100644
--- a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.html
+++ b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.html
@@ -38,8 +38,7 @@
-
- (click)="addPaymentDetails()">
+
{{ 'labels.inputs.Show Payment Details' | translate }}
diff --git a/src/app/shared/datetime-picker-stub/datetime-picker-stub.component.ts b/src/app/shared/datetime-picker-stub/datetime-picker-stub.component.ts
new file mode 100644
index 000000000..df3afd7a8
--- /dev/null
+++ b/src/app/shared/datetime-picker-stub/datetime-picker-stub.component.ts
@@ -0,0 +1,15 @@
+import { Component, Input } from '@angular/core';
+
+/* eslint-disable @angular-eslint/component-selector */
+/* eslint-disable @angular-eslint/prefer-standalone */
+@Component({
+ selector: 'ngx-mat-datetime-picker',
+ template: `
+
+
+ `,
+ standalone: false
+})
+export class DatetimePickerStubComponent {
+ @Input() enableMeridian: boolean = true;
+}
diff --git a/src/app/shared/form-dialog/formfield/formfield.component.html b/src/app/shared/form-dialog/formfield/formfield.component.html
index c462a2102..d6aeac0b6 100644
--- a/src/app/shared/form-dialog/formfield/formfield.component.html
+++ b/src/app/shared/form-dialog/formfield/formfield.component.html
@@ -50,14 +50,12 @@
{{ formfield.label }}
-
-
{{ formfield.label }} {{ 'labels.commons.is' | translate }}
{{ 'labels.commons.required' | translate }}
diff --git a/src/app/shared/form-dialog/formfield/model/datepicker-base.ts b/src/app/shared/form-dialog/formfield/model/datepicker-base.ts
index b522c406c..d573bc1fa 100644
--- a/src/app/shared/form-dialog/formfield/model/datepicker-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/datepicker-base.ts
@@ -1,13 +1,25 @@
import { FormfieldBase } from './formfield-base';
+interface DatepickerOptions {
+ minDate?: Date;
+ maxDate?: Date;
+ controlType?: string;
+ controlName?: string;
+ label?: string;
+ value?: any;
+ required?: boolean;
+ order?: number;
+ type?: string;
+}
+
export class DatepickerBase extends FormfieldBase {
controlType = 'datepicker';
minDate: Date;
maxDate: Date;
- constructor(options: {} = {}) {
+ constructor(options: DatepickerOptions = {}) {
super(options);
- this.minDate = options['minDate'] || new Date(2000, 0, 1);
- this.maxDate = options['maxDate'] || new Date();
+ this.minDate = options.minDate || new Date(2000, 0, 1);
+ this.maxDate = options.maxDate || new Date();
}
}
diff --git a/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts b/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts
index cb6325fe8..2ac2c3978 100644
--- a/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/datetimepicker-base.ts
@@ -1,13 +1,29 @@
import { FormfieldBase } from './formfield-base';
+// Define the base options interface based on FormfieldBase requirements
+interface FormfieldBaseOptions {
+ controlType?: string;
+ controlName?: string;
+ label?: string;
+ value?: any;
+ required?: boolean;
+ order?: number;
+}
+
+// Extend the base options for DateTimePicker
+interface DateTimePickerOptions extends FormfieldBaseOptions {
+ minDate?: Date;
+ maxDate?: Date;
+}
+
export class DateTimepickerBase extends FormfieldBase {
controlType = 'datetimepicker';
minDate: Date;
maxDate: Date;
- constructor(options: {} = {}) {
+ constructor(options: DateTimePickerOptions = {}) {
super(options);
- this.minDate = options['minDate'] || new Date(2000, 0, 1);
- this.maxDate = options['maxDate'] || new Date();
+ this.minDate = options.minDate || new Date(2000, 0, 1);
+ this.maxDate = options.maxDate || new Date();
}
}
diff --git a/src/app/shared/form-dialog/formfield/model/input-base.ts b/src/app/shared/form-dialog/formfield/model/input-base.ts
index 38beffcf8..df3d68117 100644
--- a/src/app/shared/form-dialog/formfield/model/input-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/input-base.ts
@@ -1,11 +1,25 @@
import { FormfieldBase } from './formfield-base';
+interface InputBaseOptions extends FormfieldBaseOptions {
+ type?: string;
+ [key: string]: any;
+}
+
+interface FormfieldBaseOptions {
+ controlType?: string;
+ controlName?: string;
+ label?: string;
+ value?: any;
+ required?: boolean;
+ order?: number;
+}
+
export class InputBase extends FormfieldBase {
controlType = 'input';
type: string;
- constructor(options: {} = {}) {
+ constructor(options: InputBaseOptions = {}) {
super(options);
- this.type = options['type'] || 'text';
+ this.type = options.type || 'text';
}
}
diff --git a/src/app/shared/form-dialog/formfield/model/select-base.ts b/src/app/shared/form-dialog/formfield/model/select-base.ts
index f3bbe9823..2eaf955d6 100644
--- a/src/app/shared/form-dialog/formfield/model/select-base.ts
+++ b/src/app/shared/form-dialog/formfield/model/select-base.ts
@@ -1,15 +1,27 @@
import { FormfieldBase } from './formfield-base';
+interface SelectOption {
+ label: string;
+ value: string;
+ data: {}[];
+}
+
+interface SelectBaseOptions {
+ options?: SelectOption;
+ controlType?: string;
+ controlName?: string;
+ label?: string;
+ value?: any;
+ required?: boolean;
+ order?: number;
+}
+
export class SelectBase extends FormfieldBase {
controlType = 'select';
- options: {
- label: string;
- value: string;
- data: {}[];
- };
+ options: SelectOption;
- constructor(options: {} = {}) {
+ constructor(options: SelectBaseOptions = {}) {
super(options);
- this.options = options['options'];
+ this.options = options.options || { label: '', value: '', data: [] };
}
}
diff --git a/src/app/shared/shared.module.ts b/src/app/shared/shared.module.ts
index a97d3efb9..6eac6c50d 100644
--- a/src/app/shared/shared.module.ts
+++ b/src/app/shared/shared.module.ts
@@ -36,7 +36,7 @@ import { EntityDatatableTabComponent } from './tabs/entity-datatable-tab/entity-
import { DatatableSingleRowComponent } from './tabs/entity-datatable-tab/datatable-single-row/datatable-single-row.component';
import { DatatableMultiRowComponent } from './tabs/entity-datatable-tab/datatable-multi-row/datatable-multi-row.component';
import { SvgIconComponent } from './svg-icon/svg-icon.component';
-import { NgxMatDatetimePickerModule, NgxMatNativeDateModule } from '@angular-material-components/datetime-picker';
+// import { NgxMatDatetimePickerModule, NgxMatNativeDateModule } from '@angular-material-components/datetime-picker';
import { ViewJournalEntryComponent } from './accounting/view-journal-entry/view-journal-entry.component';
import { ViewJournalEntryTransactionComponent } from './accounting/view-journal-entry-transaction/view-journal-entry-transaction.component';
import { AccountNumberComponent } from './account-number/account-number.component';
@@ -51,6 +51,7 @@ import { LongTextComponent } from './long-text/long-text.component';
import { DropdownComponent } from './dropdown/dropdown.component';
import { InputAmountComponent } from './input-amount/input-amount.component';
import { InputPasswordComponent } from './input-password/input-password.component';
+import { DatetimePickerStubComponent } from './datetime-picker-stub/datetime-picker-stub.component'; // import Datetime Picker Stub
/**
* Shared Module
@@ -65,9 +66,9 @@ import { InputPasswordComponent } from './input-password/input-password.componen
ReactiveFormsModule,
TranslateModule,
PipesModule,
- DirectivesModule,
- NgxMatDatetimePickerModule,
- NgxMatNativeDateModule
+ DirectivesModule
+ // NgxMatDatetimePickerModule,
+ // NgxMatNativeDateModule
],
declarations: [
FormfieldComponent,
@@ -108,7 +109,9 @@ import { InputPasswordComponent } from './input-password/input-password.componen
LongTextComponent,
DropdownComponent,
InputAmountComponent,
- InputPasswordComponent
+ InputPasswordComponent,
+ DatetimePickerStubComponent // temporarily added stub for datetime picker
+
],
exports: [
FileUploadComponent,
@@ -143,7 +146,9 @@ import { InputPasswordComponent } from './input-password/input-password.componen
ThemeToggleComponent,
LongTextComponent,
DropdownComponent,
- InputAmountComponent
+ InputAmountComponent,
+ DatetimePickerStubComponent // Export stub for datetime picker
+
]
})
export class SharedModule {}
diff --git a/src/app/shares/shares-account-actions/shares-account-actions.component.ts b/src/app/shares/shares-account-actions/shares-account-actions.component.ts
index 8457ae21a..31405770b 100644
--- a/src/app/shares/shares-account-actions/shares-account-actions.component.ts
+++ b/src/app/shares/shares-account-actions/shares-account-actions.component.ts
@@ -44,6 +44,8 @@ export class SharesAccountActionsComponent {
*/
constructor(private route: ActivatedRoute) {
const name = this.route.snapshot.params['name'];
- this.actions[name] = true;
+ if (name && name in this.actions) {
+ this.actions[name as keyof typeof this.actions] = true;
+ }
}
}
diff --git a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts
index a32104777..241870c4b 100644
--- a/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts
+++ b/src/app/system/configure-maker-checker-tasks/configure-maker-checker-tasks.component.ts
@@ -8,31 +8,48 @@ import { PopoverService } from '../../configuration-wizard/popover/popover.servi
import { ConfigurationWizardService } from '../../configuration-wizard/configuration-wizard.service';
import { SystemService } from '../system.service';
+interface Permission {
+ code: string;
+ id: number;
+ selected: boolean;
+ grouping?: string;
+}
+
+interface PermissionGroup {
+ permissions: Permission[];
+}
+
+interface PermissionData {
+ [key: string]: PermissionGroup;
+}
+
+interface SubmitPermissionData {
+ permissions: {
+ [key: string]: boolean;
+ };
+}
+
@Component({
selector: 'mifosx-configure-maker-checker-tasks',
templateUrl: './configure-maker-checker-tasks.component.html',
styleUrls: ['./configure-maker-checker-tasks.component.scss']
})
export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewInit {
- permissionsData: any;
+ permissionsData: Permission[] = [];
groupings: string[] = [];
+ currentGrouping = '';
+ tempPermissionUIData: PermissionData = {};
+ permissions: PermissionGroup = { permissions: [] };
+
formData = {};
isDisabled = true;
newEntry: any;
selectedItem = '';
previousGrouping = '';
checkboxesChanged: Boolean = false;
- currentGrouping: string;
formGroup: UntypedFormGroup;
backupform: UntypedFormGroup;
- permissions: {
- permissions: { code: string; id: number }[];
- };
- tempPermissionUIData: {
- permissions: { code: string }[];
- }[];
-
/* Reference of edit button */
@ViewChild('buttonEdit') buttonEdit: ElementRef;
/* Template for popover on edit button */
@@ -95,29 +112,33 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
});
}
- setMakerCheckerTask() {
- this.tempPermissionUIData = [
- {
- permissions: []
- }
- ];
- for (const i in this.permissionsData) {
- if (this.permissionsData[i]) {
- if (this.permissionsData[i].grouping !== this.currentGrouping) {
- this.currentGrouping = this.permissionsData[i].grouping;
- this.groupings.push(this.currentGrouping);
- this.tempPermissionUIData[this.currentGrouping] = { permissions: [] };
- }
- const temp = { code: this.permissionsData[i].code, id: i, selected: this.permissionsData[i].selected };
- this.tempPermissionUIData[this.currentGrouping].permissions.push(temp);
+ setMakerCheckerTask(): void {
+ this.tempPermissionUIData = {};
+
+ for (const permission of this.permissionsData) {
+ if (permission.grouping !== this.currentGrouping) {
+ this.currentGrouping = permission.grouping || '';
+ this.groupings.push(this.currentGrouping);
+ this.tempPermissionUIData[this.currentGrouping] = { permissions: [] };
}
+
+ const temp: Permission = {
+ code: permission.code,
+ id: permission.id,
+ selected: permission.selected
+ };
+
+ this.tempPermissionUIData[this.currentGrouping].permissions.push(temp);
}
}
- showPermissions(grouping: string) {
- this.permissions = this.tempPermissionUIData[grouping];
- this.selectedItem = grouping;
- this.previousGrouping = grouping;
+ showPermissions(grouping: string): void {
+ const group = this.tempPermissionUIData[grouping];
+ if (group) {
+ this.permissions = group;
+ this.selectedItem = grouping;
+ this.previousGrouping = grouping;
+ }
}
permissionName = function (name: any) {
@@ -175,17 +196,20 @@ export class ConfigureMakerCheckerTasksComponent implements OnInit, AfterViewIni
this.formGroup.controls.roster.disable();
}
- submit() {
- const value = this.formGroup.get('roster').value;
- const data = {};
- const permissionData = {
+ submit(): void {
+ const value = this.formGroup.get('roster')?.value;
+ const permissionData: SubmitPermissionData = {
permissions: {}
};
- for (let i = 0; i < value.length; i++) {
- data[value[i].code] = value[i].selected;
+
+ if (Array.isArray(value)) {
+ value.forEach((item) => {
+ if (item.code && typeof item.selected === 'boolean') {
+ permissionData.permissions[item.code] = item.selected;
+ }
+ });
}
- permissionData.permissions = data;
- this.formGroup.controls.roster.disable();
+ this.formGroup.get('roster')?.disable();
this.checkboxesChanged = false;
this.isDisabled = true;
this.systemService.updateMakerCheckerPermission(permissionData).subscribe((response: any) => {});
diff --git a/src/app/system/manage-hooks/create-hook/create-hook.component.html b/src/app/system/manage-hooks/create-hook/create-hook.component.html
index 40af29872..aa8f7517a 100644
--- a/src/app/system/manage-hooks/create-hook/create-hook.component.html
+++ b/src/app/system/manage-hooks/create-hook/create-hook.component.html
@@ -108,7 +108,7 @@
-
{{ 'labels.inputs.Events' | translate }}*
+
{{ 'labels.inputs.Events' | translate }}*