Contact us
Back to knowledgebase

Perpetual Inventory

Perpetual inventory is the practice of updating stock records as transactions are posted. A warehouse receives twelve valves. A clerk reserves six for a customer. The quantity available to sell falls by six while all twelve valves sit in the same bin. Later, a van takes a carton away. Until someone posts the shipment, the screen still shows twelve on hand.

A stock level in software is a projection. Start from an opening balance, select the events that count for a purpose, and apply the rules that turn those events into a quantity. Here projection means a calculation about the present or the past. A clerk can settle a disagreement about how many valves are in the bin by counting them. Whether the six reserved valves should count as stock depends on who is asking for them. They are available to ship to the customer who reserved them. Offering them to the next caller would sell them twice.

How many valves are in stock?

On Monday morning the warehouse books twelve valves against a single part number. Two await inspection. A customer orders six and the clerk reserves them from the ten that have passed. By 9 a.m. the warehouse can give three answers to “How many do you have?” A counter walking the building should find twelve. The shipping supervisor has ten cleared for dispatch, including the six already spoken for. A salesman taking a new order can offer four for immediate shipment.

Of twelve valves on hand, six are reserved, four are free, and two await inspection. The reserved and free valves together make ten cleared for dispatch.

At noon a second customer orders seven. The clerk reserves the remaining four and puts three on backorder. The shelf still holds twelve. This warehouse now reports zero free and three backordered. A screen that deducts all outstanding customer demand from the ten cleared units would display −3. The warehouse owes three valves for which it has no cleared stock. Sending −3 to a clerk as the quantity to find in the bin would be absurd.

There is no industry-wide rule that makes a field called Available mean any one of these quantities. One seller reserves stock when the customer checks out. Another waits until payment clears. Both rules can be implemented exactly as specified. A pickup page that reads the ten cleared units could still sell the first customer’s six valves a second time.

Even a single reservation can take two quite different forms in a database. One system leaves twelve units in the warehouse row and puts the reservation for six in a separate table. Another transfers six units to a virtual location called “pickup.” It now shows six there and six in the main location, including the two on hold. The clerk can offer four valves under either convention. Subtract the reservation again from the main location in the second system and those four disappear from the website.

What the transaction was recorded for

Most enterprise data originates as a by-product of getting work done. Consider a shopper buying a lemon and a lime at the same price. The lime’s barcode fails, so the cashier scans the lemon twice. The shopper pays the right amount. Two pieces of fruit leave the store. The stock calculation deducts two lemons and leaves the lime on the books. Both the till total and the combined fruit count reconcile, down to the cent and the piece. The produce buyer is now short one lime and has one more lemon than the records suggest. This cashier’s workaround is discussed in Data Preparation.

A physical count supplies a fresh observation. An empty bin can expose phantom inventory after an unrecorded loss. Finding twelve valves establishes how many the clerk saw in the bin at a stated time. The clerk still needs the contract to establish ownership, the orders to identify reservations, and the inspection records to know which valves can ship. See Inventory Accuracy for how to compare a count with the corresponding book balance.

A shipment can have two dates

At 4 p.m. Monday a van takes the first customer’s six valves. The clerk posts the shipment at 9 a.m. Tuesday, with Monday afternoon as the effective time. No other valves move. Monday’s 6 p.m. inventory export said twelve on hand. A report run on Tuesday for that same Monday evening says six. An analyst can reproduce both figures, provided the shipment record keeps both timestamps and the reporting rules are known.

The balance visible on Monday stays at twelve through the evening export and falls to six when the shipment is posted on Tuesday. A later report using the shipment time puts the drop at 4 p.m. Monday.

To investigate what the website offered on Monday evening, use the postings it could see then. To reconstruct what remained in the building, use the dispatch time and check it against the shipping note. Substituting Tuesday’s corrected history into a test of Monday’s software grants it knowledge it could not have had.

What the database keeps

An application can update a balance in place, rebuild it from a movement journal, or update a summary table in batches. A busy checkout can queue deductions so many tills can accept sales without waiting to update the same stock row. Export the balance table just before the batch runs and the latest sales will be missing. Read the queue just afterward and it will already be empty. To recover the quantity after all accepted sales, read both tables at a consistent point in time and apply the pending deductions once. This design is described in Introduction to Supply Chain, §5.4.1.

Sometimes the history is gone. A system may overwrite a reservation when an order ships and retain only its final status. Today’s balance and the shipment journal cannot tell whether the customer reserved the valves on Monday or last Friday. Start saving dated snapshots of the balances the application actually exposed, alongside the movements and the rules used to interpret them. A daily snapshot preserves what that day’s export said. An order reserved and canceled between exports can still leave no trace. Lokad’s data extraction guide

A drop shipment appears on the list of open purchase orders, but the supplier will deliver the goods straight to the customer. If the warehouse includes those units in its stock on order, the buyer may skip a purchase while waiting for a delivery that will never reach the site.

Which balance belongs in the ordering rule?

In Lokad’s experience, stock levels are usually the hardest figures to interpret in a new client’s data extract. Even publicly traded companies can reconcile their aggregate inventory and still struggle to supply a figure that works for replenishment at one branch. A perfectly implemented reservation field can produce a bad purchase order. It depends on what the purchasing software does with the outstanding orders.

Consider the valve buyer at noon. The two customers have ordered thirteen valves between them. Ten are cleared and reserved, two are on hold, and no purchase is on its way. Suppose the held pair will miss the delivery deadline. How many more valves does the buyer need to cover these orders?

Starting with ten cleared, the buyer compares them with all thirteen ordered and needs three more. The zero free balance already accounts for the ten reserved valves. Only the three backordered remain to cover. A rule that buys enough to cover the shortfall orders three under either convention. Give that routine zero free and tell it that all thirteen valves still need covering, and it buys ten more than the customers need.

The dispatch rule needs a different view of those ten valves. The driver collecting the first customer’s six can take all six, even though the free balance says zero. Once that shipment posts, four cleared valves remain against seven still owed. The shortfall is still three. If sending the van creates a fresh purchase requirement for six, the buyer has a reproducible example of where the logic went wrong.

Suppose instead that the thirteen valves are needed for a Friday assembly run, with ten set aside for the job. One valve must be sourced even if both held valves pass inspection. Should the planner buy the other two? If replacements can arrive in time after Thursday’s inspection, the planner can wait. If the supplier takes its last order on Wednesday, the extra pair buys protection against an idle line. Whether that protection pays depends on the chance of a late release and the cost of the stoppage. Two warehouses can report identical stock figures and warrant different purchases because one will finish its inspections a week later than the other.