30.10.2019

If the settlement register supports the validity period then. The base dimension property of the calculation register. The record property of the calculation register LogPeriod is


The results of some accruals and deductions depend on the results obtained from other types of calculation. For example, percentage markup to wages depends on the amount of basic earnings accrued to the employee. Principal amount wages in this case, it is called the basis for calculating the surcharge, and the types of calculation that make up the base are called the basic types of calculation.

The base is calculated for the base period specified in the calculation register entry. The base period is the period for which accruals are selected from the calculation register to determine the base. The base period can be less than a month (for example, when calculating the allowance for the combination of professions, if the combination lasted less than a month) or several calculation periods (for example, the base period for the quarterly bonus is 3 months).

The base for calculating accruals includes all accruals for the base period, regardless of the billing period in which they were accrued. For example, when calculating the bonus for July, the database will include both the salary payment for the first half of July, accrued in July, and the salary payment for the second half of July, registered in August. This dependence on the base charges is called period dependence.

In case of dependence on the validity period, the base is collected from the results of the calculation register entries, the validity period of which falls within the base period. If the calculation register record does not have a validity period, then the record registration period is analyzed, and if it falls within the base period, the result is included in the base. With such a dependence, a situation may arise when only a part of the accrual validity period falls into the base period. For example, the salary payment is calculated for a whole month, and the base for the combination allowance needs to be determined only for half a month. In this case, the base for the allowance will include only a part of the salary payment for the number of days or hours according to the employee's schedule that falls on the base period.

The basis for calculating deductions, for example, enforcement orders, is formed in a different way. The base includes all charges registered in the current month, regardless of the period for which they were charged. This relationship is called registration period dependency.

Rice. Base dependency

Rice. Partial overlap of base period and validity period

In case of dependence by the registration period, the database includes the results of only those records of the calculation registers, the registration period of which falls within the base period.

The relationship between the results of accruals and deductions can be multilevel and quite complex. Most allowances, such as seniority, grade, and service area allowance, are set at percentage from the basic pay accrued to the employee for the hours worked. On the amount of the basic payment, taking into account allowances, bonuses are accrued under the wage system. The bonuses, in turn, are included in the base for calculating the northern allowance, and the base of the latter also includes the basic payment and other allowances for the employee. If, after completing all calculations, for some reason, the result of one of the charges changes, then all charges dependent on it must be recalculated.

For example, if, after the calculation, it is found that the employee has been assigned an incorrect wage rate and the result of the salary payment must be recalculated, then all allowances dependent on the salary payment, as well as bonuses and the northern allowance, must be recalculated sequentially. This is not an easy task, especially when you consider that in the general case, all these charges can be registered in the infobase with several documents. The program allows you to automatically track such situations and determine the list of documents that need to be recalculated. To use the mechanism, for each dependent calculation type, you must specify a list of leading calculation types.

Leading are those types of calculation, when the results of which change, it is required to recalculate the result of this type of calculation.

The concepts of basic and leading types of calculation are very close in meaning, and most often the lists of basic and leading types of calculation coincide, but you should not scare them.

Basic are the types of calculation that directly affect the result of this type of calculation. Leading types of calculation may not be included in the base, but have an indirect effect on the result, i.e. the list of leading calculation types can be broader than the list of basic calculation types.

We will see the discrepancy between the lists of basic and leading types of calculation when we consider setting up the calculation of average earnings. The base for bonuses taken into account when calculating average earnings is collected separately from the employee's basic earnings. To automatically obtain a base on premiums in terms of calculation types Average earnings there are special types of calculation of Bonuses, taken into account in the composition of average earnings, the basic for which are the types of calculation of bonuses. The amount of the bonus can be calculated as a percentage of other accruals (payments at tariff rates, wage premiums, etc.), which, although they are not included in the base for the type of calculation. are included in the list of the leading types of comb.

Lists of basic and leading calculation types are set up in the form of a dependent calculation type.

When setting up leading calculation types, you must follow the rule in the same way as when setting up displacing calculation types: if calculation type A is the leading for calculation type B, which in turn is leading for calculation type C, then the list of leading calculation types for calculation type C both calculation type B and calculation type A must be included. Otherwise, the program will display an error message: "Incomplete list of leading calculation types!" For example, if the Quarterly Bonus is included in the list of leading accruals, then all leading accruals for the quarterly bonus should be included, such as Salary by day Salary by hour, etc.

Rice. Setting up basic and leading types of calculation

1. Metadata objects used in periodic calculations In V 8, the following objects are intended for the implementation of complex periodic calculations: plans of calculation types, calculation registers. Additionally: Reference books store objects that are used as sections of periodic calculations, for example, individuals, organizational units, employee positions, etc. Information registers can store any information expanded across several dimensions. With the help of information registers, time tracking schedules are implemented (analogous to calendars in version 7. 7). The documents are intended for entering entries into the calculation registers. Reports are used to display detailed and summary information.

