Formula for calculating accrual in 1s. Formulas of initial components


The calculation formula editor allows you to enter mathematical formulas for calculating accruals or deductions, which will be used to calculate salaries.


To describe calculation formulas you can use:



    Calculation indicator identifiers;


    Simple arithmetic operations: " + ", "- " , "/ " ,"* ", including using brackets () ;


    Mathematical functions such as: Max () , Min () , Env () , Int () ;


    Condition construction ?(,) ;


    Function EvaluateBy() .

Calculation indicator identifiers

Calculation indicators are the input values ​​for the calculation. These values ​​are manipulated to calculate the accrual result. Indicators are entered by the user when conducting certain documents, entered in the information register “Values ​​of indicators of incentive schemes” or downloaded automatically.


Examples of indicators:



    Time in days;


    Standard time in days;



An indicator identifier is a symbolic representation of an indicator that does not contain delimiters or special characters.


Examples of indicator identifiers:



    TimeInDays;


    NormTimeInDays;



All identifiers available for use are located in the "Indicators" table of this formula editor.

Simple arithmetic operations

When describing calculation formulas, you can use arithmetic operations " + ", "- ", "/ ", "* ", including using parentheses () .


Example: Revenue * Percentage

Mathematical functions

Max(<Значение 1>, ..., <Значение N>)

<Значение 1>, ..., <Значение N>
The maximum of the values ​​passed to the function is returned.

Max (Salary / NormDays * Days Worked, Revenue * Percentage)

Min(<Значение 1>, ..., <Значение N>)


<Значение 1>, ..., <Значение N>- a set of values ​​for comparison.
The minimum of the values ​​passed to the function is returned.

Min (Salary / NormDays * Days Worked, Revenue * Percentage)



Okr.(<Число>, <Разрядность>)

<Разрядность>- determines the number of decimal places to which rounding is performed. If the parameter is negative, then the number is rounded to the corresponding digit in the integer part, starting from the least significant digits.
Default value: 0

Okr (SalaryDays * Days Worked, 2)

Cel(<Число>)

<Число>- initial number or indicator.

Goal (Revenue * Percent);

Condition construction ?(,)

? (evaluate expression based on condition)
Syntax:
?(<Логическое выражение>, <Выражение 1>, <Выражение 2>)
Options:
<Логическое выражение>
A Boolean expression whose evaluation determines one of the resulting expressions to be evaluated. If the result of its calculation is True, then it will be calculated<Выражение 1>. If the result is False then<Выражение 2>.
<Выражение 1>
The resulting expression that will be evaluated if the result of the Boolean expression is True.
<Выражение 2>
The resulting expression that will be evaluated if the result of the Boolean expression is False.
Return value:
The result of evaluating one of the resulting expressions.
Description:
Allows you to evaluate one of two specified expressions depending on the result of evaluating a logical expression.

An example of using the condition construction to describe the formulas for calculation methods:

It is necessary to introduce a bonus for length of service, which is calculated as a percentage of the salary, while the percentage of the bonus depends on length of service and is determined on a scale:






















WithBypercent
5
5 10 10
10 20 20
20 99 30

The formula will look like this:


Salary * ? (Experience in Years<5 , , ?( ExperienceInYears<10 , 10 , ?( ExperienceInYears<20 , 20 , 30 )))

Function EvaluateSoftware()

Syntax:
RateSoftware(<Значение>, <Шкала оценки>)


Options:


<Значение>- an indicator that is assessed on a rating scale


<Шкала оценки>- an indicator with the type scale by which we evaluate the value


The function evaluates the value using a rating scale.

. 1C Salary and Personnel Management is primarily a specialized software product for automating payroll calculations. In my previous articles, I already mentioned that the program provides ample opportunities for setting up a variety of formulas, which you can not only choose, but also create yourself, using predefined and your own indicators. Unfortunately, quite often it is easier for programmers to modify and rewrite the configuration rather than deal with the standard tools of the software product 1C ZiUP. As a result, the end user, the client, has the need to pay for the extra work of the programmer, and also entails an increase in the cost of the planned update of the program itself and other minor but unpleasant difficulties associated with using a configuration that has been removed from support.

In this article we will look at an example in which I will try to most fully reflect the key capabilities of using formulas and indicators. The issue of using the directory will also be touched upon. "Work schedules" and a mysterious document. Do not confuse with the report of the same name. Of course, it will not be possible to tell everything within the framework of one example, so a little later I will write several more publications on this topic.

Arbitrary calculation formulas in 1C ZiUP




