xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField Sales & SFACRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
Auto DMSConsumer Goods DMSSales Force Automation (SFA) FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Inventory/Inventory period balances
CONCEPT · Last reviewed

Inventory period balances

Inventory period balances are a stored summary of the inventory ledger: one row per item, branch, accounting book and fiscal period, with opening, inward, outward and closing quantity and value. Rebuild on the Inventory Valuation page recomputes them for the current fiscal year. No standard screen or report reads the stored rows, though. The period and year columns on the Valuation Statement are calculated live from the ledger each time the statement loads, so they're always up to date, whether or not you rebuild.

Overview

Every stock movement posts to the inventory ledger, and the costing engine values that ledger under the accounting book's method. A period balance freezes the result for one fiscal period, the way a closing stock register does:

  • Quantity: what the item and branch held at the start of the period, what came in, what went out and what was left.
  • Value: the same four figures in money, at the cost the book's method gives them.
  • Method: the costing method that produced the values.

Rows are written only by the rebuild. Posting a document never updates them, so stored rows describe the ledger as it stood at the last rebuild.

When to use it

In most cases, you don't need it. Here's where to look instead:

You wantUseNeeds a rebuild?
Stock value today, at a past date or at a fiscal-year endInventory → Inventory Valuation, Balance as OnNo, calculated live
Value per period or per year side by sideCompare by → By period or By years on the same pageNo, calculated live
Opening, change and closing for each periodCompare by → By period (movement)No, calculated live
Quantities per periodInventory → Inventory Stock, Compare byNo, read from the ledger

A rebuild is useful when someone needs the stored rows refreshed, for example when your organization reads them through its own reporting. If you rebuild, do it after backdated postings, corrections in earlier periods or a change of valuation policy.

How xMatix handles it

What a rebuild covers

A rebuild always covers one company, one accounting book and one fiscal year:

  • Company: the company selected on the Valuation Statement.
  • Book: the book in the Accounting book picker. The picker appears only when the company has more than one book, and it defaults to the primary book. If the company has no book that is ticked Is Primary and active, and no book is chosen, nothing is written.
  • Fiscal year: the company's fiscal year that contains today's date. If none does, the most recent one by start date is used. The Balance as On and Compare by choices have no effect on the rebuild.
  • Cut-off: the fiscal year's end date. Ledger entries dated up to that day are included, including any dated later than today.

Every period of that fiscal year gets rows. Rows from other fiscal years and other books are left alone.

How each period is worked out

For each item and branch with ledger entries, the rebuild replays the ledger through the costing engine one period at a time:

  1. Periods from earlier fiscal years are replayed first, but only to find the stock carried into this year. They don't get new rows.
  2. Each period starts from the previous period's closing stock and replays only its own movements. With a periodic method such as weighted average, a period averages its opening stock with its own receipts. It never re-averages receipts an earlier period has already used up.
  3. The costing method is resolved separately for each period, using the book's valuation policies as at the period's end date. If a policy changes method from a given date, the periods before and after it are valued differently.

Each row then holds:

  • Inward: the receipts dated in the period, at their receipt cost.
  • Outward: what the period's issues drew from stock, at the cost they were drawn at. This is the period's cost of goods issued.
  • Closing: the stock left at the period's end and its carrying value.
  • Opening: closing − inward + outward. It equals the previous period's closing figure.

An item and branch gets a row for a period only when it has at least one ledger entry dated on or before that period's end. Rows are kept per branch; entries with no branch form their own row. Values are rounded to 2 decimals and quantities to 4.

What the rows don't include

  • Storage location, lot and SKU: the grain is item, branch, book and period, the same as the cost layers.
  • Commitments: allocations, picks, holds and in-transit entries don't move owned stock, so they carry no cost and are skipped.
  • Write-downs: net realizable value write-downs aren't applied to the stored values.

Corrections count as movements

When a posted line is edited, cancelled or deleted, the ledger records a reversing entry of the same type with a negative quantity. The costing engine counts that entry as one more movement in the same direction, so a reversed receipt adds to Inward a second time rather than cancelling out. The Valuation Statement works the same way. See Remaining quantity doesn't match the stock on hand.

Prerequisites

  • The company has fiscal years and fiscal periods with start and end dates (see Fiscal years and periods).
  • The fiscal year has a company set.
  • The company has an active primary accounting book, and that book has valuation policies (see Accounting books).
  • You can open Inventory → Inventory Valuation, and your security profile may run the rebuild (see Permissions).

Procedure

Step 1 — Open the Valuation Statement

Go to Inventory → Inventory Valuation. The Valuation Statement shows one row per item with Qty and Value.

Step 2 — Choose the company and book

Select the company. If the company has more than one accounting book, choose the book in Accounting book. Its default is the primary book.

Step 3 — Select Rebuild

Select Rebuild at the right of the toolbar. Its tooltip reads Recompute the period-balance cache from the ledger. The button shows a spinner while the rows are rewritten, then the statement reloads.

No confirmation message appears. The figures on the statement stay the same, because they don't come from the stored rows. If the rebuild fails, the page shows Could not rebuild the inventory period balances.

Business rules

  • Replace, don't add. A rebuild deletes the stored rows for the company, book and fiscal year's periods, then writes fresh ones. You can run it as often as you like.
  • All or nothing. If any item and branch can't be replayed, for example because an issue takes more stock than was on hand on its date, the whole rebuild fails and the previous rows stay as they were.
  • A method the engine can't replay stops that item there. If a period resolves to Standard Cost, or to a method name the engine doesn't recognize, that item and branch has rows only up to the period before. No rows are written from that period on, and the rest of the rebuild carries on.
  • Not on a schedule. Posting, period close and year close don't run it. It runs only when someone selects Rebuild.
  • Read-only to users. Period balances aren't on any menu, list or report, so you can't view, edit, import or delete the rows on a standard screen.

