Mass-Balance Reports: R2v3’s Favorite Spreadsheet, Generated
How tonnage in equals tonnage out (plus accountable losses), with a period picker and a fallback to order-shipped when settlements lag.
Mass balance is the R2v3 (and several other standards’) requirement that says: for every kilogram you receive, you must be able to account for where it ended up. Recycled, refurbished, sold, scrapped, or in inventory — but accounted for. The mass-balance report is the calculation that proves it.
The math
For a defined period and scope: Inflows (received tonnage from inbound orders) equal Outflows (shipped tonnage in outbound orders, with destination categories — refurbish, recycle, scrap, donation) plus Inventory delta (closing inventory minus opening inventory) plus Accountable losses (recorded write-offs with reasons).
If the equation doesn’t balance, the report flags the variance and the operator investigates. Most variances are weighing precision (which the platform tracks separately from the data) or mid-period transfers between warehouses that haven’t been reconciled.
Period picker and company filter
/core/reports/mass-balance has a period-picker (month, quarter, calendar year, custom range) and a company-filter so a tenant with multiple legal entities can produce per-entity reports — or aggregated reports across all entities. The query is backed by mass_balance_periods (a denormalized table that aggregates the raw data), refreshed nightly.
Order-shipped fallback
Settlement data is the authoritative source for outflow weights, but settlements close on a 14–30 day lag (the deal completes, the buyer pays, the settlement writes). For a report run for the current month, the K4 fallback uses order-shipped data instead of settlements — meaning the report shows the actual physical outflows even if the financial reconciliation hasn’t caught up. The methodology note in the report explains which data source was used per row.
What the auditor sees
The report exports as a CSV (line-by-line) and a PDF (with the totals, the variance, and the methodology). The auditor wants the line-level data; the management wants the variance summary. Both views are built from the same query, so the two never disagree.