Enhancement in loan and savings account views (#1690)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-02-22 23:15:51 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent c0185627f7
commit 6ef53c6462
91 changed files with 841 additions and 568 deletions
@@ -41,7 +41,7 @@ export class ActivateSavingsAccountComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -49,7 +49,7 @@ export class AddChargeSavingsAccountComponent implements OnInit {
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions;
});
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId'];
this.savingAccountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -45,7 +45,7 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.savingsAccountData = data.savingsAccountActionData;
});
@@ -41,7 +41,7 @@ export class ApproveSavingsAccountComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -51,7 +51,7 @@ export class CloseSavingsAccountComponent implements OnInit {
this.paymentTypeOptions = data.savingsAccountActionData[0].paymentTypeOptions;
this.transactionAmount = data.savingsAccountActionData[1].summary.accountBalance;
});
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -49,7 +49,7 @@ export class ManageSavingsAccountComponent implements OnInit {
private settingsService: SettingsService) {
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase().replaceAll(' ', '');
this.transactionType[this.transactionCommand] = true;
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId'];
this.savingAccountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -41,7 +41,7 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -41,7 +41,7 @@ export class RejectSavingsAccountComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -7,7 +7,7 @@
<mifosx-savings-account-unassign-staff *ngIf="actions['Unassign Staff']"></mifosx-savings-account-unassign-staff>
<mifosx-withdraw-by-client-savings-account *ngIf="actions['Withdraw By Client']"></mifosx-withdraw-by-client-savings-account>
<mifosx-add-charge-savings-account *ngIf="actions['Add Charge']"></mifosx-add-charge-savings-account>
<mifosx-savings-transactions *ngIf="actions['Withdrawal'] || actions['Deposit']"></mifosx-savings-transactions>
<mifosx-savings-transactions [currencyCode]="currencyCode" *ngIf="actions['Withdrawal'] || actions['Deposit']"></mifosx-savings-transactions>
<mifosx-close-savings-account *ngIf="actions['Close']"></mifosx-close-savings-account>
<mifosx-apply-annual-fees-savings-account *ngIf="actions['Apply Annual Fees']"></mifosx-apply-annual-fees-savings-account>
<mifosx-manage-savings-account *ngIf="actions['Hold Amount'] || actions['Block Account']"></mifosx-manage-savings-account>
@@ -49,10 +49,15 @@ export class SavingAccountActionsComponent {
'Unblock Account': false
};
currencyCode: string;
/**
* @param {ActivatedRoute} route Activated Route
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.currencyCode = data.savingsAccountActionData.currency.code;
});
const name = this.route.snapshot.params['name'];
this.actions[name] = true;
}
@@ -45,7 +45,7 @@ export class SavingsAccountAssignStaffComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
this.savingsAccountData = data.savingsAccountActionData;
});
@@ -20,9 +20,11 @@
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-form-field appearance="fill">
<mat-label>Transaction Amount</mat-label>
<input type="number" formControlName="transactionAmount" required matInput />
<span matTextSuffix class="m-l-10">{{ currencyCode }}</span>
<span fxFlex="auto"></span>
<input type="number" class="right-input" formControlName="transactionAmount" required matInput />
<mat-error *ngIf="savingAccountTransactionForm.controls.transactionAmount.hasError('required')">
Transaction Amount is <strong>required</strong>
</mat-error>
@@ -30,7 +32,7 @@
<mat-form-field>
<mat-label>Payment Type</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-select required formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypeOptions" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
@@ -1,3 +1,15 @@
.expandcollapsebutton {
margin-top: -7px;
}
.container {
width: 37rem;
max-width: 37rem;
}
.right-input {
text-align: right;
}
.right-label {
padding-right: 25px !important;
}
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, Input, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
@@ -18,6 +18,8 @@ import { Dates } from 'app/core/utils/dates';
})
export class SavingsAccountTransactionsComponent implements OnInit {
@Input() currencyCode: string;
/** Minimum Due Date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum Due Date allowed. */
@@ -61,7 +63,7 @@ export class SavingsAccountTransactionsComponent implements OnInit {
});
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase();
this.transactionType[this.transactionCommand] = true;
this.savingAccountId = this.route.parent.snapshot.params['savingAccountId'];
this.savingAccountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -77,8 +79,8 @@ export class SavingsAccountTransactionsComponent implements OnInit {
*/
createSavingAccountTransactionForm() {
this.savingAccountTransactionForm = this.formBuilder.group({
'transactionDate': ['', Validators.required],
'transactionAmount': ['', Validators.required],
'transactionDate': [this.settingsService.businessDate, Validators.required],
'transactionAmount': [0, Validators.required],
'paymentTypeId': [''],
'note': ['']
});
@@ -89,7 +91,6 @@ export class SavingsAccountTransactionsComponent implements OnInit {
*/
addPaymentDetails() {
this.addPaymentDetailsFlag = !this.addPaymentDetailsFlag;
/*
if (this.addPaymentDetailsFlag) {
this.savingAccountTransactionForm.addControl('accountNumber', new FormControl(''));
this.savingAccountTransactionForm.addControl('checkNumber', new FormControl(''));
@@ -103,8 +104,6 @@ export class SavingsAccountTransactionsComponent implements OnInit {
this.savingAccountTransactionForm.removeControl('receiptNumber');
this.savingAccountTransactionForm.removeControl('bankNumber');
}
*/
}
/**
@@ -41,7 +41,7 @@ export class SavingsAccountUnassignStaffComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -31,7 +31,7 @@ export class UndoApprovalSavingsAccountComponent implements OnInit {
private savingsService: SavingsService,
private route: ActivatedRoute,
private router: Router) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**
@@ -41,7 +41,7 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit {
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
this.accountId = this.route.snapshot.params['savingAccountId'];
}
/**