fixed
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { createPurchaseOrder, receivePurchaseOrder } from "@/lib/actions";
|
||||
import { receivePurchaseOrder } from "@/lib/actions";
|
||||
import { PurchaseOrderCreateForm } from "@/components/purchase-order-create-form";
|
||||
import { formatCurrency, formatDate } from "@/lib/format";
|
||||
import { getLowStockParts, getPurchaseOrders, getVendors } from "@/lib/repository";
|
||||
import { getLowStockParts, getOrderItemOptions, getPurchaseOrders, getVendors } from "@/lib/repository";
|
||||
|
||||
export default function PurchaseOrdersPage() {
|
||||
const vendors = getVendors();
|
||||
const items = getOrderItemOptions();
|
||||
const orders = getPurchaseOrders();
|
||||
const lowStockParts = getLowStockParts();
|
||||
|
||||
@@ -12,18 +14,8 @@ export default function PurchaseOrdersPage() {
|
||||
<section className="two-up">
|
||||
<article className="panel">
|
||||
<h2 className="section-title">Create Purchase Order</h2>
|
||||
<p className="section-copy">Enter one line per row as `SKU,quantity,unit cost`.</p>
|
||||
<form action={createPurchaseOrder} className="form-grid">
|
||||
<div className="form-row">
|
||||
<label htmlFor="vendorCode">Vendor Code</label>
|
||||
<select className="select" id="vendorCode" name="vendorCode">
|
||||
{vendors.map((vendor) => <option key={vendor.id} value={vendor.code}>{vendor.code} - {vendor.name}</option>)}
|
||||
</select>
|
||||
</div>
|
||||
<div className="form-row"><label htmlFor="purchase-lines">Line Items</label><textarea className="textarea" id="purchase-lines" name="lines" placeholder={"PART-001,10,31.50\nPART-002,24,6.25"} required /></div>
|
||||
<div className="form-row"><label htmlFor="purchase-notes">Notes</label><textarea className="textarea" id="purchase-notes" name="notes" /></div>
|
||||
<button className="button" type="submit">Save Purchase Order</button>
|
||||
</form>
|
||||
<p className="section-copy">Build the PO from real inventory items so receipts, costing, and restocking stay relational.</p>
|
||||
<PurchaseOrderCreateForm vendors={vendors} items={items} />
|
||||
</article>
|
||||
<article className="panel">
|
||||
<h2 className="section-title">Receiving Flow</h2>
|
||||
|
||||
@@ -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