+
Unranked
-
-
{{ basicStats.user_position }}
+
+ {{ userPosition }}
My Total Spend
- {{ basicStats.user_sum | currency:'GBP':'symbol':'1.2-2' }}
+ {{ userSum | currency:'GBP':'symbol':'1.2-2' }}
Value to Local Economy
- {{ basicStats.user_sum * 2.3 | currency:'GBP':'symbol':'1.2-2' }}
+ {{ userSum * 2.3 | currency:'GBP':'symbol':'1.2-2' }}
diff --git a/src/app/snippets/cust-snippet-bar.component.ts b/src/app/snippets/cust-snippet-bar.component.ts
index c680ece..93ac86d 100644
--- a/src/app/snippets/cust-snippet-bar.component.ts
+++ b/src/app/snippets/cust-snippet-bar.component.ts
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
-import { OrgSnippetsService } from '../providers/org-snippets.service';
+import { CustSnippetsService } from '../providers/cust-snippets.service';
@Component({
selector: 'snippet-bar-cust',
@@ -7,41 +7,19 @@ import { OrgSnippetsService } from '../providers/org-snippets.service';
})
export class CustBarSnippetComponent implements OnInit {
- public thisMonthSalesCount = 0;
- public thisMonthSalesTotal = 0;
- public thisWeekSalesCount = 0;
- public thisWeekSalesTotal = 0;
- public todaySalesCount = 0;
- public todaySalesTotal = 0;
-
- public thisMonthPurchasesCount = 0;
- public thisMonthPurchasesTotal = 0;
- public thisWeekPurchasesCount = 0;
- public thisWeekPurchasesTotal = 0;
- public todayPurchasesCount = 0;
- public todayPurchasesTotal = 0;
+ public userSum = 0;
+ public userPosition = 0;
constructor(
- private snippetsService: OrgSnippetsService,
+ private snippetsService: CustSnippetsService,
) { }
public ngOnInit(): void {
this.snippetsService.getData()
.subscribe(
result => {
- this.thisMonthSalesCount = result.snippets.this_month_sales_count;
- this.thisMonthSalesTotal = result.snippets.this_month_sales_total;
- this.thisWeekSalesCount = result.snippets.this_week_sales_count;
- this.thisWeekSalesTotal = result.snippets.this_week_sales_total;
- this.todaySalesCount = result.snippets.today_sales_count;
- this.todaySalesTotal = result.snippets.today_sales_total;
-
- this.thisMonthPurchasesCount = result.snippets.this_week_purchases_count;
- this.thisMonthPurchasesTotal = result.snippets.this_week_purchases_total;
- this.thisWeekPurchasesCount = result.snippets.this_month_purchases_count;
- this.thisWeekPurchasesTotal = result.snippets.this_month_purchases_total;
- this.todayPurchasesCount = result.snippets.today_purchases_count;
- this.todayPurchasesTotal = result.snippets.today_purchases_total;
+ this.userSum = result.snippets.user_sum;
+ this.userPosition = result.snippets.user_position;
}
);
}