fixed
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { createSalesOrder, shipSalesOrder } from "@/lib/actions";
|
||||
import { shipSalesOrder } from "@/lib/actions";
|
||||
import { SalesOrderCreateForm } from "@/components/sales-order-create-form";
|
||||
import { formatCurrency, formatDate } from "@/lib/format";
|
||||
import { getCustomers, getSalesOrders } from "@/lib/repository";
|
||||
import { getCustomers, getOrderItemOptions, getSalesOrders } from "@/lib/repository";
|
||||
|
||||
export default function SalesOrdersPage() {
|
||||
const customers = getCustomers();
|
||||
const items = getOrderItemOptions();
|
||||
const orders = getSalesOrders();
|
||||
|
||||
return (
|
||||
@@ -11,18 +13,8 @@ export default function SalesOrdersPage() {
|
||||
<section className="two-up">
|
||||
<article className="panel">
|
||||
<h2 className="section-title">Create Sales Order</h2>
|
||||
<p className="section-copy">Enter one line per row as `SKU,quantity,unit price`.</p>
|
||||
<form action={createSalesOrder} className="form-grid">
|
||||
<div className="form-row">
|
||||
<label htmlFor="customerCode">Customer Code</label>
|
||||
<select className="select" id="customerCode" name="customerCode">
|
||||
{customers.map((customer) => <option key={customer.id} value={customer.code}>{customer.code} - {customer.name}</option>)}
|
||||
</select>
|
||||
</div>
|
||||
<div className="form-row"><label htmlFor="sales-lines">Line Items</label><textarea className="textarea" id="sales-lines" name="lines" placeholder={"PART-001,2,79.99\nKIT-100,1,249.00"} required /></div>
|
||||
<div className="form-row"><label htmlFor="sales-notes">Notes</label><textarea className="textarea" id="sales-notes" name="notes" /></div>
|
||||
<button className="button" type="submit">Save Sales Order</button>
|
||||
</form>
|
||||
<p className="section-copy">Build the order from real inventory records so each line references an actual item in the database.</p>
|
||||
<SalesOrderCreateForm customers={customers} items={items} />
|
||||
</article>
|
||||
<article className="panel">
|
||||
<h2 className="section-title">Shipping Flow</h2>
|
||||
|
||||
Reference in New Issue
Block a user