feat(accounting): provisioning entries component
Add provisioning entries component.
This commit is contained in:
@@ -31,6 +31,7 @@ import { ViewRuleComponent } from './accounting-rules/view-rule/view-rule.compon
|
||||
import { ViewAccountingRuleResolver } from './accounting-rules/view-rule/view-rule.resolver';
|
||||
import { EditRuleComponent } from './accounting-rules/edit-rule/edit-rule.component';
|
||||
import { PeriodicAccrualsComponent } from './periodic-accruals/periodic-accruals.component';
|
||||
import { ProvisioningEntriesComponent } from './provisioning-entries/provisioning-entries.component';
|
||||
|
||||
const routes: Routes = [
|
||||
Route.withShell([
|
||||
@@ -206,6 +207,11 @@ const routes: Routes = [
|
||||
path: 'periodic-accruals',
|
||||
component: PeriodicAccrualsComponent,
|
||||
data: { title: extract('Periodic Accrual Accounting'), breadcrumb: 'Execute Periodic Accrual Accounting' }
|
||||
},
|
||||
{
|
||||
path: 'provisioning-entries',
|
||||
component: ProvisioningEntriesComponent,
|
||||
data: { title: extract('Provisioning Entries'), breadcrumb: 'Provisioning Entries' }
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -70,11 +70,9 @@
|
||||
<p matLine>Accrues income, expenses and liabilities as on the provided date</p>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item>
|
||||
<mat-list-item [routerLink]="['/accounting/provisioning-entries']">
|
||||
<mat-icon matListIcon>settings_backup_restore</mat-icon>
|
||||
<a matLine href="https://www.google.com">
|
||||
Provisioning Entries
|
||||
</a>
|
||||
<h4 matLine>Provisioning Entries</h4>
|
||||
<p matLine>Create provisioning entries</p>
|
||||
</mat-list-item>
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import { CreateRuleComponent } from './accounting-rules/create-rule/create-rule.
|
||||
import { ViewRuleComponent } from './accounting-rules/view-rule/view-rule.component';
|
||||
import { EditRuleComponent } from './accounting-rules/edit-rule/edit-rule.component';
|
||||
import { PeriodicAccrualsComponent } from './periodic-accruals/periodic-accruals.component';
|
||||
import { ProvisioningEntriesComponent } from './provisioning-entries/provisioning-entries.component';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -62,7 +63,8 @@ import { PeriodicAccrualsComponent } from './periodic-accruals/periodic-accruals
|
||||
CreateRuleComponent,
|
||||
ViewRuleComponent,
|
||||
EditRuleComponent,
|
||||
PeriodicAccrualsComponent
|
||||
PeriodicAccrualsComponent,
|
||||
ProvisioningEntriesComponent
|
||||
],
|
||||
entryComponents: [
|
||||
RevertTransactionComponent,
|
||||
|
||||
@@ -169,4 +169,8 @@ export class AccountingService {
|
||||
return this.http.post('/runaccruals', periodicAccruals);
|
||||
}
|
||||
|
||||
getProvisioningEntries() {
|
||||
return this.http.get('/provisioningentries');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
|
||||
<button mat-raised-button color="primary" [routerLink]="['/accounting/provisioning-entries/create']">
|
||||
<mat-icon>add</mat-icon> Create Provisioning Entry
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
<div fxLayout="row" fxLayoutGap="20px">
|
||||
<mat-form-field fxFlex>
|
||||
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<div class="mat-elevation-z8">
|
||||
|
||||
<table mat-table [dataSource]="dataSource" matSort>
|
||||
|
||||
<ng-container matColumnDef="createdUser">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Created By </th>
|
||||
<td mat-cell *matCellDef="let provisioningEntry"> {{ provisioningEntry.createdUser }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="createdDate">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Created On </th>
|
||||
<td mat-cell *matCellDef="let provisioningEntry"> {{ provisioningEntry.createdDate }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="journalEntry">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header> Journal Entry Created </th>
|
||||
<td mat-cell *matCellDef="let provisioningEntry"> {{ provisioningEntry.journalEntry }} </td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="viewReport">
|
||||
<th mat-header-cell *matHeaderCellDef> View Report </th>
|
||||
<td mat-cell *matCellDef="let provisioningEntry">
|
||||
<button mat-button>View</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="recreateProvisioning">
|
||||
<th mat-header-cell *matHeaderCellDef> Recreate Provisioning </th>
|
||||
<td mat-cell *matCellDef="let provisioningEntry">
|
||||
<button mat-button>Recreate</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="viewJournalEntry">
|
||||
<th mat-header-cell *matHeaderCellDef> View Journal Entry </th>
|
||||
<td mat-cell *matCellDef="let provisioningEntry">
|
||||
<button mat-button>View</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
|
||||
</table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,3 @@
|
||||
table {
|
||||
width: 100%;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ProvisioningEntriesComponent } from './provisioning-entries.component';
|
||||
|
||||
describe('ProvisioningEntriesComponent', () => {
|
||||
let component: ProvisioningEntriesComponent;
|
||||
let fixture: ComponentFixture<ProvisioningEntriesComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ProvisioningEntriesComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ProvisioningEntriesComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,33 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatSort, MatPaginator, MatTableDataSource } from '@angular/material';
|
||||
|
||||
import { AccountingService } from '../accounting.service';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-provisioning-entries',
|
||||
templateUrl: './provisioning-entries.component.html',
|
||||
styleUrls: ['./provisioning-entries.component.scss']
|
||||
})
|
||||
export class ProvisioningEntriesComponent implements OnInit {
|
||||
|
||||
displayedColumns: string[] = ['createdUser', 'createdDate', 'journalEntry', 'viewReport', 'recreateProvisioning', 'viewJournalEntry'];
|
||||
dataSource: any;
|
||||
|
||||
@ViewChild(MatPaginator) paginator: MatPaginator;
|
||||
@ViewChild(MatSort) sort: MatSort;
|
||||
|
||||
constructor(private accountingService: AccountingService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.getProvisioningEntries();
|
||||
}
|
||||
|
||||
getProvisioningEntries() {
|
||||
this.accountingService.getProvisioningEntries().subscribe((provisioningEntryData: any) => {
|
||||
this.dataSource = new MatTableDataSource(provisioningEntryData);
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user