Bp 3.0 control of negative residues. Accounting info. Executing movements in registers

At trade or industrial enterprises in accounting in the accounting system, negative balances "pop up". They reflect unnecessarily written off item / materials.

What are the reasons for their occurrence?

Lack of arrival

Often the most common reason can be the lack of a posted goods receipt or the entry of opening balances. For example, you have purchased a product, but have not yet managed to register it in the system, but have already sold it. And it happens - the goods were capitalized, then moved to the store and sold, but someone canceled the receipt document.

In this situation, the correct way of action would be to check the availability of the receipt document in the database. If it is present and not posted, check the filling and validate. If there is no receipt document in the database at all, you must enter it retroactively. At the same time, it is necessary to understand that the addition of documents retroactively in a closed tax period may entail changes in the amounts of taxes, in particular - VAT.

Re-grading

Another common reason for the phenomenon we are considering is a re-grading or excess of one name of a product (material) and at the same time a lack of another. For example, in the program, only a black wallet in the amount of 10 is marked in stock, and in a store the seller sells a red wallet and draws up its sale in the database in the amount of 5 pcs. As a result, the remainder of the black wallets in the database does not decrease, and our remainder appears in the red wallets.

IN in this case the correction of the balances is solved in the following way: the posting of one product and the write-off of another is made To do this, a document "Capitalization of goods" is created and 5 pieces are capitalized in it. red wallets. Next, a document "Write-off of goods" is created and 5 pieces are written off in it. black wallets.

When there is a negative balance for goods (materials) in 1C: Accounting 3.0, then when the document "Sale of goods" is posted, an information message is displayed that this document cannot be posted, since the number of units displayed in the tabular section of the document exceeds the balance.

Fig. 1 Message in the document when there is no balance in the warehouse

Warning Signals in the Balance Sheet - Negative balances are highlighted in red!



Fig. 2 Tracking by WWS

How to enable or disable the control of negative balances in 1C BP 3.0

You can set up control in the "Administration" section, then click on the "Posting documents" link.



Fig. 3 Setting

To disable control, you need to activate the checkbox on the "Allow inventory write-off when there are no balances according to accounting data" parameter.



Fig. 4 Permission to write off units in case of negative balance indicators

It happens that for the urgent sale of a product that also needs to be shipped urgently, you need to turn off control for a while. The document "Realizations" is posted in the system, and then the control is turned on again. Then be sure to remember to analyze the residues in order to correct the accounting error, due to which a negative product arose.

In order to control the balances in the context of warehouses, you need to set up analytics for them in the "Accounting parameters" through "Administration".



Fig. 5 Parameters

Click "Setting up a chart of accounts".



Fig. 6 Setting parameter

We press "By nomenclature, lots and warehouses (by quantity and amount)".



Fig. 7 Inventory accounting parameters

When installing analytics, by clicking "By warehouses (storage locations)", we choose how to keep records.



Fig. 8 Activating warehouse analytics

If the setting "by quantity and amount" is selected, respectively, accounting will be in quantitative and total accounting for warehouses separately, and if - "by quantity", then only quantitative in the context of each warehouse, and write-off amounts are determined by dividing the price of stocks by the entire quantity in all warehouses.

Control reports

The report "Control of negative stocks" is used to analyze the detected negative stocks of goods of organizations. You can open it through "Warehouse - Control of negative balances".



Fig. 9 Reports for control of balances



Fig. 10 Control report form

In the report settings, you can specify on what data to build the report, for example, group data by Organization, Warehouse, Write-off Document, Nomenclature, etc.



Fig. 11 Control report settings

In the selection, you can specify on what data to generate a report, for example, for a specific warehouse or for a problem item.



Figure 12 Selections in the control report



Fig. 13 Generation of a control report

Negative balances are a kind of indicator of accounting errors. It is important to constantly monitor the balances in warehouses and correct them in a timely manner. Existing incorrect balances create problems for the operational work of users, and can also cause incorrect calculation of the cost, revaluation, and others important indicators accounting.

This article is intended for 1C implementors - and especially for those who are preparing for Attestation on 1C: Platform Specialist.

Today we will analyze 2 methods of control of balances - and not only balances in the warehouse, but also, for example, mutual settlements ("What is the current debt of the client and is it possible to ship goods to him")