Let's jump straight into an example. I think it will be more clear this way. So, the organization has a security department. The employees of this department, there are 4 of them, work every 3 days. We will make a separate work schedule for each. An employee receives a full salary if he works his entire plan according to schedule. If they do days not worked, then the salary is recalculated in proportion to the days worked. It is also possible that an employee will work more days than required according to your schedule. This occurs when employees replace another employee who has gone on vacation or left due to illness. In this case, the employee who worked as a substitute has more days worked than required according to his schedule. It is necessary to ensure that in this case his salary is calculated as for normal work within the framework of the planned days of the schedule, and payment for days worked beyond the plan would be attributed to another type of calculation “Additional payment for combination”.

Creating elements of the “Work Schedules” directory

First we need to discuss the elements directory "Work Schedules". It can be found on the program desktop on the “Personnel Accounting” tab in the middle column.

For our purposes, there is already a template “In three days (40 hours work week)”. An option will appear in which the program will separately count night and evening hours worked for employees working on this schedule. In our example, this is not required, so we do not check the box. But let’s set the date from which the periodicity countdown begins to 07/01/2014. In the second chart - “In three days 2” - this date will shift by 1 day and so on.

After that, click the “Fill” button. And the schedule will be filled starting from the specified date.

Thus, we will create three more graphs for each of the shifts.

Creating calculation types to automate payroll in 1C ZiUP

Seminar “Lifehacks for 1C ZUP 3.1”
Analysis of 15 life hacks for accounting in 1C ZUP 3.1:

CHECKLIST for checking payroll calculations in 1C ZUP 3.1
VIDEO - monthly self-check of accounting:

Payroll calculation in 1C ZUP 3.1
Step-by-step instructions for beginners:

Also, when hiring these employees, it is necessary to set the types of calculations. They need to be created. The first is “Salary (security)”. Let me remind you once again that such a salary must be paid in full if everything is worked according to the schedule (i.e. there are no missed days), but if not fully worked, then it is calculated in proportion to the days worked. But in the case when an employee worked beyond the established schedule, it is necessary to ensure that only one salary is accrued, without recalculation for overworked days. Payment for processing will be carried out by another type of payment, but more on that later.

Let's open the directory "Basic accruals of the organization" and based on the standard type of calculation “Salary by day”, we will create a new type of calculation “Salary (security)” by copying. The link to the reference book can be found on the tab "Payroll calculation" the program desktop at the very bottom in the “See” section. Also". All parameters except the formula and name are saved as for the original element. Let's move straight to editing the formula. To do this, first set the “Calculation method” switch to the position "An arbitrary calculation formula" then click on the “Edit calculation formula” link. As a result, a separate window will open in which we will create the formula. It consists of three areas:

  • Calculation formula – here the formula will be generated directly;
  • Functions are arithmetic and logical operations predefined by developers that can be used in a formula. In the help you can find out more about each;
  • Indicators are, firstly, predefined variables that take values ​​programmed by 1C developers. For example, the “TimeInDays” parameter will return the number of days worked by the employee for whom the calculation is performed using this type of calculation. Secondly, you can create indicators yourself. For example, create an indicator “Items sold”, depending on which a bonus will be awarded to the employee, and the value itself, i.e. how much sold fill out once a month before calculating payroll.

I’ll immediately give the formula that we will use, and then I’ll explain:

? (TimeInDays>=NormTimeInDays, TariffRateMonthly, TariffRateMonthly / NormTimeInDays * TimeInDays)

First, let me explain the construction in which this formula is implemented: ?(condition, expression1, expression2).

).

If the condition in parentheses is met, then the result takes the value of the variable located after the first comma (i.e. expression1, in our case it is TariffRateMonthly ). If the condition is not met, then the result takes on the value obtained after executing the formula, which is located after the second comma (i.e. expression2, in our example this is Tariff RateMonthly / StandardTimeInDays * TimeInDays ).

Secondly, I’ll decipher the indicators used in the formula:

  • TimeInDays– number of days worked by the employee in the current month –;
  • NormTimeInDays– the planned number of days that the employee must work in the current month in accordance with the work schedule – predefined indicator - calculated automatically by the program;
  • TariffRateMonthly– how much an employee will earn if they work their planned working days in full – predetermined indicator - indicated when assigning this type of payment to an employee.

And now I will try to explain the essence of the formula. If the employee has worked ( TimeInDays) all my normal days ( NormTimeInDays) or in excess of this norm (i.e. the condition is met), then the Employee is paid his full salary. If the condition is not met, i.e. he worked fewer days than the norm, then his payment is determined based on the monthly tariff rate in proportion to days worked. The final form of the calculation will look like this.

