Merge remote-tracking branch 'origin/development' into james/heropoints
This commit is contained in:
commit
e1bf569f37
16 changed files with 342 additions and 24 deletions
6
.gitattributes
vendored
6
.gitattributes
vendored
|
@ -15,3 +15,9 @@
|
||||||
*.PDF diff=astextplain
|
*.PDF diff=astextplain
|
||||||
*.rtf diff=astextplain
|
*.rtf diff=astextplain
|
||||||
*.RTF diff=astextplain
|
*.RTF diff=astextplain
|
||||||
|
|
||||||
|
# ensures font files are loaded as binary not text
|
||||||
|
*.ttf binary
|
||||||
|
*.eot binary
|
||||||
|
*.woff binary
|
||||||
|
*.woff2 binary
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
# Force sudo due to issue in travis
|
||||||
|
sudo: required
|
||||||
addons:
|
addons:
|
||||||
chrome: stable
|
chrome: stable
|
||||||
language: node_js
|
language: node_js
|
||||||
|
|
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -2,6 +2,19 @@
|
||||||
|
|
||||||
# Next Release
|
# Next Release
|
||||||
|
|
||||||
|
* Amended category list on transaction submission
|
||||||
|
* Added budget view for weekly breakdown of spend by category
|
||||||
|
|
||||||
|
# v0.1.3
|
||||||
|
|
||||||
|
* Made fix to Travis config
|
||||||
|
|
||||||
|
# v0.1.2
|
||||||
|
|
||||||
|
* Removed unused button
|
||||||
|
* Added ability to choose category for transaction
|
||||||
|
* Added version bump on Angular
|
||||||
|
|
||||||
# v0.1.1
|
# v0.1.1
|
||||||
|
|
||||||
* Redid layout on circle customer view
|
* Redid layout on circle customer view
|
||||||
|
|
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "localloop-web",
|
"name": "localloop-web",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "localloop-web",
|
"name": "localloop-web",
|
||||||
"version": "0.1.1",
|
"version": "0.1.3",
|
||||||
"description": "LocalLoop Web - Web interface for LocalLoop app",
|
"description": "LocalLoop Web - Web interface for LocalLoop app",
|
||||||
"author": "",
|
"author": "",
|
||||||
"url": "http://www.peartrade.org",
|
"url": "http://www.peartrade.org",
|
||||||
|
|
|
@ -25,17 +25,33 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-md-3 form-control-label" for="text-input">Category</label>
|
<label class="col-md-3 form-control-label" for="text-input">Budget Type</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div class="input-group">
|
<div class="row">
|
||||||
<select type="text" class="form-control" [(ngModel)]="categoryId">
|
<div class="col-md-6">
|
||||||
<option value="">Uncategorised</option>
|
<div>
|
||||||
<option *ngFor="let category of categoryIdList, let i=index" [ngValue]="category" >
|
<label>
|
||||||
{{ categoryNameList[i] }}
|
<input value="" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||||
</option>
|
Uncategorised
|
||||||
</select>
|
</label>
|
||||||
|
</div>
|
||||||
|
<div class="radio" *ngFor="let category of leftCategoryIdList, let i=index">
|
||||||
|
<label>
|
||||||
|
<input [value]="category" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||||
|
{{ categoryNameList[i] }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="radio" *ngFor="let category2 of rightCategoryIdList, let i=index">
|
||||||
|
<label>
|
||||||
|
<input [value]="category2" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||||
|
{{ categoryNameList[category2 - 1] }}
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="help-block"><strong>Optional:</strong> Choose the relevant Category for the purchase.</span>
|
<span class="help-block"><strong>Optional:</strong> Choose the Budget Type for the majority of the purchase.</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
|
|
@ -39,7 +39,8 @@ export class AddDataComponent implements OnInit {
|
||||||
transactionFormInvalid = true;
|
transactionFormInvalid = true;
|
||||||
myDate: any;
|
myDate: any;
|
||||||
minDate: any;
|
minDate: any;
|
||||||
categoryIdList: number[] = [];
|
leftCategoryIdList: number[] = [];
|
||||||
|
rightCategoryIdList: number[] = [];
|
||||||
categoryNameList: string[] = [];
|
categoryNameList: string[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
|
@ -85,8 +86,14 @@ export class AddDataComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
private setCategoryList(data: any) {
|
private setCategoryList(data: any) {
|
||||||
this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
|
let categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
|
||||||
this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
||||||
|
console.log(categoryIdList);
|
||||||
|
let halfLength = Math.floor(categoryIdList.length / 2);
|
||||||
|
this.leftCategoryIdList = categoryIdList.splice(0, halfLength);
|
||||||
|
console.log(this.leftCategoryIdList);
|
||||||
|
this.rightCategoryIdList = categoryIdList;
|
||||||
|
console.log(this.rightCategoryIdList);
|
||||||
}
|
}
|
||||||
|
|
||||||
getMinDate() {
|
getMinDate() {
|
||||||
|
|
128
src/app/dashboard/category-month.component.html
Normal file
128
src/app/dashboard/category-month.component.html
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
<div class="animated fadeIn">
|
||||||
|
<div class=row>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<h4 class="card-title float-left mb-0">Purchases Last Week</h4>
|
||||||
|
</div><!--/.col-->
|
||||||
|
</div><!--/.row-->
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<ul class="horizontal-bars type-2">
|
||||||
|
<li *ngFor="let categoryEntry of weekList1 | slice:0:categoryLimit1; let i=index;">
|
||||||
|
<span class="title">{{ categoryNameList[categoryEntry.category] || 'Uncategorised' }}</span>
|
||||||
|
<span class="value">{{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} <span class="text-muted small">
|
||||||
|
({{ (categoryEntry.value || 0 ) / weekListValueSum1 | percent:'1.0-0' }})</span></span>
|
||||||
|
<div class="bars">
|
||||||
|
<div class="progress" style="height: 6px;">
|
||||||
|
<div class="progress-bar bg-success" role="progressbar"
|
||||||
|
[style.width]="(categoryEntry.value || 0 ) / weekListValueSum1 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<div *ngIf="weekList1 !== undefined">
|
||||||
|
<li *ngIf="weekList1.length > categoryLimit1 && disableCategoryButton1 == false" class="divider text-center">
|
||||||
|
<button type="button" class="btn btn-sm btn-link text-muted" (click)="loadMore1()"><i class="icon-options"></i></button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!--/.col-->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<h4 class="card-title float-left mb-0">Purchases 1 Week Ago</h4>
|
||||||
|
</div><!--/.col-->
|
||||||
|
</div><!--/.row-->
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<ul class="horizontal-bars type-2">
|
||||||
|
<li *ngFor="let categoryEntry of weekList2 | slice:0:categoryLimit2; let i=index;">
|
||||||
|
<span class="title">{{ categoryNameList[categoryEntry.category] || 'Uncategorised' }}</span>
|
||||||
|
<span class="value">{{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} <span class="text-muted small">
|
||||||
|
({{ (categoryEntry.value || 0 ) / weekListValueSum2 | percent:'1.0-0' }})</span></span>
|
||||||
|
<div class="bars">
|
||||||
|
<div class="progress" style="height: 6px;">
|
||||||
|
<div class="progress-bar bg-success" role="progressbar"
|
||||||
|
[style.width]="(categoryEntry.value || 0 ) / weekListValueSum2 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<div *ngIf="!weekList2 == null">
|
||||||
|
<li *ngIf="weekList2.length > categoryLimit2 && disableCategoryButtonFirst == false" class="divider text-center">
|
||||||
|
<button type="button" class="btn btn-sm btn-link text-muted" (click)="loadMore2()"><i class="icon-options"></i></button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!--/.col-->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<h4 class="card-title float-left mb-0">Purchases 2 Weeks Ago</h4>
|
||||||
|
</div><!--/.col-->
|
||||||
|
</div><!--/.row-->
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<ul class="horizontal-bars type-2">
|
||||||
|
<li *ngFor="let categoryEntry of weekList3 | slice:0:categoryLimit3; let i=index;">
|
||||||
|
<span class="title">{{ categoryNameList[categoryEntry.category] || 'Uncategorised' }}</span>
|
||||||
|
<span class="value">{{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} <span class="text-muted small">
|
||||||
|
({{ (categoryEntry.value || 0 ) / weekListValueSum3 | percent:'1.0-0' }})</span></span>
|
||||||
|
<div class="bars">
|
||||||
|
<div class="progress" style="height: 6px;">
|
||||||
|
<div class="progress-bar bg-success" role="progressbar"
|
||||||
|
[style.width]="(categoryEntry.value || 0 ) / weekListValueSum3 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<div *ngIf="weekList3 !== undefined">
|
||||||
|
<li *ngIf="weekList3.length > categoryLimit3 && disableCategoryButtonFirst == false" class="divider text-center">
|
||||||
|
<button type="button" class="btn btn-sm btn-link text-muted" (click)="loadMore3()"><i class="icon-options"></i></button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!--/.col-->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-block">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12">
|
||||||
|
<h4 class="card-title float-left mb-0">Purchases 3 Weeks Ago</h4>
|
||||||
|
</div><!--/.col-->
|
||||||
|
</div><!--/.row-->
|
||||||
|
<div class="chart-wrapper">
|
||||||
|
<ul class="horizontal-bars type-2">
|
||||||
|
<li *ngFor="let categoryEntry of weekList4 | slice:0:categoryLimit4; let i=index;">
|
||||||
|
<span class="title">{{ categoryNameList[categoryEntry.category] || 'Uncategorised' }}</span>
|
||||||
|
<span class="value">{{ ( categoryEntry.value || 0 ) | currency:'GBP':'symbol':'1.2-2' }} <span class="text-muted small">
|
||||||
|
({{ (categoryEntry.value || 0 ) / weekListValueSum4 | percent:'1.0-0' }})</span></span>
|
||||||
|
<div class="bars">
|
||||||
|
<div class="progress" style="height: 6px;">
|
||||||
|
<div class="progress-bar bg-success" role="progressbar"
|
||||||
|
[style.width]="(categoryEntry.value || 0 ) / weekListValueSum4 | percent:'1.0-0'" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
<div *ngIf="!weekList4 == null">
|
||||||
|
<li *ngIf="weekList4.length > categoryLimit4 && disableCategoryButtonFirst == false" class="divider text-center">
|
||||||
|
<button type="button" class="btn btn-sm btn-link text-muted" (click)="loadMore4()"><i class="icon-options"></i></button>
|
||||||
|
</li>
|
||||||
|
</div>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!--/.col-->
|
||||||
|
</div><!--/.row-->
|
||||||
|
</div>
|
128
src/app/dashboard/category-month.component.ts
Normal file
128
src/app/dashboard/category-month.component.ts
Normal file
|
@ -0,0 +1,128 @@
|
||||||
|
import { Directive, Component, OnInit } from '@angular/core';
|
||||||
|
import { ApiService } from '../providers/api-service';
|
||||||
|
import { DataType } from '../shared/data-types.enum';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
import 'rxjs/add/operator/map';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
templateUrl: 'category-month.component.html'
|
||||||
|
})
|
||||||
|
export class CategoryMonthComponent implements OnInit {
|
||||||
|
|
||||||
|
disableCategoryButton1: boolean = false;
|
||||||
|
disableCategoryButton2: boolean = false;
|
||||||
|
disableCategoryButton3: boolean = false;
|
||||||
|
disableCategoryButton4: boolean = false;
|
||||||
|
|
||||||
|
weekPurchaseList = {
|
||||||
|
first: 0,
|
||||||
|
};
|
||||||
|
|
||||||
|
weekList1 = [];
|
||||||
|
weekList2 = [];
|
||||||
|
weekList3 = [];
|
||||||
|
weekList4 = [];
|
||||||
|
weekListValueSum1: number = 0;
|
||||||
|
weekListValueSum2: number = 0;
|
||||||
|
weekListValueSum3: number = 0;
|
||||||
|
weekListValueSum4: number = 0;
|
||||||
|
|
||||||
|
categoryList: number[] = [];
|
||||||
|
dayList: any[] = [];
|
||||||
|
valueList: number[] = [];
|
||||||
|
myWeek1: any;
|
||||||
|
myWeek2: any;
|
||||||
|
myWeek3: any;
|
||||||
|
myWeek4: any;
|
||||||
|
categoryIdList: number[] = [];
|
||||||
|
categoryNameList: string[] = [];
|
||||||
|
categoryLimit1: number = 6;
|
||||||
|
categoryLimit2: number = 6;
|
||||||
|
categoryLimit3: number = 6;
|
||||||
|
categoryLimit4: number = 6;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private api: ApiService,
|
||||||
|
) {
|
||||||
|
this.setDate();
|
||||||
|
this.api.categoryList().subscribe(
|
||||||
|
result => {
|
||||||
|
this.setCategoryList(result.categories);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.log('Retrieval Error');
|
||||||
|
console.log( error._body );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
this.api.categoryTransactionList().subscribe(
|
||||||
|
result => {
|
||||||
|
this.setData(result);
|
||||||
|
},
|
||||||
|
error => {
|
||||||
|
console.log('Retrieval Error');
|
||||||
|
console.log( error._body );
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
}
|
||||||
|
|
||||||
|
private setCategoryList(data: any) {
|
||||||
|
this.categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
|
||||||
|
this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
||||||
|
}
|
||||||
|
|
||||||
|
private setDate () {
|
||||||
|
this.myWeek1 = moment().startOf('isoWeek').format('YYYY-MM-DD');
|
||||||
|
this.myWeek2 = moment(this.myWeek1).subtract(1, 'weeks').format('YYYY-MM-DD');
|
||||||
|
this.myWeek3 = moment(this.myWeek2).subtract(1, 'weeks').format('YYYY-MM-DD');
|
||||||
|
this.myWeek4 = moment(this.myWeek3).subtract(1, 'weeks').format('YYYY-MM-DD');
|
||||||
|
}
|
||||||
|
|
||||||
|
private setData (data: any) {
|
||||||
|
function prop<T, K extends keyof T>(obj: T, key: K) {
|
||||||
|
return obj[key];
|
||||||
|
}
|
||||||
|
this.weekList1 = prop(data.data, this.myWeek1);
|
||||||
|
this.weekList2 = prop(data.data, this.myWeek2);
|
||||||
|
this.weekList3 = prop(data.data, this.myWeek3);
|
||||||
|
this.weekList4 = prop(data.data, this.myWeek4);
|
||||||
|
this.getMaxValue(this.weekList1, this.weekList2, this.weekList3, this.weekList4);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getMaxValue (data1: any,
|
||||||
|
data2: any,
|
||||||
|
data3: any,
|
||||||
|
data4: any) {
|
||||||
|
if (data1) {
|
||||||
|
this.weekListValueSum1 = data1.reduce(function (s, a) {return s + a.value;}, 0);
|
||||||
|
}
|
||||||
|
if (data2) {
|
||||||
|
this.weekListValueSum2 = data2.reduce(function (s, a) {return s + a.value;}, 0);
|
||||||
|
}
|
||||||
|
if (data3) {
|
||||||
|
this.weekListValueSum3 = data3.reduce(function (s, a) {return s + a.value;}, 0);
|
||||||
|
}
|
||||||
|
if (data4) {
|
||||||
|
this.weekListValueSum4 = data4.reduce(function (s, a) {return s + a.value;}, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private loadMore1 () {
|
||||||
|
this.disableCategoryButton1 = true;
|
||||||
|
this.categoryLimit1 = 20;
|
||||||
|
}
|
||||||
|
private loadMore2 () {
|
||||||
|
this.disableCategoryButton2 = true;
|
||||||
|
this.categoryLimit2 = 20;
|
||||||
|
}
|
||||||
|
private loadMore3 () {
|
||||||
|
this.disableCategoryButton3 = true;
|
||||||
|
this.categoryLimit3 = 20;
|
||||||
|
}
|
||||||
|
private loadMore4 () {
|
||||||
|
this.disableCategoryButton4 = true;
|
||||||
|
this.categoryLimit4 = 20;
|
||||||
|
}
|
||||||
|
}
|
|
@ -94,7 +94,7 @@
|
||||||
<strong>{{ sectorPurchases[i] || 'N/A' }}</strong>
|
<strong>{{ sectorPurchases[i] || 'N/A' }}</strong>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="sectorLetters.length > 10 && disableSectorButton == false" class="divider text-center">
|
<li *ngIf="sectorLetters.length > sectorLimit && disableSectorButton == false" class="divider text-center">
|
||||||
<button type="button" class="btn btn-sm btn-link text-muted" (click)="loadMore()"><i class="icon-options"></i></button>
|
<button type="button" class="btn btn-sm btn-link text-muted" (click)="loadMore()"><i class="icon-options"></i></button>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -168,7 +168,7 @@ export class DashboardCustomerComponent implements OnInit {
|
||||||
this.sectorPurchases = Object.keys(data.purchases).map(key => data.purchases[key]);
|
this.sectorPurchases = Object.keys(data.purchases).map(key => data.purchases[key]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public loadMore () {
|
private loadMore () {
|
||||||
this.disableSectorButton = true;
|
this.disableSectorButton = true;
|
||||||
this.sectorLimit = 22;
|
this.sectorLimit = 22;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,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 { CategoryMonthComponent } from './category-month.component';
|
||||||
import { PayrollLogComponent } from './payroll-log.component';
|
import { PayrollLogComponent } from './payroll-log.component';
|
||||||
import { LeaderboardComponent } from './leaderboard.component';
|
import { LeaderboardComponent } from './leaderboard.component';
|
||||||
import { MapComponent } from './map.component';
|
import { MapComponent } from './map.component';
|
||||||
|
@ -67,6 +68,7 @@ import { NgPipesModule } from 'ngx-pipes';
|
||||||
OrgResultComponent,
|
OrgResultComponent,
|
||||||
OrgTableComponent,
|
OrgTableComponent,
|
||||||
TransactionLogComponent,
|
TransactionLogComponent,
|
||||||
|
CategoryMonthComponent,
|
||||||
TransactionResultComponent,
|
TransactionResultComponent,
|
||||||
PayrollLogComponent,
|
PayrollLogComponent,
|
||||||
PayrollResultComponent,
|
PayrollResultComponent,
|
||||||
|
|
|
@ -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 { CategoryMonthComponent } from './category-month.component';
|
||||||
import { PayrollLogComponent } from './payroll-log.component';
|
import { PayrollLogComponent } from './payroll-log.component';
|
||||||
import { LeaderboardComponent } from './leaderboard.component';
|
import { LeaderboardComponent } from './leaderboard.component';
|
||||||
import { MapComponent } from './map.component';
|
import { MapComponent } from './map.component';
|
||||||
|
@ -59,6 +60,11 @@ const routes: Routes = [
|
||||||
component: TransactionLogComponent,
|
component: TransactionLogComponent,
|
||||||
data: { title: 'Transaction Log' },
|
data: { title: 'Transaction Log' },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'category-month',
|
||||||
|
component: CategoryMonthComponent,
|
||||||
|
data: { title: 'Budget' },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'map',
|
path: 'map',
|
||||||
component: MapComponent,
|
component: MapComponent,
|
||||||
|
|
|
@ -81,6 +81,14 @@
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" routerLinkActive="active" [routerLink]="['/category-month']">
|
||||||
|
<div class="row no-gutters align-items-center">
|
||||||
|
<div class="col-2"><i class="icon-basket"></i></div>
|
||||||
|
<div class="col-10">Budget</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li *ngIf="accountType == 'organisation'" class="nav-item">
|
<li *ngIf="accountType == 'organisation'" class="nav-item">
|
||||||
<a class="nav-link" routerLinkActive="active" [routerLink]="['/payroll-log']">
|
<a class="nav-link" routerLinkActive="active" [routerLink]="['/payroll-log']">
|
||||||
<div class="row no-gutters align-items-center">
|
<div class="row no-gutters align-items-center">
|
||||||
|
|
|
@ -4,15 +4,6 @@
|
||||||
<div class="col-sm-8">
|
<div class="col-sm-8">
|
||||||
<h4 class="card-title mb-0">All Purchases</h4>
|
<h4 class="card-title mb-0">All Purchases</h4>
|
||||||
</div><!--/.col-->
|
</div><!--/.col-->
|
||||||
<div class="col-sm-4 hidden-sm-down">
|
|
||||||
<div class="btn-toolbar float-right" role="toolbar" aria-label="Toolbar with button groups">
|
|
||||||
<div class="btn-group mr-3" data-toggle="buttons" aria-label="First group">
|
|
||||||
<label class="btn btn-outline-secondary active">
|
|
||||||
<input type="radio" name="options" id="option2" checked> Week
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div><!--/.col-->
|
|
||||||
</div><!--/.row-->
|
</div><!--/.row-->
|
||||||
<div class="chart-wrapper">
|
<div class="chart-wrapper">
|
||||||
<canvas baseChart class="chart"
|
<canvas baseChart class="chart"
|
||||||
|
|
|
@ -127,6 +127,17 @@ export class ApiService {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Basic Customer User stats API
|
||||||
|
public categoryTransactionList() {
|
||||||
|
const key = this.sessionKey;
|
||||||
|
return this.http.post<any>(
|
||||||
|
this.apiUrl + '/stats/category',
|
||||||
|
{
|
||||||
|
session_key : key,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Searches organisations used for transaction submission
|
// Searches organisations used for transaction submission
|
||||||
|
|
||||||
public search(data) {
|
public search(data) {
|
||||||
|
|
Reference in a new issue