2. Plans of calculation types The employee's salary includes the following intermediate calculations: calculation of basic charges (salary, tariff), calculation of deviations (vacation, sick leave), calculation of additional charges (bonuses, surcharges, dividends), calculation of taxes and other deductions (personal income tax, alimony) , other calculations (PFR, UST), calculation of the total amount to be issued. For the calculation of these payroll components, calculation types are used, grouped into type plans

2. 1. Purpose Each plan of calculation types describes the interaction scheme of the calculation register records and allows you to set the rules by which the records will be calculated, their relative position in time and the rules for their recalculation. There can be several plans of calculation types. The distribution of calculation types for plans is not arbitrary, since the plan has some General characteristics, which will apply to all types of calculations included in it. For example, support for mutual crowding out by the period of validity is typical for basic charges and deviations (salary, vacation) and is not typical for taxes and deductions (personal income tax, alimony). Comment. Calculation types in V 8 are not configuration objects, as they were in 7. 7. They are stored in the calculation type plans, that is, they are data objects, not metadata objects.

2. 2. Predefined types of calculation In terms of types of calculations, already at the stage of developing an applied solution, predefined types of calculations can be started. The rest of the BPs are entered into the plans in 1C: Enterprise mode.

2. 3. Interrelation of calculation types For each BP, basic, leading and displacing types of calculations are indicated. Basic - these are the types of calculation, the results of which are used in the calculation of this type of calculation. For example, the salary amount is used when calculating the additional payment to the salary, and the main charges are the basis for calculating personal income tax. Leading are the types of calculation, when the results change, you need to recalculate given view calculation. For example, when the salary payment is changed "retroactively", it is necessary to recalculate the vacation pay, since when calculating the vacation pay average salary employee for the previous months. The list of leading calculation types may not coincide with the list of basic ones.

Continued Displacing - these are settlement types whose validity period should not overlap with the period of this settlement type. Preemptive calculation types have a higher priority of preemption, therefore they displace this type of calculation in time. For example, vacation pay displaces salary pay, and sick leave pay displaces vacation pay and salary pay. When a record with a specific validity period is preempted, its actual validity period may change, that is, it will decrease or be divided into several intervals. For example, a vacation record from the 10th to the 20th of the month crowds out a salary record that has a validity period of the entire month. Then the actual period of validity of the salary record will consist of two intervals: from the 1st to the 9th day and from the 21st to the end of the month.

Note Only BPs belonging to the same plan of calculation types can be pushed out (basic and leading BPs can be located in several plans)

2. 5. Predefined tabular sections of a chart of calculation types For storing basic, displacing and leading BPs, the Plans of calculation types provide the following predefined tabular sections: Base. Views. Calculation Displacing. Views. Calculation, Leading. Views. Calculation. Access to PM data from the program - according to the rules for accessing PM of configuration objects (see Syntatkis help)

3. Registers (see dt "Data transfer" in the TC) calculation (PP) Calculation registers are designed to store calculation records (intermediate and final results) - see the Calculation log in V 7. 7. A distinctive feature of the calculation register is that that it is not intended to be interactively edited by the user. The developer can, if necessary, provide the user with the ability to edit the calculation register, but the purpose of the calculation register is to modify it based on the algorithms of the database objects, and not as a result of direct user actions.

3. 1. Structure of the Settlement Register The structure of the settlement register determines which information and in which aspects will be stored in the register. The developer specifies dimensions, resources and register details: Dimensions are sections of the stored information. For example, the register is Basic. Accruals can have dimensions Employee, Organization, Department, and the Taxes register has dimensions: Employee and Organization. Resources - calculation results, for example, Result Result for the General register. Accruals. Resources can only be of numeric type. Details - an additional characteristic of the calculation record. Attributes can be of almost any type stored in the database. For example, the attributes Days and Hours for the Main register. Accruals, the Amount variable for storing the initial calculation data, etc.

3. 2. Periodicity РР Distinctive features of the calculation register are: 1. The periodicity of the register determines the period with which movements are recorded and within which movements can influence each other (for registers that support the validity period). The periodicity of the calculation register can be defined by one of the following values: Day, Month, Quarter, Year.

continued The periodicity of the calculation register determines the period of time to which each register entry will relate. To indicate the fact that a record belongs to any period, the register has the service variable “Period. Registration "type Date. When writing data to the register, the platform always brings the value of this variable to the beginning of the period in which it falls. For example, if you write data into the calculation register with a monthly periodicity, where “Period. Registration ”is set as 08. 04. 2009, then the register will save this data with the value of the field“ Period. Registration "01.04.2009

