---
name: "LedgerSMB::DBObject::Employee"
section: "3pm"
platform: "linux"
package: "ledgersmb"
version: "1.3.40-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/LedgerSMB::DBObject::Employee"
---

# LedgerSMB::DBObject::Employee(3pm)

LedgerSMB class for managing Employees

## NAME

LedgerSMB::DBObject::Employee - LedgerSMB class for managing Employees

## SYOPSIS

This module creates object instances based on LedgerSMB's in-database ORM.

## METHODS

The following method is static:

- new ($LedgerSMB object);

  - save

  Saves an employee.  Inputs required

  - entity\_id

    May not be undef

  - start\_date

    - end\_date

    - dob date

    may not be undef

  - role

    Not the database role.  Either manager or user

  - ssn

    - sales

    - manager\_id

    - employee\_number

    - search

  Returns a list of employees matching set criteria:

  - employeenumber (exact match)

    - startdate\_from (start of date range)

    - startdate\_to (end of date range)

    - first\_name (partial match)

    - middle\_name (partial match)

    - last\_name (partial match)

    - notes (partial match)

    Undef values match all values.

- set\_entity\_class

  Sets the entity class to 3.

- get\_managers

  Retrieves a set of managers and attaches to `$self`-\>{all\_managers}

- save\_location

  Saves the location data for the contact.

  Inputs are standard location inputs (line\_one, line\_two, etc)

- save\_contact

  Saves contact information.  Inputs are standard contact inputs:

  - entity\_id

    - contact\_class

    - contact

    - description

    - save\_bank\_account

    Saves a bank account to an employee.

    Standard inputs (entity\_id, iban, bic, remark)

  - *get\_metadata()*

    This retrieves various information vor building the user interface.  Among other things, it sets the following properties: `$self`-\>{ar\_ap\_acc\_list} = qw(list of ar or ap accounts) `$self`-\>{cash\_acc\_list} = qw(list of cash accounts)

  - get

    Returns the employee record with all the inputs required for "save" populated.

    Also populates:

    - locations

      List of location info

    - contacts

      List of contact info

    - notes

      List of notes

    - bank account

      List of bank accounts

  - save\_notes

    Saves a note to an employee entity.

    Standard inputs (note, subject, entity\_id)

  - delete\_contact

    required request variables:

    contact\_class\_id:  int id of contact class contact: text of contact information person\_id: int of entity\_credit\_account.id, preferred value

  - delete\_location

    Deletes a record from the location side.

    Required request variables:

    location\_id location\_class\_id person\_id

    Returns true if a record was deleted.  False otherwise.

  - delete\_bank\_account

    Deletes a bank account

    Requires:

    entity\_id bank\_account\_id

    Returns true if a record was deleted, false otherwise.

- get\_user\_info

  Attaches the user\_id and username to the employee object.

  If the user does not have manage\_users powers, this will simply return false

## Copyright (C) 2007, The LedgerSMB core team.

This file is licensed under the Gnu General Public License version 2, or at your option any later version.  A copy of the license should have been included with your software.