Both techniques are used in typical configurations, and in Certification Tasks. And since there are two of them - you need to clearly understand when the “new” technique is applicable, and when only the “old”.

This is basic knowledge for 1C programmers, we recommend not to leave gaps in such areas. It should take you to study 15 minutes :)

Formulation of the problem

Let's take a simple configuration with documents “Goods receipt” and “Goods sale”:

The accumulation register “Free balances” is used to record balances:

When the document "Goods receipt" is posted, the following movements are made:

Posting Processing Procedure (Refusal, Mode)


For Each Tech Row Products From Products Cycle
Movement \u003d Movement.FreeRemains.Add ();
Movement.Motion Type \u003d Movement TypeAccumulation.Arrival;
Movement.Period \u003d Date;
Movement.Nomenclature \u003d TechStringProducts.Nomenclature;
Movement.Number \u003d TechStringProducts.Quantity;
End of Cycle;

End of Procedure

The processing of the document “Goods receipt” was carried out using the motion constructor and is of no interest, since when it arrives at the warehouse, control of the stock is not needed.

Sometimes the control of balances is also implemented for the document “Goods receipt” - so that when the document is canceled or re-posted, a negative balance does not form.

For example, 10 new LG TVs arrived at the warehouse, 6 of them were sold. If the receipt document contains 10 pieces. fix by 5 pcs. - a negative balance "minus 1 item" is formed.

In typical UT 11, such control is enabled using the functional option "Control goods of organizations when canceling receipts".

When carrying out the document "Sale of goods" it is necessary to organize control of residues... If there is not enough stock on stock, the document is not posted and a diagnostic message is issued. This is the problem to be solved.

We are deliberately working on a simple task, when the cost is not calculated when writing off. This will allow us to focus specifically on the nuances of residual control.

Note - the algorithms presented below are designed for teaching and should be as clear as possible.
They can be optimized, but then the "coefficient of understanding" will be lower, so in this article we will not stop there.

Naturally, you can optimize them yourself, or take our 1C Acceleration and Optimization course :)

As you already understood, the solution to the problem can be done in two ways. Let's start with the methodology that has been used since the days of 1C: Enterprise 8.0.

Old residue control technique

The principle of the old residue control method is as follows: we check if there is a balance of goods in the required quantity. If there is - we write off, if not - we report an error.

The algorithm in the old technique consists of several blocks:

  1. The request receives the balances of goods and document data
  2. The cycle carries out control of the sufficiency of goods
  3. If there are not enough goods, then the document is not posted
  4. If there are enough goods, movements-consumption are performed

This is how the program code looks like:

// 1. Clearing old register movements
Movement.FreeRemains.Write \u003d True;
Motions.Write ();

// 2. Receiving a request for document data and register remains
Request \u003d New Request;
Request.Text \u003d
"SELECT

| POST Products
| FROM
| WHERE
| Products.Link \u003d & Link
| LOAD BY
| Products.Nomenclature
| INDEX BY
| Nomenclature
|;

