What is an accumulation register in 1s. The order of recording register movements when posting a document. Indexing the dimensions of the accumulation register

The task of any accounting system is the storage and prompt display of information for the user, i.e. The goal of any system design is to promptly provide the user with a report. With the help of the obtained data, as a rule, managerial decisions are made at enterprises.

Suppose we have 1000 different documents: receipt of goods, write-off, return, sale, etc. And each of the documents changes the quantity of a certain product in the warehouse. To get information about the current quantity in the warehouse, it is necessary to sort through everything: some increase the quantity of goods, some decrease, some can both increase and decrease. And if you also need to take into account the warehouse, organization?.. Such a system is very resource-intensive.

To simplify this process, 1C developers came up with special configuration objects. They are used for the convenience of storing and retrieving information, in 1C 8.3 and 8.2 all kinds of registers are used, in this article we will talk about Accumulation registers.

The accumulation register itself is a table with information in which all movements (receipts / write-offs or turnovers) of certain documents are collected. Consider how the movement table looks like, using the example of a typical accumulation register "Goods in warehouses" in the "Trade Management 10.3" configuration:

Here we see that 1C "Sales" documents reduce the quantity of a certain product in a certain storage location, and receipt documents, on the contrary, increase the quantity. As a result, we get a general picture, which clearly shows what, when and in what quantity was received (was written off) according to accounting. According to such a table, it is already much more convenient to build a report.

Accumulation register in the configurator

What is an accumulation register in terms of configuration development? Let's start by looking at the fields of the accumulation register in:

Get 267 1C video lessons for free:

The accumulation register has Dimensions, Resources, Attributes and Standard Attributes.

Consider first the standard details of the accumulation register:

  • period- the date of movement does not have to coincide with the date of the document;
  • registrar- a document that makes an entry in the register;
  • line number— row number in the record set, unique within the registrar;
  • activity- is responsible for getting records into virtual tables (more on them below);
  • viewmovements- incoming or outgoing.

Accumulation register measurements

A dimension is a section in which accounting is kept. In the above example, the accounting section is: warehouse, nomenclature, nomenclature characteristic, nomenclature series, quality. That is, by setting the measurements of interest to us, we can at any time get the quantity - the resource. In the context of different measurements in the future, for example, you can get balances on a specific date.

Accumulation register resource

A resource is a numeric field that stores information in the context of the dimensions described above.

Otherwise, dimension/resource interactions can be schematically depicted as a coordinate system:

Two dimensions - the abscissa and the ordinate of the coordinate system, i.e. in this dimension example, these are warehouse and item. At the intersection of dimensions, we can get a quantity - a resource. For example, in the “main” warehouse of the product “pencil”, 1 piece is available.

Accumulation register details 1C

Requisites of accumulation registers carry the role of a “comment” or additional information; in the context of measurements, it is impossible to obtain balances / turnovers. Rarely used.

Types of accumulation register

There are two types of accumulation register − turnovers and balances.

If the purpose of the accumulation register is not to receive balances, it is imperative to use the type of accumulation register − turns. A typical example of the use of a turnover register is the recording of sales volume. In this case, we only need to know what sales were for a certain period of time, the balances in this case do not make sense.

If, among the purposes of using the accumulation register, is to obtain balances for a certain period, we need a register with the form leftovers. This type allows you to receive both balances and turnovers. For such a register, the system automatically calculates the balances. An example of a “residual” register is goods in warehouses, money in cash.

Using the register type leftovers where you can get by turns, is considered a gross error in the design of the accumulation register in terms of system performance.

Depending on the type of register, the system will create different virtual tables for the accumulation register. A virtual table is a quick way to get profile information from registers.

For the accumulation register, this is:

  • Remains;
  • Turnovers;
  • Remains and turnovers.

For the solution developer, data is taken from one (virtual) table, but in fact, the 1C platform takes from many tables, converting them into the desired form.

Proper design of accumulation registers

