diff --git a/src/app/dashboard/add-data.component.html b/src/app/dashboard/add-data.component.html index c413237..dea50d2 100644 --- a/src/app/dashboard/add-data.component.html +++ b/src/app/dashboard/add-data.component.html @@ -24,6 +24,15 @@ Enter the amount spent, such as 5.35 for £5.35. +
+ +
+
+ +
+ Tick if the purchase is deemed an essential purchase for budgeting purposes. +
+
diff --git a/src/app/dashboard/add-data.component.ts b/src/app/dashboard/add-data.component.ts index 48622bf..94a0274 100644 --- a/src/app/dashboard/add-data.component.ts +++ b/src/app/dashboard/add-data.component.ts @@ -32,6 +32,7 @@ export class AddDataComponent implements OnInit { amount: number; // Assumes Groceries is 1st category categoryId: number = 1; + essentialPurchase = false; transactionAdditionType = 1; storeList = []; showAddStore = false; @@ -88,12 +89,9 @@ export class AddDataComponent implements OnInit { private setCategoryList(data: any) { let categoryIdList = Object.keys(data.ids).map(key => data.ids[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() { @@ -196,6 +194,7 @@ export class AddDataComponent implements OnInit { purchase_time : purchaseTime, organisation_id : this.organisationId, category : this.categoryId, + essential : this.essentialPurchase, }; break; case 2: @@ -204,7 +203,7 @@ export class AddDataComponent implements OnInit { transaction_value : this.amount, purchase_time : purchaseTime, organisation_id : this.organisationId, - category : this.categoryId, + essential : this.essentialPurchase, }; break; case 3: @@ -216,7 +215,7 @@ export class AddDataComponent implements OnInit { street_name : this.submitOrg.street_name, town : this.submitOrg.town, postcode : this.submitOrg.postcode, - category : this.categoryId, + essential : this.essentialPurchase, }; break; } diff --git a/src/app/dashboard/category-month.component.html b/src/app/dashboard/category-month.component.html index 0a7c91f..42a3d7a 100644 --- a/src/app/dashboard/category-month.component.html +++ b/src/app/dashboard/category-month.component.html @@ -10,8 +10,19 @@