How to process employee earnings using the API?
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. 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: Step 2 - Add the "RhpBE100" namespace. To make it easier to read the code, add the API's HR namespace. Step 3 - Validate if the Employee exists. To be able to process employees' earnings, they must already be registered in the database. Step 4 - Create the processing object with the necessary information. Step 5 - Enter the period specified for the Employee. Step 6 - Perform the processing.Salary Processing
using RhpBE100;
if (PriEngine.Engine.RecursosHumanos.Funcionarios.Existe(txtEmployeeID.Text))
{
//Employee Exists
}
else
MessageBox.Show("The Employee type does not exist.");
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
};
Payroll.Periodo = PriEngine.Engine.RecursosHumanos.Funcionarios.DaValorAtributo(Payroll.Funcionario, "Periodo").ToString()
PriEngine.Engine.RecursosHumanos.Processamento.ProcessaAuto(Payroll, ref error)
login para deixar a sua opinião.