Easy-Acumatica Docs

Employee Payroll Builders

This guide covers the builders used for creating and managing employee payroll classes and their individual settings. These builders work with the `EmployeesService`.

Importing the Builders

To get started, import the builders from their respective modules.

python

from easy_acumatica.models.employee_payroll_class_builder import EmployeePayrollClassBuilder
from easy_acumatica.models.employee_payroll_settings_builder import EmployeePayrollSettingsBuilder

EmployeePayrollClassBuilder

This builder constructs the payload for creating an `EmployeePayrollClass`, which acts as a template for payroll settings that can be applied to multiple employees.

python

# Build the payload for a new payroll class
payroll_class_payload = (
    EmployeePayrollClassBuilder()
    .employee_payroll_class_id("SALARIED")
    .description("Salaried Employees, Bi-Weekly")
    .payroll_defaults(EmployeeType="Salaried", PayGroup="BIWEEKLY")
    .add_pto_default(PTOBank="VACATION", EffectiveDate="2023-01-01")
)

# Use with the EmployeesService to create the class
# client.employees.create_employee_payroll_class(
#     "24.200.001", 
#     builder=payroll_class_payload
# )

EmployeePayrollSettingsBuilder

This builder constructs the payload for updating the payroll settings of a specific employee. This is used to assign a payroll class, set payment methods, define work locations, and more.

python

# Build the payload to update an employee's payroll settings
payroll_settings_payload = (
    EmployeePayrollSettingsBuilder()
    .employee_id("EP00000004")
    .class_id("SALARIED") # Assign the class created above
    .payment_method("DIRECT")
    .cash_account("10200")
    .add_employment_record(StartDate="2023-01-01", Position="Developer")
)

# Use with the EmployeesService to update the employee
# client.employees.update_employee_payroll_settings(
#     "24.200.001",
#     builder=payroll_settings_payload
# )
Easy-Acumatica v0.3.9 — Created and Developed by Matthew Hirstius (Nioron07).
Significant Contributions made by Chris Xu
Want to see the NPM version? See it here