Support additional export table report options (#1780)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-07-11 06:38:19 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 7913707324
commit c5374c2a46
24 changed files with 555 additions and 231 deletions
+1 -3
View File
@@ -4,7 +4,7 @@ import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common
import { RouteReuseStrategy, RouterModule } from '@angular/router';
/** Translation Imports */
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateModule } from '@ngx-translate/core';
/** Custom Services */
import { AuthenticationService } from './authentication/authentication.service';
@@ -28,8 +28,6 @@ import { RouteReusableStrategy } from './route/route-reusable-strategy';
/** Custom Modules */
import { SharedModule } from '../shared/shared.module';
import { NotificationsModule } from '../notifications/notifications.module';
import { SearchModule } from 'app/search/search.module';
/** Custom Components */
import { ShellComponent } from './shell/shell.component';
@@ -0,0 +1,84 @@
<div class="container" fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="31%">
<mat-label>{{ 'labels.inputs.Filter' | translate }}</mat-label>
<mat-select [formControl]="entryTypeFilter">
<mat-option *ngFor="let filter of entryTypeFilterData" [value]="filter.value">
{{ filter.option }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="31%" (click)="transferDateFromPicker.open()">
<mat-label>Transfer Date From</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="transferDateFromPicker" [formControl]="transferDateFrom">
<mat-datepicker-toggle matSuffix [for]="transferDateFromPicker"></mat-datepicker-toggle>
<mat-datepicker #transferDateFromPicker></mat-datepicker>
</mat-form-field>
<mat-form-field fxFlex="31%" (click)="transferDateToPicker.open()">
<mat-label>Transfer Date To</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="transferDateToPicker" [formControl]="transferDateTo">
<mat-datepicker-toggle matSuffix [for]="transferDateToPicker"></mat-datepicker-toggle>
<mat-datepicker #transferDateToPicker></mat-datepicker>
</mat-form-field>
<mat-form-field fxFlex="31%">
<mat-label>Transfer External Id</mat-label>
<input matInput [formControl]="transferExternalId">
</mat-form-field>
</div>
<div class="mat-elevation-z8 container">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="investor">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Investor </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="loanAccount">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Loan </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="totalAmount">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Total Amount </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="principal">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Principal </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="interest">
<th mat-header-cell *matHeaderCellDef> Interest </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="fees">
<th mat-header-cell *matHeaderCellDef> Fees </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="penalties">
<th mat-header-cell *matHeaderCellDef> Penalties </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Actions </th>
<td mat-cell *matCellDef="let item"> </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;" [routerLink]="['transactions/view', row.transactionId]" class="select-row"></tr>
</table>
<mat-paginator [pageSize]="50" [pageSizeOptions]="[50, 100, 200, 500]" showFirstLastButtons></mat-paginator>
</div>
@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { InvestorsComponent } from './investors.component';
describe('InvestorsComponent', () => {
let component: InvestorsComponent;
let fixture: ComponentFixture<InvestorsComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ InvestorsComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(InvestorsComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,49 @@
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { MatTableDataSource } from '@angular/material/table';
@Component({
selector: 'mifosx-investors',
templateUrl: './investors.component.html',
styleUrls: ['./investors.component.scss']
})
export class InvestorsComponent implements OnInit {
/** Minimum transaction date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum transaction date allowed. */
maxDate = new Date();
transferDateFrom = new FormControl('');
transferDateTo = new FormControl('');
transferExternalId = new FormControl('');
/** Entry type filter form control. */
entryTypeFilter = new FormControl('');
/** Entry type filter data. */
entryTypeFilterData = [
{
option: 'All',
value: ''
},
{
option: 'Sale',
value: true
},
{
option: 'Buyed Back',
value: false
}
];
/** Columns to be displayed in investors table. */
displayedColumns: string[] = ['investor', 'loanAccount', 'totalAmount', 'principal', 'interest', 'fees', 'penalties', 'actions'];
/** Data source for investors table. */
dataSource: MatTableDataSource<any> = new MatTableDataSource();
constructor() { }
ngOnInit(): void {
}
}
@@ -105,6 +105,7 @@ import { ManageFundResolver } from './manage-funds/manage-fund.resolver';
import { ViewFundComponent } from './manage-funds/view-fund/view-fund.component';
import { EditFundComponent } from './manage-funds/edit-fund/edit-fund.component';
import { CreateFundComponent } from './manage-funds/create-fund/create-fund.component';
import { InvestorsComponent } from './investors/investors.component';
/** Organization Routes */
const routes: Routes = [
@@ -342,6 +343,12 @@ const routes: Routes = [
advanceSearchTemplate: AdvanceSearchTemplateResolver
}
},
{
path: 'investors',
component: InvestorsComponent,
data: { title: extract('Investors'), breadcrumb: 'Investors' },
resolve: { }
},
{
path: 'adhoc-query',
data: { title: extract('Adhoc Query'), breadcrumb: 'Adhoc Query' },
+181 -140
View File
@@ -8,76 +8,98 @@
<mat-nav-list>
<div #office>
<mat-list-item [routerLink]="['offices']" *mifosxHasPermission="'READ_OFFICE'">
<mat-icon matListIcon>
<fa-icon icon="building" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Offices</h4>
<p matLine>Add new office or modify or deactivate office or modify hierarchy</p>
</mat-list-item>
</div>
<div #office>
<mat-list-item [routerLink]="['offices']" *mifosxHasPermission="'READ_OFFICE'">
<mat-icon matListIcon>
<fa-icon icon="building" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Offices</h4>
<p matLine>Add new office or modify or deactivate office or modify hierarchy</p>
</mat-list-item>
</div>
<div #holidays>
<mat-list-item [routerLink]="['holidays']" *mifosxHasPermission="'READ_HOLIDAY'">
<mat-icon matListIcon>
<fa-icon icon="calendar-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Holidays</h4>
<p matLine>Define holidays for office</p>
</mat-list-item>
</div>
<div #holidays>
<mat-list-item [routerLink]="['holidays']" *mifosxHasPermission="'READ_HOLIDAY'">
<mat-icon matListIcon>
<fa-icon icon="calendar-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Holidays</h4>
<p matLine>Define holidays for office</p>
</mat-list-item>
</div>
<div #employee>
<mat-list-item [routerLink]="['employees']" *mifosxHasPermission="'READ_STAFF'">
<mat-icon matListIcon>
<fa-icon icon="user" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Employees</h4>
<p matLine>An employee represents loan officers with no access to systems</p>
</mat-list-item>
</div>
<div #employee>
<mat-list-item [routerLink]="['employees']" *mifosxHasPermission="'READ_STAFF'">
<mat-icon matListIcon>
<fa-icon icon="user" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Employees</h4>
<p matLine>An employee represents loan officers with no access to systems</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['standing-instructions-history']" *mifosxHasPermission="'READ_STANDINGINSTRUCTION'">
<mat-icon matListIcon>
<fa-icon icon="book" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Standing Instructions History</h4>
<p matLine>View logged history of standing instructions</p>
</mat-list-item>
<div #standinginstructions>
<mat-list-item [routerLink]="['standing-instructions-history']"
*mifosxHasPermission="'READ_STANDINGINSTRUCTION'">
<mat-icon matListIcon>
<fa-icon icon="book" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Standing Instructions History</h4>
<p matLine>View logged history of standing instructions</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['fund-mapping']" *mifosxHasPermission="'READ_OFFICE'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Fund Mapping</h4>
<p matLine>Bulk entry screen for mapping fund sources to loans</p>
</mat-list-item>
<div #fundmapping>
<mat-list-item [routerLink]="['fund-mapping']" *mifosxHasPermission="'READ_OFFICE'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Fund Mapping</h4>
<p matLine>Bulk entry screen for mapping fund sources to loans</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['password-preferences']" *mifosxHasPermission="'READ_PASSWORD_VALIDATION_POLICY'">
<mat-icon matListIcon>
<fa-icon icon="lock" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Password Preferences</h4>
<p matLine>Define standards for enforcing the usage of stronger passwords</p>
</mat-list-item>
<div #investor>
<mat-list-item [routerLink]="['investors']" *mifosxHasPermission="'READ_OFFICE'">
<mat-icon matListIcon>
<fa-icon icon="user-tie" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Investors</h4>
<p matLine>View the loan account details associated with the investors</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['provisioning-criteria']" *mifosxHasPermission="'VIEW_PROVISIONS'">
<mat-icon matListIcon>
<fa-icon icon="edit" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Loan Provisioning Criteria</h4>
<p matLine>Define Loan Provisioning Criteria for Organization</p>
</mat-list-item>
<div #provisioningcriteria>
<mat-list-item [routerLink]="['provisioning-criteria']" *mifosxHasPermission="'VIEW_PROVISIONS'">
<mat-icon matListIcon>
<fa-icon icon="edit" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Loan Provisioning Criteria</h4>
<p matLine>Define Loan Provisioning Criteria for Organization</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['entity-data-table-checks']" *mifosxHasPermission="'READ_ENTITY_DATATABLE_CHECK'">
<mat-icon matListIcon>
<fa-icon icon="check" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Entity Data Table Checks </h4>
<p matLine>Define Entity Data Table Checks for Organization</p>
</mat-list-item>
<div #entitydatatable>
<mat-list-item [routerLink]="['entity-data-table-checks']"
*mifosxHasPermission="'READ_ENTITY_DATATABLE_CHECK'">
<mat-icon matListIcon>
<fa-icon icon="check" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Entity Data Table Checks </h4>
<p matLine>Define Entity Data Table Checks for Organization</p>
</mat-list-item>
</div>
<div #passwordpreferences>
<mat-list-item [routerLink]="['password-preferences']"
*mifosxHasPermission="'READ_PASSWORD_VALIDATION_POLICY'">
<mat-icon matListIcon>
<fa-icon icon="lock" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Password Preferences</h4>
<p matLine>Define standards for enforcing the usage of stronger passwords</p>
</mat-list-item>
</div>
</mat-nav-list>
</div>
@@ -86,84 +108,95 @@
<mat-nav-list>
<div #addEditCurrency>
<mat-list-item [routerLink]="['currencies']" *mifosxHasPermission="'READ_CURRENCY'">
<mat-icon matListIcon>
<fa-icon icon="cogs" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Currency Configuration</h4>
<p matLine>Currencies available across organization for different products</p>
</mat-list-item>
</div>
<div #addEditCurrency>
<mat-list-item [routerLink]="['currencies']" *mifosxHasPermission="'READ_CURRENCY'">
<mat-icon matListIcon>
<fa-icon icon="money-check" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Currency Configuration</h4>
<p matLine>Currencies available across organization for different products</p>
</mat-list-item>
</div>
<div #manageFunds>
<mat-list-item [routerLink]="['manage-funds']" *mifosxHasPermission="'READ_FUND'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Funds</h4>
<p matLine>Funds are associated with loans</p>
</mat-list-item>
</div>
<div #manageFunds>
<mat-list-item [routerLink]="['manage-funds']" *mifosxHasPermission="'READ_FUND'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Manage Funds</h4>
<p matLine>Funds are associated with loans</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['bulkloan']" *mifosxHasPermission="'BULKREASSIGN_LOAN'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Bulk Loan Reassignment</h4>
<p matLine>Easy way to reassign all the loan from one LO to another LO</p>
</mat-list-item>
<div #bulkloan>
<mat-list-item [routerLink]="['bulkloan']" *mifosxHasPermission="'BULKREASSIGN_LOAN'">
<mat-icon matListIcon>
<fa-icon icon="copy" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Bulk Loan Reassignment</h4>
<p matLine>Easy way to reassign all the loan from one LO to another LO</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['tellers']" *mifosxHasPermission="'READ_TELLER'">
<mat-icon matListIcon>
<fa-icon icon="money-bill-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Teller / Cashier Management</h4>
<p matLine>Manage Tellers / Cashiers and Cash Allocation and Settlement</p>
</mat-list-item>
<div #tellers>
<mat-list-item [routerLink]="['tellers']" *mifosxHasPermission="'READ_TELLER'">
<mat-icon matListIcon>
<fa-icon icon="building" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Teller / Cashier Management</h4>
<p matLine>Manage Tellers / Cashiers and Cash Allocation and Settlement</p>
</mat-list-item>
</div>
<div #workingDays>
<mat-list-item [routerLink]="['working-days']" *mifosxHasPermission="'READ_WORKINGDAYS'">
<mat-icon matListIcon>
<fa-icon icon="calendar-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Working Days</h4>
<p matLine>Define working days and configure behaviour of payments due on holidays</p>
</mat-list-item>
</div>
<div #workingDays>
<mat-list-item [routerLink]="['working-days']" *mifosxHasPermission="'READ_WORKINGDAYS'">
<mat-icon matListIcon>
<fa-icon icon="calendar-alt" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Working Days</h4>
<p matLine>Define working days and configure behaviour of payments due on holidays</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['payment-types']" *mifosxHasPermission="'READ_PAYMENTTYPE'">
<mat-icon matListIcon>
<fa-icon icon="dollar-sign" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Payment Type</h4>
<p matLine>Manage payment types</p>
</mat-list-item>
<div #paymenttypes>
<mat-list-item [routerLink]="['payment-types']" *mifosxHasPermission="'READ_PAYMENTTYPE'">
<mat-icon matListIcon>
<fa-icon icon="dollar-sign" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Payment Type</h4>
<p matLine>Manage payment types</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['sms-campaigns']" *mifosxHasPermission="'VIEW_SMSCAMPAIGNS'">
<mat-icon matListIcon>
<fa-icon icon="envelope" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>SMS Campaigns</h4>
<p matLine>Define SMS Campaigns for Organization</p>
</mat-list-item>
<div #smscampaigns>
<mat-list-item [routerLink]="['sms-campaigns']" *mifosxHasPermission="'VIEW_SMSCAMPAIGNS'">
<mat-icon matListIcon>
<fa-icon icon="envelope" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>SMS Campaigns</h4>
<p matLine>Define SMS Campaigns for Organization</p>
</mat-list-item>
</div>
<mat-list-item [routerLink]="['adhoc-query']" *mifosxHasPermission="'VIEW_ADHOC'">
<mat-icon matListIcon>
<fa-icon icon="chevron-right" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>AdHocQuery</h4>
<p matLine>Define AdHocQuery for Organization</p>
</mat-list-item>
<mat-list-item [routerLink]="['bulk-import']" *mifosxHasPermission="'VIEW_BULKIMPORT'">
<mat-icon matListIcon>
<fa-icon icon="upload" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Bulk Import</h4>
<p matLine>Bulk data import using excel spreadsheet templates for clients, offices, etc.</p>
</mat-list-item>
<div #adhocquery>
<mat-list-item [routerLink]="['adhoc-query']" *mifosxHasPermission="'VIEW_ADHOC'">
<mat-icon matListIcon>
<fa-icon icon="chevron-right" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>AdHocQuery</h4>
<p matLine>Define AdHocQuery for Organization</p>
</mat-list-item>
</div>
<div #bulkimports>
<mat-list-item [routerLink]="['bulk-import']" *mifosxHasPermission="'VIEW_BULKIMPORT'">
<mat-icon matListIcon>
<fa-icon icon="upload" size="sm"></fa-icon>
</mat-icon>
<h4 matLine>Bulk Import</h4>
<p matLine>Bulk data import using excel spreadsheet templates for clients, offices, etc.</p>
</mat-list-item>
</div>
</mat-nav-list>
</div>
@@ -178,7 +211,8 @@
<h2>Manage Offices</h2>
<p class="mw300">The Manage Offices page allows you to create, edit and add the offices within your organization.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStepOffice()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStepOffice()">Next</button>
</div>
@@ -186,9 +220,11 @@
<ng-template #templateAddEditCurrency let-popover="popover">
<h2>Currency Configuration</h2>
<p class="mw300">This section allows an organization to define what currencies will be used throughout their interactions within the Mifos X system.</p>
<p class="mw300">This section allows an organization to define what currencies will be used throughout their
interactions within the Mifos X system.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStepAddEditCurrency()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStepAddEditCurrency()">Next</button>
</div>
@@ -196,9 +232,11 @@
<ng-template #templateHolidays let-popover="popover">
<h2>Manage Holidays</h2>
<p class="mw300">The ability to manage holidays for individual offices is a very useful tool for an organization spanning multiple locations.Use this option to customize holidays for each office of your organization.</p>
<p class="mw300">The ability to manage holidays for individual offices is a very useful tool for an organization
spanning multiple locations.Use this option to customize holidays for each office of your organization.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStepHolidays()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStepHolidays()">Next</button>
</div>
@@ -208,7 +246,8 @@
<h2>Manage Employees</h2>
<p class="mw300">With this option, you may view, edit and/or delete your organization's employees.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStepEmployee()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStepEmployee()">Next</button>
</div>
@@ -218,7 +257,8 @@
<h2>Working Days</h2>
<p class="mw300">Working days page allows you to define which days of the week are working days.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStepWorkingDays()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStepWorkingDays()">Next</button>
</div>
@@ -228,7 +268,8 @@
<h2>Manage Funds</h2>
<p class="mw300">This allows you to manage funds associated with loans.</p>
<div fxLayout="row" fxLayoutAlign="end" fxLayoutGap="2%" fxLayout.lt-md="column">
<button mat-raised-button color="warn" (click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="warn"
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
<button mat-raised-button color="primary" (click)="popover.close();previousStepManageFunds()">Back</button>
<button mat-raised-button color="primary" (click)="popover.close();nextStepManageFunds()">Next</button>
</div>
@@ -77,6 +77,7 @@ import { CreateHoliday } from './holidays/create-holiday/create-holiday.service'
import { CreateFundComponent } from './manage-funds/create-fund/create-fund.component';
import { EditFundComponent } from './manage-funds/edit-fund/edit-fund.component';
import { ViewFundComponent } from './manage-funds/view-fund/view-fund.component';
import { InvestorsComponent } from './investors/investors.component';
/**
@@ -154,6 +155,7 @@ import { ViewFundComponent } from './manage-funds/view-fund/view-fund.component'
CreateFundComponent,
EditFundComponent,
ViewFundComponent,
InvestorsComponent,
],
providers: [
CreateHoliday,
@@ -13,6 +13,7 @@ import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan
/** Custom Services */
import { ProductsService } from 'app/products/products.service';
import { SettingsService } from 'app/settings/settings.service';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
@Component({
selector: 'mifosx-create-loan-product',
@@ -47,7 +48,7 @@ export class CreateLoanProductComponent implements OnInit {
const assetAccountData = this.loanProductsTemplate.accountingMappingOptions.assetAccountOptions || [];
const liabilityAccountData = this.loanProductsTemplate.accountingMappingOptions.liabilityAccountOptions || [];
this.loanProductsTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = assetAccountData.concat(liabilityAccountData);
data.configurations.globalConfiguration.forEach((config: any) => {
data.configurations.globalConfiguration.forEach((config: GlobalConfiguration) => {
if (config.name === 'days-before-repayment-is-due') {
this.loanProductsTemplate['dueDaysForRepaymentEvent'] = config.value;
} else if (config.name === 'days-after-repayment-is-overdue') {
@@ -13,6 +13,7 @@ import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan
/** Custom Services */
import { ProductsService } from 'app/products/products.service';
import { SettingsService } from 'app/settings/settings.service';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
@Component({
selector: 'mifosx-edit-loan-product',
@@ -42,11 +43,22 @@ export class EditLoanProductComponent implements OnInit {
private productsService: ProductsService,
private settingsService: SettingsService,
private router: Router) {
this.route.data.subscribe((data: { loanProductAndTemplate: any }) => {
this.route.data.subscribe((data: { loanProductAndTemplate: any, configurations: any }) => {
this.loanProductAndTemplate = data.loanProductAndTemplate;
const assetAccountData = this.loanProductAndTemplate.accountingMappingOptions.assetAccountOptions || [];
const liabilityAccountData = this.loanProductAndTemplate.accountingMappingOptions.liabilityAccountOptions || [];
this.loanProductAndTemplate.accountingMappingOptions.assetAndLiabilityAccountOptions = assetAccountData.concat(liabilityAccountData);
data.configurations.globalConfiguration.forEach((config: GlobalConfiguration) => {
if (config.name === 'days-before-repayment-is-due') {
if (this.loanProductAndTemplate['dueDaysForRepaymentEvent'] == null) {
this.loanProductAndTemplate['dueDaysForRepaymentEvent'] = config.value;
}
} else if (config.name === 'days-after-repayment-is-overdue') {
if (this.loanProductAndTemplate['overDueDaysForRepaymentEvent'] == null) {
this.loanProductAndTemplate['overDueDaysForRepaymentEvent'] = config.value;
}
}
});
});
}
@@ -184,8 +184,8 @@ export class LoanProductSettingsStepComponent implements OnInit {
'graceOnArrearsAgeing': [true]
}),
'delinquencyBucketId': ['', Validators.required],
'dueDaysForRepaymentEvent': [''],
'overDueDaysForRepaymentEvent': ['']
'dueDaysForRepaymentEvent': ['', Validators.required],
'overDueDaysForRepaymentEvent': ['', Validators.required]
});
}
+2 -1
View File
@@ -198,7 +198,8 @@ const routes: Routes = [
component: EditLoanProductComponent,
data: { title: extract('Edit Loan Product'), breadcrumb: 'Edit', routeParamBreadcrumb: false },
resolve: {
loanProductAndTemplate: LoanProductAndTemplateResolver
loanProductAndTemplate: LoanProductAndTemplateResolver,
configurations: GlobalConfigurationsResolver
}
}
]
+3 -1
View File
@@ -20,6 +20,7 @@ import { RunReportResolver } from './common-resolvers/run-report.resolver';
import { MixTaxonomyResolver } from './common-resolvers/mixtaxonomy.resolver';
import { MixMappingsResolver } from './common-resolvers/mixmappings.resolver';
import { GlAccountsResolver } from '../accounting/common-resolvers/gl-accounts.resolver';
import { GlobalConfigurationsResolver } from 'app/system/configurations/global-configurations-tab/global-configurations.resolver';
/** Reports Routes */
const routes: Routes = [
@@ -45,7 +46,8 @@ const routes: Routes = [
data: { title: extract('Reports'), routeParamBreadcrumb: 'name' },
component: RunReportComponent,
resolve: {
reportParameters: RunReportResolver
reportParameters: RunReportResolver,
configurations: GlobalConfigurationsResolver
}
}
]
@@ -6,7 +6,7 @@
<mat-card-content fxLayout="column">
<ng-container *ngFor="let param of paramData" [ngSwitch]="param.displayType">
<ng-container *ngFor="let param of paramData" [ngSwitch]="param.displayType">
<ng-container *ngIf="reportForm.contains(param.name)">
@@ -17,7 +17,7 @@
{{param.label}} is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex *ngSwitchCase="'date'" (click)="runReportDatePicker.open()">
<mat-label>{{param.label}}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="runReportDatePicker" required
@@ -46,7 +46,7 @@
</ng-container>
<mat-form-field fxFlex>
<mat-label>Decimal Places</mat-label>
<mat-label>{{ 'Decimal Places' | translate }}</mat-label>
<mat-select [formControl]="decimalChoice">
<mat-option value="0">0</mat-option>
<mat-option value="1">1</mat-option>
@@ -56,14 +56,27 @@
</mat-select>
</mat-form-field>
<mat-form-field fxFlex *ngIf="report.type === 'Pentaho' && reportForm.contains('outputType')">
<mat-label>Output Type</mat-label>
<mat-select formControlName="outputType" value="HTML">
<mat-option value="HTML">Normal format</mat-option>
<mat-option value="XLS">Excel format</mat-option>
<mat-option value="XLSX">Excel 2007 format</mat-option>
<mat-option value="CSV">CSV format</mat-option>
<mat-option value="PDF">PDF format</mat-option>
<mat-form-field fxFlex *ngIf="isPentahoReport() && reportForm.contains('outputType')">
<mat-label>{{ 'Output Type' | translate }}</mat-label>
<mat-select required [formControlName]="outputType">
<mat-option *ngFor="let option of outputTypeOptions" [value]="option.value">
{{option.name | translate}}
</mat-option>
</mat-select>
</mat-form-field>
<div fxFlex="98%" *ngIf="exportToS3Allowed" >
<mat-checkbox labelPosition="after" formControlName="exportOutputToS3">
Export output data to S3 repository [{{exportToS3Repository}}]
</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>
@@ -72,8 +85,8 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['/reports']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!reportForm.valid" id="runreport">
<fa-icon icon="cogs"></fa-icon>
&nbsp; Run Report
<fa-icon icon="file-export" class="m-r-10"></fa-icon>
{{ 'Run Report' | translate }}
</button>
</mat-card-actions>
@@ -89,12 +102,12 @@
<div class="m-b-20">
<button mat-raised-button color="primary" (click)="isCollapsed = false">
Parameters
{{ 'Parameters' | translate }}
</button>
</div>
<div>
<mifosx-table-and-sms *ngIf="!hideTable"[dataObject]="dataObject"></mifosx-table-and-sms>
<mifosx-table-and-sms *ngIf="!hideTable" [dataObject]="dataObject"></mifosx-table-and-sms>
<mifosx-chart *ngIf="!hideChart" [dataObject]="dataObject"></mifosx-chart>
<mifosx-pentaho *ngIf="!hidePentaho" [dataObject]="dataObject"></mifosx-pentaho>
</div>
@@ -11,6 +11,7 @@ import { SettingsService } from 'app/settings/settings.service';
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';
/**
* Run report component.
@@ -53,6 +54,10 @@ export class RunReportComponent implements OnInit {
hidePentaho = true;
/** Report uses dates */
reportUsesDates = false;
exportToS3Allowed = false;
reportToBeExportedInRepository: any;
exportToS3Repository: string;
outputTypeOptions: any[] = [];
/**
* Fetches report specifications from route params and retrieves report parameters data from `resolve`.
@@ -70,16 +75,32 @@ export class RunReportComponent implements OnInit {
this.report.type = queryParams.type;
this.report.id = queryParams.id;
});
this.route.data.subscribe((data: { reportParameters: ReportParameter[] }) => {
this.route.data.subscribe((data: { reportParameters: ReportParameter[], configurations: any }) => {
this.paramData = data.reportParameters;
if (this.isTableReport()) {
data.configurations.globalConfiguration.forEach((config: GlobalConfiguration) => {
if (config.name === 'report-export-s3-folder-name') {
this.exportToS3Allowed = config.enabled;
this.exportToS3Repository = config.stringValue;
}
});
}
});
}
isTableReport(): boolean {
return (this.report.type === 'Table');
}
isPentahoReport(): boolean {
return (this.report.type === 'Pentaho');
}
/**
* Creates and sets the run report form.
*/
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.maxDate = this.settingsService.maxAllowedDate;
this.createRunReportForm();
}
@@ -102,10 +123,20 @@ export class RunReportComponent implements OnInit {
this.updateParentParameters(parent);
}
});
if (this.report.type === 'Pentaho') {
if (this.isPentahoReport()) {
this.reportForm.addControl('outputType', new FormControl(''));
this.outputTypeOptions = [
{ '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' }
];
this.mapPentahoParams();
}
if (this.exportToS3Allowed) {
this.reportForm.addControl('exportOutputToS3', new FormControl(false));
}
this.decimalChoice.patchValue('0');
this.setChildControls();
}
@@ -179,14 +210,19 @@ export class RunReportComponent implements OnInit {
formatUserResponse(response: any) {
const formattedResponse: any = {};
let newKey: string;
this.reportToBeExportedInRepository = false;
for (const [key, value] of Object.entries(response)) {
if (key === 'outputType') {
formattedResponse['output-type'] = value;
continue;
} else if (key === 'exportOutputToS3') {
this.reportToBeExportedInRepository = value;
continue;
}
const param: ReportParameter = this.paramData
.find((_entry: any) => _entry.name === key);
newKey = this.report.type === 'Pentaho' ? param.pentahoName : param.inputName;
newKey = this.isPentahoReport() ? param.pentahoName : param.inputName;
switch (param.displayType) {
case 'text':
formattedResponse[newKey] = value;
@@ -223,6 +259,9 @@ export class RunReportComponent implements OnInit {
dateFormat: this.settingsService.dateFormat
};
}
if (this.reportToBeExportedInRepository) {
formData['exportS3'] = true;
}
this.dataObject = {
formData: formData,
report: this.report,
@@ -1,12 +1,12 @@
<div *ngIf = "!hideOutput">
<div class="m-b-10" *ngIf = "dataObject.report.type === 'Table'" fxLayoutAlign="end">
<button mat-raised-button color="primary" (click)="downloadCSV()" >
<button mat-raised-button color="primary" (click)="downloadCSV()" [disabled]="notExistsReportData">
Export CSV
</button>
</div>
<div class="table-output">
<div class="table-output" [hidden]="notExistsReportData">
<table mat-table [dataSource]="dataSource">
<div *ngFor= "let column of displayedColumns index as i">
<ng-container [matColumnDef]="column">
@@ -23,4 +23,10 @@
<mat-paginator [pageSizeOptions]="[100, 200, 300]" showFirstLastButtons></mat-paginator>
</div>
<div class="alert" [hidden]="!notExistsReportData">
<div class="message">
<i class="fa fa-exclamation-circle alert-check"></i>
No report data was generated
</div>
</div>
</div>
@@ -2,7 +2,7 @@
import { Component, Input, ViewChild, OnChanges } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { DecimalPipe } from '@angular/common';
import { DecimalPipe, NumberSymbol, getLocaleNumberSymbol } from '@angular/common';
/** Custom Servies */
import { ReportsService } from '../../reports.service';
@@ -30,6 +30,7 @@ export class TableAndSmsComponent implements OnChanges {
hideOutput = true;
/** Data to be converted into CSV file */
csvData: any;
notExistsReportData = false;
/** Paginator for run-report table. */
@ViewChild(MatPaginator) paginator: MatPaginator;
@@ -55,6 +56,7 @@ export class TableAndSmsComponent implements OnChanges {
this.reportsService.getRunReportData(this.dataObject.report.name, this.dataObject.formData)
.subscribe( (res: any) => {
this.csvData = res.data;
this.notExistsReportData = (res.data.length === 0);
this.setOutputTable(res.data);
res.columnHeaders.forEach((header: any) => {
this.columnTypes.push(header.columnDisplayType);
@@ -79,9 +81,14 @@ export class TableAndSmsComponent implements OnChanges {
* Generates the CSV file dynamically for run report data.
*/
downloadCSV() {
const userLang = navigator.language;
const headers = this.displayedColumns;
let csv = this.csvData.map((object: any) => object.row.join());
csv.unshift(`data:text/csv;charset=utf-8,${headers.join()}`);
let delimiter = ',';
if (getLocaleNumberSymbol(userLang, NumberSymbol.CurrencyDecimal) !== '.') {
delimiter = ';';
}
let csv = this.csvData.map((object: any) => object.row.join(delimiter));
csv.unshift(`data:text/csv;charset=utf-8,${headers.join(delimiter)}`);
csv = csv.join('\r\n');
const link = document.createElement('a');
link.setAttribute('href', encodeURI(csv));
@@ -18,8 +18,9 @@ import { AppConfigurationComponent } from './app-configuration/app-configuration
import { TaskManagementComponent } from './task-management/task-management.component';
/** Custom Resolvers */
import { UsersResolver } from './users/users.resolver';
import { ViewUserResolver } from './users/view-user/view-user.resolver';
import { OfficesResolver } from 'app/organization/offices/common-resolvers/offices.resolver';
import { UsersResolver } from 'app/users/users.resolver';
/** Self Service Admin Portal Routes */
const routes: Routes = [
@@ -43,7 +44,10 @@ const routes: Routes = [
{
path: 'create',
component: CreateUserComponent,
data: { title: extract('Create Self Service User'), breadcrumb: 'Create' }
data: { title: extract('Create Self Service User'), breadcrumb: 'Create' },
resolve: {
offices: OfficesResolver
}
},
{
path: 'view/:id',
@@ -89,7 +93,6 @@ const routes: Routes = [
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
providers: [
UsersResolver,
ViewUserResolver
]
})
@@ -12,7 +12,7 @@
<div *ngIf="userType.value === 'Existing User'">
<form>
<form [formGroup]="createUserForm">
<mat-card-content>
@@ -20,18 +20,21 @@
<mat-form-field>
<mat-label>Office</mat-label>
<mat-select>
<mat-option *ngFor="let office of officeData" [value]="office">
{{ office }}
<mat-select required formControlName="officeId">
<mat-option *ngFor="let office of offices" [value]="office.id">
{{ office.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="createUserForm.controls.officeId.hasError('required')">
Office is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Staff</mat-label>
<mat-select>
<mat-option *ngFor="let staff of staffData" [value]="staff">
{{ staff }}
<mat-select formControlName="staffId">
<mat-option *ngFor="let staff of staffOptions" [value]="staff.id">
{{ staff.displayName }}
</mat-option>
</mat-select>
</mat-form-field>
@@ -63,26 +66,29 @@
<div *ngIf="userType.value === 'New User'">
<form>
<form [formGroup]="createUserForm">
<mat-card-content>
<div fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column">
<mat-form-field fxFlex="48%">
<mat-form-field>
<mat-label>Office</mat-label>
<mat-select>
<mat-option *ngFor="let office of officeData" [value]="office">
{{ office }}
<mat-select required formControlName="officeId">
<mat-option *ngFor="let office of offices" [value]="office.id">
{{ office.name }}
</mat-option>
</mat-select>
<mat-error *ngIf="createUserForm.controls.officeId.hasError('required')">
Office is <strong>required</strong>
</mat-error>
</mat-form-field>
<mat-form-field fxFlex="48%">
<mat-label>Staff</mat-label>
<mat-select>
<mat-option *ngFor="let staff of staffData" [value]="staff">
{{ staff }}
<mat-select formControlName="staffId">
<mat-option *ngFor="let staff of staffOptions" [value]="staff.id">
{{ staff.displayName }}
</mat-option>
</mat-select>
</mat-form-field>
@@ -1,6 +1,8 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { ClientsService } from 'app/clients/clients.service';
import { SettingsService } from 'app/settings/settings.service';
/**
@@ -14,17 +16,21 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./create-user.component.scss']
})
export class CreateUserComponent implements OnInit {
/** Create Client Form */
createUserForm: FormGroup;
/** Denotes type of user. */
userTypes = ['Existing User', 'New User'];
/** Radio button group form control for type of user. */
userType = new FormControl(this.userTypes[0]);
/** Placeholder for office data. */
officeData = ['Office 1', 'Office 2'];
offices: any[] = [];
/** Placeholder for staff data. */
staffData = ['Staff 1', 'Staff 2'];
staffOptions: any [] = [];
/** Placeholder for staff data. */
genderOptions: any [] = [];
/** Placeholder for client data. */
clientData = ['Client 1', 'Client 2'];
clientData: any [] = [];
/** Placeholder for gender data. */
genderData = ['Male', 'Female'];
/** Minimum date of birth of user allowed. */
@@ -35,10 +41,42 @@ export class CreateUserComponent implements OnInit {
/**
* @param {SettingsService} settingsService Settings Service
*/
constructor(private settingsService: SettingsService) { }
constructor(private formBuilder: FormBuilder,
private route: ActivatedRoute,
private clientService: ClientsService,
private settingsService: SettingsService) {
this.route.data.subscribe((data: { offices: any }) => {
this.offices = data.offices;
});
}
ngOnInit() {
this.minDate = this.settingsService.minAllowedDate;
this.maxDate = this.settingsService.businessDate;
this.setClientForm();
this.buildDependencies();
}
/**
* Creates the client form.
*/
setClientForm() {
this.createUserForm = this.formBuilder.group({
'officeId': ['', Validators.required],
'staffId': ['', Validators.required]
});
}
/**
* Adds controls conditionally.
*/
buildDependencies() {
this.createUserForm.get('officeId').valueChanges.subscribe((officeId: number) => {
this.clientService.getClientWithOfficeTemplate(officeId).subscribe((clientTemplate: any) => {
this.staffOptions = clientTemplate.staffOptions;
this.genderOptions = clientTemplate.genderOptions;
});
});
}
}
@@ -44,7 +44,12 @@ export class UsersComponent implements OnInit {
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { users: User[] }) => {
this.userData = data.users;
this.userData = [];
data.users.forEach((user: any) => {
if (user.isSelfServiceUser) {
this.userData.push(user);
}
});
});
}
@@ -1,33 +0,0 @@
/** Angular Routes */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { UserService } from './user.service';
/** Custom Model */
import { User } from './user.model';
/**
* Self service users data resolver.
*/
@Injectable()
export class UsersResolver implements Resolve<Object> {
/**
* @param {UserService} userService Self service user service.
*/
constructor(private userService: UserService) {}
/**
* Returns the users data.
* @returns {Observable<User[]>}
*/
resolve(): Observable<User[]> {
return this.userService.getUsers();
}
}
+5 -1
View File
@@ -103,7 +103,9 @@ import {
faInfo,
faTasks,
faCoins,
faPiggyBank
faPiggyBank,
faFileExcel,
faFileExport
} from '@fortawesome/free-solid-svg-icons';
/**
@@ -154,6 +156,8 @@ export class IconsModule {
faFileAlt,
faFileUpload,
faFileWord,
faFileExcel,
faFileExport,
faFillDrip,
faHandHoldingUsd,
faHome,
@@ -0,0 +1,14 @@
/**
* Global Configuration model.
*/
export interface GlobalConfiguration {
id: number;
name: string;
enabled: boolean;
value: any;
trapDoor: boolean;
description?: string;
stringValue?: string;
dateValue?: string;
}