Fix to display due or submitted date in Loan charges (#1830)
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
640f3b46f7
commit
a9b8543120
@@ -20,14 +20,15 @@
|
||||
<td mat-cell *matCellDef="let charge"> {{ charge.chargeTimeType.value }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="dueDate" *ngIf="!useDueDate">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Submitted On </th>
|
||||
<td mat-cell *matCellDef="let charge"> {{ charge.submittedOnDate | dateFormat }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="dueDate" *ngIf="useDueDate">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Due as of </th>
|
||||
<td mat-cell *matCellDef="let charge"> {{ charge.dueDate | dateFormat }} </td>
|
||||
<ng-container matColumnDef="dueDate">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header [hide]="useDueDate">
|
||||
<span *ngIf="useDueDate"> Due as of </span>
|
||||
<span *ngIf="!useDueDate"> Submitted On </span>
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let charge">
|
||||
<span *ngIf="useDueDate">{{ charge.dueDate | dateFormat }}</span>
|
||||
<span *ngIf="!useDueDate">{{ charge.submittedOnDate | dateFormat }}</span>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="calculationtype">
|
||||
|
||||
@@ -147,15 +147,13 @@ export class LoansViewComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
// Allow ChargeOff only If there loan is not already ChargeOff
|
||||
if (!this.loanDetailsData.chargedOff) {
|
||||
// Charge-Off only when there is not Interest Recalculation and the Interest Rate is zero
|
||||
if (!this.loanDetailsData.chargedOff && !this.loanDetailsData.isInterestRecalculationEnabled && this.loanDetailsData.interestRatePerPeriod === 0) {
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Charge-Off',
|
||||
icon: 'coins',
|
||||
taskPermissionName: 'CHARGEOFF_LOAN'
|
||||
});
|
||||
}
|
||||
this.buttonConfig.addButton({
|
||||
name: 'Charge-Off',
|
||||
icon: 'coins',
|
||||
taskPermissionName: 'CHARGEOFF_LOAN'
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { DomSanitizer } from '@angular/platform-browser';
|
||||
/** Custom Services */
|
||||
import { ReportsService } from '../../reports.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { ProgressBarService } from 'app/core/progress-bar/progress-bar.service';
|
||||
|
||||
/**
|
||||
* Pentaho Component
|
||||
@@ -30,7 +31,9 @@ export class PentahoComponent implements OnChanges {
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private sanitizer: DomSanitizer,
|
||||
private reportsService: ReportsService, private settingsService: SettingsService) { }
|
||||
private reportsService: ReportsService,
|
||||
private settingsService: SettingsService,
|
||||
private progressBarService: ProgressBarService) { }
|
||||
|
||||
/**
|
||||
* Fetches run report data post changes in run report form.
|
||||
@@ -48,6 +51,7 @@ export class PentahoComponent implements OnChanges {
|
||||
const filecontent = URL.createObjectURL(file);
|
||||
this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent);
|
||||
this.hideOutput = false;
|
||||
this.progressBarService.decrease();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -56,13 +56,16 @@
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field fxFlex *ngIf="isPentahoReport() && reportForm.contains('outputType')">
|
||||
<mat-form-field fxFlex *ngIf="isPentahoReport()">
|
||||
<mat-label>{{ 'Output Type' | translate }}</mat-label>
|
||||
<mat-select required [formControlName]="outputType">
|
||||
<mat-select required formControlName="outputType">
|
||||
<mat-option *ngFor="let option of outputTypeOptions" [value]="option.value">
|
||||
{{option.name | translate}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="reportForm.controls['outputType'].hasError('required')">
|
||||
Report Output Type is <strong>required</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<div fxFlex="98%" *ngIf="exportToS3Allowed" >
|
||||
@@ -71,15 +74,6 @@
|
||||
</mat-checkbox>
|
||||
</div>
|
||||
|
||||
<mat-form-field fxFlex *ngIf="report.type === 'Table' && reportForm.contains('exportAsType')">
|
||||
<mat-label>{{ 'Export output as' | translate }}</mat-label>
|
||||
<mat-select required formControlName="exportAsType">
|
||||
<mat-option *ngFor="let option of outputTypeOptions" [value]="option.value">
|
||||
{{option.name | translate}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||
|
||||
@@ -12,6 +12,7 @@ import { ReportParameter } from '../common-models/report-parameter.model';
|
||||
import { SelectOption } from '../common-models/select-option.model';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
|
||||
import { ProgressBarService } from 'app/core/progress-bar/progress-bar.service';
|
||||
|
||||
/**
|
||||
* Run report component.
|
||||
@@ -68,8 +69,9 @@ export class RunReportComponent implements OnInit {
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private reportsService: ReportsService,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates) {
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates,
|
||||
private progressBarService: ProgressBarService) {
|
||||
this.report.name = this.route.snapshot.params['name'];
|
||||
this.route.queryParams.subscribe((queryParams: { type: any, id: any }) => {
|
||||
this.report.type = queryParams.type;
|
||||
@@ -124,13 +126,13 @@ export class RunReportComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
if (this.isPentahoReport()) {
|
||||
this.reportForm.addControl('outputType', new FormControl(''));
|
||||
this.reportForm.addControl('outputType', new FormControl('', Validators.required));
|
||||
this.outputTypeOptions = [
|
||||
{ 'name': 'PDF format', 'value': 'PDF' },
|
||||
{ 'name': 'Normal format', 'value': 'HTML' },
|
||||
{ 'name': 'Excel format', 'value': 'XLS' },
|
||||
{ 'name': 'Excel 2007 format', 'value': 'XLSX' },
|
||||
{ 'name': 'CSV format', 'value': 'CSV' },
|
||||
{ 'name': 'PDF format', 'value': 'PDF' }
|
||||
{ 'name': 'CSV format', 'value': 'CSV' }
|
||||
];
|
||||
this.mapPentahoParams();
|
||||
}
|
||||
@@ -231,8 +233,7 @@ export class RunReportComponent implements OnInit {
|
||||
formattedResponse[newKey] = value['id'];
|
||||
break;
|
||||
case 'date':
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
formattedResponse[newKey] = this.dateUtils.formatDate(value, dateFormat);
|
||||
formattedResponse[newKey] = this.dateUtils.formatDate(value, this.settingsService.dateFormat);
|
||||
this.reportUsesDates = true;
|
||||
break;
|
||||
case 'none':
|
||||
|
||||
@@ -11,8 +11,8 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
|
||||
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
import { environment } from 'environments/environment';
|
||||
import { ProgressBarService } from 'app/core/progress-bar/progress-bar.service';
|
||||
|
||||
/**
|
||||
* Table and SMS Component
|
||||
@@ -50,7 +50,7 @@ export class TableAndSmsComponent implements OnChanges {
|
||||
constructor(private reportsService: ReportsService,
|
||||
public dialog: MatDialog,
|
||||
private decimalPipe: DecimalPipe,
|
||||
private dateUtils: Dates) { }
|
||||
private progressBarService: ProgressBarService) { }
|
||||
|
||||
/**
|
||||
* Fetches run report data post changes in run report form.
|
||||
@@ -77,6 +77,7 @@ export class TableAndSmsComponent implements OnChanges {
|
||||
});
|
||||
}
|
||||
this.hideOutput = false;
|
||||
this.progressBarService.decrease();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@
|
||||
|
||||
<ng-container matColumnDef="loan">
|
||||
<th mat-header-cell *matHeaderCellDef> Loan </th>
|
||||
<td mat-cell *matCellDef="let loan" class="view-details" [routerLink]="['../../clients', loan.clientId, 'loans-accounts', 'loan.id']">
|
||||
{{ loan.loanProductName}}({{loan.accountNo}}) </td>
|
||||
<td mat-cell *matCellDef="let loan" class="view-details" [routerLink]="['../../clients', loan.clientId, 'loans-accounts', loan.id]">
|
||||
{{ loan.loanProductName}} ({{loan.accountNo}}) </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="amount">
|
||||
|
||||
Reference in New Issue
Block a user