1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| procedure TxmGestAbs.ValidHORAIRESAfterInstruction(
XMLInstruction: IXMLInstruction; InputDoc, OutputDoc, Input,
Output: IXMLCursor);
type
Tabenreg = record
DateReal : Tdate;
Prevu : array[1..1440] of byte;
Realise : array[1..1440] of byte;
end;
var
WUser,Wnumrec : String;
dDernierEnreg : TDateTime;
indG, indM, ind_finp, ind_finr, ind_debp, ind_debr : Integer;
zDateReal : TDate;
zEcartPrevReal : double;
TabPlage : array[1..100] of TabEnreg;
FlagPremierPassage : boolean;
function CalculInd(zHoraire: TDateTime): integer;
var
H,M,S,MS : Word;
begin
decodetime(zHoraire,H,M,S,Ms);
result := H * 60 + M;
end;
function CalculEcart(zDateReal: TDate): Double;
var
SommeHeureRea,SommeHeurePrevu : Double;
Sol_Rea,Sol_Prevu : word;
indMl,indGl : integer;
begin
indGl := 0;
indMl := 0;
Sol_Rea := 0;
Sol_Prevu := 0;
repeat
indGl := indGl + 1;
until zDateReal = TabPlage[indGl].DateReal;
For indMl := 1 to 1440 do
begin
if TabPlage[indGl].Realise[indMl] = 1 then
Sol_Rea := Sol_Rea + 1;
if TabPlage[indGl].Prevu[indMl] = 1 then
Sol_Prevu := Sol_Prevu + 1;
end; }
SommeHeureRea := encodetime((Sol_Rea DIV 60),(Sol_Rea mod 60),0,0);
SommeHeurePrevu := encodetime((Sol_Prevu DIV 60),(Sol_Prevu mod 60),0,0);
result := SommeHeureRea - SommeHeurePrevu;
end;
begin
if XMLInstruction.Name = 'DateEnreg_Maj' then
Begin
WUser := Context.Values['User']; |
Partager