Be sure to record this type of calculation to save any changes.

Now let’s create a second type of calculation, “Additional payment for combined work,” which will track the situation when an employee has worked more days than provided for by his work schedule. Payment for such processing will be calculated based on the monthly tariff rate, in proportion to the days processed. The formula for this type of calculation will look like:

? (TimeInDays > NormTimeInDays, ((TimeInDays – NormTimeInDays) / NormTimeInDays * TariffRateMonthly), 0)

If the condition is not met, i.e. if the employee has not exceeded the number of days worked according to his schedule, then the result will be zero, i.e. in this case, the employee does not receive additional payment. No new parameters have appeared compared to the previous type of calculations, so there is no point in explaining them again. We save this type of calculation.

Now we need to assign these types of calculations to our employees. If there are new employees, then this is done in the hiring document. Read more about hiring employees. If the types of calculation are established for already working employees, then you can use the document “Introducing permanent accrual or deduction of organizations” or “Entering information about planned accruals for employees of the organization”. But only in the first case will you have to enter two documents for each type of calculation, and in the second case you can get by with one document.

Payroll calculation using created calculation types

Seminar “Lifehacks for 1C ZUP 3.1”
Analysis of 15 life hacks for accounting in 1C ZUP 3.1:

CHECKLIST for checking payroll calculations in 1C ZUP 3.1
VIDEO - monthly self-check of accounting:

Payroll calculation in 1C ZUP 3.1
Step-by-step instructions for beginners:

So, as a result, each of these four employees should have two planned accruals.

Let me remind you that salary calculation in 1C ZiUP is carried out according to the displacement principle. All days of the schedule are considered worked if there were no documents displacing the working days of the schedule (sick leave, vacation pay, etc.). Read more about the sequence of payroll calculation in ZUP. So far we have not entered preemptive documents for our employees into the program, and if you try to generate a report "Time sheet"(more about reports and printed forms), then we will see that employees worked all the days in August according to their schedules.

Now let's assume that employee Shelestov went on vacation from August 22 and it turns out that someone must work his days (in August this is the 24th and 28th). Gorin agreed to this. It is not difficult for Shelestov to reflect his vacation. For this we use the document “Accrual of vacation to an employee”(read more about vacations). But in order to reflect additional days to employee Gorin, we will use the document "Time sheet". Once again, do not confuse this document with the report of the same name. This document can be found on the “Payroll calculation” tab of the program desktop. Let's create a new document. Let's set the accrual month to August 2014 and add employee Gorin to the tabular part of the document. In this case, the employee’s timesheet will be filled out automatically in accordance with his work schedule in August. We just need to change August 24 and 28 from weekends to working days (“I am 24”).

We carry out the document.

Now we can open the document “Payroll for employees of the organization”, fill out this document with employees of the security department and calculate this document. As a result, we get the following.

So, Shelestov worked 2 days less due to vacation, instead of 7 days 5, so his salary is calculated in proportion to the days worked:

12,500 / 7 * 5 = 8,928.57 rubles.

Of course, there is no question of any additional payment, so the “Additional payment for combination” is equal to 0.

Employee Gorin worked two days more than his plan, instead of 8 days 10. The salary is accrued in full as for 8 planned days - 12,500 rubles. But the additional payment is calculated in proportion to two days worked in excess of the norm of 8 working days:

12,500 / 8 * 2 = 3,125.00 rub.

Like this. We automated everything that could be automated in this example using standard tools. For convenience, you can also do external processing, in which it will be possible, based on vacation and other supplanting documents, to create a document “Working Time Sheet”, indicating in this processing who is replacing whom. But it’s worth working on this only if such a procedure is widespread from month to month with a large number of employees. And you can enter it manually.

That's all for today! Soon there will be new interesting materials on.

To be the first to know about new publications, subscribe to my blog updates:

So, let's take an example to see what specific capabilities 1C ZUP provides. The example conditions will be as follows. In an organization, employees of a department can be assigned to work in another production area for a certain number of days within a month. Each site has its own monthly tariff rate. Calculation at each site is carried out in proportion to the time worked. We will use the following table as data for calculating the example.

Creating a new type of calculation in 1C ZUP

To automate the calculation of this payroll scheme, we need to create a new type of calculation. To do this, open the list of “Basic accruals of the organization.” Let's create a new element. In the form that opens, set the “Primary accrual” switch to the active position, since this type of calculation does not depend on other accruals. Next, in the “Calculation method” settings group, set the value to “Custom calculation formula” and then follow the “Edit calculation formula” link to the editing window:

