Payroll
Mar 12 Avr 2011 - 2:34
Hi,
I am using Acomba SDK and programmed to enter customers, employees, Timesheets... Now i want to enter payroll through SDK.
It is not allowing me to enter payroll details. I am using class TransPA022 and my code is like this
//******************************************
AcombaX acomba = new AcombaX();
Employee022 objEmployee = new Employee022();
TransPA022 empPay = new TransPA022();
objEmployee.PKey_EmNumber = EmNumber;
int _error = objEmployee.FindKey(index, true);
if (_error == 0)
{
http://empPay.PaEmployeeNumber = objEmployee.PKey_EmNumber;
http://empPay.PaEmployeeCP = objEmployee.CardPos;
//_error = empPay.ReserveCardNumber();
_error = empPay.ReserveEmployee(objEmployee.CardPos,1);
if (_error == 0)
{
empPay.PaEmployeeNumber = objEmployee.PKey_EmNumber;
empPay.PaEmployeeCP = objEmployee.CardPos;
empPay.PaPeriodStartDate = DateTime.Now.Date;
empPay.PaPeriodEndDate = DateTime.Now.AddDays(5);
empPay.PaPeriodNumber = 26;
empPay.PaPeriodPayDate = DateTime.Now.Date;
empPay.set_Sa_Line_Amount(1, 1, 200);
empPay.PaTemporary = 1;
_error = empPay.AddCard();
//================================================================== }
}
It is giving the error --> error code 202 employee not reserved.
Can anyone give me the solution. Can i insert payroll details through SDK.
Thanking You,
Phani.
I am using Acomba SDK and programmed to enter customers, employees, Timesheets... Now i want to enter payroll through SDK.
It is not allowing me to enter payroll details. I am using class TransPA022 and my code is like this
//******************************************
AcombaX acomba = new AcombaX();
Employee022 objEmployee = new Employee022();
TransPA022 empPay = new TransPA022();
objEmployee.PKey_EmNumber = EmNumber;
int _error = objEmployee.FindKey(index, true);
if (_error == 0)
{
http://empPay.PaEmployeeNumber = objEmployee.PKey_EmNumber;
http://empPay.PaEmployeeCP = objEmployee.CardPos;
//_error = empPay.ReserveCardNumber();
_error = empPay.ReserveEmployee(objEmployee.CardPos,1);
if (_error == 0)
{
empPay.PaEmployeeNumber = objEmployee.PKey_EmNumber;
empPay.PaEmployeeCP = objEmployee.CardPos;
empPay.PaPeriodStartDate = DateTime.Now.Date;
empPay.PaPeriodEndDate = DateTime.Now.AddDays(5);
empPay.PaPeriodNumber = 26;
empPay.PaPeriodPayDate = DateTime.Now.Date;
empPay.set_Sa_Line_Amount(1, 1, 200);
empPay.PaTemporary = 1;
_error = empPay.AddCard();
//================================================================== }
}
It is giving the error --> error code 202 employee not reserved.
Can anyone give me the solution. Can i insert payroll details through SDK.
Thanking You,
Phani.
- hench
- Nombre de messages : 163
Date d'inscription : 30/12/2008
Fiche d'Entreprise
Nom de l'entreprise:
Re: Payroll
Mer 4 Mai 2011 - 23:23
Hi,
I have no environment to test this out so this is going to be pure guessing and reading of the SDK help file
A few suggestions before more code analyzing :
1. Make sure company is correctly open;
2. That a user a correctly logged on;
3. Watch every variables and properties and ensure they contain what is expected;
As I can see from that code snippet, you don't use method "ReserveCard" on TransPA object to make sure you got enough credential to write on that card.
second parm is "1", which mean "TemporaryPay" to True
So I guess you should be using method "ModifyTemporaryPay" instead of AddCard on TransPA object.
Note : Don't forget to use method FreeEmployee after you got it done.
Let me know if this is still not working,
I have no environment to test this out so this is going to be pure guessing and reading of the SDK help file
A few suggestions before more code analyzing :
1. Make sure company is correctly open;
2. That a user a correctly logged on;
3. Watch every variables and properties and ensure they contain what is expected;
As I can see from that code snippet, you don't use method "ReserveCard" on TransPA object to make sure you got enough credential to write on that card.
- Code:
_error = empPay.ReserveEmployee(objEmployee.CardPos,1);
second parm is "1", which mean "TemporaryPay" to True
So I guess you should be using method "ModifyTemporaryPay" instead of AddCard on TransPA object.
Note : Don't forget to use method FreeEmployee after you got it done.
Let me know if this is still not working,
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum