Skip to main content

Scenario: "Employee's Paysheet Email Distribution"

The paysheet email distribution functionality allows you to automate and flexibly configure the sending of paysheets to employees in various formats, using individual report layouts, language settings, file naming templates, and password protection.

This mechanism enables you to:

  • Use different paysheet layouts for different employees, departments, or calculation groups.
  • Generate a customized email body using a separate report.
  • Configure the email subject.
  • Name attached PDF files using a flexible template.
  • Use the employee’s password to protect the attached file.
  • Perform background or mass distribution.
  • Apply a priority-based rule selection mechanism.

Step 1: Structure of the “Employee Mailing Setup”

To manage paysheet email distribution, the Employee Mailing Setup page is used.
This page allows defining rules for generating the email and its attachments.

FieldDescription
ScenarioFor paysheet distribution, select Paysheets.
Calc Group CodeThe calculation group code. Required when the rule should apply only to employees belonging to a specific calculation group.
Org. Unit CodeThe organizational unit code. Required when the rule should apply to employees of a specific department.
Employee No.Employee code. Required when the rule should apply to a specific employee.
DescriptionDescription of the mailing rule.
Email SubjectText field for specifying the email subject.
Protect With Employee PasswordEnables PDF protection using the employee’s password stored in the “Report Password” field on the Employee Card.
Report No.ID of the paysheet report. The default value is 70950596.
Report CaptionFilled automatically.
Report Layout NameThe required layout of the paysheet report must be selected here.
Report Language CodeDefault language of the report. If the report contains variables dependent on user regional settings, they will be formatted using the language specified here.
Attachment File NameFilename template for the attached PDF. Supports variables enclosed in curly braces: {EmployeeFullName}, {EmployeeFullNameENG}, {PeriodCode}, {VATNo}.
Body Report No.The report ID used to generate the email body. Default value: 70950735.
Body Report CaptionFilled automatically.
Body Report Layout NameRequired layout of the email body report.

Uniqueness rule:
When creating a record, the system checks for duplicates with the same combination of: Scenario, Calc Group Code, Org. Unit Code, Employee No.. If such a record exists, a blocking error is raised.

Step 2: Logic for Selecting the Distribution Rule

When paysheet distribution is triggered for each posted payroll document, the system selects one relevant rule from Employee Mailing Setup with Scenario = paysheets, following the priority sequence below:

  1. Employee No. + Calculation Group Code (Organizational Unit — any)
  2. Employee No. only (Calculation Group empty; Organizational Unit — any)
  3. Organizational Unit Code + Calculation Group Code (Employee empty)
  4. Organizational Unit Code only (Calculation Group empty; Employee empty)
  5. Calculation Group Code only (Organizational Unit empty; Employee empty)
  6. Default (all filter fields empty)

If a matching rule is found, it is applied. If no rule is found, the standard distribution mechanism is used.

Important: If at least one employee has an individual rule, it is recommended to also create a default rule so that all remaining employees receive paysheets as expected.

Step 3: Generating the Email and Attachments

Based on the selected rule, the system performs the following actions:

  1. Generating the PDF paysheet.
    The file is created using the report layout specified in Report Layout Name.

  2. Naming the attachment.
    The filename is generated using the template defined in Attachment File Name.

  3. Generating the email body.
    The email text is generated according to the layout specified in Body Report Layout Name.

  4. Email subject.
    Taken from the Email Subject field.

  5. Optional password protection.
    If Protect With Employee Password = Yes, the PDF is encrypted using the value in the employee’s “Report Password” field.
    If the password is empty — the email is not sent, and the system raises an error.
    During mass distribution, a summary of errors is produced; employees with valid data still receive their paysheets.

Step 4: Distribution Triggers

  • From a posted payroll document — sends paysheets for one or multiple selected payroll documents.
  • During posting of payroll sheet — automatically sends paysheets for the corresponding employees.
© 2008 - 2023 SMART business