Suppliers and purchasing

Suppliers, purchase orders, receiving into lots, invoices, claims, and settlement.

Suppliers

/dashboard/platform/suppliers needs canManageSuppliers. A Supplier has name, contactName, email, phone, paymentTerms (net_30, net_60, cod), and a minimum order. updateSupplierMinimumOrder changes the minimum.

Purchase orders

/dashboard/platform/purchasing needs canManageInventory. Status flow: draft, sent, confirmed, received, cancelled.

Create a draft

createPurchaseOrderDraft(idempotencyKey, supplierId, expectedDeliveryDate, notes, items) where each item has productId, quantity, and unitCost. At least one item is required. groceryPurchasingOptions supplies the picker. Remove a line with removePurchaseOrderDraftItem.

Send and confirm

transitionPurchaseOrder(purchaseOrderId, status) accepts sent, confirmed, or cancelled. These are status changes recorded by staff. A purchase order with received inventory cannot be cancelled.

Receive

receivePurchaseOrder(purchaseOrderId, receipts). Each receipt gives poItemId, targetQuantityReceived, lotNumber, expirationDate, optional location, deliveryReference, and a condition (accepted, inspection_pending, rejected). Each receipt creates a PurchaseReceipt and an InventoryLot.

Supplier settlement

manageSupplierSettlement(action, idempotencyKey, invoiceId, creditId, input):

ActionUse
capture_invoiceRecord a SupplierInvoice against receipts
approve_invoiceApprove a captured or variance invoice. A different operator must approve variances
open_claimOpen a SupplierCredit claim for short or damaged goods. Cannot exceed the invoice liability
record_debitRecord a supplier debit
resolve_claimOutcome credit or rejected
settle_invoiceMark settled. Needs canManagePayments
void_invoiceVoid it

Settled and voided invoices are immutable.

On this page