3. 4. Dependency of records by base period This mechanism allows you to base the calculation of dependent (secondary) register records on the data obtained as a result of the calculation of primary records. The settlement register (via the corresponding BP plan) can support two types of dependence on the base: Dependency by the validity period Dependence by the registration period.

continued Dependency by period of validity means that when analyzing base records, those records will be selected for which the intersection of their actual validity period and the specified base period is found. For example, in April, the salary for March is recalculated (for example, salary indexation). The bonus for March should be calculated based on the payment for the salary for March. In this case, as a rule, the dependence on the period of validity is used. Dependency by registration period means that when analyzing base records, those records will be selected that fall within the specified base period by the value of their field "Registration period". An example is the calculation of fines when calculating salaries for March. As a basis for calculating the amount of fines, records of truancy registered in March should be taken (these can be both records of absenteeism in March and records of truancy in February). In this case, as a rule, the dependence on the registration period is used:

3. 5. Possibility of establishing connection between the RR and the time schedule. If the PP is used to store BP records, the calculation of which depends on the hours worked, a link is established with a schedule that stores the data on the planned working hours.

4. Time charts If the "Validity period" checkbox is selected for the register, you can fill in the "Chart", "Chart value" and "Chart date" properties. Such a timeline should be a register of information (non-periodic, with a mandatory dimension of the Date type and a resource of the Number type), which contains a temporary schema of the initial data involved in the calculations. The dimensions of this schedule can be, for example, the work schedule (link to the reference book) and the date, and the resource is the number of working hours on this date. In this case, it will be possible to link the calculation register record with any specific work schedule (by specifying a link to the work schedule reference book as a record attribute) and in the future, using the built-in language, receive information about the number of working hours in the validity period, the actual validity period or the period registration of this record. For example, this can be an organization's work schedule broken down by work days and hours, a schedule for the duration of work shifts, a schedule for lecture hours, etc.

5. Partial hit of calculation register records in the base period Let us consider the case when the base period is not a multiple of the calculation register period. For example, there is some kind of "special" premium (valid in May), which has a base period from 15.04.2009 to 15.04.2009 (for example, you can also give the following options for base periods: the last 2 weeks, the first and the last week of the previous month, last two days, Mondays, etc.). Upon receipt of the base, the system must add up the results of all records that fall within this period. Obviously, a situation may arise when the records in the considered base period are not completely, but "partially". Of course, we are talking only about those records that contain settlement types specified in the plan of settlement types as base for this premium. For definiteness, let us assume that the “special” bonus contains “Salary” as the basic type of calculation. Records can fall into the base period either "by registration period" or "by validity period".

Continuation Consider the first case when the records fall into the base period by the registration period. In this case, the characteristic "Depends on the registration period" must be set in the plan of settlement types associated with the settlement ledger. Recall that the registration period is always a specific date corresponding to the beginning of the settlement register period. If the registration period (that is, a specific date) does not fall within the base period, then this record will not be taken into account when calculating the base. That is, if the base dependence is established by the registration period, then there will be no "partial" results: either the record will be fully taken into account, or completely not taken into account. In our case, no record will be included in the base period of the "special" premium, since the period from 15.04.2009 to 15.04.2009 does not cover any start date of the calculation register period.

Continuation Consider the second case, when the records fall into the base period by the validity period. In this case, the characteristic "Depends on validity period" must be set in the plan of settlement types associated with the settlement ledger. Here you need to determine what part of the result should be taken when calculating the base. To make such results "discrete", the "Graph" object is used. Using the information from the graph, you can calculate what part of the total result of the "baseline" falls on each day, and take only those days that fall within the base period.

6. Recalculations The system allows you to automatically track records that require recalculation. This situation can arise when their results are somehow related to other types of calculations, and those have been changed (deleted or added new records). For example, when you change employee charges, you need to recalculate taxes. Then, for the calculation type "personal income tax", the accruals will be the leading calculation types, which is configured in the plan of calculation types on the "Leading" tab. Let's say we have Main calculation registers. Accruals, Bonuses and Retentions. Taxes are calculated after all accruals and bonuses, as their results are used. To automatically track the relevance of tax records for each employee, you need to create an allocation with the Employee dimension in the Retention register. The measurement is assigned as the data of the leading registers

continued Subordinate objects Recalculation are intended for registering the facts of occurrence of records in the register that affect the result of calculation of already existing register records. The Allocation configuration object can have several dimensions, each of which can establish a relationship between the dimensions of the given calculation register and the influencing calculation registers. In a particular case, it can be the same register. In an information structure created in the database based on the configuration object Recalculate, the platform stores information about which ledger entries are to be recalculated. The clearing tables are filled in automatically, both based on the settlement register entries affected by the leading settlement types, and based on the settlement register entries for which the actual validity period has changed. Based on this information, the developer can decide whether to recalculate the register entries.

6. Programming techniques To work with PP by means of the built-in language, the following objects are used (see Syntax-Helper - independently)

