-
+
\ No newline at end of file
diff --git a/src/app/clients/clients-routing.module.ts b/src/app/clients/clients-routing.module.ts
index 8f600884f..48cf5af27 100644
--- a/src/app/clients/clients-routing.module.ts
+++ b/src/app/clients/clients-routing.module.ts
@@ -20,7 +20,7 @@ const routes: Routes = [
data: { title: extract('Create Client') }
},
{
- path: 'clients/view',
+ path: 'clients/view/:id',
component: ViewClientComponent,
data: { title: extract('View Client') }
},
diff --git a/src/app/clients/clients.component.html b/src/app/clients/clients.component.html
index 927b4e73e..bb506cc94 100644
--- a/src/app/clients/clients.component.html
+++ b/src/app/clients/clients.component.html
@@ -47,7 +47,8 @@
|
-
+
+
diff --git a/src/app/clients/clients.component.ts b/src/app/clients/clients.component.ts
index 4697d61a3..ab4e9c354 100644
--- a/src/app/clients/clients.component.ts
+++ b/src/app/clients/clients.component.ts
@@ -11,7 +11,7 @@ import { Observable } from 'rxjs';
})
export class ClientsComponent implements OnInit {
post: any = [];
- private ELEMENT_DATA: any = null;
+ private ELEMENT_DATA: any = undefined;
displayedColumns = ['name', 'clientno', 'externalid', 'status', 'office', 'staff'];
dataSource = new MatTableDataSource();
@@ -20,10 +20,10 @@ export class ClientsComponent implements OnInit {
constructor(private clientService: ClientsService) {
// GET from clients API
- this.clientService.getServer()
+ this.clientService.getClients()
.subscribe(
(res => {
- console.log(res);
+ // console.log(res);
this.ELEMENT_DATA = res;
this.dataSource = new MatTableDataSource(this.ELEMENT_DATA);
})
diff --git a/src/app/clients/clients.service.ts b/src/app/clients/clients.service.ts
index 82e03dcdc..adefd9493 100644
--- a/src/app/clients/clients.service.ts
+++ b/src/app/clients/clients.service.ts
@@ -9,7 +9,7 @@ import { map } from 'rxjs/operators';
@Injectable()
export class ClientsService {
constructor(private http: Http) {} // tslint:disable-line
- getServer() {
+ getClients() {
const username = 'mifos';
const password = 'password';
const headers = new Headers(); // tslint:disable-line
@@ -18,7 +18,7 @@ export class ClientsService {
headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
headers.append('Access-Control-Allow-Origin', '*');
return this.http.get
- ('https://mobile.openmf.org/fineract-provider/api/v1/clients?tenantIdentifier=mobile&pretty=true',
+ ('https://demo.openmf.org/fineract-provider/api/v1/clients?tenantIdentifier=default&pretty=true',
{headers: headers})
.pipe(
map(
@@ -30,4 +30,71 @@ export class ClientsService {
)
);
}
+ getClientId(clientId: number) {
+ const username = 'mifos';
+ const password = 'password';
+ const headers = new Headers(); // tslint:disable-line
+ headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));
+ headers.append('Content-Type', 'application/json');
+ headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
+ headers.append('Access-Control-Allow-Origin', '*');
+ return this.http.get
+ ('https://demo.openmf.org/fineract-provider/api/v1/clients/' + clientId + '?tenantIdentifier=default&pretty=true',
+ {headers: headers})
+ .pipe(
+ map(
+ (response: Response) => { // tslint:disable-line
+ response = response.json();
+ return response;
+
+ }
+ )
+ );
+ }
+
+ getClientAccounts(clientId: number) {
+ const username = 'mifos';
+ const password = 'password';
+ const headers = new Headers(); // tslint:disable-line
+ headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));
+ headers.append('Content-Type', 'application/json');
+ headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
+ headers.append('Access-Control-Allow-Origin', '*');
+ return this.http.get
+ ('https://demo.openmf.org/fineract-provider/api/v1/clients/' + clientId
+ + '/accounts' + '?tenantIdentifier=default&pretty=true',
+ {headers: headers})
+ .pipe(
+ map(
+ (response: Response) => { // tslint:disable-line
+ response = response.json();
+ return response;
+
+ }
+ )
+ );
+ }
+
+ getClientCharges(clientId: number) {
+ const username = 'mifos';
+ const password = 'password';
+ const headers = new Headers(); // tslint:disable-line
+ headers.append('Authorization', 'Basic ' + btoa(username + ':' + password));
+ headers.append('Content-Type', 'application/json');
+ headers.append('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
+ headers.append('Access-Control-Allow-Origin', '*');
+ return this.http.get
+ ('https://demo.openmf.org/fineract-provider/api/v1/clients/' + clientId
+ + '/charges' + '?tenantIdentifier=default&pretty=true',
+ {headers: headers})
+ .pipe(
+ map(
+ (response: Response) => { // tslint:disable-line
+ response = response.json();
+ return response;
+
+ }
+ )
+ );
+ }
}
diff --git a/src/app/clients/view-client/view-client.component.html b/src/app/clients/view-client/view-client.component.html
index 97f08f7fb..64c0996ea 100644
--- a/src/app/clients/view-client/view-client.component.html
+++ b/src/app/clients/view-client/view-client.component.html
@@ -1,161 +1,203 @@
-
+
+ Loan Account Overview
+
+
+
+
+
+
+ | Account #ng |
+ {{row.accountNo}} |
+
+
+
+
+ Loan Account |
+ {{row.productName}} |
+
+
+
+
+ Original Loan |
+ {{row.originalLoan}} |
+
+
+
+
+
+
+ Loan Balance |
+ {{row.loanBalance}} |
+
+
+
+
+ Amount Paid |
+ {{row.amountPaid}} |
+
+
+
+
+
+ Type |
+ {{row.loanType.value}} |
+
+
+
+
+
+
-