fixes
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
import { receivePurchaseOrder } from "@/lib/actions";
|
||||
import { PurchaseOrderFulfillmentForm } from "@/components/purchase-order-fulfillment-form";
|
||||
import { PurchaseOrderForm } from "@/components/purchase-order-form";
|
||||
import { formatCurrency, formatDate } from "@/lib/format";
|
||||
import { getLowStockParts, getOrderItemOptions, getPurchaseOrders, getVendors } from "@/lib/repository";
|
||||
import { getLowStockParts, getOrderItemOptions, getPurchaseOrderLineDetails, getPurchaseOrders, getVendors } from "@/lib/repository";
|
||||
|
||||
export default function PurchaseOrdersPage() {
|
||||
const vendors = getVendors();
|
||||
const items = getOrderItemOptions();
|
||||
const orders = getPurchaseOrders();
|
||||
const orderLines = getPurchaseOrderLineDetails();
|
||||
const lowStockParts = getLowStockParts();
|
||||
|
||||
return (
|
||||
@@ -19,7 +20,7 @@ export default function PurchaseOrdersPage() {
|
||||
</article>
|
||||
<article className="panel">
|
||||
<h2 className="section-title">Receiving Flow</h2>
|
||||
<p className="section-copy">Leave line quantities blank to receive the remaining balance, or enter `SKU,quantity` rows for a partial receipt.</p>
|
||||
<p className="section-copy">Receive relational order lines directly by entering quantities against the remaining balance on each line.</p>
|
||||
<div className="table-wrap">
|
||||
<table className="table">
|
||||
<thead><tr><th>Order</th><th>Vendor</th><th>Status</th><th>Total</th><th>Qty Progress</th><th>Created</th><th>Action</th></tr></thead>
|
||||
@@ -39,11 +40,10 @@ export default function PurchaseOrdersPage() {
|
||||
{order.status === "received" ? (
|
||||
<span className="muted">Received</span>
|
||||
) : (
|
||||
<form action={receivePurchaseOrder} className="form-grid">
|
||||
<input type="hidden" name="orderId" value={order.id} />
|
||||
<textarea className="textarea" name="lines" placeholder={"PART-001,4\nPART-002,10"} />
|
||||
<button className="button secondary" type="submit">Receive</button>
|
||||
</form>
|
||||
<PurchaseOrderFulfillmentForm
|
||||
orderId={order.id}
|
||||
lines={orderLines.filter((line) => line.purchaseOrderId === order.id && line.remainingQuantity > 0)}
|
||||
/>
|
||||
)}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user