An example of a module for posting a salary accrual document Procedure Processing. Holding (Failure, Mode) For Each Current Line. List From List Cycle // register Log. Calculation Movement = Movement. Magazine. Calculation. Add(); Traffic. Storno = False; Traffic. Registrar = Link; Traffic. View. Calculation = Current. Line. List. View. Calculation; Traffic. Period. Actions. Start = Current Line. List. Date. Beginnings; Traffic. Period. Actions. End = Current Line. List. Date. Endings; Traffic. Base. Period. Start = Start. Day (Current. String. List. Date. Start); Traffic. Base. Period. End = End. Day (Current. Line. List. Date. End); Traffic. Period. Registrations = Period. Registration; Traffic. Employee = Tech. Line. List. Employee; Traffic. Result = 0; Traffic. Amount = Current Line. List. Magnitude;

continued If Movement. View. Calculation = Plans. Species. Calculation. Views. Calculations. fine f Then Movement. Result = Current Line. List. Magnitude; End. If; If Movement. View. Calculation = Plans. Species. Calculation. Views. Calculations. Sick Then Move. Result = Current Line. List. Magnitude; End. If; end. Cycle; // write the register movements (the result field is indicated only for those VRs, // which are entered into the document by a ready-made value). Movements. Magazine. Calculation. Write ();

continued // get a list of all employees contained in the document Request = New Request; Inquiry. Text = "| SELECT DIFFERENT | Accrual. Salaries. List. Employee | FROM | Document. Accrual. Salaries. List | HOW. Salaries. List | | WHERE | Accrual. Salaries. List. Link = & Current. Document"; Inquiry. Install. Parameter ("Current. Document", link); // create a list of employees Tab. Val = Request. Execute (). Unload (); Array. Employees = Tab. Mean. Unload. Column ("Employee"); List. Employees = New List. Values;

continued Calculate. Accruals (Movements. Journal. Calculation, Plans. Types. Calculation. Types. Calculations. Salary, List. Employees); Movement. Magazine. Calculation. Write (, True); Calculate. Accruals (Movements. Journal. Calculation, Plans. Types. Calculation. Types. Calculation. Bonus, List. Employees); Movement. Magazine. Calculation. Write (, True);

continued Procedure Calculate. Accruals (Set. Movements, Selected. Type. Calculation, List. Employees) Export If selected. View. Calculation = Plans. Species. Calculation. Views. Calculations. Salary Then For Each Move From The Set. Movement Cycle If Movement. View. Calculation = Plans. Species. Calculation. Views. Calculations. Salary Then Actually. Completed = Movement. receive. Data. Graphics (Type. Period. Register. Calculation. Actual. Period. Actions); Completed. Plan = Movement. Receive. Data. Graphics (Type. Per iod. Register. Calculation. Period. Actions); Traffic. Result = Movement. Amount * Actually. Completed. Value / Worked out. Plan. Meaning; End. If; End. Cycle; End. If;

continued If select. View. Calculation = Plans. Species. Calculation. Views. Calculations. award Then Resources = New Array (1); Resources = "Journal. Calculation. Result"; Dimensions = New Structure ("Employee", "Journal. Calculation. Employee"); For each Movement from the Set. Movement Cycle If Movement. View. Calculation = Plans. Species. Calculation. Views. Calculations. Bonus Then Base. Calculation = Movement. Receive. Base (Resources, Measurements); Traffic. Result = Movement. Amount * Base. Calculation. Result / 10 0; End. If; End. Cycle; End. If; End. Procedures

In this article, we will consider theoretical basis work with calculation registers, as well as perform the calculation of the employee's salary in proportion to the number of hours worked.

Theory

Calculation register (RR)- a configuration metadata object used to implement periodic calculations in the 1C system. Of the obvious areas of application of the calculation registers, the following can be distinguished: payroll calculation, rent calculation, rent calculation.

Calculation registers are similar in structure to accumulation registers or information registers. They, like the accumulation registers, have dimensions, resources, details, but the principle of operation of the calculation registers is completely different.

In essence, the measurements in the accumulation register serve as “ filter»In the context of which we receive data from the accumulation register. As an example, when we take "balances" according to the accumulation register "Balances of goods" in the context of a certain nomenclature or "a cut of the latter" according to the register of information "Salaries of employees" in the context of a certain employee. In contrast to the accumulation register, measurements in the periodic calculation register are used to implement ““ (this is when calculation types extended in time compete with each other on the interval of the record validity period, i.e., as an example, the type of calculation business trip displaces the type of calculation of salary by the period of validity) and ““ (This is when the type of calculation of the bonus depends on the type of calculation of the salary for the past periods).

displacement mechanism by period of action«:

Here we see that the type of calculation "Business trip" has a length in time and is valid from April 10 to 20, "Business trip" is indicated as a displacing type of calculation for the type of calculation "Salary". "Salary" also has a length of time and is valid from 1 to 30 April. Since "Business trip" is indicated as a displacing type of calculation for the calculation type "Salary" (has a higher priority than salary) and is valid for the period of validity of the salary, the salary is replaced by a business trip and the "Actual period of validity of the salary" is formed. "Actual period of validity of the salary. »This is the period of validity of the salary after displacement by a business trip, in our case it consists of 2 periods - from 1 to 9 April and from 21 to 30 April and in total is 19 days. The period-based displacement mechanism works only for calculations that are extended in time.

The figure above graphically shows the principle “ the mechanism of dependence on the base period«:

Let's say at the end of April 2017 we want to accrue an employee a bonus of 10% of his salary. The salary is indicated as the basic types of calculation for the bonus.

But as a "base" for calculating the premium, we will take not the entire month of April, but only the interval from 10 to 20 April (11 days). Let's calculate the base for the bonus, the employee's salary is 60,000 rubles, we have 30 days in a month, the daily salary = 60,000/30 = 2,000 rubles. Then 2000 * 11 = 22000 rubles. The basis for calculating the premium is 22,000 rubles.

Let's calculate the premium: (22000/100) * 10 = 2200 rubles. The bonus in the amount of 10% of the salary is 2200 rubles.

Closely related to the settlement ledger is the "Plan of settlement types" metadata application object.

Calculation type plan (PVR)- a configuration metadata object that stores information about the types of calculation types and determines the impact of different calculations on each other.

One calculation type chart can be used in several calculation ledgers, but one calculation ledger cannot use several calculation type plans at the same time.

The calculation register is a table that stores the calculated data, and in the plan of calculation types, the algorithms for calculating these data are stored. The payroll register must have at least one document registrar that makes the movements in the payroll register (for example, Payroll).

The settlement mechanisms in the 1C Enterprise system are designed in such a way that you first need to make entries in the settlement register and only then perform a calculation based on this data. For example, you cannot calculate a bonus based on a salary until that same salary is recorded in the calculation register.

Practice

Let's take a closer look at the calculation registers in practice:

Step 1 Let's start with a chart of calculation types. You must create a chart of settlement types before creating a settlement ledger. We create a plan of calculation types in front of the calculation register, because before creating a table for storing calculated data (i.e., calculation register), it is necessary to specify algorithms for calculating these data (i.e. a plan of calculation types).

Let's create a plan of calculation types "Basic charges". Let's go to the "Calculation" tab right away. Here we immediately see the flag “ Uses a validity period", When this flag is set, all types of calculations included in this plan will have length of time(for example, Salary, Business trip), and for this plan of calculation types, " displacement mechanism by period of action". If the checkbox "Uses the validity period" is not set, then the types of calculation will not have a length in time (for example, Bonus, Penalty) and the "preemption mechanism by period of validity" will not work. Also on this tab there are sections "Dependence on the base" and "Base charts of calculation types" - they are used to implement " the mechanism of dependence on the base period“, But we'll talk about it later. For now, let's leave the "Base dependency" in the "Does not depend" mode.

Let's create a predefined calculation type "Salary". Everything is simple on the "General" tab. We set the name and code of the calculation type.

Thanks to the fact that we have set the flag " Uses a validity period"We now have a tab" Displacing"And turned on" period displacement mechanism«.

On this tab, we indicate the types of calculation that will displace the salary by the period of validity (for example, Business trip).

Note: in "Displacing" you can add calculation types belonging only to this plan of calculation types.

There is also a tab “ Leading»- it indicates the types of calculation when changing which the current type of calculation should be recalculated. Here you can also specify calculation types from other plans of calculation types. For example, the "Salary" calculation type is the leading one for the "Bonus" calculation type, i.e. when the salary is changed, the bonus must be recalculated. the bonus is calculated depending on the salary. V this case Calculation type "Salary" belongs to PVR "Basic charges" using the validity period, and the calculation type "Bonus" belongs to PVR "Additional charges" that does not use the validity period.

Step 2.Create the "Charts" reference with the default structure. In the “Graphs” reference book, we will store the work modes of employees (five-day, six-day, etc.).

Step 3 We also need an object in which we will store the Production calendar (weekdays and weekends). For these purposes, we use a non-periodic independent information register.

Let's create a non-periodic independent information register "Work schedules" with 2 dimensions "Date" and "Schedule" and the resource "Number of hours".

Thanks to the register of information "Schedules of work", we will be able to calculate wages from the salary in proportion to the number of days worked.

Step 4.Create a document "Payroll" with the structure of the details shown below:

Requisites:

We set the prompt execution in the value "Forbid" since it does not make sense for the mechanism of periodic settlements in 1C - we never charge any bonus, salary or fine in real time.

Let's create a document form with default settings.