Accumulation registers must be designed from the required reports. The most difficult thing in the 1C 8.3 system is to store information correctly so that it can be easily retrieved at any time.

Among the design features of the register, it should be noted the need to correctly arrange the measurements in the register in order. Above all, it is necessary to put measurements that will be more often requested in the system.

Indexing the dimensions of the accumulation register

Accumulation register measurements have a property - "index". This property must be set on dimensions in cases where it is planned to apply filters on the dimension frequently when obtaining data and this dimension can have a large number of value options.

For example, the register "Goods in Warehouses", measurements - "Warehouse, Nomenclature", resource - "Quantity".

It is more correct to index the "Nomenclature", and the field "Warehouse" should not be indexed, because the number of warehouses in the system, as a rule, is not significant.

To reflect various business operations in programs based on 1C: Enterprise, users use documents. From them you can get all the necessary data, for example, on the balance of funds in the accounts of the company, the number of goods sold for a certain period of time.

In the process of work, there can be quite a large number of such documents. Here we can talk not about hundreds of documents, but about thousands and tens of thousands. Naturally, building reports and other data from such a large number of documents is very long, laborious and inefficient.

Just imagine that when registering the sale of any product, the accountant sits and waits for the program to check the previously submitted documents and calculate whether there is enough balance in the warehouse to write off.

To solve such problems in 1C, there are special configuration objects - accumulation registers. When conducting documents, they make entries in them, and only then from these registers you can quickly get all the necessary data, including balances and turnovers. That is, accumulation registers not only store data, but also allow you to quickly process it.

As mentioned earlier, accumulation registers can allow you to quickly receive balances and turnovers. This functionality is directly related to the type of register. It can be changed on the "Basic" tab of the form for editing a specific register.

  • Turnover accumulation registers allow you to get only turnover for a certain period of time. In this case, it is not possible to receive the rest. The accumulation register with the “Turnover” type creates only one virtual table in the system - turnover.
  • Accumulation registers with the “Remainders” type enable the developer to receive both balances and turnovers. In this case, three virtual tables will be created: balances, turnovers, balances and turnovers. An example of such a register can be a register of balances of goods and materials in warehouses, cash flows on the settlement accounts of the organization.

note that, despite the universality of the balance register in obtaining both balances and turnovers, it also has its drawbacks. When receiving turnovers in the balance register, the performance is significantly reduced. In this regard, it is strongly not recommended to use the balance register in cases where you need only turnovers (for example, sales turnover). It is not necessary to set the register type to remainders “just in case”, because the registers are designed to speed up the program, and on the contrary, you will slow down this process.

Accumulation register data

measurements

Measurements of accumulation registers mean certain cuts in which you will be able to obtain information in the future. In our case, as measurements of the register "Product Release" are: organization, order, specification, division, and others.

At any time, we will be able to receive balances, for example, for the entire organization as a whole, for a specific order.

Dimension Properties

Each dimension has its own set of properties, which can significantly affect the operation of the register as a whole. Similar properties are also present in resources with attributes.

In the event that you plan to set the selection by any dimension quite often in the future. In our case, we will not use indexing for the organization.

You can also specify here whether the dimension is required to be filled in, whether full-text search should be used, and other settings.

Resources

Resources are numeric data that store some information. It is this that we will obtain in the future in various sections. For example, in the accumulation register “Product output”, only quantity will act as a resource. In this case, we will be able to get the number of products manufactured at a certain point in time, for example, for a certain division.

Another simple example. Let's assume that we carry out all operations on the cash register according to the accumulation register. The resources will be the amount of money that is either received (receipt) or issued (expenditure) from the cash register. The dimension can be, for example, a counterparty/reporting entity. As a result, we will be able to obtain data on the balances and turnovers of both the cash register as a whole and for individual counterparties.

Requisites

Unlike dimensions and resources, props are not used as often. They store the data that is needed for the informative completion of the register (note). Data will be used as props if it is neither a resource nor a dimension.

Standard details

