소스 검색

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

Lee Morgan 5 년 전
부모
커밋
8324385703
2개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  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 = {
     /*