瀏覽代碼

Bug Fix: Ingredient in analytics was not multiplying by the count of the recipe within the transaction.

Lee Morgan 5 年之前
父節點
當前提交
38547fe11a
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      views/dashboardPage/bundle.js
  2. 1 1
      views/dashboardPage/js/classes/Transaction.js

+ 1 - 1
views/dashboardPage/bundle.js

@@ -1289,7 +1289,7 @@ class Transaction{
             const recipe = this._recipes[i].recipe;
             for(let j = 0; j < recipe.ingredients.length; j++){
                 if(recipe.ingredients[j].ingredient === ingredient){
-                    quantity += recipe.ingredients[j].quantity;
+                    quantity += recipe.ingredients[j].quantity * this._recipes[i].quantity;
                 }
             }
         }

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

@@ -75,7 +75,7 @@ class Transaction{
             const recipe = this._recipes[i].recipe;
             for(let j = 0; j < recipe.ingredients.length; j++){
                 if(recipe.ingredients[j].ingredient === ingredient){
-                    quantity += recipe.ingredients[j].quantity;
+                    quantity += recipe.ingredients[j].quantity * this._recipes[i].quantity;
                 }
             }
         }