In addition to the usual requisites that the developer can add on their own, there are also standard requisites. You cannot delete or add new ones to this list. You can go to the standard details by clicking the button of the same name on the "Data" tab.

Aggregates

Aggregates are available only in accumulation registers with the “Turnover” type. You can access them from the Data tab. Aggregates are used in databases with large amounts of data to speed up reporting. We will not consider this mechanism in detail, since this is a rather extensive topic.

Movements in accumulation registers

Any accumulation register can have one or more registrars. A document acts as a registrar, during which a corresponding entry is formed in the accumulation register.

You can view the list of accumulation registrars on the tab of the same name in the form of the register itself. In this example, movements in the “Product Release” register can be generated when posting four different documents.

In the documents themselves, which are registrars, the list of registers by which they make movements is located on the "Movements" tab. A motion constructor is also available here, which will help in creating such procedures (posting and undoing). Comparison of document and register data is performed by comparing data types.

Documents are the essence of accounting in 1C. Each document has a result, for example, goods +10 pcs.

Reports - allow you to view the results. These results are summarized and shown to the user.

However, there are many documents, and if one had to summarize their results, it would be too complicated. So here's the best way!

Documents record their results (called “movements”) in special tables - 1c registers, which themselves summarize the results so that the report simply displays the pre-calculated totals.

Today we will talk about 1C registers and their use.

Register 1c is a table, the same as in Excel, each document writes to register 1c one or more lines of its movements (results) with some sign - plus or minus. This means that the total register 1C has changed to the corresponding figure.

The document that recorded the movements in the 1C register is called the Registrar. The date and time of movement are equal (in 99% of cases) to the date of the document. The date of movement is called Period.

Each 1C register usually takes into account the movements of any one directory. For example, register 1C Goods in warehouses - movement of goods (in terms of 1C "nomenclature") - how many goods arrived at the warehouse, how many left. Register 1C Mutual settlements with counterparties (buyers and suppliers) - movements of contracts with counterparties - how much the counterparty owes us after the purchase or how much we owe him after payment. The directory in the context of which the register is maintained is called the main measurement (analytics) of the 1C register.

Of course, no one makes one basic measurement of k y register 1C. After all, if we take into account the movement of goods, then we are interested not only in what goods have decreased or increased, but also, for example, in which warehouse. Therefore, there are always three to five additional dimensions “just in case”, which can be called additional analytics of the 1C register.

How is a document posted to registers?

Document movements in registers 1C

Let's see how 1C registers work. Here we have a goods receipt document, in which we see that the goods Oil have arrived at the Main warehouse.

In terms of logic and mathematics, this document has the result:

Kremlin oil, Main warehouse +10 (pcs)

Let's check - is it so?

This menu item will show us all the movements of the document that it made in registers. As we can see, the document made movements through a whole bunch of 1C registers, into each of which it wrote different information (in accordance with the purpose of the 1C register). According to the register 1C Goods in warehouses, he made the posting that we calculated with you.

How does it look in register 1C? Let's open register 1C through the Operations menu.

Register 1C opened. It contains a lot of data. We will make a selection only according to our document.

As a result, we see the movement of our document along the 1C register. It exactly coincides with what we calculated manually:

  • Plus - type of movement (income / expense)
  • Registrar is our document
  • Active - This motion line is valid (i.e. not disabled)
  • Nomenclature, main dimension
  • Warehouse, additional dimension
  • Quantity, resource (that is, the figure that we consider).

If we set the selection not by document, but by nomenclature (in exactly the same way), then we will see the movements of all documents that touched this nomenclature. One document - we bought the goods. The other one was sold. In total, of course, the 1C register itself does not show - for this you need to use a report or a query.

1C registers are different (we will discuss this below). Postings for different 1C registers also look different. We have now looked at the postings on the accumulation register 1C. This is how the postings of our same document in the 1C accounting register, which works on the basis of the 1C accounting (tax) chart of accounts, look like.

Why do we need 1C registers

