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
+17 -1
View File
@@ -1,5 +1,5 @@
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable({
@@ -29,5 +29,21 @@ export class AccountingService {
return this.http.post('/journalentries', journalEntry);
}
getJournalEntry(transactionId: string) {
let httpParams = new HttpParams();
httpParams = httpParams.set('transactionId', transactionId);
httpParams = httpParams.set('transactionDetails', 'true');
return this.http.get(`/journalentries`, { params: httpParams });
}
revertTransaction(transactionId: string, comments: string) {
let httpParams = new HttpParams();
httpParams = httpParams.set('command', 'reverse');
let data = {};
if (comments) {
data = { comments: comments };
}
return this.http.post(`/journalentries/${transactionId}`, data, { params: httpParams });
}
}