Clients search enhancement (#1605)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
475059a974
commit
d0dc2aabb2
+8
@@ -0,0 +1,8 @@
|
||||
<h1 mat-dialog-title>Release Amount</h1>
|
||||
<div mat-dialog-content>
|
||||
<p>Are you sure you want to release this amount ?</p>
|
||||
</div>
|
||||
<mat-dialog-actions align="end">
|
||||
<button mat-raised-button mat-dialog-close>Cancel</button>
|
||||
<button mat-raised-button color="warn" [mat-dialog-close]="{ confirm: true }">Confirm</button>
|
||||
</mat-dialog-actions>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ReleaseAmountDialogComponent } from './release-amount-dialog.component';
|
||||
|
||||
describe('ReleaseAmountDialogComponent', () => {
|
||||
let component: ReleaseAmountDialogComponent;
|
||||
let fixture: ComponentFixture<ReleaseAmountDialogComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ReleaseAmountDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ReleaseAmountDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { MatDialogRef } from '@angular/material/dialog';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-release-amount-dialog',
|
||||
templateUrl: './release-amount-dialog.component.html',
|
||||
styleUrls: ['./release-amount-dialog.component.scss']
|
||||
})
|
||||
export class ReleaseAmountDialogComponent {
|
||||
|
||||
/**
|
||||
* @param {MatDialogRef} dialogRef Component reference to dialog.
|
||||
*/
|
||||
constructor(public dialogRef: MatDialogRef<ReleaseAmountDialogComponent>) { }
|
||||
|
||||
}
|
||||
@@ -135,6 +135,9 @@ export class SavingsAccountViewComponent implements OnInit {
|
||||
case 'Post Interest As On':
|
||||
case 'Assign Staff':
|
||||
case 'Add Charge':
|
||||
case 'Hold Amount':
|
||||
case 'Block Account':
|
||||
case 'Unblock Account':
|
||||
case 'Unassign Staff':
|
||||
case 'Withdraw By Client':
|
||||
case 'Apply Annual Fees':
|
||||
|
||||
@@ -39,6 +39,11 @@ export class SavingsButtonsConfiguration {
|
||||
icon: 'arrow-down',
|
||||
taskPermissionName: 'WITHDRAW_SAVINGSACCOUNT'
|
||||
},
|
||||
{
|
||||
name: 'Hold Amount',
|
||||
icon: 'lock',
|
||||
taskPermissionName: 'HOLDAMOUNT_SAVINGSACCOUNT'
|
||||
},
|
||||
{
|
||||
name: 'Calculate Interest',
|
||||
icon: 'table',
|
||||
|
||||
+28
-22
@@ -1,17 +1,20 @@
|
||||
<div fxLayoutAlign="end" class="container m-b-20" fxLayoutGap="2%"
|
||||
*ngIf="!(transactionData.interestedPostedAsOn === false && (transactionData.transactionType.id === 17 || transactionData.transactionType.id === 3))">
|
||||
<span *mifosxHasPermission="'ADJUSTTRANSACTION_SAVINGSACCOUNT'">
|
||||
<button mat-raised-button color="primary"
|
||||
*ngIf="transactionData.transactionType.value == 'Transfer' || transactionData.reversed == 'true'
|
||||
|| transactionData.transactionType.id==3 || transactionData.transactionType.id==17"
|
||||
[routerLink]="'edit'">
|
||||
<fa-icon icon="edit"></fa-icon> Edit
|
||||
<button mat-raised-button color="primary" *ngIf="transactionData.transactionType.value == 'Transfer' || transactionData.reversed == 'true'
|
||||
|| transactionData.transactionType.id==3 || transactionData.transactionType.id==17" [routerLink]="'edit'">
|
||||
<fa-icon icon="edit" class="m-r-10"></fa-icon>Edit
|
||||
</button>
|
||||
</span>
|
||||
<button mat-raised-button color="warn"
|
||||
*mifosxHasPermission="'UNDOTRANSACTION_SAVINGSACCOUNT'"
|
||||
(click)="undoTransaction()">
|
||||
<fa-icon icon="undo"></fa-icon> Undo
|
||||
<span *ngIf="!transactionData.reversed && transactionData.transactionType.amountHold">
|
||||
<button mat-raised-button color="primary" *mifosxHasPermission="'RELEASEAMOUNT_SAVINGSACCOUNT'"
|
||||
(click)="releaseAmount()">
|
||||
<fa-icon icon="lock-open" class="m-r-10"></fa-icon>Release Amount
|
||||
</button>
|
||||
</span>
|
||||
<button mat-raised-button color="warn" *mifosxHasPermission="'UNDOTRANSACTION_SAVINGSACCOUNT'"
|
||||
(click)="undoTransaction()" [disabled]="transactionData.reversed">
|
||||
<fa-icon icon="undo" class="m-r-10"></fa-icon>Undo
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +33,7 @@
|
||||
<div fxFlex="50%">
|
||||
{{ transactionData.id }}
|
||||
</div>
|
||||
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
Type
|
||||
</div>
|
||||
@@ -44,7 +47,7 @@
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%">
|
||||
{{ transactionData.date | dateFormat }}
|
||||
{{ transactionData.date | dateFormat }}
|
||||
</div>
|
||||
|
||||
<div fxFlex="50%" class="mat-body-strong">
|
||||
@@ -76,47 +79,47 @@
|
||||
<div *ngIf="transactionData.paymentDetailData.paymentType" fxFlex="50%" class="mat-body-strong">
|
||||
Payment Type
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.paymentType" fxFlex="50%">
|
||||
{{ transactionData.paymentDetailData.paymentType.name }}
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.accountNumber" fxFlex="50%" class="mat-body-strong">
|
||||
Account No.
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.accountNumber" fxFlex="50%">
|
||||
{{ transactionData.paymentDetailData.accountNumber }}
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.checkNumber" fxFlex="50%" class="mat-body-strong">
|
||||
Cheque Number
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.checkNumber" fxFlex="50%">
|
||||
{{ transactionData.paymentDetailData.checkNumber }}
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.routingCode" fxFlex="50%" class="mat-body-strong">
|
||||
Routing Code
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.routingCode" fxFlex="50%">
|
||||
{{ transactionData.paymentDetailData.routingCode }}
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.receiptNumber" fxFlex="50%" class="mat-body-strong">
|
||||
Receipt No.
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.receiptNumber" fxFlex="50%">
|
||||
{{ transactionData.paymentDetailData.receiptNumber }}
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.bankNumber" fxFlex="50%" class="mat-body-strong">
|
||||
Bank No.
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="transactionData.paymentDetailData.bankNumber" fxFlex="50%">
|
||||
{{ transactionData.paymentDetailData.bankNumber }}
|
||||
</div>
|
||||
@@ -125,6 +128,9 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div fxLayout="row" fxLayoutAlign="center" fxLayoutGap="2%" fxLayout.lt-md="column">
|
||||
<button type="button" mat-raised-button color="primary" [routerLink]="['../']">{{ 'Back' | translate }}</button>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
|
||||
+18
-2
@@ -10,6 +10,7 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
/** Custom Dialogs */
|
||||
import { UndoTransactionDialogComponent } from '../../custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { ReleaseAmountDialogComponent } from '../../custom-dialogs/release-amount-dialog/release-amount-dialog.component';
|
||||
|
||||
/**
|
||||
* View Transaction Component.
|
||||
@@ -25,6 +26,8 @@ export class ViewTransactionComponent {
|
||||
/** Transaction data. */
|
||||
transactionData: any;
|
||||
|
||||
accountId: string;
|
||||
|
||||
/**
|
||||
* Retrieves the Transaction data from `resolve`.
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
@@ -41,7 +44,9 @@ export class ViewTransactionComponent {
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe((data: { savingsAccountTransaction: any }) => {
|
||||
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
|
||||
this.transactionData = data.savingsAccountTransaction;
|
||||
console.log(this.transactionData);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -49,7 +54,6 @@ export class ViewTransactionComponent {
|
||||
* Undo the savings transaction
|
||||
*/
|
||||
undoTransaction() {
|
||||
const accountId = this.route.parent.snapshot.params['savingAccountId'];
|
||||
const undoTransactionAccountDialogRef = this.dialog.open(UndoTransactionDialogComponent);
|
||||
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
@@ -61,7 +65,19 @@ export class ViewTransactionComponent {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id).subscribe(() => {
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id).subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
releaseAmount() {
|
||||
const releaseAmountDialogRef = this.dialog.open(ReleaseAmountDialogComponent);
|
||||
releaseAmountDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
const data = { };
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'releaseAmount', data, this.transactionData.id).subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user