Registers 1C are of different types. The purpose of using register 1C depends on its type.

  • Information registers 1C
    This is a regular table, like in Excel. It has no movements (revenues/expenses). The 1C information register is usually used to store additional directory data. Using the 1C information register, you can organize
  • Accounting registers 1C
    From the user's point of view, accounting is kept on the accounting chart of accounts. In fact, accounting is kept in the table of 1C accounting registers, which are made in the context of the 1C chart of accounts.
  • Accumulation registers 1C (register of balances 1C)
    Table of movement of documents + and -, which automatically calculates the total at the beginning of the period and the total at the end of the period. For example, the movement of goods Shovel was +10, and then -8. So the remainder at the beginning was 0, and the remainder at the end became 2.

    The 1C accumulation register with the “Balance” type means that movements will be stored (revenues and expenses, which are also called “Turnovers”) and totals (which are called “Balances”) will additionally be automatically calculated.

    The 1C balance register is used when the directory can logically have a remainder. For example, when we take into account the movement of goods, we will use the 1C balance register - after all, we can say that there are 3 pieces of the Shovel product left.

  • Accumulation registers 1C (turnover register 1C)
    Table of movement of documents + and -, which does not count the total.

    The 1C turnover register is no different from the balance register, except that it does not automatically calculate balances.

    The 1C turnover register is used when the reference book logically cannot have a remainder. If we need to take into account the sale of goods, then we will use the turnover register.

    For example, sales of goods were +10 (we sold) and then -2 (we were returned). We cannot say that the remaining sales became 8, because logically the concept of the remaining sales does not exist, we will say that the total turnover (the sum of each line of turnover) has become 8.

  • Calculation registers 1C

    Table of movements by types of calculation and periods. Used in payroll (called Complex periodic calculations).

Where are the registers 1C

