inventory.ejs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. <strand-selector></strand-selector>
  14. <div id="inventoryStrand" class="strand">
  15. <h1><span><%= merchant.name %></span> inventory</h1>
  16. <div class="options">
  17. <a class="button" href="/recipes">View Recipes</a>
  18. <button class="button" onclick="addIngredientObj.display()">Add Ingredient</button>
  19. <button class="button" onclick="enterPurchaseObj.display()">Enter Purchases</button>
  20. <% if(merchant.pos === "none"){ %>
  21. <button class="button" onclick="enterTransactionsObj.display()">Enter Transactions</button>
  22. <% } %>
  23. </div>
  24. <input id="filter" onkeyup="inventoryObj.filter()" type="text" placeholder="FILTER INGREDIENTS">
  25. <table>
  26. <thead>
  27. <tr>
  28. <th onclick="inventoryObj.sortIngredients('name')">Item</th>
  29. <th onclick="inventoryObj.sortIngredients('category')">Category</th>
  30. <th onclick="inventoryObj.sortIngredients('quantity')">Quantity</th>
  31. <th onclick="inventoryObj.sortIngredients('unit')">Unit</th>
  32. <th>Actions</th>
  33. </tr>
  34. <tbody></tbody>
  35. </thead>
  36. </table>
  37. </div>
  38. <div id="accountStrand" class="strand">
  39. <h1>Account Strand</h1>
  40. </div>
  41. <div id="addIngredientAction" class="action">
  42. <button class="button" onclick="inventoryObj.display()">Back to Inventory</button>
  43. <div class="container">
  44. <form onsubmit="addIngredientObj.submitAdd()">
  45. <h2>Select Ingredient</h2>
  46. <label>Ingredient
  47. <select id="addName"></select>
  48. </label>
  49. <label>Quantity
  50. <input id="addQuantity" type="number" step="0.01" required>
  51. </label>
  52. <input class="button" type="submit" value="Add Ingredient">
  53. </form>
  54. <form onsubmit="addIngredientObj.submitNew()">
  55. <h2>Create New Ingredient</h2>
  56. <label>Name
  57. <input id="newName" type="text" required>
  58. </label>
  59. <label>Category
  60. <input id="newCategory" type="text" required>
  61. </label>
  62. <label>Unit
  63. <input id="newUnit" type="text" required>
  64. </label>
  65. <label>Quantity
  66. <input id="newQuantity" type="number" step="0.01" required>
  67. </label>
  68. <input class="button" type="submit" value="Create Ingredient">
  69. </form>
  70. </div>
  71. </div>
  72. <div id="enterTransactionsAction" class="action">
  73. <h1>Enter items sold since (Date)</h1>
  74. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  75. <table>
  76. <thead>
  77. <tr>
  78. <th>Recipe</th>
  79. <th>Number sold</th>
  80. </tr>
  81. </thead>
  82. <tbody></tbody>
  83. </table>
  84. <button class="button" onclick="enterTransactionsObj.submit()">Submit</button>
  85. </div>
  86. <div id="enterPurchaseAction" class="action">
  87. <h1>Enter Purchases</h1>
  88. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  89. <table>
  90. <thead>
  91. <tr>
  92. <th>Ingredient</th>
  93. <th>Amount</th>
  94. </tr>
  95. </thead>
  96. <tbody></tbody>
  97. </table>
  98. <button class="button" onclick="enterPurchaseObj.submit()">Submit</button>
  99. </div>
  100. <script>
  101. <% if(locals.error){ %>
  102. let error = <%- JSON.stringify(error) %>;
  103. <% }else{ %>
  104. let error = undefined;
  105. <% } %>
  106. </script>
  107. <script>
  108. let merchant = <%- JSON.stringify(merchant) %>;
  109. </script>
  110. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  111. <script src="../shared/validation.js"></script>
  112. <script src="/inventoryPage/inventory.js"></script>
  113. <script src="/inventoryPage/account.js"></script>
  114. <script src="/inventoryPage/addIngredient.js"></script>
  115. <script src="/inventoryPage/enterTransactions.js"></script>
  116. <script src="/inventoryPage/enterPurchase.js"></script>
  117. <script src="/shared/controller.js"></script>
  118. </body>
  119. </html>