Step 5... Finally, we got to the creation of calculation registers.

The calculation register metadata object is located in the Calculation registers branch of the configurator.

Let's create a register of calculation "Basic charges". Consider the calculation register settings below:

1. In the "Plan of calculation types" field, indicate the IRR "Basic charges" created in step 1.

2.Set the flag "Validity period" to the value "True" since PVR specified in step 1 possesses length in time.

After setting this flag, the standard details "Validity Period", "Validity Period Beginning", "Validity Period End" immediately become available to us, which means that the calculation types registered in this calculation register also have length of time and it becomes available with us " displacement mechanism by period of action«.


P.S. If you specify a TAP with length of time for a PP with the "Validity period" flag set to "False", then this TAP will work as a TAP without length in time.

3. After setting the "Validity period" flag to the "True" value, the fields "Chart", "Chart value", "Chart date" become available to us.

In the "Schedule" field, indicate the "Schedule" information register created in step 3.

In the "Schedule value" field, indicate the "Number of Hours" resource of the "Schedules" information register.

In the "Schedule date" field, indicate the "Date" dimension of the "Schedule" information register.

4. In the field "Frequency" we indicate the value "Month", which means that the data will be entered into the register on a monthly basis.

Below is the structure of the register metadata:

The "Basic" flag for a dimension only affects performance, it can be left unchecked, but if checked, the "Employee" field will be indexed.

Dimension "Employee" - it is applied in " displacement mechanism by period of action" and " the mechanism of dependence on the base period«.

Resource "Sum" - the calculated salary will be written there.

The "Schedule" variable is specified as an attribute, not a register dimension, since neither he nor he displaces anything - in fact, a reference field. Important!!! Do not forget to fill in the "Link to schedule" field at the "Schedule" variable, the "Schedule" dimension of the "Schedule" information register must be indicated, otherwise the salary will not be calculated.

The "Parameter" attribute will store the salary value.

Now, when we have indicated the connection with the PC "Work Schedules", the employee's salary will be calculated in proportion to the number of days worked.

As a registrar, we indicate the document “ Payroll“Created in step 4.

Step 6... We make movements in the register of calculation "Basic charges".

Let's go back to the document "Payroll" created in step 4.

Let's describe the processing of conducting in the module of the document object:

Fragment of the document processing code

1C (Code)

Procedure Posting (Refusal, Posting Mode) // register MainAcountsMotion.MainCalculations.Write = True; Movements.MainCalculations.Clear (); Registration Period = StartMonth (Date); For Each TekStringBasicAccounts From BasicAccounts Cycle Movement = Movement.MainCalculations.Add (); Movement.Storny = Lie; Movement.CalculationType = CurrentStringBasicAccounts.CalculationType; Movement.Action PeriodStart = CurrentStringMainAccounts.StartDate; Movement.ActionPeriodEnd = EndDay (CurrentStringBasicAccounts.EndDate); Movement.Registration Period = Registration Period; Movement.Employee = TechStringBasicAccounts.Employee; Movement.Chart = TekStringBasicAccounts.Chart; Movement.Parameter = TekStringMainCalculations.Size; End of Cycle; End of Procedure

Posting Processing Procedure (Refusal, Posting Mode)

// register Main

Movement. Basic Accruals. Write = True;

Movement. Basic Accruals. Clear ();

Registration Period = StartMonth (Date);

For each text line

Movement = Movement. Basic Accruals. Add() ;

Traffic. Storno = False;

Traffic. Calculation Type = CurrentStringMainCalculations. Calculation type;

Traffic. Validity PeriodStart = CurrentStringMainCalculations. Start date;

Traffic. Validity PeriodEnd = EndDay (CurrentStringBasicAccounts .EndDate);

Traffic. Registration Period = Registration Period;

Traffic. Employee = TekStringBasicAccruals. Employee;

Traffic. Chart = CurrentStringMainCalculations. Schedule;

Traffic. Parameter = CurrentStringMainCalculations. The size;

End of Cycle;

End of Procedure

Let's create a test document and run it:

Let's go to "Document movements":

We see that the registration period was set as the beginning of the month. the frequency of the RR is indicated as "Month". We also see that all fields have been filled in except for the amount (the salary has not been calculated yet).

Step 7.Let's write the payroll code.

Let's create a general module "Calculation" with the following flags:

In this general module, the calculation itself will take place.

Let's write the export function “Calculate charges” in the “Calculation” module:

Since we filled in the PP settings "Basic charges" the fields "Chart", "Chart value", "Chart date", we now have access to a virtual table of the calculation register DataGraphics, in the query to the virtual table, we are interested in the fields:

"Number of Hours Actual Validity Period" - contains the number of hours actually worked calculated on the basis of the graph data

"Number of HoursPeriod of Operation" - contains the number of working hours in the calculation period calculated on the basis of the schedule data

