Functionality fully added
This commit is contained in:
parent
7b03f6adff
commit
089e7f7a97
9 changed files with 49 additions and 5 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
# Next Release
|
# Next Release
|
||||||
|
|
||||||
|
* Payroll Log Data added
|
||||||
* Fixed register box view on login page
|
* Fixed register box view on login page
|
||||||
* Made the form reset properly if adding a new one
|
* Made the form reset properly if adding a new one
|
||||||
* Added better error messages on register and account edit
|
* Added better error messages on register and account edit
|
||||||
|
|
|
@ -13,6 +13,7 @@ import { AccountEditComponent } from './account-edit.component';
|
||||||
import { AddDataComponent } from './add-data.component';
|
import { AddDataComponent } from './add-data.component';
|
||||||
import { FeedbackComponent } from './feedback.component';
|
import { FeedbackComponent } from './feedback.component';
|
||||||
import { TransactionLogComponent } from './transaction-log.component';
|
import { TransactionLogComponent } from './transaction-log.component';
|
||||||
|
import { PayrollLogComponent } from './payroll-log.component';
|
||||||
|
|
||||||
import { GraphWidget } from '../widgets/graph-widget.component';
|
import { GraphWidget } from '../widgets/graph-widget.component';
|
||||||
import { OrgBarSnippetComponent } from '../snippets/org-snippet-bar.component';
|
import { OrgBarSnippetComponent } from '../snippets/org-snippet-bar.component';
|
||||||
|
@ -22,6 +23,7 @@ import { DashboardRoutingModule } from './dashboard.routing';
|
||||||
import { OrgResultComponent } from '../shared/org-result.component';
|
import { OrgResultComponent } from '../shared/org-result.component';
|
||||||
import { OrgTableComponent } from '../shared/org-table.component';
|
import { OrgTableComponent } from '../shared/org-table.component';
|
||||||
import { TransactionResultComponent } from '../shared/transaction-result.component';
|
import { TransactionResultComponent } from '../shared/transaction-result.component';
|
||||||
|
import { PayrollResultComponent } from '../shared/payroll-result.component';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -43,6 +45,8 @@ import { TransactionResultComponent } from '../shared/transaction-result.compone
|
||||||
OrgTableComponent,
|
OrgTableComponent,
|
||||||
TransactionLogComponent,
|
TransactionLogComponent,
|
||||||
TransactionResultComponent,
|
TransactionResultComponent,
|
||||||
|
PayrollLogComponent,
|
||||||
|
PayrollResultComponent,
|
||||||
FeedbackComponent,
|
FeedbackComponent,
|
||||||
GraphWidget,
|
GraphWidget,
|
||||||
OrgBarSnippetComponent,
|
OrgBarSnippetComponent,
|
||||||
|
|
|
@ -12,6 +12,7 @@ import { AccountEditComponent } from './account-edit.component';
|
||||||
import { AddDataComponent } from './add-data.component';
|
import { AddDataComponent } from './add-data.component';
|
||||||
import { FeedbackComponent } from './feedback.component';
|
import { FeedbackComponent } from './feedback.component';
|
||||||
import { TransactionLogComponent } from './transaction-log.component';
|
import { TransactionLogComponent } from './transaction-log.component';
|
||||||
|
import { PayrollLogComponent } from './payroll-log.component';
|
||||||
|
|
||||||
// Using child path to allow for FullLayout theming
|
// Using child path to allow for FullLayout theming
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
|
@ -48,6 +49,12 @@ const routes: Routes = [
|
||||||
component: TransactionLogComponent,
|
component: TransactionLogComponent,
|
||||||
data: { title: 'Transaction Log' },
|
data: { title: 'Transaction Log' },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'payroll-log',
|
||||||
|
component: PayrollLogComponent,
|
||||||
|
data: { title: 'Payroll Log' },
|
||||||
|
canActivate: [OrgGuard],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'feedback',
|
path: 'feedback',
|
||||||
component: FeedbackComponent,
|
component: FeedbackComponent,
|
||||||
|
|
|
@ -10,13 +10,13 @@
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Seller</th>
|
<th>Entry Period</th>
|
||||||
<th>Value</th>
|
<th>Gross Payroll</th>
|
||||||
<th>Purchase Time</th>
|
<th>Employees</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr transaction-result *ngFor="let payroll of payrollList | paginate: paginateConfig" [payroll]="payroll"></tr>
|
<tr payroll-result *ngFor="let payroll of payrollList | paginate: paginateConfig" [payroll]="payroll"></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<pagination-template #p="paginationApi"
|
<pagination-template #p="paginationApi"
|
||||||
|
|
|
@ -45,6 +45,11 @@
|
||||||
<i class="icon-basket"></i> Transaction Log
|
<i class="icon-basket"></i> Transaction Log
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li *ngIf="accountType == 'organisation'" class="nav-item">
|
||||||
|
<a class="nav-link" routerLinkActive="active" [routerLink]="['/payroll-log']">
|
||||||
|
<i class="icon-basket"></i> Payroll Log
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -8,6 +8,7 @@ import { Router } from '@angular/router';
|
||||||
})
|
})
|
||||||
export class FullLayoutComponent implements OnInit {
|
export class FullLayoutComponent implements OnInit {
|
||||||
public displayName: string;
|
public displayName: string;
|
||||||
|
public accountType: any;
|
||||||
public disabled = false;
|
public disabled = false;
|
||||||
public status: {isopen: boolean} = {isopen: false};
|
public status: {isopen: boolean} = {isopen: false};
|
||||||
|
|
||||||
|
@ -29,6 +30,7 @@ export class FullLayoutComponent implements OnInit {
|
||||||
// getDisplayName function from api didnt work
|
// getDisplayName function from api didnt work
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.displayName = localStorage.getItem('displayname') || 'User';
|
this.displayName = localStorage.getItem('displayname') || 'User';
|
||||||
|
this.accountType = localStorage.getItem('usertype');
|
||||||
}
|
}
|
||||||
|
|
||||||
userLogout() {
|
userLogout() {
|
||||||
|
|
3
src/app/shared/payroll-result.component.html
Normal file
3
src/app/shared/payroll-result.component.html
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<td>{{payrollDate}}</td>
|
||||||
|
<td>{{payroll.gross_payroll | currency:'GBP':true:'1.2-2' }}</td>
|
||||||
|
<td>{{payroll.employee_amount}}</td>
|
22
src/app/shared/payroll-result.component.ts
Normal file
22
src/app/shared/payroll-result.component.ts
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
|
||||||
|
interface PayrollData {
|
||||||
|
entry_period: string;
|
||||||
|
gross_payroll: number;
|
||||||
|
employee_amount: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
// tslint:disable-next-line
|
||||||
|
selector: '[payroll-result]',
|
||||||
|
templateUrl: 'payroll-result.component.html',
|
||||||
|
})
|
||||||
|
export class PayrollResultComponent implements OnInit {
|
||||||
|
@Input() public payroll: PayrollData;
|
||||||
|
public payrollDate: string;
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.payrollDate = moment(this.payroll.entry_period).format('MMMM YYYY');
|
||||||
|
}
|
||||||
|
}
|
|
@ -3,7 +3,7 @@ import * as moment from 'moment';
|
||||||
|
|
||||||
interface TransactionData {
|
interface TransactionData {
|
||||||
seller: number;
|
seller: number;
|
||||||
value: string;
|
value: number;
|
||||||
purchase_time: string;
|
purchase_time: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Reference in a new issue