Skip to content

Company portals

Set company budgets and report branch spending

Configure monthly/quarterly allowances, over-budget review, committed spending and private branch CSV reports.

PressFlow 3.0.0 · 5 min read

Guide source reviewed for PressFlow 2.3.0.

Budget tracking is optional and off by default. It works with existing company members, approved delivery branches, financial approval and WooCommerce orders. It does not add another payment or accounting system.

Set up a company budget

  1. Enable PressFlow settings > Features & integrations > Company budgets & spending.
  2. Open B2B storefronts > Manage company > Budgets & spending.
  3. Tick Track spending and use budgets for this company.
  4. Choose a calendar month or calendar quarter. Periods use the WordPress shop timezone.
  5. Enter the complete company allowance and optional branch allowances. Enter 0 for no limit at that level. The company and selected branch limits both apply.
  6. Choose Show a warning and allow the order, or Require company financial approval. The latter requires the existing financial approval feature.
  7. Save. Existing company orders are indexed in batches of 100. Checkout waits until this initial refresh is complete. Use Continue spending refresh if needed.

A budget controls purchasing within a period. A credit limit controls money owed. Approval over budget does not raise the allowance or waive the separate credit, payment, artwork-check or customer-proof requirements. Company administrators and purchasing approvers use the existing approval queue; purchasers cannot approve their own purchases. A printer review still requires its recorded reason.

What the figures mean

  • All amounts use complete WooCommerce order totals, including discounts, tax, shipping and fees. Copies are not multiplied into the order total again.
  • Committed means a pending order awaiting payment or company approval.
  • Spent means paid orders or orders released to processing, completion or an approved company account. This is purchasing spend, not cash received.
  • Available subtracts both committed and spent amounts from the allowance.
  • Cancelled, failed, trashed and refunded orders release their remaining budget. Unsubmitted Checkout Block drafts do not reserve an allowance. Once checkout is submitted, its draft reserves budget before the payment gateway runs, so two parallel submissions cannot both claim the same remaining allowance. A failed status or WooCommerce draft cleanup releases that reservation.
  • Partial refunds reduce the original order’s period. Refunds do not transfer budget into a later month. Deleting an order retains a released spend record.
  • The order’s original creation date and saved delivery branch attribute spend. Retrying or paying an older order does not move it to the current period.
  • There is no rollover of unused budget. Current configured allowances are shown for historical reports too; past allowance settings are not reconstructed.

Changing quantities or amounts, changing branches and reopening a released order rechecks its budget. An over-budget financial hold is retained separately from payment. A completed historical order can be corrected for reporting without reopening production. Repeated saves and retries replace one indexed spend row for that order rather than adding another charge.

Customer and manager views

Company tools > Budgets & spending works in both the dedicated company storefront and the account portal. Purchasers see the available company and selected-branch budgets. Company administrators and purchasing approvers see the full branch report, committed/spent totals, paginated orders and CSV export. Catalogue viewers cannot open the spending area. Another company’s login cannot open or export this company’s report.

Select a month to report; quarterly companies get that month’s whole quarter. Available indexed history starts at the date shown. Initial indexing covers the current quarter and at least four previous quarters. Reports do not invent older history. Amounts use the budget currency; other currencies are not converted. Changing the shop currency or decimal precision requires an explicit budget review and refresh. The active checkout refuses currency mismatches.

The CSV contains branch aggregates and numeric amounts, not private artwork or customer contact details. Formula-like labels are escaped for spreadsheets. The report is private and is not an invoice, profit report or cash-flow statement.

Refresh and recovery

Order saves, status changes and refunds update the indexed record. If a write or company lock fails, new budget-controlled checkout is held and a bounded history refresh is queued. A changed order before a scan cursor causes a fresh pass rather than silently clearing the hold with stale figures. The printer can use Refresh spending records or Continue spending refresh.

Turning tracking off keeps the spending records. Turning off the global feature stops new budget enforcement and hides the customer navigation; configured company ledgers continue tracking order changes. Existing financial approval holds remain financial holds. Re-enabling company tracking rebuilds its history.

On a demonstration shop with installed demo orders, a company whose name includes Demo has an explicit Add demonstration spending orders action. It creates four repeatable fictional fee-only company orders across the first two branches: 120 spent, 80 spent, 45 committed and 30 cancelled. They create no print jobs, payments, stock movements, email messages or supplier submissions. They are not sales evidence. Repeating the action retains existing completed examples.

Developer notes

  • PFW_B2B_Budgets::settings($company) returns versioned company configuration. impact() returns integer-minor-unit company/branch usage and proposed overage. guard($order) performs the authoritative serialized order check.
  • PFW_B2B_Budget_Pages::report($company, 'YYYY-MM') performs company/role access checks. Do not expose it through a public unauthenticated endpoint.
  • Company metadata is _pfw_b2b_budgets; review context is recorded on the order as _pfw_b2b_budget_review. New approval records explicitly bind their saved branch ID alongside the existing commercial/address signature. Existing valid pre-budget approval signatures are preserved without a forced migration.
  • {prefix}pfw_budget_orders holds one row per order, with company/currency/date and branch indexes. Summaries use indexed SQL aggregation. Details are paginated 25 rows at a time; checkout does not enumerate the complete order history.
  • Company leases serialize final checks and updates. Locked aggregates use a current database read, including inside an existing WooCommerce transaction. No plugin transaction commits or rolls back a caller’s WooCommerce transaction.
  • pfw_b2b_budget_index is the bounded refresh event. Orders are read through WooCommerce CRUD/query helpers for both HPOS and legacy order storage.
  • Preserve the B2B no-cache/noindex rules for both company routes. Budget figures must never enter a public catalogue cache or a different company’s response.

Need a hand?

Contact the PressFlow team with details of what you are trying to do.