Example

A trading company uses weighted average in its primary book and has monthly periods. One pump model has these movements:

DateMovementQuantityUnit cost
5 AprGoods receipt1010.00
20 AprInvoice4—
10 MayGoods receipt1030.00
20 MayInvoice5—

After a rebuild, the rows read:

PeriodOpeningInwardOutwardClosing
April0 · 0.0010 · 100.004 · 40.006 · 60.00
May6 · 60.0010 · 300.005 · 112.5011 · 247.50

May averages its opening stock (6 at 10.00) with its own receipt (10 at 30.00): 360.00 ÷ 16 = 22.50. Both the five issued and the eleven left are valued at 22.50. Averaging the whole history instead would give 400.00 ÷ 20 = 20.00, and it would count the four units April already used up a second time.

Training

Practice exercise

In a sandbox company with weighted average set on the primary book and two open monthly periods:

  1. Receive 10 units of a test item at 10.00 in the first period and invoice 4 in the same period.
  2. Receive 10 units at 30.00 in the second period and invoice 5.
  3. On Inventory → Inventory Valuation, set Compare by to By period (movement). Read the item's opening, change and closing for each period.
  4. Select Rebuild.

Expected result: the statement shows 60.00 at the end of the first period and 247.50 at the end of the second, both before and after the rebuild. The rebuild changes nothing on screen, because the statement calculates its columns live.

Quick reference

  • Period columns on the Valuation and Stock statements are live and need no rebuild.
  • Rebuild writes stored rows for the current fiscal year, one company and one book.
  • Grain: item × branch × book × fiscal period. There are no storage location, lot or SKU rows.
  • Opening = closing − inward + outward = the previous period's closing.
  • Each period is valued from its own opening stock and movements.
  • The method is resolved per period, at the period's end date.
  • Negative stock anywhere fails the whole rebuild.
  • Standard Cost stops that item's rows at the period before.

Permissions

  • Opening the page. The seeded Inventory Valuation page is granted to the System Admin profile. An administrator can grant it to other profiles under Access Control (see Security profiles).
  • Running the rebuild. Rebuild runs the fiscal-year server action Rebuild Inventory Period Balances. It is seeded for the System Admin and Standard User profiles, among others. A user whose profile doesn't allow it sees Could not rebuild the inventory period balances.
  • Seeing the rows. No profile gives a screen for the stored rows, because there isn't one.

Configuration

Nothing configures the rebuild itself. Its results depend on these settings:

  • Accounting books: which book is primary, and which books exist for the picker. See Accounting books.
  • Valuation policies: the costing method per book, item, branch and effective dates. See Inventory valuation and costing.
  • Fiscal years and periods: the period windows the rows are cut into, and which year counts as current. See Fiscal years and periods.
  • Inventory ledger settings: which documents post which movement types, and so what counts as inward and outward. See Inventory configuration.

Common problems

"Could not rebuild the inventory period balances."

The rebuild failed and nothing changed. The usual causes are:

  • Negative stock. For some item and branch, an issue is dated before the receipt that covers it. Post the missing receipt or a stock-up adjustment dated no later than the issue, then rebuild.
  • Specific identification without a lot. Under specific identification, an issue names no lot, or names a lot without enough quantity left. Correct the lot on the document.
  • The fiscal year has no company. Open the fiscal year and set its company.
  • Your profile can't run the action. Ask an administrator to allow Rebuild Inventory Period Balances for your profile.

I rebuilt, but the statement didn't change

That's expected. The Valuation Statement doesn't read the stored rows; it calculates every column from the ledger when it loads. If a figure looks wrong, use the value drills (Valuation lots, Consumption lots, View ledger) to see how it was built. See Inventory valuation and costing.

Rebuild seems to do nothing

The rebuild wrote no rows. Check that:

  • the company has an active primary accounting book;
  • the company has at least one fiscal year with periods;
  • the item has ledger entries dated within or before that year.

The rebuild used the wrong fiscal year

It always uses the fiscal year that contains today. If none does, it uses the one with the latest start date. To cover an older year, there's no option on the page. The period columns for any year are available live through Balance as On and Compare by.

Common questions

Do I need to rebuild before reading a period comparison?

No. Compare by → By period, By years and their movement variants on the Valuation Statement replay the ledger through the costing engine every time the page loads. They reflect every posting up to that moment, including backdated ones. The Inventory Stock statement's period columns are read straight from the ledger too. Rebuild only refreshes the stored rows, and no standard screen shows those rows. It's safe to run, but skipping it doesn't make any figure on screen stale.

Why is a period's value not just quantity times a price?

Value comes from the costing engine under the book's method, period by period. Under FIFO, the closing value is the receipt layers that are still unused at the period's end. Under weighted average, each period averages its opening stock with its own receipts. That's why May in the example is valued at 22.50, not at the 30.00 latest cost or the 20.00 all-time average. The method can also differ between periods if a valuation policy changes on a date in between.

Why does Inward look too high after a correction?

Correcting a posted receipt adds a reversing entry with the same movement type and a negative quantity. The costing engine counts that entry as another receipt, so Inward rises instead of netting to zero. The Valuation Statement behaves the same way. To spot this, look for reversing entries on the item's ledger in that period. See Inventory valuation and costing.

Is there a report that lists the stored period balances?

No. The rows aren't exposed on any menu, list, report or dashboard. The fiscal year also has an Inventory Comparative action in its metadata, but it isn't on the fiscal year page and has no server behaviour, so running it returns nothing. For period figures, use the Valuation Statement's Compare by options, which you can preview, print and export.