
good day
Automation of retail trade is a very typical task that various people of different specialties encounter in a particular profile. Accordingly, most of the technical problems arising in the context of this task are worked out quite thoroughly.
Nevertheless, we decided to take the liberty to consider the conceptual model of retail sales accounting.
')
The main subject of this article is the mechanism for transforming primary sales data into accounting documents of the ERP system. The article abstracts as much as possible from the specific systems that implement the described techniques, but the terminology used is partially borrowed from the
open source ERP system OpenPapyrus (the approaches described there have been implemented and have worked perfectly for many years).
Despite the fact that I emphasize the market segment of retail sales, the same scheme applies equally to the restaurant business and, in part, to other segments of the business to be automated.
Requirements
First of all, it should be determined, at least in general, the list of requirements imposed by various divisions of the retail enterprise on the infrastructure of automated accounting (in the context of our discussion):
- Availability of tools for analyzing primary sales data.
- Availability of consistent sales data that can be compared with other indicators.
- Mechanisms for the automatic transformation of sales information into accounting and financial indicators.
- Providing the most reliable baseline data to predict future demand.
- Techniques to control the automatic deduction of raw materials used for their own production of products, based on sales results.
- Various tricks for implementing all sorts of data consolidations, import and export.

Now to the point
The diagram shows the main components of retail sales accounting and the
curves of the direction of their interaction. It is important to note that none of the above components are optional: an attempt to remove one or more of them will lead to the “disability” of the sales accounting technology in a retail enterprise. Next, I will describe each of the elements of the scheme and at the same time argue the previous statement.
general description
If we consider the process in general, the mechanism of data transformation can be described as follows:
- Primary sales data comes to the ERP system from point-of-sale management subsystem.
- Incoming data about checks are usually grouped into cash sessions (shifts). If not (such cases are extremely rare), then we must artificially group them.
- Cash sessions are grouped into super sessions, which will be discussed in more detail below.
- The next phase is the consolidation of cash checks in the aggregator. Again, it is described in more detail below.
- The final phase: the transformation of consolidated sales data into accounting documents, modifying the balance sheet parameters of the enterprise (commodity balances, accounting entries, etc.).
Cashier Checks
Actually, the primary data of retail sales, passing through point-of-sale, are represented by cash vouchers. Here, the public is quite prepared because I do not see any reason to go deep into particular structures of cash vouchers and other technical nuances, especially since this goes beyond the scope of the article.
I will list the essential, in the context of the article, the features of cash checks:
- each check represents a sale “as is”: nothing is grouped in it (for goods, for example), the time and place of sale is presented as accurately as possible.
- cash checks as a data object should be the “property” of the infrastructure system that implements the accounting model under discussion. In other words, if the system relies on the fact that checks are stored somewhere in another system (for example, a cash terminal server) or, even more, are not stored anywhere else after aggregation, then our entire structure falls.
Cash session
A grouping object that combines a sample of cash checks for a period of time. In Russian practice, almost (but not absolutely) cash session always coincides with the so-called Z-report (or interchangeable) of cash.
Cash sessions have the following important properties:
- each recorded check belongs to one and only one cash session.
- there may be special types of checks that are not tied to a specific session, but such checks do not in any way affect the balance sheet of the company. For example, pending checks, pending confirmation or further change, abnormal checks (resulting from a failure and for this reason not accepted).
- each cash session is tied to a specific cash register. Thus, if you have a hypermarket with 30 checkout hubs that have punched at least one check in a day, then you should get 30 checkout sessions per day.
Cash Super Sessions
An important, complex and not obvious component of our scheme. Super Sessions group ordinary cash session, discussed above. This group has several objectives:
- Reducing the fragmentation of sales at cash registers for the final write-off and turning into documents.
In order to present the importance of this function, it is enough to recall that, say, plastic bags are sold throughout the day at all the box office stores. Without super sessions, we get the number of accounting transactions for the sale of packages in an amount equal to the number of operating cash desks. It is clear that the HDD will endure, but over the years, the overall performance will begin to fall, and even to understand such data is not a hurry.
- Solving the problem of round-the-clock work. This problem is not evident in a cursory study of the task of building accounting in the enterprise, but it is very painful. The bottom line is that accounting documents are tied to dates, while cash checks and cash sessions (shifts) are tied to absolute time. As a result, it may happen that the write-off documents of cash sessions are “scattered” between neighboring dates at random and when receiving reports it is very difficult to understand we see sales, say, for the whole month or for a month without a pair of cash desks closed on the first day of the next month, or with cash registers closed last month, but maybe in the current month.
Super Sessions allow you to determine these ambiguities by controlling the aggregation mechanism of single cash sessions.
- Another difficulty ordered by the supersessions lies even deeper. If we are talking about automating a restaurant or a super- (hyper-) market that has its own production, written off on the fact of sale (reverse accounting of production), then according to the results of cash sessions, we will have to generate MRP tables and write off production in relation to these sessions.
So, the cash supersessions greatly simplify this task by structuring many ordinary cash sessions and arranging them in time (the problem described in the previous paragraph has an even more dramatic effect on production write-down than on receiving reports).
For the cash super sessions, since they are an artificial object, the extreme uniqueness of the algorithm and the rules for including ordinary sessions are extremely important.
Aggregator
The next element of our model, uncomplicatedly called an aggregator, as in a good pipeline, performs the function of grouping data from the cash vouchers included in the supersession already on more subtle attributes: goods, serial numbers and, possibly, warehouses.
The aggregator is the last echelon of preprocessing primary sales data before the final write-off.
The following question is quite expected: why should the aggregator be singled out as a separate component of the retail sales accounting model? Isn't it easier to group everything in a transient-object and put it on the “depletion” module of the write-off. Unfortunately no. The aggregator is a persistent object and performs an important function in managing the accounting deficit and in decommissioning production (mentioned above).
In the event of a deficit (for some reason, a greater quantity of goods passed through the cash registers, rather than being on the accounting balance), the aggregator fixes it and allows taking measures to eliminate it. It can be both manual actions and automatic.
I once put on display a detailed overview of the problems of accounting deficit . Therefore, I will not repeat his theses here.
Write-off documents
The final component of the model and, in fact, the ultimate goal of the process: accounting documents, write-off balances, generating accounting entries, displaying the processes of production of its own products, etc.
Documents write off cash sessions, it turns out, are divided into several classes that should be considered:
Retail Documents
The most significant and most understandable class of documents written off. These are simply documents reflecting the fact of the sale of goods through the cash desks, grouped by super sessions, goods, serial numbers, etc. When party accounting each line of such a document is tied to the lot (party).
Returns Documents
Addition to the previous class, reflecting refunds through cash.
The final sum document of the cash session
An optional class of documents that carries into the accounting plane all the necessary amounts associated with cash sessions.
The reasons for which such documents can be claimed stem from the fact that when translating cash checks into debit documents, there may be sum differences related to the following factors:
- Accounting deficit
- Trivial rounding problems (which, however, can be eliminated in other ways)
In addition, the sum document allows you to reflect many of the parameters of cash sessions, which are problematic to include in the sales documents write-offs. As such: the differentiation of amounts according to payment methods, detailed discounts, etc.
Production write-off documents
The above-mentioned production write-off based on sales results finds its final embodiment in this class of documents. In general, the technology of such a write-off is quite complicated, precise, and deserves a separate large article. Here I will only inform that the said documents relate to the so-called type of product modification: they contain both consumable raw materials and manufactured goods with cost balancing and other gusto.
Automatic shortage compensation documents
Another tricky optional class of documents written off cash sessions, designed to solve the problem of accounting deficit "through the knee." If the corresponding mechanism is allowed by the management of the enterprise, then the subsystem of writing off cash sessions can simply create artificial documents that come into deficient positions.
In addition to such vulgar application, this class of documents can perform more respectable functions. For example, to automatically transfer items stored in warehouses other than the main depreciation warehouse (trading floor).
Conclusion
As a conclusion, I will give several advantages of our model.
- Scalability: the model is applicable for retailers of any scale - from a single store to chains from any number of stores.
- Universality: this model works in different business segments. I mentioned the automation of retail and restaurant automation, I will add to this the excellent adaptability of the model for the pharmacy business (there are a number of nuances that distinguish this segment about ordinary retail) and, not surprisingly, beauty services and fitness clubs.
- Manageability and reversibility: data transformation processes in the described model, being the most automatic, allow at the same time to control each of the stages.
- Efficiency: the considerations given in the article provide compact data storage and high processing speed. For large enterprises, this is a significant factor.
Thanks for attention.