Payroll procedure

1C (Code)

Procedure Calculate Accruals (Registrar, Record Set) Export // Salary Request = New Request; Zapros.Tekst = "SELECT | ESTNULL (OsnovnyeNachisleniyaDannyeGrafika.KolichestvoChasovFakticheskiyPeriodDeystviya, 0) AS ChasovFakt, | OsnovnyeNachisleniyaDannyeGrafika.Parametr, | ESTNULL (OsnovnyeNachisleniyaDannyeGrafika.KolichestvoChasovPeriodDeystviya, 0) AS ChasovPlan, | OsnovnyeNachisleniyaDannyeGrafika.NomerStroki | FROM | RegistrRascheta.OsnovnyeNachisleniya.DannyeGrafika (| Recorder = & Registrar | And Type of Settlement = & Type of Settlement Salary) AS Basic AccrualsGraph Data "; Request.SetParameter ("Registrar", Registrar); // transfer the document to the registrar so that the search is performed only on the current document Request.SetParameter ("SettlementTypeWarehouse", PlansTypesCalculation.MainCalculations.Warning); // set the type of salary calculation since calculate the salary Sample = Request.Run (). Select (); Search Structure = New Structure; SearchStructure.Insert ("LineNumber", 0); // create a structure to search for data for calculation by line number For Each Record From RecordSet Loop // cycle through the set of records of the current document SearchStructure.StringNumber = Record.LineNumber; // fill in the row number for search If Selection.FindNext (SearchStructure) Then // search for data in the selection for calculation by the current row number Record.Sum =? (Selection.HoursPlan = 0,0, Selection.HoursFact / Selection.HoursPlan * Selection .Parameter); // calculate the salary in proportion to the days worked, in Parameter - the current salary EndIf; Fetch.Reset (); // reset the selection, we want the next record in the recordset to search the selection first EndLoop; Recordset.Write (, True); // write the calculated records to the database, pass the parameter Replace = True EndProcedure

//Salary

Request = New Request;

Inquiry. Text = "SELECT

| IS NULL (BasicAccrualsGraphicsData.Number of HoursActualAction Period, 0) AS HoursFact.

| BasicAccountingDataGraphics.Parameter,

| THERE IS NULL (BasicAccrualsGraphicsData.Number of HoursAction Period, 0) AS HoursPlan,

| BasicAccountsDataGraphics.NumberStrings

| FROM

