inventory.ejs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>The Subline</title>
  6. <link rel="icon" type="img/png" href="/shared/images/logo.png">
  7. <link rel="stylesheet" href="/inventoryPage/inventory.css">
  8. <link rel="stylesheet" href="/shared/shared.css">
  9. </head>
  10. <body>
  11. <% include ../shared/header %>
  12. <% include ../shared/banner %>
  13. <div id="inventoryStrand">
  14. <h1><span><%= merchant.name %></span> inventory</h1>
  15. <div class="options">
  16. <a class="button" href="/recipes">View Recipes</a>
  17. <button class="button" onclick="addIngredientObj.display()">Add Ingredient</button>
  18. <button class="button" onclick="enterPurchaseObj.display()">Enter Purchases</button>
  19. <% if(merchant.pos === "none"){ %>
  20. <button class="button" onclick="enterTransactionsObj.display()">Enter Transactions</button>
  21. <% } %>
  22. </div>
  23. <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="FILTER INGREDIENTS">
  24. <table>
  25. <thead>
  26. <tr>
  27. <th onclick="inventoryObj.sortIngredients('name')">Item</th>
  28. <th onclick="inventoryObj.sortIngredients('category')">Category</th>
  29. <th onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
  30. <th onclick="inventoryObj.sortIngredients('unit')">Unit</th>
  31. <th>Actions</th>
  32. </tr>
  33. <tbody></tbody>
  34. </thead>
  35. </table>
  36. </div>
  37. <div id="addIngredientStrand" class="add-ingredient">
  38. <button class="button" onclick="inventoryObj.display()">Back to Inventory</button>
  39. <div class="container">
  40. <form onsubmit="addIngredientObj.submitAdd()">
  41. <h2>Select Ingredient</h2>
  42. <label>Ingredient
  43. <select id="addName"></select>
  44. </label>
  45. <label>Quantity
  46. <input id="addQuantity" type="number" step="0.01" required>
  47. </label>
  48. <input class="button" type="submit" value="Add Ingredient">
  49. </form>
  50. <form onsubmit="addIngredientObj.submitNew()">
  51. <h2>Create New Ingredient</h2>
  52. <label>Name
  53. <input id="newName" type="text" required>
  54. </label>
  55. <label>Category
  56. <input id="newCategory" type="text" required>
  57. </label>
  58. <label>Unit
  59. <input id="newUnit" type="text" required>
  60. </label>
  61. <label>Quantity
  62. <input id="newQuantity" type="number" step="0.01" required>
  63. </label>
  64. <input class="button" type="submit" value="Create Ingredient">
  65. </form>
  66. </div>
  67. </div>
  68. <div id="enterTransactionsStrand">
  69. <h1>Enter items sold since (Date)</h1>
  70. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  71. <table>
  72. <thead>
  73. <tr>
  74. <th>Recipe</th>
  75. <th>Number sold</th>
  76. </tr>
  77. </thead>
  78. <tbody></tbody>
  79. </table>
  80. <button class="button" onclick="enterTransactionsObj.submit()">Submit</button>
  81. </div>
  82. <div id="enterPurchaseStrand">
  83. <h1>Enter Purchases</h1>
  84. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  85. <table>
  86. <thead>
  87. <tr>
  88. <th>Ingredient</th>
  89. <th>Amount</th>
  90. </tr>
  91. </thead>
  92. <tbody></tbody>
  93. </table>
  94. <button class="button" onclick="enterPurchaseObj.submit()">Submit</button>
  95. </div>
  96. <script>
  97. <% if(locals.error){ %>
  98. let error = <%- JSON.stringify(error) %>;
  99. <% }else{ %>
  100. let error = undefined;
  101. <% } %>
  102. </script>
  103. <script>
  104. let merchant = <%- JSON.stringify(merchant) %>;
  105. </script>
  106. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  107. <script src="../shared/validation.js"></script>
  108. <script src="/inventoryPage/inventory.js"></script>
  109. <script src="/inventoryPage/recipe.js"></script>
  110. <script src="/inventoryPage/addIngredient.js"></script>
  111. <script src="/inventoryPage/enterTransactions.js"></script>
  112. <script src="/inventoryPage/enterPurchase.js"></script>
  113. <script src="/inventoryPage/controller.js"></script>
  114. </body>
  115. </html>