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,108 @@
<h1 mat-dialog-title>View Journal Entry</h1>
<div mat-dialog-content>
<table>
<tr>
<th>Office</th>
<td>{{ data.journalEntry.officeName }}</td>
</tr>
<tr>
<th>Entry ID</th>
<td>{{ data.journalEntry.id }}</td>
</tr>
<tr>
<th>Transaction ID</th>
<td>{{ data.journalEntry.transactionId }}</td>
</tr>
<tr>
<th>Transaction Date</th>
<td>{{ data.journalEntry.transactionDate }}</td>
</tr>
<tr>
<th>Type</th>
<td>{{ data.journalEntry.glAccountType.value }}</td>
</tr>
<tr>
<th>Account Code</th>
<td>{{ data.journalEntry.glAccountId }}</td>
</tr>
<tr>
<th>Account Name</th>
<td>{{ data.journalEntry.glAccountName }}</td>
</tr>
<tr>
<th>
<span *ngIf="data.journalEntry.entryType.value === 'CREDIT'">Credit</span>
<span *ngIf="data.journalEntry.entryType.value === 'DEBIT'">Debit</span>
</th>
<td>
{{ (data.journalEntry.currency.displaySymbol || data.journalEntry.currency.code) + ' ' + data.journalEntry.amount }}
</td>
</tr>
<tr *ngIf="data.journalEntry.referenceNumber">
<th>Reference Number</th>
<td>{{ data.journalEntry.referenceNumber }}</td>
</tr>
<tr *ngIf="data.journalEntry.comments">
<th>Comments</th>
<td>{{ data.journalEntry.comments }}</td>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails">
<th colspan="2" class="header">Payment Details</th>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails?.paymentType">
<th>Payment Type</th>
<td>{{ data.journalEntry.transactionDetails.paymentDetails.paymentType.name }}</td>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails?.accountNumber">
<th>Account Number</th>
<td>{{ data.journalEntry.transactionDetails.paymentDetails.accountNumber }}</td>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails?.checkNumber">
<th>Cheque Number</th>
<td>{{ data.journalEntry.transactionDetails.paymentDetails.checkNumber }}</td>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails?.routingCode">
<th>Routing Code</th>
<td>{{ data.journalEntry.transactionDetails.paymentDetails.routingCode }}</td>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails?.receiptNumber">
<th>Receipt Number</th>
<td>{{ data.journalEntry.transactionDetails.paymentDetails.receiptNumber }}</td>
</tr>
<tr *ngIf="data.journalEntry.transactionDetails.paymentDetails?.bankNumber">
<th>Bank Number</th>
<td>{{ data.journalEntry.transactionDetails.paymentDetails.bankNumber }}</td>
</tr>
<tr>
<th>Created by</th>
<td>{{ data.journalEntry.createdByUserName }}</td>
</tr>
<tr>
<th>Created on</th>
<td>{{ data.journalEntry.createdDate }}</td>
</tr>
</table>
</div>
<mat-dialog-actions align="end">
<button mat-button mat-dialog-close>Close</button>
</mat-dialog-actions>
@@ -0,0 +1,13 @@
th {
text-align: left;
font-weight: 500;
}
th, td {
padding: 0 0.4rem 0 0;
}
.header {
text-align: center;
padding: 0.4rem 0.4rem 0 0;
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ViewJournalEntryComponent } from './view-journal-entry.component';
describe('ViewJournalEntryComponent', () => {
let component: ViewJournalEntryComponent;
let fixture: ComponentFixture<ViewJournalEntryComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewJournalEntryComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ViewJournalEntryComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,17 @@
import { Component, OnInit, Inject } from '@angular/core';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material';
@Component({
selector: 'mifosx-view-journal-entry',
templateUrl: './view-journal-entry.component.html',
styleUrls: ['./view-journal-entry.component.scss']
})
export class ViewJournalEntryComponent implements OnInit {
constructor(public dialogRef: MatDialogRef<ViewJournalEntryComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) { }
ngOnInit() {
}
}