Receiving - every line still to come in on the purchase orders * that are ordered, by PO, oldest order first - or one PO's (?po_id=). Type * how many came in (All fills in what is left) and receive them together. * Our own stock of a product that tracks it goes on the shelf; a client's * hardware can become their assets, a unit each, with the serials typed. The * work is poReceive() in functions/purchase_orders.php. */ require_once "includes/inc_all.php"; poRequireLevel(1); $can_edit = poLevel() >= 2; $can_assets = lookupUserPermission('module_support') >= 2; $can_stock = lookupUserPermission('module_sales') >= 2; $po_filter = intval($_GET['po_id'] ?? 0); $vendor_filter = intval($_GET['vendor'] ?? 0); $by_po = poAwaitingLines($po_filter); if ($vendor_filter) { $by_po = array_filter($by_po, function ($lines) use ($mysqli, $vendor_filter) { return intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT po_vendor_id FROM purchase_orders WHERE po_id = " . intval($lines[0]['po_item_po_id'])))[0] ?? 0) === $vendor_filter; }); } $tracking = poTrackingFor(array_keys($by_po)); $asset_types = array_keys(productAssetTypes()); $line_count = array_sum(array_map('count', $by_po)); ?>

Receiving

Show every purchase order line on purchase order still to come in.
'deliveries', 'icon' => 'fa-truck-loading', 'filtered' => (bool) ($po_filter || $vendor_filter), 'title' => 'Nothing to receive', 'text' => 'Lines show here once their purchase order is marked ordered, until all of them have come in.']) ?>
$lines) { $head = $lines[0]; ?>
· · ordered · their order
Item Ordered In so far Came in Serials
Our stock - goes on the shelf Our stock ·
to come