| CHOOSE
,
| REFERENCE REPRESENTATION (Products.Nomenclature) AS NomenclaturePresentation,
| Products.Quantity AS Quantity,
| IS NULL (Balance.Quantity Balance, 0) AS Balance
| FROM
| Products AS Products
| LEFT JOIN Accumulation Register.Free Balances.Remains (
| &Moment of time,
| Nomenclature B
| (SELECT
| Products.Nomenclature AS Nomenclature
| OF
| ON Goods.Nomenclature \u003d Balances.Nomenclature ";
Request.SetParameter ("Moment of Time", Moment of Time ());

// 3. Traversing query results

// 4. Check for the sufficiency of goods
Shortage \u003d SampleProducts.Quantity - SampleProducts.Remainst;
If Deficit\u003e 0 Then
Refusal \u003d True;
Message.Text \u003d "Goods" + Selection of Goods.NomenclaturePresentation + "not enough in quantity" + Insufficient + "pcs.";
Message.Inform ();
EndIf;

// 5. Jump to the beginning of the cycle if there were errors
If Failure Then
Continue;
EndIf;

// 6. Execution of movements in registers
Movement.Period \u003d Date;

End of Cycle;

// 7. Setting the flag of recording movements at the end of the transaction
Movement.FreeRemains.Write \u003d True;

End of Procedure

Let's comment on the key points of the algorithm.

1. Clearing old register movements

Below in the algorithm there will be a request for the remainder of the register.

If the current document was previously posted, then there is probability of getting old document movements in the request Is a serious problem.

When is this possible? When document date moves forward.

Let's show with an example what this will lead to:

  1. Remaining table lamps 10 pcs.
  2. A document dated 02/16/17 is being held, we write off 6 lamps
  3. In the document, the date changes to 02/17/17 (the date can be shifted at least 1 second forward), we will repost the document.

If you do not clean the movements, the system will report a shortage of 2 pieces. Why? Because the old document movements have written off 6 out of 10 available lamps. Then the system tries to write off 6 more pieces, and there are only 4 on the balance.

The problem is solved in 3 lines of code:

  • Recordset is being cleaned up (it could have been read on the form or in previous handlers)
  • Recordset has the "Write" flag set
  • Recording is performed for all sets that have the "Record" flag set

Strictly speaking, we can control the cleaning of the movements when conducting documents:

The option with deleting movements when canceling swipes is recommended - we ourselves control when it is necessary to really delete movements.

2. Receipt of document data and register balances by request

The request consists of two packages:

  • In the first, the grouped data of the tabular section is obtained - a temporary table is created
  • In the second request, the remainders from the register are appended to the document data.

What to look for in this request:

  1. When creating a temporary table, the field is indexed on which the join will be performed further - this is done for optimal performance
  2. The moment of receiving the remains - correspond to the position of the document on the time axis
  3. There may be no leftovers in the register - therefore, a left join is performed and the “ECTNULL” function is used for the “Quantity” resource - the NULL value is reduced to zero.

3. Traversing query results

The developed request contains grouped document data and balances by item items.

In a loop, we go through the result of this request.

4. Checking for the sufficiency of goods

We determine the shortage of goods.

If the deficit is greater than zero, then the product is in short supply:

  • We issue a diagnostic message
  • We set the parameter "Failure" of processing to the value "True"

If "Refusal" is equal to "True", then the result of the document posting transaction will not be recorded. In simple terms, this is a command to the system not to post this document.

5. Jump to the beginning of the cycle if there were errors

If there were errors at this or previous steps of the cycle (Failure \u003d True), then it makes no sense to form movements. They will not be written to the database anyway.

6. Execution of movements in registers

If the check of the residuals was successful, we form the flow-flow.

7. Setting the flag of recording movements at the end of the transaction

If this flag is not set, then the movements will NOT be recorded.

At the end of the document posting transaction, only those record sets are written for which the "Write" flag is set.

For the sake of fairness, we note that setting the “Record” property of a recordset makes sense under one condition - the “Record selected” value must be specified in the document property “Record movements during swiping”:

However, it is the “Record Selected” value that is the de facto standard:

  • It is used in typical solutions
  • Set by default when creating new documents.

Another value of the property - “Write modified” is obsolete and practically does not occur in modern configurations.

New residue control technique

The new method uses the principle: we write off the necessary goods, then we check whether negative balances have formed on the goods of the document. If so, then you need to roll back the document posting.

As you can see, there is a fundamental difference in the moment of controlling the balances:

  • Old technique - first check the balance, then write off
  • New method - first we write off, then we check the balance.

As a result, the program code will look like this:

Posting Processing Procedure (Refusal, Posting Mode)

// 1. Getting the document data by request
Request \u003d New Request;
Query.TempTablesManager \u003d NewTempTablesManager;
Request.Text \u003d
"SELECT
| Products.Nomenclature AS Nomenclature,
| SUM (Items.Quantity) AS Quantity
| POST Products
| FROM
| Document.Realization of GoodsServices.Goods AS Goods
| WHERE
| Products.Link \u003d & Link
| LOAD BY
| Products.Nomenclature
| INDEX BY
| Nomenclature
|;
|////////////////////////////////////////////////////////////////////////////////
| CHOOSE
| Products.Nomenclature AS Nomenclature,
| Products.Quantity AS Quantity
| FROM
| Goods AS Goods ";
Request.SetParameter ("Link", Link);
QueryResult \u003d Query.Run ();

// 2. Formation of movements-register consumption
Movement.FreeRemains.Clear ();
SelectProducts \u003d QueryResult.Select ();
While SampleProducts.Next () Cycle
Movement \u003d Movement.FreeRemains.AddExpense ();
Movement.Period \u003d Date;
Movement.Nomenclature \u003d SampleProducts.Nomenclature;
Movement.Quantity \u003d SampleProducts.Quantity;
End of Cycle;

// 3. Recording movements in the database
Movement.FreeRemains.Write \u003d True;
Motions.Write ();

// 4. Request receiving negative residuals from the register
Request.Text \u003d
"SELECT
| Balances. Nomenclature AS Nomenclature,
| REPRESENTATION OF REFERENCE (Remains. Nomenclature) AS Nomenclature Representation,
| -Remains.Quantity Remainder AS Defect
| FROM
| Accumulation Register.Free Balances.Remains (
| &Moment of time,
| Nomenclature B
| (SELECT
| Products.Nomenclature AS Nomenclature
| OF
| Goods AS Goods)) AS Balances
| WHERE
| Remains. Amount.< 0";

ControlBorder \u003d New Boundary (Instant () ,BorderView.Including);
Request.SetParameter ("Moment of Time", ControlBoundary);
QueryResult \u003d Query.Run ();

// 5. Displaying messages about the lack of goods
If Not QueryResult.Empty () Then
Refusal \u003d True;
ErrorFetch \u003d QueryResult.Select ();
While FetchingErrors.Next () Loop
Message \u003d New Message to User;
Message.Text \u003d "Goods" + SelectionErrors.NomenclaturePresentation + "not enough in quantity" + SelectionErrors.Defecite + "pcs.";
Message.Inform ();
End of Cycle;
EndIf;

End of Procedure

Let's analyze the key points of the algorithm.

1. Getting the document data by request

This query is needed to group the data of the tabular section of the document.

Note that the first request in the package creates a temporary table - it will be used in the next request as well. This is possible thanks to the temporary table manager that was created for this query.

2. Formation of movements-register consumption

The cycle writes data from the document to the register - that is, an unconditional (without verification) write-off of goods is performed.

3. Recording movements in the database

For the residuals in the register to change, the movements must be recorded.

4. Query receiving negative balances from the register

And now, with a simple query, we select negative balances for the goods of the document.

It is here that the temporary table created in the first step is used - a condition is imposed on the item (for this we do not create a new object of the "Request" type, but use the one created earlier).

Pay attention to how the moment in time is transmitted - the data type "Border" is used. The balances must be received at a point in time immediately AFTER the current document.

Was it possible to get leftovers without a border, for example, by adding 1 second to the document date?

No! Indeed, in one second there can be a large number of documents. Therefore, the only correct option is to use the Include border view.

5. Displaying messages about the lack of goods

If the query result is not empty, then there are negative residuals - in this case, the document is not posted and messages about all errors are displayed.

Benefits of controlling residues using the new method

So, both algorithms solve the same problem.

The difference between the algorithms is visible, but the benefits are not obvious.

So let's emphasize them:

  1. No need to clean up old document movements... In fact, this is an operation of writing an empty set of movements to the database and deleting existing movements - these are quite resource-intensive operations
  2. A query getting data on negative balances only accesses one table - there is no need to make a left join with the document data and use the "IS NULL ()" function

In addition, during the normal course of business processes, the user specifies a quantity that does not exceed the balance in the warehouse.

In this case, the second request will not return any data and the document will be posted as quickly as possible.

Are these milliseconds so important?

On databases with a small amount of data and users, the difference will not be noticeable. But on busy systems with dozens of users, the cost of every millisecond is high.

In addition, on the 1C: Platform Specialist exam, it is imperative to use a new method of controlling balances, if a specific task allows it.

Ok, so you should always use a new technique, right?

No it is not!

The new technique can be used only if for posting the document there is all the necessary data in the document itself.

That is, to obtain data, you do not need to refer to the registers used to control the balances.

So, for example, if the amount was also taken into account in the “Free balances” register, then the old control method would have to be used.

By the way, the standard "1C: Trade Management 11" implements the control of balances according to the new method, and in "1C: Accounting 8" - according to the old method.

But that's not all!

The algorithms presented above can be used for educational purposes only. The fact is that they do not take into account managed locksthat must be used if more than one user is running on the system.

Locks for both residual control methods are devoted to. Also in this article we solve a more complex problem - in addition to controlling the balances, we calculate the cost of the item being written off. We recommend that you study it carefully.

And for the "seed" we just say that locking in the new technique is very simple - and this is another advantage of the new way to control residues.

Outcome

Let's summarize briefly.

We have reviewed two residue control techniques, each of which is used in today's typical configurations.

Key difference between techniques at the moment of control of residues:

  • Old technique - control before recording movements in registers
  • New technique - control after recording movements in registers

In general, the new technique is more effective, but it is not always applicable.

Applicability criterion - if for the formation of movements there is no need to refer to the data of the controlled register, you can use a new technique.

If we talk about the control of inventory balances, then the application of the new method is possible when the data on the cost price and inventory balances are stored in different registers.

And finally, examples from typical configurations:

  • IN UT 11 there are 2 main registers for item accounting: Free balances (quantity) and Cost of goods (data on cost price) - a new method is used
  • IN BP 3.0 data on the cost price and balances are stored in one register of accounting - the old method of controlling balances is used.

There are two types of situations in which you need to adjust the balance control.

The first situation. Sometimes accountants have to deal with the problem of the impossibility of writing off materials or goods in the 1C 8.3 program due to their absence in the accounting, although in fact they are available. And the accountant urgently needs to draw up documents for the shipment of materials or goods:

This situation is possible if the organization has just started accounting in 1C 8.3 or the data is entered into the program out of time.

The second situation is when the accountant writes off materials that are not available in the warehouse. And the accountant prepares the shipping documents, which does not add up very well to the company's reputation.

Balance control setup

The program 1C 8.3 Accounting has a balance control setting. And when creating a database in the default settings, it is allowed to write off goods that, according to the accounting data, are absent in the program.

The balances are monitored in the context of a specific organization and warehouse in all types of documents: implementation, demand-invoice, transfers, etc., where invoices with Warehouse analytics are involved.

Important! In order to control the balances at the warehouse level, in 1C 8.3 it is necessary to install analytics for warehouses in the accounts of goods or materials.

In this way:

  • For the first situation, you need to check the box and enter all the leftovers by materials in the database. And it is advisable after that to record the receipt of goods and materials in a timely manner.
  • For the second situation, it is necessary to uncheck the checkbox to prohibit the write-off of the missing product (materials).

How to disable control of residues in 1C 8.3

To remove the prohibition on posting documents with missing goods, it is necessary in the 1C 8.3 program settings in the Administration section - hereinafter Document posting settings:

check the box Allowed to write off inventories in the absence of balances according to accounting data:

Control of balances in the context of warehouses

To prevent negative balances by warehouses, we set the By Warehouse analytics. You can enable warehouse analytics in the accounting settings: Administration section - hereinafter Accounting parameters. We choose Setting up a chart of accounts and in inventory accounting, click on By nomenclature and warehouses (by quantity):

In the new window, set the flag By warehouses (storage locations)... This checkbox will affect the control of balances in the context of warehouses:

  • If the checkbox is unchecked, the control of balances is carried out in the context of organizations;
  • If the box is checked - by organization and specific warehouse:

Control of negative residues in 1C 8.3

If it is not possible to uncheck the box or there are reasons to keep records with negative balances, 1C 8.3 Accounting has implemented a report that allows you to control negative balances.

Report Control of negative residues in 1C 8.3 is located in the Warehouses section - hereinafter Control of negative balances:

The report can be generated for a certain period with detailing by documents, warehouses, nomenclature and other accounting objects. And also display data for a specific warehouse or item using selection:

Important! The Negative Balance Control report shows negative balances only for the specified period. If there were write-off documents before the start of the report, then the negative balances on them will not be included in the report.

To change the report settings, use the Show Settings command. Moving through the settings tabs Grouping, Selection, Additional fields, you can give the report the required form:

The site can be found on the configuration 1C Accounting 8.3.

More about setting up the 1C 8.2 (8.3) program Prohibiting inventory write-off in the absence of balanceshow does it affect financial results see the following video:


Rate this article:

In my video tutorials, I often say that the 1C database must be prepared for the end of the period and reporting. And one of the important points of such preparation is the control of negative balances of goods, materials and finished products... What reports should you use to check the status of inventory accounts in 1C: Accounting? Let's take a look at some of them.

1. Report "Account balance sheet"

Many accountants are accustomed to working with the balance sheet of the account. This report, indeed, can be used to control inventory balances, you just need to make sure that the display of quantitative indicators is set in the settings.
Press the button "Show settings", go to the tab "Indicators".

Then we carefully review the report and analyze the errors found

The balance sheet is convenient in that it allows you to assess not only the presence of negative quantitative balances, but also to detect other problem situations:
- the quantitative balance of goods and materials without the amount;
- total balance without quantity;
- negative total balance.
However, if a large number of nomenclature items are involved in accounting, then such a check can be quite laborious. In addition, the WWS will have to be generated for each accounting account separately (10, 41, 43), which also somewhat complicates the work process.

2. Report "Control of negative balances"

In the configuration 1C: Enterprise Accounting 8 edition 3.0, a report is provided that is ideal for monitoring negative quantitative balances of inventory. The report is located on the "Warehouse" tab.

We indicate the period, organization and form a report.

The report includes only those nomenclature items for which a negative quantitative balance is found. A big plus is that data on all inventory accounts are analyzed. In my opinion, working with a report is more convenient than working with an SALT.
But there is also a minus - the report allows you to control only negative quantitative residues, leaving behind the scenes other problems that can be detected by WWS.

3. Report "Subconto Analysis"

I have told about this report more than once. Subconto analysis is one of my favorite reports, which allows not only to detect errors, but also to understand their causes in many situations.
Go to the "Reports" - "Subconto analysis" section.

We select the subconto "Nomenclature", check that the display of quantitative indicators is enabled in the report settings.

The subconto analysis is good in that it allows you to get information about the movement of goods and materials for all accounting accounts. For example, to track situations when the goods arrived at one accounting account, and were sold from another.

However, with a large number of items, it can be difficult to analyze the data.
I told you more about working with this report in the video tutorial How to work with the report "Subconto Analysis" in 1C - VIDEO.
Thus, each of the reviewed reports has its pros and cons. In my work, I would recommend combining them:
- find gross errors by the report "Control of negative balances";
- then view SALT on all inventory accounts;
- to identify the reasons for the incorrect balance, use the "Subconto analysis" report.
Interesting examples related to the search and correction of errors when accounting for goods and materials, I also analyzed in two useful videos:

Control over warehouse balances is a mandatory accounting procedure at any enterprise that works with goods. You can often face a situation when there is no product in the program, but it is actually in the warehouse. In such a situation, there are two options:

  • Send it on sale;
  • Leave in the warehouse until the circumstances of such a situation are clarified.

The choice depends on several factors, such as organizational policy or specific situation. When the product is on the counter and the buyer is interested in it (holds in his hands), it is not advisable to refuse to sell.

Some enterprises practice the formation of a sales document without posting it, but not all use this practice. In case of such situations, the 1C program in its latest versions suggests the ability to disable the control of negative balances.

When control is activated, the sale of a product that is not in the warehouse according to the program will issue a warning to the user: “The column“ Quantity ”in line 1 of the“ Products ”list is filled in incorrectly. “The specified amount exceeds the balance. Remaining: 18. Not enough 111.093 ”.

Disable control of negative residues in 1C

The operation of enabling / disabling control of balances in 1C is carried out through the menu "Main" - "Settings" - "Accounting parameters" - "Inventories". Here you need to select the checkbox "Allow inventory write-off when there is no inventory according to accounting data".

After that, the action is confirmed by the "Save and Close" button. In turn, such actions are guaranteed to become the basis for the formation of negative balances in accounting. They will need to be eliminated.

Negative Balance Control Report

This report is generated through the "Warehouse" - "Reports" menu, where the document is presented. The user is required to define the request interval and click on the "Generate" button. The absence of a specified period will not allow showing negative balances, which is a feature of the system that requires mandatory filling in the "Period" column.

The finished report has the following appearance.

For the report itself, a standard set of filters is available, including grouping, sorting and other data transformations in accordance with the requests and needs of users. Using the Show Customization button, you can manually include additional lines in the report.



Copyright © 2020 All for an entrepreneur.