inventory.ejs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. <form onsubmit="accountObj.submitForm()"></form>
  41. </div>
  42. <div id="addIngredientAction" class="action">
  43. <button class="button" onclick="inventoryObj.display()">Back to Inventory</button>
  44. <div class="container">
  45. <form onsubmit="addIngredientObj.submitAdd()">
  46. <h2>Select Ingredient</h2>
  47. <label>Ingredient
  48. <select id="addName"></select>
  49. </label>
  50. <label>Quantity
  51. <input id="addQuantity" type="number" step="0.01" required>
  52. </label>
  53. <input class="button" type="submit" value="Add Ingredient">
  54. </form>
  55. <form onsubmit="addIngredientObj.submitNew()">
  56. <h2>Create New Ingredient</h2>
  57. <label>Name
  58. <input id="newName" type="text" required>
  59. </label>
  60. <label>Category
  61. <input id="newCategory" type="text" required>
  62. </label>
  63. <label>Unit
  64. <input id="newUnit" type="text" required>
  65. </label>
  66. <label>Quantity
  67. <input id="newQuantity" type="number" step="0.01" required>
  68. </label>
  69. <input class="button" type="submit" value="Create Ingredient">
  70. </form>
  71. </div>
  72. </div>
  73. <div id="enterTransactionsAction" class="action">
  74. <h1>Enter items sold since (Date)</h1>
  75. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  76. <table>
  77. <thead>
  78. <tr>
  79. <th>Recipe</th>
  80. <th>Number sold</th>
  81. </tr>
  82. </thead>
  83. <tbody></tbody>
  84. </table>
  85. <button class="button" onclick="enterTransactionsObj.submit()">Submit</button>
  86. </div>
  87. <div id="enterPurchaseAction" class="action">
  88. <h1>Enter Purchases</h1>
  89. <button class="button" onclick="inventoryObj.display()">Back to inventory</button>
  90. <table>
  91. <thead>
  92. <tr>
  93. <th>Ingredient</th>
  94. <th>Amount</th>
  95. </tr>
  96. </thead>
  97. <tbody></tbody>
  98. </table>
  99. <button class="button" onclick="enterPurchaseObj.submit()">Submit</button>
  100. </div>
  101. <script>
  102. <% if(locals.error){ %>
  103. let error = <%- JSON.stringify(error) %>;
  104. <% }else{ %>
  105. let error = undefined;
  106. <% } %>
  107. </script>
  108. <script>
  109. let merchant = <%- JSON.stringify(merchant) %>;
  110. </script>
  111. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  112. <script src="../shared/validation.js"></script>
  113. <script src="/inventoryPage/inventory.js"></script>
  114. <script src="/inventoryPage/account.js"></script>
  115. <script src="/inventoryPage/addIngredient.js"></script>
  116. <script src="/inventoryPage/enterTransactions.js"></script>
  117. <script src="/inventoryPage/enterPurchase.js"></script>
  118. <script src="/shared/controller.js"></script>
  119. </body>
  120. </html>