Now, in the window that opens, you need to set the formula by which accruals for this type of calculation will be calculated. The formula will look like this:

+ +

Let me explain this formula. NormTimeForMonthInDays - this is an indicator predetermined by the developers. It returns the standard time in days set according to the current employee's schedule. For example, in September 2014 for the Five Days schedule it is 22 days. Tariff Rate Monthly - also a predetermined indicator. Its value will be set when an employee is hired, or when payment terms are changed using the “Personnel Transfer” document.

TimeInDays - also a predetermined indicator. If an employee had no registered absences (sick leave, vacations, etc.) in a month, then this indicator will be equal to NormTimePerMonthInDays. If there were absences, the indicator will be reduced by the number of working days that the employee was absent.

Creating your own metrics

SalaryOnsite… - 2 indicators that are conditionally constant. They need to be added. To do this, in the previously opened form, at the bottom of it, click on the “Add indicator” link. We indicate the name in the field "Type of indicator" monetary, in the field "Purpose of indicator" set “For the entire company (organization)”, and the field “Procedure for entering an indicator” will be automatically set to “Periodic”. The most interesting field here is "Purpose of indicator". It can also take the value “For department” and “For employee”. We’ll talk about the latter below, and you can read about the cases in which an indicator for a department can be used in the article Arbitrary formulas for calculation types in 1C ZiUP: using your own indicators for calculating wages. Thus, we create a 2nd indicator based on the number of sections.

DaysOnSite ... - 2 indicators that will be entered by the accountant monthly for each employee, if the employee worked at the sites. Let's create these indicators. Let's fill out the form fields when creating it as follows:

  • Type of indicator - numeric;
  • The purpose of the indicator is for the employee;
  • The procedure for entering the indicator is monthly before salary calculation.

Let's create 2 such indicators based on the number of sections.

Now enter the formula in the field located at the top of the window. Let me remind you of the formula once again:

(TariffRateMonthly / StandardTimeInDays * (TimeInDays - DaysAtSite1 - DaysAtSite2)) + SalaryAtSite1 / StandardTimeInDays * DaysAtSite1 + SalaryAtSite2 / StandardTimeInDays * DaysAtSite2

Let's save this formula.

Next, you need to go to the “Time” tab in the calculation type being created and set the “Accrual for work of a full shift within the normal time” switch to the active position. And in the “Type of time according to classifier...” field, indicate “Attendance”.

Now we save this type of calculation.

Entering values ​​for created indicators

Now let's enter the values ​​for the created measures. First, let's enter information for the indicators SalaryAtSite1 And SalaryAtSite2. To do this, open the “Payroll Indicators” service. You can access it on the “Payroll calculation” tab of the main menu of the program in the left column of links, below. In the window that opens, go to the “Permanent” tab, select the “Organization data” switch, select the organization and add values ​​for our two indicators.

