Fix to sort loan charges by due date (#1744)
Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
c09bc5c4bc
commit
1c453d1b2c
@@ -88,6 +88,6 @@
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" class="select-row" [routerLink]="[row.id]"></tr>
|
||||
</table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
<mat-paginator [pageSizeOptions]="[50, 100, 200]" showFirstLastButtons></mat-paginator>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort } from '@angular/material/sort';
|
||||
import { MatTableDataSource, MatTable } from '@angular/material/table';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
@@ -65,6 +65,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
this.status = this.loanDetails.status.value;
|
||||
let actionFlag;
|
||||
this.chargesData.forEach((element: any) => {
|
||||
element.dueDate = this.dateUtils.parseDate(element.dueDate);
|
||||
if (element.paid || element.waived || element.chargeTimeType.value === 'Disbursement' || this.loanDetails.status.value !== 'Active') {
|
||||
actionFlag = true;
|
||||
} else {
|
||||
@@ -72,6 +73,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
}
|
||||
element.actionFlag = actionFlag;
|
||||
});
|
||||
this.chargesData = this.chargesData.sort(function(a: any, b: any) { return b.dueDate - a.dueDate; } );
|
||||
this.dataSource = new MatTableDataSource(this.chargesData);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<div class="container m-b-20 space-top" fxLayout="row" fxLayoutGap="20px">
|
||||
<div #schedulerStatus>
|
||||
<h2 class="no-m">Scheduler Status:<span class="m-l-20 m-r-20">{{ schedulerActive ? 'Active' : 'Inactive' }}</span></h2>
|
||||
<h2 class="no-m">Scheduler Status:<span class="m-l-20 m-r-20">{{ schedulerActive ? 'Active' : 'Inactive' }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
<button mat-raised-button class="suspend" (click)="suspendScheduler()" *ngIf="schedulerActive">
|
||||
<fa-icon icon="times-circle" class="m-r-10"></fa-icon>
|
||||
@@ -35,13 +36,14 @@
|
||||
|
||||
<ng-container matColumnDef="select">
|
||||
<th mat-header-cell *matHeaderCellDef>
|
||||
<mat-checkbox class="m-r-10" (change)="$event ? masterToggle() : null" [checked]="selection.hasValue() && isAllSelected()"
|
||||
<mat-checkbox class="m-r-10" (change)="$event ? masterToggle() : null"
|
||||
[checked]="selection.hasValue() && isAllSelected()"
|
||||
[indeterminate]="selection.hasValue() && !isAllSelected()">
|
||||
</mat-checkbox>
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let row">
|
||||
<mat-checkbox class="m-r-10" (click)="$event.stopPropagation()" (change)="$event ? selection.toggle(row) : null"
|
||||
[checked]="selection.isSelected(row)">
|
||||
<mat-checkbox class="m-r-10" *ngIf="!row.currentlyRunning && row.active" (click)="$event.stopPropagation()"
|
||||
(change)="$event ? selection.toggle(row) : null" [checked]="selection.isSelected(row)">
|
||||
</mat-checkbox>
|
||||
</td>
|
||||
</ng-container>
|
||||
@@ -51,6 +53,16 @@
|
||||
<td mat-cell *matCellDef="let job"> {{ job.displayName }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="active">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Active ? </th>
|
||||
<td mat-cell *matCellDef="let job" class="center">
|
||||
<div [className]="job.active === true ? 'currently-running' : 'not-currently-running'">
|
||||
<fa-icon matTooltip="{{ job.active === true ? 'Yes' : 'No' }}" matTooltipPosition="right" icon="circle"
|
||||
size="lg"></fa-icon>
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="nextRunTime">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Next Run </th>
|
||||
<td mat-cell *matCellDef="let job"> {{ job.nextRunTime }} </td>
|
||||
@@ -113,7 +125,7 @@
|
||||
<h2>Template</h2>
|
||||
<p>This is the template I am trying to use. Is that fine.</p>
|
||||
<button (click)="popover.close();nextStepSchedulerJobs()">Next</button>
|
||||
</ng-template>
|
||||
</ng-template>
|
||||
</button>
|
||||
<button mat-raised-button color="primary" (click)="refresh()">
|
||||
<fa-icon icon="sync" class="m-r-10"></fa-icon>
|
||||
@@ -124,26 +136,35 @@
|
||||
<ng-template #templateSchedulerStatus let-data let-popover="popover">
|
||||
<h4>Scheduler Status. Button will be used to change the status.</h4>
|
||||
<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();previousStep()">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true)">Next</button>
|
||||
<button mat-raised-button color="primary"
|
||||
(click)="popover.close();showPopover(templateFilter, filter, 'bottom', true)">Next</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #templateFilter let-data let-popover="popover">
|
||||
<h4>Search bar to filter jobs.</h4>
|
||||
<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="primary" (click)="popover.close();showPopover(templateSchedulerStatus,schedulerStatus, 'bottom', true)">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();showPopover(templateJobsTable,jobsTable, 'top', true)">Next</button>
|
||||
<button mat-raised-button color="warn"
|
||||
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
|
||||
<button mat-raised-button color="primary"
|
||||
(click)="popover.close();showPopover(templateSchedulerStatus,schedulerStatus, 'bottom', true)">Back</button>
|
||||
<button mat-raised-button color="primary"
|
||||
(click)="popover.close();showPopover(templateJobsTable,jobsTable, 'top', true)">Next</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<ng-template #templateJobsTable let-data let-popover="popover">
|
||||
<h4>List of all scheduled batch jobs <a href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895356/Manage+Scheduler+Jobs" target="_blank">Schedular Jobs</a></h4>
|
||||
<h4>List of all scheduled batch jobs <a
|
||||
href="https://mifosforge.jira.com/wiki/spaces/docs/pages/67895356/Manage+Scheduler+Jobs" target="_blank">Schedular
|
||||
Jobs</a></h4>
|
||||
<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="primary" (click)="popover.close();showPopover(templateFilter, filter, 'bottom', true)">Back</button>
|
||||
<button mat-raised-button color="warn"
|
||||
(click)="popover.close();configurationWizardService.closeConfigWizard()">Close</button>
|
||||
<button mat-raised-button color="primary"
|
||||
(click)="popover.close();showPopover(templateFilter, filter, 'bottom', true)">Back</button>
|
||||
<button mat-raised-button color="primary" (click)="popover.close();nextStep()">Next</button>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
@@ -8,7 +8,6 @@ import { SelectionModel } from '@angular/cdk/collections';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { of } from 'rxjs';
|
||||
import { SystemService } from '../../system.service';
|
||||
|
||||
/** Custom Services */
|
||||
@@ -33,7 +32,7 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
|
||||
/** Scheduler data */
|
||||
schedulerData: any;
|
||||
/** Columns to be displayed in manage scheduler jobs table. */
|
||||
displayedColumns: string[] = ['select', 'displayName', 'nextRunTime', 'previousRunTime', 'previousRunStatus', 'currentlyRunning', 'errorLog'];
|
||||
displayedColumns: string[] = ['select', 'displayName', 'active', 'nextRunTime', 'previousRunTime', 'previousRunStatus', 'currentlyRunning', 'errorLog'];
|
||||
/** Data source for manage scheduler jobs table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
/** Initialize Selection */
|
||||
@@ -216,7 +215,7 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
|
||||
* Next Step (Accounting) Dialog Configuration Wizard.
|
||||
*/
|
||||
openNextStepDialog() {
|
||||
const nextStepDialogRef = this.dialog.open( NextStepDialogComponent, {
|
||||
const nextStepDialogRef = this.dialog.open(NextStepDialogComponent, {
|
||||
data: {
|
||||
nextStepName: 'Setup Accounting',
|
||||
previousStepName: 'System',
|
||||
@@ -235,5 +234,5 @@ export class ManageSchedulerJobsComponent implements OnInit, AfterViewInit {
|
||||
this.router.navigate(['/home']);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user