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:
José Alberto Hernández
2023-07-27 14:32:01 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 640f3b46f7
commit a9b8543120
7 changed files with 38 additions and 39 deletions
@@ -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();
});
}