1C:Enterprise 8.3. Practical Developer’s Guide. Lesson 18 (3:40). Using calculation registers. Examples of displacement and dependency by base period

Examples of displacement and dependency by base period

Recalculation report

Dependency by base period

Displacement by action period

In Designer mode

Let us create the report.

  1. Create a Report configuration object named Recalculation.
  2. Run the Data composition schema wizard.
  3. Add Data set – query and run the Query builder. 
  4. In the Database list, expand Recalculations and select all the fields from the Accruals.Recalculation virtual table (fig. 18.9):
    • RecalculationObject
    • CalculationType
    • Employee
    Lesson 18 (3:40). Using calculation registers / Examples of displacement and dependency by base period / Recalculation report / In Designer mode
    Fig. 18.9. Query fields and tables
  5. Click OK.

    This completes the query creation.
  6. On the Settings tab, add the <Detailed records> grouping.
  7. On the Selected fields tab, select the following fields:
    • RecalculationObject
    • CalculationType
    • Employee
  8. Close the data composition schema wizard by clicking OK.
  9. In the editor of the Recalculation report configuration object, on the Subsystems tab, specify that the document is displayed in the Payroll subsystem.

In 1C:Enterprise mode

If you generate the report in 1C:Enterprise mode, you will see that no recalculations have been performed yet. You need another Employee accrual document to test recalculations.

  1. Start 1C:Enterprise in the debug mode.
  2. Create the Employee accrual #2 document with September bonuses for Jonnson and Walkman (fig. 18.10).

    Lesson 18 (3:40). Using calculation registers / Examples of displacement and dependency by base period / Dependency by base period / In 1C:Enterprise mode
    Fig. 18.10. Employee accrual #2 document

    This document records the fact that bonuses are due to employees named Johnson and Walkman based on their work in September. Since you do not know the bonus amount (it will be calculated based on a certain algorithm), leave the Accrual field empty.
  3. Click Post and close.
  4. Open the Employee accrual # 1 document and change Johnson’s salary from 10 000 to 7 000.
  5. Click Post and close.
  6. Generate the Recalculation report (fig. 18.11).

    Lesson 18 (3:40). Using calculation registers / Examples of displacement and dependency by base period / Dependency by base period / In 1C:Enterprise mode
    Fig. 18.11. Recalculation report

    As you see, it now has some data.

    This is because the Bonus calculation type depends on the Salary calculation type by base period. Once you modify the existing records of Salary type, the platform generates a set of recalculation records (because their base is changed).

    You may be wondering why the Walkman's record is present in the report, since you only changed Johnson’s salary. The reason is that the platform does not track the specific changes to document records. The only thing it tracks is the fact that posting (reposting) a document changes a calculation register record set.

    Therefore the recalculation record set includes ALL register records whose values MIGHT change after reposting a document that creates base records in the register.
  7. Repost the Employee accrual # 2 document (the one that accrues bonuses), and generate the Recalculation report.

    The report is empty again, as the platform has noted the fact that you recalculated the dependent records and therefore cleared the recalculation table.

    In this example you have studied calculation register dependency by base period.

In 1C:Enterprise mode

Let us check how displacement by action period works.

You need a third Employee accrual document for this.

  1. Create the Employee accrual #3 document as shown in fig. 18.12.
    Lesson 18 (3:40). Using calculation registers / Examples of displacement and dependency by base period / Displacement by action period / In 1C:Enterprise mode
    Fig. 18.12. Employee accrual #3 document

    This document records the fact that Johnson was not at work from the 1st through the 10th of September.

    Obviously, in this case you need to recalculate his salary and also his bonus that depends on the salary.
  2. Click Post and close and generate the Recalculation report (fig. 18.13).

    Lesson 18 (3:40). Using calculation registers / Examples of displacement and dependency by base period / Displacement by action period / In 1C:Enterprise mode
    Fig. 18.13. Recalculation report

    As you can see, Johnson's salary accrual record is included in the recalculation. This is the result of displacement by action period, since the Absence calculation type displaces the Salary calculation type.

    Note that Johnson's bonus accrual record is also included in the recalculation. This is because during the creation of predefined calculation types you specified that the Bonus calculation type result depends on changes of the Absence calculation type result. This dependency is indirect, but since you have explicitly specified this dependency, the platform tracks it.
  3. Repost the Employee accrual #1 and Employee accrual #2 documents and ensure that the recalculation table is cleared.

Leave a Reply

Your email address will not be published.

 

1C:Enterprise Developer's Community