www.pudn.com > Source.rar > Unit10.pas, change:2007-02-04,size:3803b


unit Unit10; 
 
interface 
 
uses Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls, 
  Buttons, ExtCtrls,dateutils; 
 
type 
  TChoix_Stat = class(TForm) 
    OKBtn: TButton; 
    CancelBtn: TButton; 
    Choix: TRadioGroup; 
    Panel1: TPanel; 
    Shape1: TShape; 
    Label2: TLabel; 
    Image1: TImage; 
    Panel2: TPanel; 
    procedure OKBtnClick(Sender: TObject); 
  private 
    { Private declarations } 
  public 
    { Public declarations } 
  end; 
 
var 
  Choix_Stat: TChoix_Stat; 
 
implementation 
 
uses Unit77, Unit3, Unit70, Unit33; 
 
{$R *.dfm} 
 
procedure TChoix_Stat.OKBtnClick(Sender: TObject); 
var 
J,i:integer; 
begin 
 
CASE choix.ItemIndex OF 
0:BEGIN 
  data.Stat_ventes.First; 
  FOR I:=1 to 12  DO 
  BEGIN 
     data.Stat_ventes.RecNo:=i; 
     data.Stat_ventes.Edit; 
     DAta.Stat_ventesTotalHT.Value:=0;Data.Stat_ventesTotalTaxe.Value:=0; 
     DAta.Stat_ventesTotalTTC.Value:=0;Data.Stat_ventesTotalTimbre.Value:=0; 
     data.Stat_ventes.Post; 
    // DATA.Stat_ventes.Next; 
  END; 
  data.T_Ventes.Filter:='Type=''Facture'''; 
  data.T_Ventes.Filtered:=True; 
  if data.T_Ventes.Eof THEN BEGIN Statistique.ShowModal; EXIT END; 
      Traitement_Dossier.Show; 
      Traitement_Dossier.Update; 
      traitement_dossier.ProgressBar1.max:=data.T_Ventes.RecordCount; 
      j:=1; 
     data.T_Ventes.First; 
     while NOT data.T_Ventes.Eof DO 
     BEGIN 
             data.Stat_ventes.RecNo:=MonthOf(data.T_VentesDate.Value); 
             data.Stat_ventes.Edit; 
             data.Stat_ventesTotalTTC.Value:=data.Stat_ventesTotalTTC.Value+data.T_VentesTotal_TTC.Value; 
             data.Stat_ventesTotalTaxe.Value:=data.Stat_ventesTotalTaxe.Value+data.T_VentesTotal_Taxe.Value; 
             data.Stat_ventesTotalTimbre.Value:=data.Stat_ventesTotalTimbre.Value+data.T_VentesTimbre.Value; 
             data.Stat_ventesTotalHT.Value:=data.Stat_ventesTotalHT.Value+data.T_VentesTotal_HT.Value; 
             data.Stat_ventes.Post; 
      application.ProcessMessages; 
      Inc(j); 
      Traitement_Dossier.ProgressBar1.Position:=j; 
 
      data.T_Ventes.Next; 
   END; 
  Traitement_Dossier.CLOSE; 
  Statistique.ShowModal; 
END; 
///////////////////////////////////////////////////////////////////////// 
1:BEGIN 
  data.Stat_achats.First; 
  FOR I:=1 to 12  DO 
  BEGIN 
     data.Stat_Achats.RecNo:=i; 
     data.Stat_Achats.Edit; 
     DAta.Stat_achatsTotalHT.Value:=0;Data.Stat_achatsTotalTaxe.Value:=0; 
     DAta.Stat_achatsTotalTTC.Value:=0;Data.Stat_achatsTotalTimbre.Value:=0; 
     data.Stat_Achats.Post; 
    // DATA.Stat_ventes.Next; 
  END; 
  data.T_Achats.Filter:='Type=''Facture'''; 
  data.T_Achats.Filtered:=True; 
  if data.T_Achats.Eof THEN BEGIN Statistique_Achats.ShowModal; EXIT END; 
      Traitement_Dossier.Show; 
      Traitement_Dossier.Update; 
      traitement_dossier.ProgressBar1.max:=data.T_Achats.RecordCount; 
      j:=1; 
     data.T_Achats.First; 
     while NOT data.T_Achats.Eof DO 
     BEGIN 
 
             data.Stat_Achats.RecNo:=MonthOf(data.T_AchatsDate.Value); 
             data.Stat_Achats.Edit; 
             data.Stat_AchatsTotalTTC.Value:=data.Stat_AchatsTotalTTC.Value+data.T_AchatsTotal_TTC.Value; 
             data.Stat_AchatsTotalTaxe.Value:=data.Stat_AchatsTotalTaxe.Value+data.T_AchatsTotal_Taxe.Value; 
             data.Stat_AchatsTotalTimbre.Value:=data.Stat_AchatsTotalTimbre.Value+data.T_AchatsTimbre.Value; 
             data.Stat_AchatsTotalHT.Value:=data.Stat_AchatsTotalHT.Value+data.T_AchatsTotal_HT.Value; 
             data.Stat_Achats.Post; 
      application.ProcessMessages; 
      Inc(j); 
      Traitement_Dossier.ProgressBar1.Position:=j; 
 
      data.T_Achats.Next; 
    END; 
  Traitement_Dossier.CLOSE; 
  Statistique_Achats.ShowModal; 
END; 
END; 
end; 
end.