At the end of September, planning for the annual stocktake starts in many companies. In an online shop it meets a situation a bricks-and-mortar store does not face: while the warehouse is being counted, orders keep arriving, pickers take goods off the shelf, returns come back, and the stock synchronisation with the sales channels keeps writing. German commercial law requires an inventory at the end of every financial year and leaves four routes open. Which of them fits a shop depends less on warehouse size than on the question of how long stock is allowed to stand still.
Why stocktaking works differently in a shop
An inventory is a schedule of all assets and liabilities by type, quantity and value. Every merchant has to draw one up at the end of each financial year, and that financial year may not exceed twelve months (Section 240 (2) of the German Commercial Code, HGB). For drawing it up the law names no fixed deadline; it requires the work to be done within the time appropriate to a proper course of business (Section 240 (2) HGB). It is exactly in this leeway that the impact on day-to-day operations is decided.
A shop on the high street locks the door on a Sunday and counts. An online shop has no door. Orders arrive around the clock, the basket reserves quantity, the carrier collects in the morning, and the way you flag unavailable products depends on the very stock figure that is currently being recounted. Anyone who starts counting without an integration plan measures a stock level that no longer exists by the time the results are evaluated.
- orders arriving during the count that reserve quantity
- open picking jobs whose goods have already left the shelf
- returns in goods-in that have not yet been assigned a bin location
- replenishment in goods-in that has not been booked in yet
- stock messages to sales channels fed from the same data set
- drop-shipped goods that do not pass through your own warehouse
So the first question is not when to count, but which stock figure applies. Only when counting time, cut-off and blocking logic fit together does the variance list make sense at the end. That is a job for the integrations between shop and ERP, not for the warehouse team alone.
The commercial-law duty applies to every merchant. Sole traders whose revenue does not exceed 800,000 euros and whose annual surplus does not exceed 80,000 euros on the balance sheet dates of two consecutive financial years do not have to apply Sections 238 to 241 HGB (Section 241a HGB). Tax law adds a threshold of its own: whoever has to keep books under laws other than tax laws also fulfils that duty for taxation purposes (Section 140 of the German Fiscal Code, AO). Beyond that, Section 141 (1) AO names the duty to keep books and to make annual physical counts for commercial operators who, according to the findings of the tax authority, had more than 800,000 euros total turnover in a calendar year or more than 80,000 euros profit in a business year. The threshold on its own does not trigger the duty: under Section 141 (2) sentence 1 AO it has to be fulfilled only from the beginning of the business year that follows the notification issued by the tax authority.
The four procedures German commercial law allows
The law knows the period-end count as the basic case and three simplifications. All four lead to an inventory that states stock by type, quantity and value; they differ in when counting happens and how much calculation sits between the count and the balance sheet date. For shop operations that is the real difference, because every calculation step needs clean movement data.
| Procedure | When you count | Route to the balance sheet date | Legal basis |
|---|---|---|---|
| Period-end count | as at the balance sheet date | none, the counted stock is the closing stock | Section 240 (2) HGB |
| Deferred count | three months before to two months after the date | roll-forward or back-calculation to the closing date | Section 241 (3) HGB |
| Perpetual inventory | spread across the year to a fixed plan | continuous stock accounting yields the closing stock | Section 241 (2) HGB |
| Sample-based count | count a subset, extrapolate the rest | recognised mathematical and statistical method | Section 241 (1) HGB |
The choice is not purely an accounting matter. The period-end count demands the shortest standstill, but precisely at the busiest point of the year. The perpetual inventory demands no standstill at all, but instead stock accounting that records every movement with a document. The deferred count and the sample-based count sit between the two.
Three questions usually lead to the right variant: how many stock items sit in the warehouse, how completely does the system book every movement, and how long may dispatch pause? Where stock accounting has gaps, no calculation method helps - then the physical count stays close to the balance sheet date. We clarify these three points before every ERP integration.
Period-end count: counting when as little as possible moves
The period-end count is the basic case: stock is physically recorded as at the balance sheet date. In practice hardly anyone counts on New Year's Eve itself, but in the days before or after, booking the movements in between afterwards. That subsequent booking is the weak point, because it has to capture every inbound and outbound movement, including those from the shop.
For the shop this means a defined cut-off. From a fixed point in time no further orders go into picking, goods-in stops booking, and orders keep arriving without consuming stock. Switching the shop off instead costs revenue and serves search engines an error page; the detour through a reservation mode is the gentler route.
- define the cut-off and set it identically in shop, ERP and warehouse
- accept orders, but freeze reservations until counting ends
- hold goods received until counting ends in a blocked area
- generate count sheets per bin location rather than per item number
- log every subsequent booking of the counting period, with timestamp and operator
Deferred count: the window of three plus two months
The deferred count detaches counting from the balance sheet date. The law permits a special inventory drawn up for a day within the last three months before or the first two months after the end of the financial year (Section 241 (3) number 1 HGB). For a financial year ending on 31 December, that window runs from 1 October to the end of February - covering the whole peak season and the wave of returns that follows it.
the merchant has recorded their stock by type, quantity and value in a special inventory, on the basis of a physical count or of another procedure permitted under subsection 2, drawn up for a day within the last three months before or the first two months after the end of the financial year
Section 241 (3) number 1 of the German Commercial Code (HGB)
The second part of the provision is the more demanding one: on the basis of the special inventory, a roll-forward or back-calculation procedure must ensure that the stock present at the end of the financial year can be properly valued as at that date (Section 241 (3) no. 2 HGB). Rolling forward means counted stock plus receipts minus issues up to the balance sheet date. Every movement the system does not know about ends up in the balance sheet as a variance.
That makes the deferred count depend on the same data quality as the reconciliation of stock across channels. If an issue booking is missing, the rolled-forward stock is too high; if a receipt booking is missing, it is too low. Both cases only surface at the next physical count, and by then a whole financial year sits in between.
Perpetual inventory: the closing stock comes out of the bookings
With a perpetual inventory the physical count at the balance sheet date is dropped. The condition is another procedure that complies with the principles of proper accounting and makes stock determinable by type, quantity and value for that date without a physical count (Section 241 (2) HGB). In practice that is stock accounting which records every movement with a document, supplemented by physical counts spread across the year.
When drawing up the inventory for the end of a financial year, a physical count of the assets as at that date is not required in so far as it is ensured, by applying another procedure complying with the principles of proper accounting, that the stock of assets by type, quantity and value can be determined for that date without the physical count.
Section 241 (2) of the German Commercial Code (HGB)
For shops with many stock items this is the calmest route: no standstill, no cut-off, no list of subsequent bookings. The price is a system landscape in which shop, ERP and warehouse management book the same movement exactly once. Anyone maintaining stock in two systems ends up with two truths and no inventory.
- every movement with document, timestamp and operator
- one leading system for stock, all others read only
- a counting plan across the year, written down and traceable
- variances from interim counts are booked, not overwritten
- stock corrections tied to named people - see roles and permissions in the shop backend
Sample-based count: extrapolate instead of touching everything
The third simplification allows stock to be determined by type, quantity and value with the help of recognised mathematical and statistical methods on the basis of samples (Section 241 (1) HGB). A subset is counted, the rest is extrapolated. This carries above all where many similar items of low individual value are stored - small parts, consumables, accessories.
The law draws a clear line here: the procedure must comply with the principles of proper accounting, and the informative value of the inventory drawn up this way must equal that of an inventory based on a physical count (Section 241 (1) HGB). A home-made random selection without a documented sampling procedure usually does not meet that standard.
In practice the procedures get mixed: count high-value items in full, cover low-value bulk goods by sampling, put seasonal goods into the deferred count. The provisions attach to the individual assets rather than to the warehouse as a whole - which is why an inventory may be assembled from several procedures, as long as each part comes about traceably.
What the shop has to do during the count
Whatever the procedure, the shop needs three things: a stock snapshot, a blocking logic and a return path for corrections. The stock snapshot is an unchangeable copy of stock at the counting time, against which comparisons are made later. Without that copy it is hard to establish afterwards whether a variance came from a missing quantity or from a booking made during the count.
<?php
// Stock snapshot at counting time: an unchangeable copy per bin location
final class Inventurschnitt
{
public function anlegen(string $lauf, \DateTimeImmutable $zeitpunkt): int
{
$sql = 'INSERT INTO inventur_schnitt (lauf, lagerplatz, artikel, menge, erfasst_am)
SELECT :lauf, b.lagerplatz, b.artikel, b.menge, :zeitpunkt
FROM lagerbestand b
WHERE b.mandant = :mandant';
return $this->db->schreiben($sql, [
'lauf' => $lauf,
'zeitpunkt' => $zeitpunkt->format('Y-m-d H:i:s'),
'mandant' => $this->mandant,
]);
}
// While the run is open the shop earmarks quantity instead of booking it
public function reservierungsmodus(string $lauf): string
{
return $this->laufOffen($lauf) ? 'vormerken' : 'buchen';
}
} The blocking logic separates reservation from booking. As long as the counting run is open, the shop earmarks ordered quantities but does not deduct them from stock. Once counting ends, the earmarked quantities are booked in one run. That keeps the counted quantity stable and prevents an item from being counted and deducted at the same moment.
The third point is the return path. After counting, the variances are known, and they belong back in the leading system as a movement, not as a silent overwrite of the stock field. An overwritten quantity is hard to explain later; a booked correction with reason, time and operator is not.
- stock snapshot before the first count sheet, with a timestamp
- earmark reservations instead of booking them until the run is closed
- goods-in and returns into a blocked area that is counted separately
- variances as correction bookings with reason and operator
- release stock messages to the sales channels only after the booking run
Reservations, open picks and returns
Four quantities sit between the shelf and the customer at counting time. They need different treatment, and this is exactly where the variances arise that are hard to explain afterwards.
Reserved quantity
Ordered, but still on the shelf. It is physically present and gets counted; in the system it is already assigned to an order.
Open picking job
The goods have left the shelf but not yet the building. They belong in a count position of their own, otherwise they go missing from the balance sheet.
Return under inspection
Back in house, not yet saleable again. It only affects stock after inspection, and it is counted in the blocked area.
Drop-shipped goods
They do not reach your own warehouse at all. They do not belong in the physical count, but they do belong in the cut-off at the balance sheet date.
For items subject to batch or serial number tracking, a fifth quantity appears: the identified unit. It is not merely counted but assigned; how that fits together between shop and ERP is covered in the article on batches and serial numbers.
Feeding variances back without losing the accounts
A stock variance is a business transaction, not a data error. It gets booked, with reason, quantity and value. For accounting that means the stock account against expense or income, depending on the direction. For the shop it means the new stock figure comes back from the leading system, not from the count sheet.
The route there runs through the accounting integration. Correct the variances only in the warehouse system and you have correct stock and a wrong balance sheet. Record them only in accounting and you have the opposite problem. Both sides need the same document with the same document number.
- one variance list per counting run, closed and unchangeable
- a reason per position: shortage, breakage, mis-booking, surplus found
- valuation from the leading system, not from the shop price
- a booking document with number, date and operator
- sign-off by a second person above a defined value threshold
Counted is not yet valued
Counting yields quantities, the balance sheet needs values. Assets and liabilities are to be valued individually as at the balance sheet date (Section 252 (1) no. 3 HGB). For current assets there is an additional rule: they are written down to the lower value resulting from a stock exchange or market price at the balance sheet date; where no such price can be established and acquisition or production costs exceed the value attributable to the assets at the balance sheet date, they are written down to that attributable value (Section 253 (4) HGB). Leftover seasonal goods therefore often sit differently in the books after the stocktake than in the catalogue.
Three simplifications make valuation easier. Similar current assets may be grouped together and recognised at the weighted average value (Section 240 (4) HGB). For the valuation of similar inventories it may be assumed that the assets acquired or produced first, or those acquired or produced last, were consumed or sold first (Section 256 HGB). And raw materials, consumables and supplies of subordinate importance may be recognised at a constant quantity and a constant value, with a physical count generally required every three years (Section 240 (3) HGB).
For the shop this has an immediate consequence: the catalogue price says nothing about the balance sheet value. Export stock values from the shop and you export selling prices. Valuation belongs in the system that holds purchase prices, incidental acquisition costs and write-downs - in a B2B setting that is usually the same system the customer-specific prices come from.
Filing, evidence and retention
Inventories are among the documents to be kept in an orderly manner (Section 147 (1) number 1 AO) and must be retained for ten years (Section 147 (3) AO). The period begins at the end of the calendar year in which the inventory was drawn up (Section 147 (4) AO). Draw up a deferred inventory in February and the clock therefore starts at the end of the following year. Which period applies to which document is set out in the article on the deletion concept for shops.
The general rules of orderly record keeping apply to the counting data itself: bookings and the other required records are to be made individually, completely, correctly, in a timely manner and in an orderly fashion (Section 146 (1) AO), and a record may not be changed in such a way that the original content can no longer be established (Section 146 (4) AO). During a tax audit the tax authority may inspect the stored data and use the data processing system to examine those documents (Section 147 (6) AO). A count sheet that can be overwritten afterwards does not stand up to that.
- count sheets and variance lists as a closed file per run
- process documentation describing the sequence, the systems and who is responsible
- a log of subsequent bookings between counting time and balance sheet date
- evidence of the blocking logic: when was the shop in which mode
- export in a machine-evaluable format rather than as a screenshot
The test run before counting day
Counting day is the wrong moment to test integrations. A trial run on a copy of the data with a few hundred items shows within a morning whether snapshot, blocking and write-back work together. Once the sequence of steps is written down, nobody has to make decisions on counting day.
- cut-off set to the same time in shop, ERP and warehouse management
- reservation mode switched over and verified in the shop
- stock messages to the sales channels paused
- count sheets generated per bin location, blocked areas kept separate
- variance list generated as a test and checked against the snapshot
- write-back executed as a dry run
- process documentation matching the actual sequence
- contacts named for warehouse, accounting and technology
What counting day actually demands
The effort in a stocktake rarely sits in the counting. It sits in the weeks before, when it is decided which stock figure applies, which system leads and how variances come back. A company that books its movements cleanly can choose between all four procedures. A company whose stock lives in two systems usually does not have that choice.
The procedures of commercial law are given, the systems behind them are not. Run shop, ERP and point of sale on one stock figure and the annual stocktake becomes a routine rather than a project - the article on connecting a POS system shows the same question from the shop-floor side. And holding the counted quantities against pack sizes and minimum order quantities and against the shipping cost models usually surfaces the positions that tie up capital without generating revenue.
This article draws on the German Commercial Code (HGB), in particular Sections 240, 241, 241a, 252, 253 and 256, and on the German Fiscal Code (AO), in particular Sections 140, 141, 146 and 147, each in the version in force as published on gesetze-im-internet.de. It does not replace tax or legal advice; assessing an individual case is a matter for a tax adviser or auditor.
Usually not. It is enough to halt stock consumption: orders are accepted and earmarked, but only booked after the counting run. A shop that is switched off costs revenue and produces error pages without making the count any more accurate.
For the deferred count, Section 241 (3) number 1 HGB names a window of three months before to two months after the end of the financial year. The counted stock then has to be brought to the balance sheet date by roll-forward or back-calculation.
Typically where many stock items are held and every warehouse movement is booked with a document anyway. Section 241 (2) HGB requires a procedure that makes stock determinable by type, quantity and value for the balance sheet date without a physical count.
They belong in a blocked area that is counted separately. They only affect stock after inspection; until then they are neither saleable goods nor a shortage. Without that separation they show up in the variance list as a surplus found.
Inventories are among the documents under Section 147 (1) number 1 AO and must be retained for ten years. The period begins at the end of the calendar year in which the inventory was drawn up (Section 147 (4) AO).
That is a job at the interface between shop and ERP. We build the counting run into the system integration as a mode of its own and run it on a copy of the data beforehand - a short project conversation is enough to get started.