|
|
@@ -429,7 +429,7 @@ class Merchant{
|
|
|
for(let i = 0; i < transaction.recipes.length; i++){
|
|
|
const recipe = transaction.recipes[i];
|
|
|
for(let j = 0; j < recipe.recipe.ingredients.length; j++){
|
|
|
- const ingredient = recipe.ingredients[i];
|
|
|
+ const ingredient = recipe.recipe.ingredients[i];
|
|
|
if(ingredients[ingredient.ingredient.id]){
|
|
|
ingredients[ingredient.ingredient.id] += recipe.quantity * ingredient.quantity;
|
|
|
}else{
|
|
|
@@ -3060,10 +3060,13 @@ let newTransaction = {
|
|
|
);
|
|
|
|
|
|
merchant.addTransaction(transaction);
|
|
|
- banner.createNotification("NEW TRANSACTION CREATED, INGREDIENTS UPDATED ACCORDINGLY");
|
|
|
+
|
|
|
+ controller.openStrand("transactions");
|
|
|
+ banner.createNotification("TRANSACTION CREATED");
|
|
|
}
|
|
|
})
|
|
|
.catch((err)=>{
|
|
|
+ console.log(err);
|
|
|
banner.createError("SOMETHING WENT WRONG. PLEASE REFRESH THE PAGE");
|
|
|
})
|
|
|
.finally(()=>{
|