Bläddra i källkod

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

Lee Morgan 5 år sedan
förälder
incheckning
38547fe11a
2 ändrade filer med 2 tillägg och 2 borttagningar
  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;
                 }
             }
         }