Forráskód Böngészése

Bug Fix: uploading an ingredient spreadsheet was not correctly handling bottle items.

Lee Morgan 5 éve
szülő
commit
8324385703
2 módosított fájl, 4 hozzáadás és 0 törlés
  1. 3 0
      controllers/ingredientData.js
  2. 1 0
      controllers/orderData.js

+ 3 - 0
controllers/ingredientData.js

@@ -197,6 +197,9 @@ module.exports = {
             }
 
             if(array[i][locations.bottle] === true){
+                let quantity = array[i][locations.quantity] * array[i][locations.bottleSize];
+                merchantItem.quantity = helper.convertQuantityToBaseUnit(quantity, array[i][locations.unit]);
+                
                 ingredient.unitType = "volume";
                 ingredient.specialUnit = "bottle";
                 ingredient.unitSize = helper.convertQuantityToBaseUnit(array[i][locations.bottleSize], array[i][locations.unit]);

+ 1 - 0
controllers/orderData.js

@@ -6,6 +6,7 @@ const helper = require("./helper.js");
 const ObjectId = require("mongoose").Types.ObjectId;
 const xlsx = require("xlsx");
 const fs = require("fs");
+const { base } = require("../models/merchant.js");
 
 module.exports = {
     /*