Forum d'entraide Acomba
Pourquoi ne pas devenir membre du forum ?

Identifiez-vous ou Inscrivez-vous afin d'accéder à l'inrégralité du forum:
Accès à toutes les catégories du forum,
Entraide entre les 6 500 membres, et ce nombre s'accroît quotidiennement!

Notez que ce forum est indépendant de la société Acceo Solutions, éditrice du logiciel Acomba.

Rejoignez le forum, c’est rapide et facile

Forum d'entraide Acomba
Pourquoi ne pas devenir membre du forum ?

Identifiez-vous ou Inscrivez-vous afin d'accéder à l'inrégralité du forum:
Accès à toutes les catégories du forum,
Entraide entre les 6 500 membres, et ce nombre s'accroît quotidiennement!

Notez que ce forum est indépendant de la société Acceo Solutions, éditrice du logiciel Acomba.
Forum d'entraide Acomba
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
Connexion
Le deal à ne pas rater :
Réassort du coffret Pokémon 151 Électhor-ex : où l’acheter ?
Voir le deal

Aller en bas
avatar
Eric Dumont
Nombre de messages : 1
Date d'inscription : 24/05/2011

Ajouter une timesheet Empty Ajouter une timesheet

Mer 1 Juin 2011 - 6:34
Bonjour j'aimerais avoir un exemple pour créer une feuille de temps et me permettre de setter aussi le earnings code.
Présentement je peux créer une timesheet sans problème mais je ne trouve pas d'exemple pour assigner le earning code.

Mon code est en Delphi
procedure TForm1.AddNewTimeSheet;

var

//Interface declarations
TimeSheetData : TimeSheet;
EmployeeIndex : EmployeeKey;
FunctionIndex : FunctionXKey;
SalaryIndex : SalaryKey;
//Variable declarations
Error : Longint;
CardPos : Longint;
FreeIt : Longint;

begin

//Interfaces Initialization
TimeSheetData := CoTimeSheet.Create;
EmployeeIndex := CoEmployeeKey.Create;
FunctionIndex := CoFunctionXKey.Create;
Salaryindex := CoSalaryKey.Create;
//Finds employee 162 in order to obtain the CardPos
EmployeeIndex.EmNumber := 'EDavis';
Error := FAcomba.FindKey(EmployeeIndex, 1);
if Error = 0 then
begin

//Reserves the time line entry procedure for
//employee 162
Error := FAcomba.TimeSheet_ReserveEmployee
(EmployeeIndex.EmCardPos);
if Error = 0 then
begin

TimeSheetData.TSEmployeeCP := EmployeeIndex.EmCardPos;
//Finds the function in order to obtain the CardPos
FunctionIndex.FnEmployeeCP := EmployeeIndex.EmCardPos;
FunctionIndex.FnOrder := 1;
Error := FAcomba.SearchKey(FunctionIndex, 1);
//if (Error = 0) and (FunctionIndex.FnEmployeeCP = EmployeeIndex.EmCardPos) and (FunctionIndex.FnOrder = 2) then
if (Error = 0) then
begin
SalaryIndex.SaEmployeeCP := EmployeeIndex.EmCardPos;
http://SalaryIndex.sa // Find the correct salary card pos
TimeSheetData.TSFunctionCP := FunctionIndex.FnCardPos;
TimeSheetData.TSStartDate := StrToDate('28/05/2011');
TimeSheetData.TSStartTime := GetNbSeconds(11, 30, 0);
TimeSheetData.TSEndDate := StrToDate('28/05/2011');
TimeSheetData.TSEndTime := GetNbSeconds(13, 0, 0);
TimeSheetData.TSTotalHours := 1.5;
TimeSheetData.TSSalaryCP := SalaryIndex.SaCardPos;
//Indicates the card creation state to the
//ModifyCard method
CardPos := IsBeingCreated;

//Indicates to the ModifyCard method to free up
//the time line entry procedure for employee 162

//after the time line successfully created
FreeIt := 1;

//Saves the TimeSheetData card
Error := FAcomba.ModifyCard(TimeSheetData, CardPos, FreeIt);
if Error = 0 then
ShowMessage('Time line successfully created.')
else
ShowMessage('Error: ' + FAcomba.GetErrorMessage(Error));


//Frees up the time line entry procedure for
//employee 162
Error := FAcomba.TimeSheet_FreeEmployee
(EmployeeIndex.EmCardPos);
if Error <> 0 then
ShowMessage('Error: ' + FAcomba.GetErrorMessage(Error));
end
else
begin
ShowMessage('Function wasn''t found in index.');
//Frees up the time line entry procedure for
//employee 162
Error := fAcomba.TimeSheet_FreeEmployee(EmployeeIndex.EmCardPos);
if Error <> 0 then
ShowMessage('Error: ' + fAcomba.GetErrorMessage(Error));

end;

end
else
ShowMessage('Error: ' + fAcomba.GetErrorMessage(Error));
end
else
ShowMessage('Error: ' + fAcomba.GetErrorMessage(Error));

end;

Merci
Revenir en haut
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum