feat(accounting): add view transactions component

Add view transactions component, ability to revert transaction and
viewing journal entry details.

Fixes #139
This commit is contained in:
abhay_1806
2018-07-21 21:06:58 +05:30
committed by Abhay Chawla
parent a22bd6d1e5
commit ec7e871ac6
17 changed files with 509 additions and 8 deletions
@@ -0,0 +1,30 @@
<div *ngIf="!data.reverted; else reverted">
<h1 mat-dialog-title>Revert Transaction</h1>
<div mat-dialog-content>
<p>Are you sure you want to revert this transaction?</p>
<mat-form-field fxFlexFill>
<textarea matInput placeholder="Comments" [formControl]="comments"></textarea>
</mat-form-field>
</div>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close>No</button>
<button mat-button [mat-dialog-close]="{ revert: true, comments: comments.value }">Yes</button>
</mat-dialog-actions>
</div>
<ng-template #reverted>
<h1 mat-dialog-title>Transaction Reverted</h1>
<div mat-dialog-content>
<h4>Success!</h4>
<p>A new journal entry has been created to reverse this transaction:</p>
<p>Transaction ID: {{ data.transactionId }}</p>
</div>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close>Close</button>
<button mat-button [mat-dialog-close]="{ redirect: true }">Redirect to New Transaction</button>
</mat-dialog-actions>
</ng-template>
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { RevertTransactionComponent } from './revert-transaction.component';
describe('RevertTransactionComponent', () => {
let component: RevertTransactionComponent;
let fixture: ComponentFixture<RevertTransactionComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RevertTransactionComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(RevertTransactionComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,20 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
import { FormControl } from '@angular/forms';
@Component({
selector: 'mifosx-revert-transaction',
templateUrl: './revert-transaction.component.html',
styleUrls: ['./revert-transaction.component.scss']
})
export class RevertTransactionComponent implements OnInit {
comments = new FormControl('');
constructor(public dialogRef: MatDialogRef<RevertTransactionComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit() {
}
}