<%- include('../partials/wrap-start') %>
<section class="panel"><h2>Daily Production Entry</h2><form class="form-grid" method="post"><input name="production_date" type="date" required><select name="shift"><option>A</option><option>B</option><option>C</option><option>General</option></select><input name="batch_no" placeholder="Batch No" required><select name="sku_id"><% skus.forEach(s=>{ %><option value="<%=s.id%>"><%=s.sku_name%></option><% }) %></select><select name="bom_id"><% boms.forEach(b=>{ %><option value="<%=b.id%>"><%=b.bom_code%></option><% }) %></select><input name="plant_section" placeholder="Plant Section"><input name="planned_qty" type="number" step="0.001" placeholder="Planned Qty"><input name="actual_qty" type="number" step="0.001" placeholder="Actual Qty"><input name="operator_name" placeholder="Operator"><input name="supervisor_name" placeholder="Supervisor"><input name="machine" placeholder="Machine"><input name="downtime_minutes" type="number" placeholder="Downtime Minutes"><input name="remarks" placeholder="Remarks"><button class="btn">Save Production</button></form></section>
<section class="panel"><h2>Production Batches</h2><table><thead><tr><th>Date</th><th>Batch</th><th>SKU</th><th>Planned</th><th>Actual</th><th>Yield</th><th>Machine</th></tr></thead><tbody><% rows.forEach(r=>{ %><tr><td><%= r.production_date.toISOString ? r.production_date.toISOString().slice(0,10) : r.production_date %></td><td><%= r.batch_no %></td><td><%= r.sku_name %></td><td><%= r.planned_qty %></td><td><%= r.actual_qty %></td><td><span class="badge"><%= Number(r.yield_percent||0).toFixed(2) %>%</span></td><td><%= r.machine %></td></tr><% }) %></tbody></table></section>
<%- include('../partials/wrap-end') %>
