Răsfoiți Sursa

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

Lee Morgan 5 ani în urmă
părinte
comite
38547fe11a

+ 1 - 1
views/dashboardPage/bundle.js

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