| Calculation Register.BasicAccruals.DataGraphics (

| Registrar = & Registrar

The new object "Plan of calculation types" is a remote analogue of calculation types in 7.7. Calculation types are data objects, not metadata objects. There may be predefined calculation types.

Instead of excluded settlement groups, you can use the built-in mechanisms of the chart of settlement types and settlement registers. To group the calculation types, you can use other objects, for example, the details of the calculation types or a directory.

New object "Register of calculation" - a remote analogue of the journal of calculation in 7.7

Instead of calendars, information registers are used to implement work schedules.

Built-in language

To significantly expand the capabilities of the platform, a new unified object model of the 1C: Enterprise 8.0 language was developed. This made it possible to dramatically expand the capabilities of the platform, speed up its development, and increase the clarity of software modules.

New literals and data types have been introduced, such as the literals Undefined, Null, True and False (boolean data type). The date type includes time.

The debugger is included in the configurator. He knows how to show a list of properties of objects with their values ​​and types. It is possible to view collections such as arrays and tables of values.

General modules have been introduced, in which there is only a section of procedures and functions. In the configuration, procedures and functions of common modules are available, declared with the "Export" keyword.

When writing software modules, contextual hint technology (analogous to IntelliSense) is used. The text editor of program modules supports grouping (folding) of syntax constructions, as well as descriptions of procedures and functions (in the form of comments).

The functionality of the external component v7plus.dll is included in the platform in the form of objects "Mail", "System Information", "Internet Connection", "FTP Connection, etc. There are tools for working with XML documents, as well as for sequential reading and writing. large text files.

The task

Payroll to employees of the company is carried out on a monthly basis. All employees work on a five-day schedule, but the solution needs to include the ability to work on several different schedules.

For conducting classes at the main place of work, employees of the educational enterprise receive payment at an hourly rate. The amount charged for the tariff is calculated as the tariff rate multiplied by the number of hours actually worked. The initial value of the tariff rate may change no more than once a day, but is taken at the beginning of the billing period

Employees can conduct on-site training. In this case, the tariff is not charged for the period of field training, but

employee consists of two parts:

Some fixed amount compensating for it fare;

Accruals directly for training in the form of remuneration, calculated as the total amount of payments made by students in the current billing period, multiplied by a certain percentage. The percentage value can be set in the document "Payroll.

In December, at the end of the year, the employees of the enterprise can be awarded a bonus as a percentage of the sum of all accruals made over the past year. The percentage of the bonus is the same for all employees of the company. The percentage value is determined at the moment of entering the information about the accrual into the information base.

The mechanism of recalculations within the framework of this task should not be used.

All charges are entered using the "Payroll" document. Consider that all data is entered only within one month, for example, you can specify the accrual at the rate from 10.01 to 31.01, and the entry: the rate from 10.01 to 03.02 cannot be entered.

To analyze the charges made to the employees of the enterprise in the configuration, it is necessary to provide a report of the following type:

The report can be built for any settlement period... To analyze the accruals made for training students on the road, in the configuration, it is necessary to provide a report of the following type:

The report can be built for any billing period.


Solution

1. We will start solving the computational problem by determining what types of charges and deductions must be created in the configuration and by what formulas the result of each type of calculation must be obtained. According to the assignment, we will need to create four types of calculation:

· Accrual for training students at the main place of work Result = Tariff Rate * Number of Hours Worked;

Please note for annual award the method of calculation is indicated immediately total amount all charges made over the past year - "Getting the base".

2. At the next stage, for the above types of calculation, we will indicate the dependencies between them.

Table 5.1. Setting up displacement and baseline dependencies between the types of calculations required to solve the problem

Calculation type Displacing Base
TRF KMD -
TRN - -
KMD - -
PfP - TRF, TRN, KMD

3. Let's create the above types of calculations in the configuration. Set up the "Calculation" section for each used calculation plan;

4. Let's create calculation registers;

5. Let's make the necessary changes to the structure of the document "Payroll";

6. Let's proceed to the document "Payroll":

a. Add the required number of entries to the register:

i. Determine the boundaries of the intervals of all existing periods for each record;

ii. We indicate the values ​​of measurements and register details;

b. Let's calculate the records of the generated sets for the primary types of calculation:

i. If transport costs are entered - the result of accrual

we will determine immediately, according to the data of the document;

ii. Calculation according to the tariff at the main place of work

1. Using the query mechanism, for each record with the specified type of calculation, we will receive data on hours worked and the current tariff rate;

2. Organize the cycle through the records of the set. For each record, we implement direct positioning to the desired row in the query selection. Let's calculate the result of the accrual;

3. Let's write down the set, without recalculating the actual period of validity;

iii. Calculation of the charge for departure

1. Let's create a revolving accumulation register “Payments

listeners ";

2. Let's make changes to the algorithm for posting the document "Income of money", when executed, this register must be filled;

3. Using the mechanism of inquiries, for each employee who worked on the road and indicated in the document, we will receive data on student payments;

4. Organize the cycle through the records of the set. For each record, we implement direct positioning to the desired row in the query selection. Let's calculate the result of the accrual;

5. Let's write down the set, without recalculating the actual period of validity;

d. We repeat the steps described in clause 4 for the records of the secondary calculation types of each level:

i. Calculation of the annual premium

1. Let's create a constant for storing the premium percentage. Turn on the mode of using the main form of constants by default;

2. Using the query mechanism, for each record with the specified type of calculation, we will receive data on the base;

3. Organize the cycle through the records of the set. For each record, we implement direct positioning to the desired row in the query selection. Let's calculate the result of the accrual;

4. Let's write the set;

e. Let's transfer the program code associated with the calculation to the general module;

7. Let's build the reports required in the task on the data of the calculation registers using the data composition mechanism.


Managed forms

The task

In the forms of all documents used in the task, it is necessary to add the ability to view movements in the registers associated with the document whose form is open on this moment time.

In the employee selection form, called from the "Payroll" document form, the list of employees to be selected must be supplemented with information about their tariff rates. When choosing an employee, information on the appropriate rate should be included in the “Size” column. For the document "Payroll" you need to create the main form of the list, in which for the current document the entries made by him in the calculation registers should be reflected.

Solution

1. Let's create the basic forms of documents. Let's open each form in the form editor window. On the "Command Interface" tab, open the "Navigation Panel - Go" branch. Let's set the "Visibility" checkboxes for the registers.

2. Let's create a non-main form for choosing the directory “ Individuals»;

a. We will make the necessary changes to the structure of the register "Information about employees";

b. Let's create new form;

c. Let's open the palette of properties of the main form attribute;

d. In the "Object" section, set the "Custom request" flag;

e. Let's open the list settings;

f. Let's make the necessary changes to the request text;

g. When creating a form on the server, we will define the values ​​of the external request parameters;

h. Let's define our own processing for choosing a value from a directory form;

3. We organize the call of the directory form from the document form

a. Let's create the main form of the "Payroll" document;

b. Let's indicate the created form of the reference book as the value of the property "Selection form" of the element of the form of the document "Basic PaymentsEmployee";


2021
mamipizza.ru - Banks. Deposits and deposits. Money transfers. Loans and taxes. Money and the state