Update dashboard table reports (#1653)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
e61f4f92e3
commit
9ed38f0f7b
@@ -3,7 +3,7 @@
|
||||
<mat-card-header class="header">
|
||||
<h3 fxFlex="100%">
|
||||
<fa-icon icon="money-bill"></fa-icon>
|
||||
Amount Disbursed
|
||||
Amount Pending / Disbursed
|
||||
<div>
|
||||
<mat-form-field id="office" fxFlex="94%">
|
||||
<mat-label>Office</mat-label>
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div *ngIf="showFallback" class="fallback" fxLayoutAlign="center center">
|
||||
<p>No Data</p>
|
||||
</div>
|
||||
</div>
|
||||
</mat-card-content>
|
||||
|
||||
</mat-card>
|
||||
|
||||
@@ -28,7 +28,7 @@ export class AmountDisbursedPieComponent implements OnInit {
|
||||
/** Substitute for resolver */
|
||||
hideOutput = true;
|
||||
/** Shows fallback element */
|
||||
showFallback = false;
|
||||
showFallback = true;
|
||||
|
||||
/**
|
||||
* Fetches offices data from `resolve`.
|
||||
|
||||
@@ -26,7 +26,7 @@ export class HomeService {
|
||||
const httpParams = new HttpParams()
|
||||
.set('R_officeId', officeId.toString())
|
||||
.set('genericResultSet', 'false');
|
||||
return this.http.get('/runreports/Demand_Vs_Collection', { params: httpParams });
|
||||
return this.http.get('/runreports/Demand Vs Collection', { params: httpParams });
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,7 +37,7 @@ export class HomeService {
|
||||
const httpParams = new HttpParams()
|
||||
.set('R_officeId', officeId.toString())
|
||||
.set('genericResultSet', 'false');
|
||||
return this.http.get('/runreports/Disbursal_Vs_Awaitingdisbursal', { params: httpParams });
|
||||
return this.http.get('/runreports/Disbursal Vs Awaitingdisbursal', { params: httpParams });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -68,6 +68,8 @@ export class LoanActionButtonResolver implements Resolve<Object> {
|
||||
return this.loansService.getLoanApprovalTemplate(loanId);
|
||||
} else if (loanActionButton === 'Add Loan Charge') {
|
||||
return this.loansService.getLoanChargeTemplateResource(loanId);
|
||||
} else if (loanActionButton === 'Foreclosure') {
|
||||
return this.loansService.getLoanForeclosureActionTemplate(loanId);
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@ export class CreateGlimAccountComponent implements OnInit {
|
||||
const memberSelected = this.selectedMembers.selectedMembers;
|
||||
this.totalLoanAmount();
|
||||
for (let index = 0; index < memberSelected.length; index++) {
|
||||
console.log(memberSelected);
|
||||
requestData.push({
|
||||
requestId: index.toString(),
|
||||
method : 'POST',
|
||||
@@ -167,7 +166,6 @@ export class CreateGlimAccountComponent implements OnInit {
|
||||
for (let index = 0; index < memberSelected.length; index++) {
|
||||
total += memberSelected[index].principal;
|
||||
}
|
||||
console.log(total);
|
||||
this.totalLoan = total;
|
||||
}
|
||||
|
||||
@@ -176,7 +174,6 @@ export class CreateGlimAccountComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const data = this.buildRequestData();
|
||||
console.log(data);
|
||||
this.loansService.createGlimAccount(data).subscribe((response: any) => {
|
||||
this.router.navigate(['../../../'], { relativeTo: this.route });
|
||||
});
|
||||
|
||||
-1
@@ -46,7 +46,6 @@ export class DisburseToSavingsAccountComponent implements OnInit {
|
||||
* Set Disbursement Loan form.
|
||||
*/
|
||||
setDisbursementToSavingsForm() {
|
||||
console.log(this.dataObject);
|
||||
this.disbursementForm = this.formBuilder.group({
|
||||
'actualDisbursementDate': [new Date(), Validators.required],
|
||||
'transactionAmount': [this.dataObject.amount, Validators.required],
|
||||
|
||||
+3
-3
@@ -21,17 +21,17 @@
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Principal</mat-label>
|
||||
<input matInput required formControlName="outstandingPrincipalPortion">
|
||||
<input matInput formControlName="outstandingPrincipalPortion">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Interest</mat-label>
|
||||
<input matInput required formControlName="outstandingInterestPortion">
|
||||
<input matInput formControlName="outstandingInterestPortion">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label>Fee Amount</mat-label>
|
||||
<input matInput required formControlName="outstandingFeeChargesPortion">
|
||||
<input matInput formControlName="outstandingFeeChargesPortion">
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field>
|
||||
|
||||
+10
-29
@@ -1,4 +1,4 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -13,6 +13,8 @@ import { Dates } from 'app/core/utils/dates';
|
||||
styleUrls: ['./foreclosure.component.scss']
|
||||
})
|
||||
export class ForeclosureComponent implements OnInit {
|
||||
@Input() dataObject: any;
|
||||
|
||||
loanId: any;
|
||||
foreclosureForm: FormGroup;
|
||||
/** Minimum Date allowed. */
|
||||
@@ -20,7 +22,6 @@ export class ForeclosureComponent implements OnInit {
|
||||
/** Maximum Date allowed. */
|
||||
maxDate = new Date();
|
||||
foreclosuredata: any;
|
||||
paymentTypes: any;
|
||||
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
@@ -46,14 +47,13 @@ export class ForeclosureComponent implements OnInit {
|
||||
|
||||
createforeclosureForm() {
|
||||
this.foreclosureForm = this.formBuilder.group({
|
||||
'transactionDate': [new Date(), Validators.required],
|
||||
'outstandingPrincipalPortion': [{value: '', disabled: true}],
|
||||
'outstandingInterestPortion': [{value: '', disabled: true}],
|
||||
'outstandingFeeChargesPortion': [{value: '', disabled: true}],
|
||||
'outstandingPenaltyChargesPortion': [{value: '', disabled: true}],
|
||||
'transactionAmount': [{value: '', disabled: true}],
|
||||
'interestAccruedAfterDeath': '',
|
||||
'note': ''
|
||||
'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required],
|
||||
'outstandingPrincipalPortion': [{value: this.dataObject.principalPortion || 0, disabled: true}],
|
||||
'outstandingInterestPortion': [{value: this.dataObject.interestPortion || 0, disabled: true}],
|
||||
'outstandingFeeChargesPortion': [{value: this.dataObject.feeChargesPortion || 0, disabled: true}],
|
||||
'outstandingPenaltyChargesPortion': [{value: this.dataObject.penaltyChargesPortion || 0, disabled: true}],
|
||||
'transactionAmount': [{value: this.dataObject.amount, disabled: true}],
|
||||
'note': ['', Validators.required]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -82,26 +82,7 @@ export class ForeclosureComponent implements OnInit {
|
||||
outstandingInterestPortion: this.foreclosuredata.interestPortion,
|
||||
outstandingFeeChargesPortion: this.foreclosuredata.feeChargesPortion,
|
||||
outstandingPenaltyChargesPortion: this.foreclosuredata.penaltyChargesPortion,
|
||||
foreClosureChargesPortion: this.foreclosuredata.foreClosureChargesPortion
|
||||
});
|
||||
if (this.foreclosuredata.unrecognizedIncomePortion) {
|
||||
this.foreclosureForm.patchValue({
|
||||
interestAccruedAfterDeath: this.foreclosuredata.unrecognizedIncomePortion
|
||||
});
|
||||
}
|
||||
this.calculateTransactionAmount();
|
||||
this.paymentTypes = this.foreclosuredata.paymentTypeOptions;
|
||||
});
|
||||
}
|
||||
|
||||
calculateTransactionAmount() {
|
||||
let transactionAmount = 0;
|
||||
transactionAmount += parseFloat(this.foreclosuredata.principalPortion);
|
||||
transactionAmount += parseFloat(this.foreclosuredata.interestPortion);
|
||||
transactionAmount += parseFloat(this.foreclosuredata.feeChargesPortion);
|
||||
transactionAmount += parseFloat(this.foreclosuredata.penaltyChargesPortion);
|
||||
this.foreclosureForm.patchValue({
|
||||
transactionAmount: transactionAmount
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<mifosx-loans-account-close [dataObject]="actionButtonData" *ngIf="actions['Close']"></mifosx-loans-account-close>
|
||||
<mifosx-undo-approval *ngIf="actions['Undo Approval']"></mifosx-undo-approval>
|
||||
<mifosx-assign-loan-officer *ngIf="actions['Assign Loan Officer']" [dataObject]="actionButtonData" ></mifosx-assign-loan-officer>
|
||||
<mifosx-foreclosure *ngIf="actions['Foreclosure']"></mifosx-foreclosure>
|
||||
<mifosx-foreclosure [dataObject]="actionButtonData" *ngIf="actions['Foreclosure']"></mifosx-foreclosure>
|
||||
<mifosx-prepay-loan [dataObject]="actionButtonData" *ngIf="actions['Prepay Loan']"></mifosx-prepay-loan>
|
||||
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Make Repayment']"></mifosx-make-repayment>
|
||||
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Goodwill Credit']"></mifosx-make-repayment>
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ export class WithdrawnByClientComponent implements OnInit {
|
||||
};
|
||||
this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', data)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../../../general'], { relativeTo: this.route });
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ export class WriteOffPageComponent implements OnInit {
|
||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||
delete data.amount;
|
||||
this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => {
|
||||
this.router.navigate(['../../../general'], {relativeTo: this.route});
|
||||
this.router.navigate(['../../general'], {relativeTo: this.route});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { LoansAccountButtonConfiguration } from './loan-accounts-button-config';
|
||||
/** Dialog Components */
|
||||
import { ConfirmationDialogComponent } from '../../shared/confirmation-dialog/confirmation-dialog.component';
|
||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||
import { LoanStatus } from '../models/loan-status.nodel';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loans-view',
|
||||
@@ -38,6 +39,8 @@ export class LoansViewComponent implements OnInit {
|
||||
/** Disburse Transaction number */
|
||||
disburseTransactionNo = 0;
|
||||
|
||||
loanStatus: LoanStatus;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
public loansService: LoansService,
|
||||
@@ -45,6 +48,8 @@ export class LoansViewComponent implements OnInit {
|
||||
this.route.data.subscribe((data: { loanDetailsData: any, loanDatatables: any}) => {
|
||||
this.loanDetailsData = data.loanDetailsData;
|
||||
this.loanDatatables = data.loanDatatables;
|
||||
this.loanStatus = this.loanDetailsData.status;
|
||||
console.log(this.loanStatus);
|
||||
});
|
||||
this.loanId = this.route.snapshot.params['loanId'];
|
||||
this.clientId = this.loanDetailsData.clientId;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { LoanStatus } from 'app/loans/models/loan-status.nodel';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
|
||||
|
||||
@@ -12,6 +13,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
|
||||
styleUrls: ['./reschedule-loan-tab.component.scss']
|
||||
})
|
||||
export class RescheduleLoanTabComponent implements OnInit {
|
||||
@Input() loanStatus: LoanStatus;
|
||||
|
||||
loanRescheduleData: any;
|
||||
loanRescheduleDataColumns: string[] = ['id', 'rescheduleFromDate', 'reason', 'status', 'actions'];
|
||||
|
||||
@@ -5,6 +5,7 @@ import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Loans service.
|
||||
@@ -14,6 +15,7 @@ import { Dates } from 'app/core/utils/dates';
|
||||
})
|
||||
export class LoansService {
|
||||
constructor(private http: HttpClient,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates) { }
|
||||
/**
|
||||
* @param {string} loanId loanId of the loan.
|
||||
@@ -28,6 +30,15 @@ export class LoansService {
|
||||
return this.http.get(`/loans/${loanId}/transactions/template`, { params: httpParams });
|
||||
}
|
||||
|
||||
getLoanForeclosureActionTemplate(loanId: string): Observable<any> {
|
||||
const httpParams = new HttpParams()
|
||||
.set('command', 'foreclosure')
|
||||
.set('locale', this.settingsService.language.code)
|
||||
.set('dateFormat', this.settingsService.dateFormat)
|
||||
.set('transactionDate', this.dateUtils.formatDate(this.settingsService.businessDate, this.settingsService.dateFormat))
|
||||
return this.http.get(`/loans/${loanId}/transactions/template`, { params: httpParams });
|
||||
}
|
||||
|
||||
getLoanAccountResource(loanId: string, associations: string): Observable<any> {
|
||||
const httpParams = new HttpParams().set('associations', associations);
|
||||
return this.http.get(`/loans/${loanId}`, { params: httpParams });
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
export interface LoanStatus {
|
||||
id: number;
|
||||
code: string;
|
||||
value: string;
|
||||
|
||||
active: boolean;
|
||||
closed: boolean;
|
||||
closedObligationsMet: boolean;
|
||||
closedRescheduled: boolean;
|
||||
closedWrittenOff: boolean;
|
||||
overpaid: boolean;
|
||||
pendingApproval: boolean;
|
||||
waitingForDisbursal: boolean;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
<div *ngIf="bulkImport.formFields >= 1">
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Office</mat-label>
|
||||
<mat-select required formControlName="officeId">
|
||||
<mat-select formControlName="officeId">
|
||||
<mat-option *ngFor="let office of officeData" [value]="office.id">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
@@ -24,7 +24,7 @@
|
||||
<div *ngIf="bulkImport.formFields >= 2">
|
||||
<mat-form-field fxFlex>
|
||||
<mat-label>Staff</mat-label>
|
||||
<mat-select required formControlName="staffId">
|
||||
<mat-select formControlName="staffId">
|
||||
<mat-option *ngFor="let staff of staffData" [value]="staff.id">
|
||||
{{ staff.displayName }}
|
||||
</mat-option>
|
||||
|
||||
@@ -89,7 +89,6 @@ export class BulkLoanReassignmnetComponent implements OnInit {
|
||||
*/
|
||||
getFromOfficers(officerId: any) {
|
||||
this.toLoanOfficers = this.fromLoanOfficers.filter((officer: any) => officer.id !== officerId );
|
||||
console.log(this.toLoanOfficers);
|
||||
this.organizationSevice.getOfficerTemplate(officerId, this.officeTemplate.id).subscribe((response: any) => {
|
||||
this.officerTemplate = response;
|
||||
});
|
||||
|
||||
@@ -143,7 +143,6 @@ export class CreateGsimAccountComponent implements OnInit {
|
||||
const requestData = [];
|
||||
const memberSelected = this.selectedMembers.selectedMembers;
|
||||
for (let index = 0; index < 1; index++) {
|
||||
console.log(index);
|
||||
requestData.push(
|
||||
this.setData( memberSelected[ index ] ),
|
||||
);
|
||||
|
||||
@@ -39,7 +39,6 @@ export class GsimAccountComponent implements OnInit {
|
||||
this.gsimOverviewData = data.gsimData[0].childGSIMAccounts;
|
||||
this.savingAccountData = data.savingAccountData;
|
||||
this.groupsData = data.groupsData;
|
||||
console.log(data);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,8 +51,6 @@ export class GsimAccountComponent implements OnInit {
|
||||
*/
|
||||
setLoanClientChargeOverview() {
|
||||
this.dataSource = new MatTableDataSource(this.gsimOverviewData);
|
||||
console.log(this.dataSource);
|
||||
console.log(this.gsimOverviewData);
|
||||
// this.dataSource.paginator = this.paginator;
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -46,7 +46,6 @@ export class ViewTransactionComponent {
|
||||
this.route.data.subscribe((data: { savingsAccountTransaction: any }) => {
|
||||
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
|
||||
this.transactionData = data.savingsAccountTransaction;
|
||||
console.log(this.transactionData);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -35,7 +35,6 @@ export class ViewHistorySchedulerJobComponent implements OnInit {
|
||||
private router: Router ) {
|
||||
this.route.data.subscribe(( data: { jobsSchedulerHistory: any }) => {
|
||||
this.jobHistoryData = data.jobsSchedulerHistory;
|
||||
console.log(this.jobHistoryData);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,6 @@ export class EditReportComponent implements OnInit {
|
||||
* if successful redirects to view updated report.
|
||||
*/
|
||||
submit() {
|
||||
console.log(this.reportParametersData);
|
||||
if (this.reportData.coreReport) {
|
||||
this.reportForm.value.reportParameters = undefined;
|
||||
} else {
|
||||
|
||||
@@ -191,7 +191,6 @@ export class EditSurveyComponent implements OnInit {
|
||||
updateSequenceNumber() {
|
||||
for (let questionIndex = 0; questionIndex < this.questionDatas.length; questionIndex++) {
|
||||
this.questionDatas.at(questionIndex).get('sequenceNo').setValue(questionIndex + 1);
|
||||
console.log(this.questionDatas);
|
||||
for (let responseIndex = 0; responseIndex < this.getResponseDatas(questionIndex).length; responseIndex++) {
|
||||
this.getResponseDatas(questionIndex).at(responseIndex).get('sequenceNo').setValue(responseIndex + 1);
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ export class LoanDisbursalComponent {
|
||||
this.batchRequests.push(batchData);
|
||||
});
|
||||
this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
|
||||
console.log(response);
|
||||
response.forEach((responseEle: any) => {
|
||||
if (responseEle.statusCode = '200') {
|
||||
approvedAccounts++;
|
||||
|
||||
Reference in New Issue
Block a user