Now go to the “Monthly” tab. Here the calculator will enter monthly indicators on the number of hours worked at the sites. We indicate the period, set the input mode to “Employee data” (see example with indicators by department.

We are completing a series of articles on the regulatory subsystem in 1C:UPP.

As part of this series, we examined in detail how specifications work in SCP - from theory to practical use.

So, 9 articles on the regulatory subsystem of SCP:

  1. (This article)

Formulas of initial components

What is this article about?

In product specifications, formulas can be used to calculate the required quantity of materials (semi-finished products). They define an algorithm for calculating the initial components.

In this article we will tell you what parameters can be set when creating calculation formulas.

Introduction

In the item specification card in the tabular section on the tab Initial components a special field is provided Formula. The specified formula is applied to the original component in the line in which it is written.

To record the expression for calculating the quantity of materials, a special processing is used, which is called “Formula Entry”. Processing is called from the field Formula tabular part Initial components.

The formula can use:

  • arithmetic operations (addition, subtraction, multiplication, division)
  • comparison operations (greater than, less than, equal to, comparison operand)
  • functions (selecting maximum and minimum values, obtaining the integer part of a number, rounding to an integer value)
  • parentheses to set the priority of operations.

Calculation formulas can also use:

  • numbers
  • quantity parameter (attribute value Quantity current row of the tabular part Initial components)
  • properties of the output product characteristic that have a value type of “Number” or “Boolean”
  • release parameters, which are defined on a special tab Product release parameters.

Let’s open the specification card “Office chair (experiment) Comfort”. Out of the field Formula in the tabular section on the tab Initial components open the form Entering a formula. To do this, click on the selection button in the field.

At the top of the form Entering a formula there is a table field in which the compiled formula will be displayed.

Below are buttons for filling out the formula. These are signs of arithmetic operations, parentheses for setting the priorities of operations, conditional operand, signs of comparison operations (less than, equal to, greater than), functions (minimum, maximum, rounding, integer). There are also buttons for moving through the formula, expanding and deleting symbols.

In a formula, you can use names or their codes for parameters. There is a special switch in the form for this purpose. Codes/names.

Below is a line with numbers and comma and period signs. A special command is provided for substituting a parameter into the formula Quantity.

It is possible to fill in a formula from a template.

In the shape of Entering a formula There is also a tabular part for product release parameters and a tabular part with the properties of the product characteristics, which can be used in drawing up the formula.

Using the “Quantity for the original component” parameter in the formula

To consider a practical example in the tabular section Initial components specification “Office chair (experiment) Comfort” we will add a new line. On a new line in a field Nomenclature We will indicate the material “Furniture glue”. In field Quantity set to 1.000. Out of the field Formula open the form Entering a formula.

Let's create a formula according to which the Quantity parameter should be divided by 3. When composing the expression, we use the parameter Quantity(In the shape of Entering a formula use the command Options – Quantity).

Let's save the changes made to the specification.

Let's turn to the pre-prepared document “Production report for the shift”, in which on the tab Products and services Specification the value “Office chair (experiment) Comfort” is selected.

In the document “Production report for the shift”, fill in the tab Materials using the service Fill according to specification.

For the material “Furniture glue” in the field Quantity the value was set to 0.334 (1.000 / 3).

Thus, as the parameter value Quantity specified in the formula, the value of the attribute is used Quantity, specified for the original component in the item specification.

Using characteristics of the output product in the properties formula

The formulas use only those properties of the output product characteristics that have the value type “Number” or “Boolean”.

All arithmetic and comparison operations can be applied to Number type values ​​in calculation formulas.

The Boolean value type has only two values: False or True. These values ​​can be used in comparisons.

From the specification card “Office chair (experiment) Comfort” we will open the form for selecting the characteristics of the output product.

At the moment, among the characteristic properties there are no properties with the value type “Number” or “Boolean”. Therefore, let's add a new property with the value type "Number".

When you select the “Number” value type, you can specify the parameters of this number: Length, Accuracy(number of decimal places), a sign of a non-negative number.

Let's define Name new property – “Back height”. Depending on the value of this property, the consumption of any material will be determined. Set the flag in the number parameters Non-negative and indicate the value Accuracy– 0, since we will measure the height of the backrest in whole centimeters. For parameter Length a value of 3 will suffice.

In the card of the created property in the tabular section Property assignments We will indicate the position of the nomenclature “Comfort office chair”.

The created property will appear in the output product characteristic selection form. Let's determine the value of this property in the already existing characteristics. Let's indicate the values ​​80, 100 and 120 centimeters.

Let’s create a formula for calculating the consumption of “Furniture Glue”. The consumption will depend on the value of the “Back height” property. Let's assume that for every 20 centimeters of backrest height, 0.1 kg of glue is required. It is necessary to multiply the height of the back by the glue consumption rate. A dot acts as a fractional separator.

Let’s save the changes made to the specification “Office chair (experiment) Comfort”.

Let's turn to the document “Production report for the shift”. On the bookmark Products and services“Comfort office chair” is indicated in the quantity of 1,000 pieces. In field Specification the value “Office chair (experiment) Comfort” is selected. In field Product characteristics indicates the characteristic for which Back height is 80 centimeters.

Let's fill out the tabular part on the tab Materials using the service Fill according to specification.

The consumption of “Furniture Glue” was 0.400 kg (80 x 0.1/20). Similarly, you can calculate the consumption of “Furniture Glue” if indicated on the tab Products and services document “Production report for the shift” and other characteristics of the “Comfort office chair” product range. In this case, respectively, the values ​​0.500 kg (100 x 0.1 / 20) and 0.6 kg (120 x 0.1 / 20) will be obtained.

Use of output parameters in the formula

The consumption of materials or semi-finished products may be influenced by some external factors, such as temperature, humidity. Information about those production parameters that affect the calculation of the number of initial components is filled in the specification on the tab Product release parameters. These options become available in the form Entering a formula.

In the specifications on the tab Product release parameters indicated Parameter type as an element of the reference book “Types of production parameters”.

Let’s create a new element of the directory “Types of production parameters” - “Temperature”. In field