Conducting the document in the code (in the program) is prescribed by the programmer. To do this, open . Find a line like “Procedure Processing Posting (”. Open the cross and you see the program for posting this document.

Setting up and developing Registers 1C

The main features of Registers 1C, by bookmarks:

1. In order to view the registers into which the information entered by the user into the document was entered, it is necessary to press the button “Document movements by registers” on the document functions panel:

2. In order to collapse/expand the information contained in the registers, you can use either the "Group Levels" line in the menu that opens when you right-click on the corresponding area of ​​the screen ...

... or the "+" / "-" buttons as shown in the image below.

3. The appearance of the report can be configured using the "Display details by ..." field:

4. A quick transition to another document is possible using the “…” button, which is located in the “Report Document” field.

The user will open an archive of all documents (of this type), among which you can find the necessary one with the help (the panel in the archive has a similar set of buttons and functions):

5. The function of saving the set settings is also available.

It is necessary to press the button of the same name on the report functions panel, enter the name of the setting and click "OK":

Algorithm for posting a document, taking into account subscriptions to events

Document Settings:

If you look at the properties of the document through the properties palette, you can see two important properties: "Deleting movements" and "Recording movements during swipe", and the second one is NOT placed on the "Movements" tab of the document editing window.

1. Removing movements.

If the property "Deleting movements" is set to "Delete automatically", then BEFORE starting execution, the program clears all movements in registers. In fact, this means writing an empty register record set with the record type - replacement. This means that the program executes the code from the "BeforeWrite" and "OnWrite" procedures of the register record set module.

If a register has an On Write event subscription defined, then the code in the associated procedure is executed.

2. Procedure "Processing" of the document module.

Pay attention: at the beginning of the processing of the execution, the modification flag of all movements is False (the value is returned by the method Movements.Register.Modification()).

When working with a set of register entries (for example, Movements.Register.Clear(), Movements.Register.Add() etc.) the modified flag becomes True.

After recording the movement in the database Movements.Register.Record() modified is false again.

If a register set is explicitly written in the subscription procedure module (.Write() ), then the program executes the code from the "BeforeWrite" and "OnWrite" procedures of the register record set module and the procedure from the subscription to the register "On Write" event.

3. Subscribing to the event "When posting" the document

It is important to understand: if in the processing of the document posting or in the event subscriptions called earlier, register movements were not explicitly recorded (Movements.Register.Record()), then the movements of the document are NOT yet recorded in the database. Therefore, they cannot be retrieved with a query, but they can be retrieved from the origin's motion collection.

Procedure When Posting a Document (Source, Refusal, Posting Mode) Export Register = Source. Movements. Accounting; ..... EndProcedure

The order of subscriptions to the same event is not explicitly defined by 1C, but in practice, subscriptions are called in the order they appear in the "Event Subscriptions" branch of the configuration editing window.

If registers are written using the Write method () , then all associated procedures are executed.

4. Recording movements.

Let's remember the property "Record of movements during drawing" from the document settings.

If it is equal to "Record modified", then all movements of the document with the "Modified" flag True will be written to the database.

If it is equal to "Write selected", then register movements for which we explicitly indicated the need for recording will be written to the database.

Movements.Register.Record = true;

Movements are recorded in the database with replacement mode Truth. This means that the records from the current record set of the Motion collection register will be written and the previous records will be cleared.

And at the end of let's look at a few examples:

Let the property of the document "Recording movements during posting" be equal to "Record modified", and "Deleting movements" - "Do not delete automatically".

Example 1

Procedure Postprocessing(Failure, Posting Mode) NewRecord = Movements.Register.Add(); .... Movements.Register.Write(False); //*** EndProcedure

With such a procedure for posting, the document will add an entry to the register with each re-posting, the entries will be multiplied. Because line //*** adds entries to the register, the Modified sign is removed.

It would be more correct to write the string //*** as

Movements.Register.Record()

or omit it altogether, and then the program itself will record the modified movements.

Example 2

In 1C 8, document movements can be formed not only in posting processing, but also from the outside, for example, from some service processing (this is how additional posting of documents, recovery of advances, etc. is implemented).

Incoming = Documents.Incoming Invoice.Select(); Postings = RegistersAccounting.Register.CreateRecordSet(); While Arrival.Next() Loop DocLink = Arrival.Link; Postings.Selection.Registrar.Install(DocLink); NewPosting = Postings.Add(); NewTransaction.Period = DocLink.Date; NewWiring.Organization = DocLink.Organization; NewTransaction.AccountDt = Charts of Accounts.Chart of Accounts.Goods; NewTransaction.AccountKt = Charts of Accounts.Chart of Accounts.Suppliers; NewWiring.Amount = DocLink.Total; Postings.Write(False); EndCycle;

In this case, when reposting the document, if there is a change in the accounting register movements (Modification flag True), the entries will be replaced by the entries generated by the document.

Example 3

Before the start of posting a document, all the details of the document are recorded in the database (i.e., the programmer can get them using a request). A Document Object is created in internal memory, and this object has a collection of motions that will be written after the completion of the swiping procedure (see step 4).

If, in the process of posting a document, register movements are not formed using the Movements collection belonging to internal object, and in other ways (manually in the form of a set of records or as in example 2, etc.), then at step 4 these records will be replaced!!! To avoid substitution in standard bases, for the "Bus Operation" document, the "Posting" document property is set to "Forbid".

If the document is to be posted to other ledgers and posting cannot be disabled, then you need to carefully configure the document properties:

Select the option to record movements "Record selected" and make sure that Movements.Register.Record = False

Select the "Record modified" option for recording movements and control the Modified attribute for the record set of this register.

Example 4 .

You need to understand that the object received by reference (let's call it "DocObject"), and the internal object ("ThisObject"), created in memory at the time of passing, are two different instances of objects.

Accordingly, their collections of movements will be different. For "DocObject" the collection of movements will include only the set of register records written to the database, and for "ThisObject" - both recorded, added and unwritten records. At the end of the execution (stage 4), the recordsets of "ThisObject" will be written to the database, moreover, with the attribute Replace = True.

If records are added to the recordset in the manner described above, then they can be replaced in step 4.