V10 ResourcesReference
ResourcesReference
Reference
Back | List of Articles

How to process employee earnings using the API?

Last changed in 02/12/2020

The Human Resources module of PRIMAVERA ERP includes features that provides organizations with greater speed and efficiency in the management of their human resources.

In practice, employee salary processing is one of the module's most important features, allowing you to process earning amounts, holiday and Christmas allowances, extraordinary and end-of-contract pays.

In this article, we use the project available in GitHub to demonstrate how you can perform salary processing using the API available in the ERP V10.

Salary Processing

To process an employee's salary, follow these steps:

Step 1 - Add the reference to the Human Resources module.

Create a project in Visual Studio and add the reference to the Human Resources API:

  • RhpBE100
  • IRhpBS100

Step 2 - Add the "RhpBE100" namespace.

To make it easier to read the code, add the API's HR namespace.

using RhpBE100;

Step 3 - Validate if the Employee exists.

To be able to process employees' earnings, they must already be registered in the database.

if (PriEngine.Engine.RecursosHumanos.Funcionarios.Existe(txtEmployeeID.Text))
{
  //Employee Exists
}
else
  MessageBox.Show("The Employee type does not exist.");

Step 4 - Create the processing object with the necessary information.

RhpBEProcessamento Payroll = new RhpBEProcessamento
{
   Funcionario = txtEmployeeID.Text.ToUpper(),
   NumPeriodoProcessado = dtProcDate.Value.Month,
   DataProcessamento = dtProcDate.Value,
   DiasProc = 21,
   TipoProcessamento = (TipoProc)cmbProcType.SelectedIndex,
   EnglobaIRS = false,
   Ano = dtProcDate.Value.Year,
   DataLimAltMensais = dtAbsOvertime.Value
};

Step 5 - Enter the period specified for the Employee.

Payroll.Periodo = PriEngine.Engine.RecursosHumanos.Funcionarios.DaValorAtributo(Payroll.Funcionario, "Periodo").ToString()

Step 6 - Perform the processing.

PriEngine.Engine.RecursosHumanos.Processamento.ProcessaAuto(Payroll, ref error)
Bookmark or share this article
Esta página foi útil?
Obrigado pelo seu voto.

login para deixar a sua opinião.

Obrigado pelo seu feedback. Iremos analisá-lo para continuarmos a melhorar!
Artigos Relacionados
Características das entidades e serviços Conceito de integração Conceito de extensibilidade Como registar projetos de extensibilidade? Boas práticas de organização de projetos de integração
Últimos Artigos Vistos
How to create employees using the API?