07-11-2013, 09:09 AM
شكرا أخ مخلوف شكرا الأخ فاتح تم حل المشكل وهذا الكود
أضفت ADOTABLE.FRIST; في البداية
أضفت ADOTABLE.FRIST; في البداية
PHP كود :
var a,b,c:real;
begin
a:=0;b:=0;c:=0;
ADOTable3.First ;
while not ADOTable3.Eof do
begin
a:=a+(ADOTable3.fieldbyname('total_detail').value);
if (ADOTable3.fieldbyname('T_v_A').value=7)then
b:=b+(ADOTable3.fieldbyname('total_detail').value)*0.07;
if (ADOTable3.fieldbyname('T_v_A').value=17)then
c:=c+(ADOTable3.fieldbyname('total_detail').value)*0.17;
ADOTable3.Next;
end;
edit1.Text:=floattostr(a);
edit2.Text:=floattostr(b);
edit3.Text:=floattostr(c);
edit4.Text:=floattostr(a+b+c);
(*//////////
edit1.Text := FormatFloat('0.00',StrToFloat(edit1.Text));
edit2.Text := FormatFloat('0.00',StrToFloat(edit2.Text));
edit3.Text := FormatFloat('0.00',StrToFloat(edit3.Text));
edit4.Text := FormatFloat('0.00',StrToFloat(edit4.Text)); //
*)
begin
ADOTable2.Insert;
ADOTable2.FieldByName('date_facture').AsString:=DateToStr(Date);
ADOTable2.FieldByName('Total_facture').AsString := FloatToStr(a);
ADOTable2.post;
end;
end;
![[صورة: U4Vep.png]](http://im32.gulfup.com/U4Vep.png)