That purchase order isn\'t here

' . '

It may be for a client you can\'t see.

Back to Purchase Orders'; } else { $po_id = intval($po['po_id']); $status = $po['po_status']; $number = poNumber($po); $currency = (string) $po['po_currency_code']; $money = function ($amount) use ($currency) { return escapeHtml(poMoney($amount, $currency)); }; $level = poLevel(); $can_edit = $level >= 2; $draft = $status === 'draft'; $arriving = in_array($status, ['ordered', 'partial'], true); $ordered_or_after = in_array($status, ['ordered', 'partial', 'received'], true); $items = poItems($po_id); $tracking = poTracking($po_id); $receipts = poReceipts($po_id); $expense = poExpense($po); $history = auditLogHistory('Purchase Order', $po_id); $needs_approval = $draft && poNeedsApproval($po); $can_order = $can_edit && poCanOrder($po); $may_approve = poMayApprove($po); $can_cancel = ($draft && $can_edit) || ($level >= 3 && in_array($status, ['pending', 'approved', 'ordered'], true) && !array_filter($items, function ($item) { return floatval($item['po_item_received']) > 0; })); $can_bill = $can_edit && lookupUserPermission('module_financial') >= 2 && $ordered_or_after && !$expense; $subtotal = 0; foreach ($items as $item) { $subtotal += round(floatval($item['po_item_quantity']) * floatval($item['po_item_cost']), 2); } $qty = array_sum(array_map('floatval', array_column($items, 'po_item_quantity'))); $received = array_sum(array_map(function ($item) { return min(floatval($item['po_item_received']), floatval($item['po_item_quantity'])); }, $items)); $waiting_count = $draft && poReady() ? intval(mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*) FROM order_items WHERE order_item_status = 'waiting'" . clientScopeSql('order_item_client_id')))[0]) : 0; $csrf = $_SESSION['csrf_token']; $modal = function ($file, $params = '') use ($po_id) { return "modals/purchasing/$file.php?po_id=$po_id" . ($params !== '' ? "&$params" : ''); }; $vendor_email = (string) ($po['vendor_contact_email'] ?: $po['vendor_email']); // Override Tab Title // No Sanitizing needed as this var will only be used in the tab title $page_title = $number; ?>

Made Approved by Ordered 0) { ?> of in
Receive
true]); $names = array_column($approvers, 'user_name'); ?>
Sent for approval - 4 ? ' or another approver' : '') . '.' : 'waiting for an admin.') ?>
Sent back:
It needs approving before it is ordered - 0 && floatval($po['po_total']) <= poSettings()['approval_over'] ? 'a line has no cost.' : (poSettings()['approval_over'] > 0 ? 'it is over ' . escapeHtml(poMoney(poSettings()['approval_over'])) . '.' : 'every purchase order does.') ?>

Lines ()

Item Qty In Unit cost Amount
= 1 ? 'product.php?product_id=' . intval($item['po_item_product_id']) : ''; ?>
' . escapeHtml($item['po_item_name']) . '' : escapeHtml($item['po_item_name']) ?>
Our stock
0 ? '' : ' ' ?> 0 ? $money($item['po_item_cost']) : 'No cost' ?>
Nothing on it yet
Subtotal
Shipping 0 ? $money($po['po_shipping']) : '-' ?>
Total

Received ()

Details

Vendor
Our account
Ship to
Note for the vendor

Tracking

  • None yet - add the numbers the vendor sends.

Vendor bill

Recorded as an expense - on .
= 1) { ?> Open the expense

When the vendor's invoice comes, record it as an expense here - it stays linked to .

Not recorded yet.
'Nothing logged yet.']) ?>