Fix to export entity client bulk import template (#1692)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-02-27 11:17:40 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent baba1c945f
commit f6ed3c1914
2 changed files with 7 additions and 6 deletions
@@ -63,7 +63,7 @@ export class ExportTransactionsComponent implements OnInit {
createTransactionsReportForm() { createTransactionsReportForm() {
this.transactionsReportForm = this.formBuilder.group({ this.transactionsReportForm = this.formBuilder.group({
'fromDate': ['', Validators.required], 'fromDate': ['', Validators.required],
'toDate': ['', Validators.required], 'toDate': [this.settingsService.businessDate, Validators.required],
}); });
} }
@@ -71,13 +71,14 @@ export class ExportTransactionsComponent implements OnInit {
* Generates client loans transactions report. * Generates client loans transactions report.
*/ */
generate() { generate() {
const dateFormat = this.settingsService.dateFormat;
const data = { const data = {
'output-type': 'PDF', 'output-type': 'PDF',
R_startDate: this.dateUtils.formatDate(this.transactionsReportForm.value.fromDate, 'yyyy-MM-dd'), R_startDate: this.dateUtils.formatDate(this.transactionsReportForm.value.fromDate, dateFormat),
R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, 'yyyy-MM-dd'), R_endDate: this.dateUtils.formatDate(this.transactionsReportForm.value.toDate, dateFormat),
R_selectLoan: this.loansAccountId R_selectLoan: this.loansAccountId
}; };
this.reportsService.getPentahoRunReportData('Client Loan Account Schedule', data, 'default', 'en', 'dd MMMM yyyy') this.reportsService.getPentahoRunReportData('Client Loan Account Schedule', data, 'default', 'en', dateFormat)
.subscribe( (res: any) => { .subscribe( (res: any) => {
const contentType = res.headers.get('Content-Type'); const contentType = res.headers.get('Content-Type');
const file = new Blob([res.body], {type: contentType}); const file = new Blob([res.body], {type: contentType});
@@ -129,7 +129,7 @@ export class ViewBulkImportComponent implements OnInit {
legalFormType = 'CLIENTS_PERSON'; legalFormType = 'CLIENTS_PERSON';
break; break;
case 'Entity': case 'Entity':
legalFormType = 'CLIENTS_ENTTTY'; legalFormType = 'CLIENTS_ENTITY';
break; break;
} }
this.organizationService.getImportTemplate(this.bulkImport.urlSuffix, officeId, staffId, legalFormType).subscribe( (res: any) => { this.organizationService.getImportTemplate(this.bulkImport.urlSuffix, officeId, staffId, legalFormType).subscribe( (res: any) => {
@@ -158,7 +158,7 @@ export class ViewBulkImportComponent implements OnInit {
/** Only for Client Bulk Imports */ /** Only for Client Bulk Imports */
if (this.bulkImport.name === 'Clients') { if (this.bulkImport.name === 'Clients') {
if (this.template.name.toLowerCase().includes('entity')) { if (this.template.name.toLowerCase().includes('entity')) {
legalFormType = 'CLIENTS_ENTTTY'; legalFormType = 'CLIENTS_ENTITY';
} else if (this.template.name.toLowerCase().includes('person')) { } else if (this.template.name.toLowerCase().includes('person')) {
legalFormType = 'CLIENTS_PERSON'; legalFormType = 'CLIENTS_PERSON';
} }