dashboard.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. import homeStrandObj from "./home.js";
  2. // const homeStrandObj = require("./home.js");
  3. // const ingredientsStrandObj = require("./ingredients.js");
  4. // const ordersStrandObj = require("./orders.js");
  5. // const recipeBookStrandObj = require("./recipeBook.js");
  6. // const transactions = require("./transactions.js");
  7. // const addIngredientsComp = require("./addIngredients.js");
  8. // const ingredientDetailsComp = require("./ingredientDetails.js");
  9. // const newIngredientComp = require("./newIngredient.js");
  10. // const newOrderComp = require("./newOrder.js");
  11. // const newRecipeComp = require("./newRecipe.js");
  12. // const newTransactionComp = require("./newTransaction.js");
  13. // const orderDetailsComp = require("./orderDetails.js");
  14. // const recipeDetailsComp = require("./recipeDetails.js");
  15. // const transactionDetailsComp = require("./transactionDetails.js");
  16. class Ingredient{
  17. constructor(id, name, category, unitType, unit, parent){
  18. this.id = id;
  19. this.name = name;
  20. this.category = category;
  21. this.unitType = unitType;
  22. this.unit = unit;
  23. this.parent = parent;
  24. }
  25. convert(quantity){
  26. if(this.unitType === "mass"){
  27. switch(this.unit){
  28. case "g": break;
  29. case "kg": quantity /= 1000; break;
  30. case "oz": quantity /= 28.3495; break;
  31. case "lb": quantity /= 453.5924; break;
  32. }
  33. }else if(this.unitType === "volume"){
  34. switch(this.unit){
  35. case "ml": quantity *= 1000; break;
  36. case "l": break;
  37. case "tsp": quantity *= 202.8842; break;
  38. case "tbsp": quantity *= 67.6278; break;
  39. case "ozfl": quantity *= 33.8141; break;
  40. case "cup": quantity *= 4.1667; break;
  41. case "pt": quantity *= 2.1134; break;
  42. case "qt": quantity *= 1.0567; break;
  43. case "gal": quantity /= 3.7854; break;
  44. }
  45. }else if(this.unitType === "length"){
  46. switch(this.unit){
  47. case "mm": quantity *= 1000; break;
  48. case "cm": quantity *= 100; break;
  49. case "m": break;
  50. case "in": quantity *= 39.3701; break;
  51. case "ft": quantity *= 3.2808; break;
  52. }
  53. }
  54. return quantity;
  55. }
  56. }
  57. class Recipe{
  58. constructor(id, name, price, ingredients, parent){
  59. this.id = id;
  60. this.name = name;
  61. this.price = price;
  62. this.parent = parent;
  63. this.ingredients = [];
  64. for(let i = 0; i < ingredients.length; i++){
  65. for(let j = 0; j < parent.ingredients.length; j++){
  66. if(ingredients[i].ingredient === parent.ingredients[j].ingredient.id){
  67. this.ingredients.push({
  68. ingredient: parent.ingredients[j].ingredient,
  69. quantity: ingredients[i].quantity
  70. });
  71. break;
  72. }
  73. }
  74. }
  75. }
  76. }
  77. class Transaction{
  78. constructor(id, date, recipes, parent){
  79. this.id = id;
  80. this.parent = parent;
  81. this.date = new Date(date);
  82. this.recipes = [];
  83. for(let i = 0; i < recipes.length; i++){
  84. for(let j = 0; j < parent.recipes.length; j++){
  85. if(recipes[i].recipe === parent.recipes[j].id){
  86. this.recipes.push({
  87. recipe: parent.recipes[j],
  88. quantity: recipes[i].quantity
  89. });
  90. break;
  91. }
  92. }
  93. }
  94. }
  95. }
  96. class Order{
  97. constructor(id, name, date, ingredients, parent){
  98. this.id = id;
  99. this.name = name;
  100. this.date = new Date(date);
  101. this.ingredients = [];
  102. this.parent = parent;
  103. for(let i = 0; i < ingredients.length; i++){
  104. for(let j = 0; j < parent.ingredients.length; j++){
  105. if(ingredients[i].ingredient === parent.ingredients[j].ingredient.id){
  106. this.ingredients.push({
  107. ingredient: parent.ingredients[j].ingredient,
  108. quantity: ingredients[i].quantity,
  109. price: ingredients[i].price
  110. });
  111. }
  112. }
  113. }
  114. }
  115. convertPrice(unitType, unit, price){
  116. if(unitType === "mass"){
  117. switch(unit){
  118. case "g": break;
  119. case "kg": price *= 1000; break;
  120. case "oz": price *= 28.3495; break;
  121. case "lb": price *= 453.5924; break;
  122. }
  123. }else if(unitType === "volume"){
  124. switch(unit){
  125. case "ml": price /= 1000; break;
  126. case "l": break;
  127. case "tsp": price /= 202.8842; break;
  128. case "tbsp": price /= 67.6278; break;
  129. case "ozfl": price /= 33.8141; break;
  130. case "cup": price /= 4.1667; break;
  131. case "pt": price /= 2.1134; break;
  132. case "qt": price /= 1.0567; break;
  133. case "gal": price *= 3.7854; break;
  134. }
  135. }else if(unitType === "length"){
  136. switch(unit){
  137. case "mm": price /= 1000; break;
  138. case "cm": price /= 100; break;
  139. case "m": break;
  140. case "in": price /= 39.3701; break;
  141. case "ft": price /= 3.2808; break;
  142. }
  143. }
  144. return price;
  145. }
  146. }
  147. class Merchant{
  148. constructor(oldMerchant, transactions){
  149. this.name = oldMerchant.name;
  150. this.pos = oldMerchant.pos;
  151. this.ingredients = [];
  152. this.recipes = [];
  153. this.transactions = [];
  154. this.orders = [];
  155. this.units = {
  156. mass: ["g", "kg", "oz", "lb"],
  157. volume: ["ml", "l", "tsp", "tbsp", "ozfl", "cup", "pt", "qt", "gal"],
  158. length: ["mm", "cm", "m", "in", "foot"]
  159. }
  160. for(let i = 0; i < oldMerchant.inventory.length; i++){
  161. this.ingredients.push({
  162. ingredient: new Ingredient(
  163. oldMerchant.inventory[i].ingredient._id,
  164. oldMerchant.inventory[i].ingredient.name,
  165. oldMerchant.inventory[i].ingredient.category,
  166. oldMerchant.inventory[i].ingredient.unitType,
  167. oldMerchant.inventory[i].defaultUnit,
  168. this
  169. ),
  170. quantity: oldMerchant.inventory[i].quantity
  171. });
  172. }
  173. for(let i = 0; i < oldMerchant.recipes.length; i++){
  174. this.recipes.push(new Recipe(
  175. oldMerchant.recipes[i]._id,
  176. oldMerchant.recipes[i].name,
  177. oldMerchant.recipes[i].price,
  178. oldMerchant.recipes[i].ingredients,
  179. this
  180. ));
  181. }
  182. for(let i = 0; i < transactions.length; i++){
  183. this.transactions.push(new Transaction(
  184. transactions[i]._id,
  185. transactions[i].date,
  186. transactions[i].recipes,
  187. this
  188. ));
  189. }
  190. }
  191. /*
  192. Updates all specified item in the merchant's inventory and updates the page
  193. If ingredient doesn't exist, add it
  194. ingredients = {
  195. ingredient: Ingredient object,
  196. quantity: new quantity,
  197. defaultUnit: the default unit to be displayed
  198. }
  199. remove = set true if removing
  200. isOrder = set true if this is coming from an order
  201. */
  202. editIngredients(ingredients, remove = false, isOrder = false){
  203. for(let i = 0; i < ingredients.length; i++){
  204. let isNew = true;
  205. for(let j = 0; j < merchant.ingredients.length; j++){
  206. if(merchant.ingredients[j].ingredient === ingredients[i].ingredient){
  207. if(remove){
  208. merchant.ingredients.splice(j, 1);
  209. }else if(!remove && isOrder){
  210. merchant.ingredients[j].quantity += ingredients[i].quantity;
  211. }else{
  212. merchant.ingredients[j].quantity = ingredients[i].quantity;
  213. }
  214. isNew = false;
  215. break;
  216. }
  217. }
  218. if(isNew){
  219. merchant.ingredients.push({
  220. ingredient: ingredients[i].ingredient,
  221. quantity: parseFloat(ingredients[i].quantity),
  222. defaultUnit: ingredients[i].defaultUnit
  223. });
  224. }
  225. }
  226. homeStrandObj.drawInventoryCheckCard();
  227. ingredientsStrandObj.populateByProperty("category");
  228. addIngredientsComp.isPopulated = false;
  229. closeSidebar();
  230. }
  231. /*
  232. Updates a recipe in the merchants list of recipes
  233. Can create, edit or remove
  234. recipe = [Recipe object]
  235. remove = will remove recipe when true
  236. */
  237. editRecipes(recipes, remove = false){
  238. let isNew = true;
  239. for(let i = 0; i < recipes.length; i++){
  240. for(let j = 0; j < this.recipes.length; j++){
  241. if(recipes[i] === this.recipes[j]){
  242. if(remove){
  243. this.recipes.splice(j, 1);
  244. }else{
  245. this.recipes[j] = recipes[i];
  246. }
  247. isNew = false;
  248. break;
  249. }
  250. }
  251. if(isNew){
  252. merchant.recipes.push(recipes[i]);
  253. }
  254. }
  255. transactionsStrandObj.isPopulated = false;
  256. recipeBookStrandObj.populateRecipes();
  257. closeSidebar();
  258. }
  259. /*
  260. Updates a list of orders in the merchants list of orders
  261. Create/edit/remove
  262. orders = [Order object]
  263. remove = will remove order when true
  264. */
  265. editOrders(orders, remove = false){
  266. for(let i = 0; i < orders.length; i++){
  267. let isNew = true;
  268. for(let j = 0; j < this.orders.length; j++){
  269. if(orders[i] === this.orders[j]){
  270. if(remove){
  271. this.orders.splice(j, 1);
  272. }else{
  273. this.orders[j] = orders[i];
  274. }
  275. isNew = false;
  276. break;
  277. }
  278. }
  279. if(isNew){
  280. this.orders.push(orders[i]);
  281. }
  282. }
  283. ordersStrandObj.populate();
  284. closeSidebar();
  285. }
  286. editTransactions(transaction, remove = false){
  287. let isNew = true;
  288. for(let i = 0; i < this.transactions.length; i++){
  289. if(this.transactions[i] === transaction){
  290. if(remove){
  291. this.transactions.splice(i, 1);
  292. }
  293. isNew = false;
  294. break;
  295. }
  296. }
  297. if(isNew){
  298. this.transactions.push(transaction);
  299. this.transactions.sort((a, b) => a.date > b.date ? 1 : -1);
  300. }
  301. transactionsStrandObj.isPopulated = false;
  302. transactionsStrandObj.display();
  303. closeSidebar();
  304. }
  305. /*
  306. Gets the indices of two dates from transactions
  307. Inputs
  308. from: starting date
  309. to: ending date (default to now)
  310. Output
  311. Array containing starting index and ending index
  312. Note: Will return false if it cannot find both necessary dates
  313. */
  314. transactionIndices(from, to = new Date()){
  315. let indices = [];
  316. for(let i = 0; i < this.transactions.length; i++){
  317. if(this.transactions[i].date > from){
  318. indices.push(i);
  319. break;
  320. }
  321. }
  322. for(let i = this.transactions.length - 1; i >=0; i--){
  323. if(this.transactions[i].date < to){
  324. indices.push(i);
  325. break;
  326. }
  327. }
  328. if(indices.length < 2){
  329. return false;
  330. }
  331. return indices;
  332. }
  333. revenue(indices){
  334. let total = 0;
  335. for(let i = indices[0]; i <= indices[1]; i++){
  336. for(let j = 0; j < this.transactions[i].recipes.length; j++){
  337. for(let k = 0; k < this.recipes.length; k++){
  338. if(this.transactions[i].recipes[j].recipe === this.recipes[k]){
  339. total += this.transactions[i].recipes[j].quantity * this.recipes[k].price;
  340. }
  341. }
  342. }
  343. }
  344. return total / 100;
  345. }
  346. /*
  347. Gets the quantity of each ingredient sold between two dates (dateRange)
  348. Inputs
  349. dateRange: list containing a start date and an end date
  350. Return:
  351. [{
  352. ingredient: Ingredient object,
  353. quantity: quantity of ingredient sold
  354. }]
  355. */
  356. ingredientsSold(dateRange){
  357. if(!dateRange){
  358. return false;
  359. }
  360. let recipes = this.recipesSold(dateRange);
  361. let ingredientList = [];
  362. for(let i = 0; i < recipes.length; i++){
  363. for(let j = 0; j < recipes[i].recipe.ingredients.length; j++){
  364. let exists = false;
  365. for(let k = 0; k < ingredientList.length; k++){
  366. if(ingredientList[k].ingredient === recipes[i].recipe.ingredients[j].ingredient){
  367. exists = true;
  368. ingredientList[k].quantity += recipes[i].quantity * recipes[i].recipe.ingredients[j].quantity;
  369. break;
  370. }
  371. }
  372. if(!exists){
  373. ingredientList.push({
  374. ingredient: recipes[i].recipe.ingredients[j].ingredient,
  375. quantity: recipes[i].quantity * recipes[i].recipe.ingredients[j].quantity
  376. });
  377. }
  378. }
  379. }
  380. return ingredientList;
  381. }
  382. singleIngredientSold(dateRange, ingredient){
  383. let total = 0;
  384. for(let i = dateRange[0]; i < dateRange[1]; i++){
  385. for(let j = 0; j < this.transactions[i].recipes.length; j++){
  386. for(let k = 0; k < this.transactions[i].recipes[j].recipe.ingredients.length; k++){
  387. if(this.transactions[i].recipes[j].recipe.ingredients[k].ingredient === ingredient.ingredient){
  388. total += this.transactions[i].recipes[j].recipe.ingredients[k].quantity;
  389. break;
  390. }
  391. }
  392. }
  393. }
  394. return total;
  395. }
  396. /*
  397. Gets the number of recipes sold between two dates (dateRange)
  398. Inputs:
  399. dateRange: array containing a start date and an end date
  400. Return:
  401. [{
  402. recipe: a recipe object
  403. quantity: quantity of the recipe sold
  404. }]
  405. */
  406. recipesSold(dateRange){
  407. let recipeList = [];
  408. for(let i = dateRange[0]; i <= dateRange[1]; i++){
  409. for(let j = 0; j < this.transactions[i].recipes.length; j++){
  410. let exists = false;
  411. for(let k = 0; k < recipeList.length; k++){
  412. if(recipeList[k].recipe === this.transactions[i].recipes[j].recipe){
  413. exists = true;
  414. recipeList[k].quantity += this.transactions[i].recipes[j].quantity;
  415. break;
  416. }
  417. }
  418. if(!exists){
  419. recipeList.push({
  420. recipe: this.transactions[i].recipes[j].recipe,
  421. quantity: this.transactions[i].recipes[j].quantity
  422. });
  423. }
  424. }
  425. }
  426. return recipeList;
  427. }
  428. /*
  429. Create revenue data for graphing
  430. Input:
  431. dateRange: [start index, end index] (this.transactionIndices)
  432. Return:
  433. [total revenue for each day]
  434. */
  435. graphDailyRevenue(dateRange){
  436. if(!dateRange){
  437. return false;
  438. }
  439. let dataList = new Array(30).fill(0);
  440. let currentDate = this.transactions[dateRange[0]].date;
  441. let arrayIndex = 0;
  442. for(let i = dateRange[0]; i <= dateRange[1]; i++){
  443. if(this.transactions[i].date.getDate() !== currentDate.getDate()){
  444. currentDate = this.transactions[i].date;
  445. arrayIndex++;
  446. }
  447. for(let j = 0; j < this.transactions[i].recipes.length; j++){
  448. dataList[arrayIndex] += (this.transactions[i].recipes[j].recipe.price / 100) * this.transactions[i].recipes[j].quantity;
  449. }
  450. }
  451. return dataList;
  452. }
  453. /*
  454. Groups all of the merchant's ingredients by their category
  455. Return: [{
  456. name: category name,
  457. ingredients: [Ingredient Object]
  458. }]
  459. */
  460. categorizeIngredients(){
  461. let ingredientsByCategory = [];
  462. for(let i = 0; i < this.ingredients.length; i++){
  463. let categoryExists = false;
  464. for(let j = 0; j < ingredientsByCategory.length; j++){
  465. if(this.ingredients[i].ingredient.category === ingredientsByCategory[j].name){
  466. ingredientsByCategory[j].ingredients.push(this.ingredients[i]);
  467. categoryExists = true;
  468. break;
  469. }
  470. }
  471. if(!categoryExists){
  472. ingredientsByCategory.push({
  473. name: this.ingredients[i].ingredient.category,
  474. ingredients: [this.ingredients[i]]
  475. });
  476. }
  477. }
  478. return ingredientsByCategory;
  479. }
  480. unitizeIngredients(){
  481. let ingredientsByUnit = [];
  482. for(let i = 0; i < this.ingredients.length; i++){
  483. let unitExists = false;
  484. for(let j = 0; j < ingredientsByUnit.length; j++){
  485. if(this.ingredients[i].ingredient.unit === ingredientsByUnit[j].name){
  486. ingredientsByUnit[j].ingredients.push(this.ingredients[i]);
  487. unitExists = true;
  488. break;
  489. }
  490. }
  491. if(!unitExists){
  492. ingredientsByUnit.push({
  493. name: this.ingredients[i].ingredient.unit,
  494. ingredients: [this.ingredients[i]]
  495. });
  496. }
  497. }
  498. return ingredientsByUnit;
  499. }
  500. getRecipesForIngredient(ingredient){
  501. let recipes = [];
  502. for(let i = 0; i < this.recipes.length; i++){
  503. for(let j = 0; j < this.recipes[i].ingredients.length; j++){
  504. if(this.recipes[i].ingredients[j].ingredient === ingredient){
  505. recipes.push(this.recipes[i]);
  506. }
  507. }
  508. }
  509. return recipes;
  510. }
  511. }
  512. let convertToMain = (unit, quantity)=>{
  513. let converted = 0;
  514. if(merchant.units.mass.includes(unit)){
  515. switch(unit){
  516. case "g": converted = quantity; break;
  517. case "kg": converted = quantity * 1000; break;
  518. case "oz": converted = quantity * 28.3495; break;
  519. case "lb": converted = quantity * 453.5924; break;
  520. }
  521. }else if(merchant.units.volume.includes(unit)){
  522. switch(unit){
  523. case "ml": converted = quantity / 1000; break;
  524. case "l": converted = quantity; break;
  525. case "tsp": converted = quantity / 202.8842; break;
  526. case "tbsp": converted = quantity / 67.6278; break;
  527. case "ozfl": converted = quantity / 33.8141; break;
  528. case "cup": converted = quantity / 4.1667; break;
  529. case "pt": converted = quantity / 2.1134; break;
  530. case "qt": converted = quantity / 1.0567; break;
  531. case "gal": converted = quantity * 3.7854; break;
  532. }
  533. }else if(merchant.units.length.includes(unit)){
  534. switch(unit){
  535. case "mm": converted = quantity / 1000; break;
  536. case "cm": converted = quantity / 100; break;
  537. case "m": converted = quantity; break;
  538. case "in": converted = quantity / 39.3701; break;
  539. case "ft": converted = quantity / 3.2808; break;
  540. }
  541. }else{
  542. converted = quantity;
  543. }
  544. return converted;
  545. }
  546. /*
  547. Switches to a different strand
  548. Input:
  549. name: name of the strand. Must end with "Strand"
  550. */
  551. let changeStrand = (name)=>{
  552. closeSidebar();
  553. for(let strand of document.querySelectorAll(".strand")){
  554. strand.style.display = "none";
  555. }
  556. let buttons = document.querySelectorAll(".menuButton");
  557. for(let i = 0; i < buttons.length - 1; i++){
  558. buttons[i].classList = "menuButton";
  559. buttons[i].onclick = ()=>{changeStrand(`${buttons[i].id.slice(0, buttons[i].id.indexOf("Btn"))}Strand`)};
  560. }
  561. let activeButton = document.querySelector(`#${name.slice(0, name.indexOf("Strand"))}Btn`);
  562. activeButton.classList = "menuButton active";
  563. activeButton.onclick = undefined;
  564. document.querySelector(`#${name}`).style.display = "flex";
  565. window[`${name}Obj`].display();
  566. if(window.screen.availWidth <= 1000){
  567. closeMenu();
  568. }
  569. }
  570. //Close any open sidebar
  571. let closeSidebar = ()=>{
  572. let sidebar = document.querySelector("#sidebarDiv");
  573. for(let i = 0; i < sidebar.children.length; i++){
  574. sidebar.children[i].style.display = "none";
  575. }
  576. sidebar.classList = "sidebarHide";
  577. if(window.screen.availWidth <= 1000){
  578. document.querySelector(".contentBlock").style.display = "flex";
  579. document.getElementById("mobileMenuSelector").style.display = "block";
  580. document.getElementById("sidebarCloser").style.display = "none";
  581. }
  582. }
  583. /*
  584. Open a specific sidebar
  585. Input:
  586. sidebar: the outermost element of the sidebar (must contain class sidebar)
  587. */
  588. let openSidebar = (sidebar)=>{
  589. document.querySelector("#sidebarDiv").classList = "sidebar";
  590. let sideBars = document.querySelector("#sidebarDiv").children;
  591. for(let i = 0; i < sideBars.length; i++){
  592. sideBars[i].style.display = "none";
  593. }
  594. sidebar.style.display = "flex";
  595. if(window.screen.availWidth <= 1000){
  596. document.querySelector(".contentBlock").style.display = "none";
  597. document.getElementById("mobileMenuSelector").style.display = "none";
  598. document.getElementById("sidebarCloser").style.display = "block";
  599. }
  600. }
  601. let changeMenu = ()=>{
  602. let menu = document.querySelector(".menu");
  603. let buttons = document.querySelectorAll(".menuButton");
  604. if(!menu.classList.contains("menuMinimized")){
  605. menu.classList = "menu menuMinimized";
  606. for(let button of buttons){
  607. button.children[1].style.display = "none";
  608. }
  609. document.querySelector("#max").style.display = "none";
  610. document.querySelector("#min").style.display = "flex";
  611. }else if(menu.classList.contains("menuMinimized")){
  612. menu.classList = "menu";
  613. for(let button of buttons){
  614. button.children[1].style.display = "block";
  615. }
  616. setTimeout(()=>{
  617. document.querySelector("#max").style.display = "flex";
  618. document.querySelector("#min").style.display = "none";
  619. }, 150);
  620. }
  621. }
  622. let openMenu = ()=>{
  623. document.getElementById("menu").style.display = "flex";
  624. document.querySelector(".contentBlock").style.display = "none";
  625. document.getElementById("mobileMenuSelector").onclick = ()=>{closeMenu()};
  626. }
  627. let closeMenu = ()=>{
  628. document.getElementById("menu").style.display = "none";
  629. document.querySelector(".contentBlock").style.display = "flex";
  630. document.getElementById("mobileMenuSelector").onclick = ()=>{openMenu()};
  631. }
  632. if(window.screen.availWidth > 1000 && window.screen.availWidth <= 1400){
  633. changeMenu();
  634. document.getElementById("menuShifter2").style.display = "none";
  635. }
  636. let merchant = new Merchant(data.merchant, data.transactions);
  637. console.log(merchant);
  638. module.exports = merchant;
  639. homeStrandObj.display();