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
| procedure TFficheselect.BitBtn3Click(Sender: TObject);
var nl,i: Integer;
begin
nl:=clbox1.items.count-1;
for i:= 0 to nl do
begin
clBox1.checked[i]:=false;
end;
end;
procedure TFficheselect.Button1Click(Sender: TObject);
VAR s:real; s1:real; s2:real;
nl,i: Integer;
begin
t1.Open;
t2.open;
if messagedlg('Attention....Etes Vous Sure De Vouloir Corriger les Soldes',mtconfirmation,[mbyes,mbno],0)=mryes then
begin
nl:=clbox1.items.count-1;
for i:= 0 to nl do
begin
s:=800000;
s1:=800000;
s2:=9523.81;
t1.First;
while not t1.eof do
begin
T1.Edit;
if(t1.fieldbyname('Mat').asstring)=(copy(clbox1.items[i],0,4)) then
begin
t1.fieldbyname('Anciensld').AsFloat:=(s);
if clbox1.checked[i] then
begin
t1.FieldByName('Nouvsld').asfloat:= t1.fieldbyname.('MontPret')-t1.fieldbyname('Retenue');
s:=T1.FieldByName('Nouvsld').asfloat;
if t2.fieldbyname('Mat').asstring= (copy(clbox1.items[i],0,4))then
begin
t2.edit;
t2.FieldByName('Nouvsld').asfloat:=s;
t2.fieldbyname('TotRemb').asfloat:=s1-s;
t2.fieldbyname('Nbrmois').asfloat:= t2.fieldbyname('TotRemb').asfloat/s2;
t2.post;
end;
end; end;
t1.post;
t1.next;
end;
end;
end;end; |
Partager