<%- include('../partials/wrap-start') %>
<section class="panel"><h2>Add Material</h2><form class="form-grid" method="post"><input name="material_code" placeholder="Material Code" required><input name="material_name" placeholder="Material Name" required><input name="category" placeholder="Category" required><input name="unit" placeholder="Unit" value="kg"><input name="purchase_rate" type="number" step="0.0001" placeholder="Purchase Rate"><input name="current_stock" type="number" step="0.001" placeholder="Current Stock"><input name="reorder_level" type="number" step="0.001" placeholder="Reorder Level"><button class="btn">Save Material</button></form></section>
<section class="panel"><h2>Material Master</h2><table><thead><tr><th>Code</th><th>Name</th><th>Category</th><th>Stock</th><th>Avg Rate</th><th>Value</th></tr></thead><tbody><% rows.forEach(r=>{ %><tr><td><%= r.material_code %></td><td><%= r.material_name %></td><td><%= r.category %></td><td><%= r.current_stock %> <%= r.unit %></td><td><%= r.average_rate %></td><td><%= (Number(r.current_stock)*Number(r.average_rate)).toLocaleString() %></td></tr><% }) %></tbody></table></section>
<%- include('../partials/wrap-end') %>
