Browse Source

Remove all unused functions from frontend classes.

Lee Morgan 4 năm trước cách đây
mục cha
commit
c062c5b26d

+ 0 - 17
views/dashboardPage/js/classes/Merchant.js

@@ -520,23 +520,6 @@ class Merchant{
         }
     }
 
-    getRevenue(from, to = new Date()){
-        const {start, end} = this.getTransactionIndices(from, to);
-
-        let total = 0;
-        for(let i = start; i < end; i++){
-            for(let j = 0; j < this.transactions[i].recipes.length; j++){
-                for(let k = 0; k < this.recipes.length; k++){
-                    if(this.transactions[i].recipes[j].recipe === this.recipes[k]){
-                        total += this.transactions[i].recipes[j].quantity * this.recipes[k].price;
-                    }
-                }
-            }
-        }
-
-        return total;
-    }
-
     /*
     Gets the quantity of each ingredient sold between two dates (dateRange)
     Inputs:

+ 0 - 4
views/dashboardPage/js/classes/Order.js

@@ -62,10 +62,6 @@ class OrderIngredient{
         }
     }
 
-    get pricePerBaseUnit(){
-        return this._pricePerUnit;
-    }
-
     cost(){
         return (this._quantity * this._pricePerUnit) / 100;
     }

+ 1 - 1
views/dashboardPage/js/classes/Recipe.js

@@ -106,7 +106,7 @@ class Recipe{
         }
 
         for(let i = 0; i < this.ingredients.length; i++){
-            traverseIngredient(this.ingredients[i]._ingredient, this.ingredients[i]._quantity);
+            traverseIngredient(this.ingredients[i].ingredient, this.ingredients[i]._quantity);
         }
     }
 }