www.pudn.com > Source.rar > Unit1.~pas, change:2007-02-04,size:23016b


UNIT Unit1; 
 
interface 
 
uses 
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, 
  Menus, ComCtrls, ToolWin, ImgList, StdCtrls, ExtCtrls, ActnList, ActnMan, 
  ActnCtrls, jpeg, Buttons, ShellAPI, 
  TeEngine, Series, TeeProcs, Chart, DbChart, ActnColorMaps, 
  DBCtrls,DateUtils, DB; 
 
TYPE 
  TFace = class(TForm) 
    MainMenu1: TMainMenu; 
    Dossier1: TMenuItem; 
    Nouveau1: TMenuItem; 
    Ovrire1: TMenuItem; 
    Supprimer1: TMenuItem; 
    N1: TMenuItem; 
    Fermer1: TMenuItem; 
    N2: TMenuItem; 
    Paramtre1: TMenuItem; 
    N3: TMenuItem; 
    Quitter1: TMenuItem; 
    Fichier1: TMenuItem; 
    Clients1: TMenuItem; 
    Fournisseurs1: TMenuItem; 
    N5: TMenuItem; 
    Articles1: TMenuItem; 
    N6: TMenuItem; 
    Localisaion: TMenuItem; 
    Ventes1: TMenuItem; 
    PiceVente: TMenuItem; 
    PieceStock: TMenuItem; 
    Imprimer1: TMenuItem; 
    Outils: TMenuItem; 
    Aide1: TMenuItem; 
    Aproposde1: TMenuItem; 
    StatusBar1: TStatusBar; 
    Timer1: TTimer; 
    Sauvegarder1: TMenuItem; 
    RindexationdesFichiers1: TMenuItem; 
    N8: TMenuItem; 
    Caculatrice1: TMenuItem; 
    ImageList1: TImageList; 
    N10: TMenuItem; 
    Utilisateurs1: TMenuItem; 
    Configurationdelimpriment1: TMenuItem; 
    PrinterSetup: TPrinterSetupDialog; 
    N11: TMenuItem; 
    Label2: TLabel; 
    ToolBar1: TToolBar; 
    SpeedButton7: TSpeedButton; 
    SpeedButton4: TSpeedButton; 
    SpeedButton8: TSpeedButton; 
    ToolButton1: TToolButton; 
    Btclients: TSpeedButton; 
    BtFournisseurs: TSpeedButton; 
    BtArticles: TSpeedButton; 
    BtMatireP: TSpeedButton; 
    ToolButton2: TToolButton; 
    BtPVente: TSpeedButton; 
    BtPStock: TSpeedButton; 
    Calculatrice: TSpeedButton; 
    ToolButton3: TToolButton; 
    N7: TMenuItem; 
    ProtectionMotdePasse1: TMenuItem; 
    Resturation1: TMenuItem; 
    N9: TMenuItem; 
    HistoriquedesVentes1: TMenuItem; 
    HistoriquedesAchats1: TMenuItem; 
    Inventaire1: TMenuItem; 
    HistoriquedesStocks1: TMenuItem; 
    HistoriqueClient1: TMenuItem; 
    HistoriqueFournisseur1: TMenuItem; 
    PicedeFabrication1: TMenuItem; 
    BtFAbrication: TSpeedButton; 
    BtSelectionnerLot: TSpeedButton; 
    EtatdesClients1: TMenuItem; 
    N17: TMenuItem; 
    SpeedButton9: TSpeedButton; 
    c: TMenuItem; 
    Statistique1: TMenuItem; 
    N14: TMenuItem; 
    FAmilles1: TMenuItem; 
    SpeedButton10: TSpeedButton; 
    btlocal: TSpeedButton; 
    Panel1: TPanel; 
    ImageConect: TImage; 
    Timer2: TTimer; 
    Modifier1: TMenuItem; 
    Cl1: TMenuItem; 
    N16: TMenuItem; 
    MatierPremier1: TMenuItem; 
    Model1041: TMenuItem; 
    N18: TMenuItem; 
    Model104FOURNISSEURS1: TMenuItem; 
    SpeedButton2: TSpeedButton; 
    SpeedButton3: TSpeedButton; 
    Agenda1: TMenuItem; 
    N20: TMenuItem; 
    CommandesnonLivres1: TMenuItem; 
    Echancierdesfactures1: TMenuItem; 
    EtatduStock2: TMenuItem; 
    Panel2: TPanel; 
    Progress: TProgressBar; 
    Label3: TLabel; 
    N13: TMenuItem; 
    Paiement1: TMenuItem; 
    Importerlesdonnes1: TMenuItem; 
    N4: TMenuItem; 
    Analysedesmouvements1: TMenuItem; 
    ToolButton4: TToolButton; 
    Optionrgionaleetlingustique1: TMenuItem; 
    AdministrateurBDE1: TMenuItem; 
    Fentre1: TMenuItem; 
    Suivante1: TMenuItem; 
    Prcdente1: TMenuItem; 
    Cascade1: TMenuItem; 
    MosaiqueVertical1: TMenuItem; 
    MosaiqueHorizontal1: TMenuItem; 
    N12: TMenuItem; 
    outFermer1: TMenuItem; 
    MessageLB: TLabel; 
    Dpts1: TMenuItem; 
    procedure Quitter1Click(Sender: TObject); 
    procedure Aproposde1Click(Sender: TObject); 
    procedure Clients1Click(Sender: TObject); 
    procedure Fournisseurs1Click(Sender: TObject); 
    procedure Articles1Click(Sender: TObject); 
    procedure FormActivate(Sender: TObject); 
    procedure Ovrire1Click(Sender: TObject); 
    procedure Nouveau1Click(Sender: TObject); 
    procedure Fermer1Click(Sender: TObject); 
    procedure Timer1Timer(Sender: TObject); 
    procedure Supprimer1Click(Sender: TObject); 
    procedure PiceVenteClick(Sender: TObject); 
    procedure PieceStockClick(Sender: TObject); 
    procedure PramtreRseau1Click(Sender: TObject); 
    procedure CalculatriceClick(Sender: TObject); 
    procedure SpeedButton12Click(Sender: TObject); 
    procedure Analyse_ClientsClick(Sender: TObject); 
    procedure SpeedButton2Click(Sender: TObject); 
    procedure Configurationdelimpriment2Click(Sender: TObject); 
    procedure Articles2Click(Sender: TObject); 
    procedure Clients2Click(Sender: TObject); 
    procedure SpeedButton10Click(Sender: TObject); 
    procedure Familles2Click(Sender: TObject); 
    procedure SpeedButton6Click(Sender: TObject); 
    procedure EtatdeRglements1Click(Sender: TObject); 
    procedure CommandenonLivres1Click(Sender: TObject); 
    procedure Inventaire1Click(Sender: TObject); 
    procedure HistoriqueFournisseur1Click(Sender: TObject); 
    procedure HistoriquedesAchats1Click(Sender: TObject); 
    procedure HistoriqueClient1Click(Sender: TObject); 
    procedure StatistiquedesVentes1Click(Sender: TObject); 
    procedure PicedeFabrication1Click(Sender: TObject); 
    procedure RindexationdesFichiers1Click(Sender: TObject); 
    procedure EtatdesClients1Click(Sender: TObject); 
    procedure ProtectionMotdePasse1Click(Sender: TObject); 
    procedure EtatdeTVAetTIMBREaPayer1Click(Sender: TObject); 
    procedure SpeedButton9Click(Sender: TObject); 
    procedure Resturation1Click(Sender: TObject); 
    procedure Sauvegarder1Click(Sender: TObject); 
    procedure EtatdesFournissseurs1Click(Sender: TObject); 
    procedure Statistique1Click(Sender: TObject); 
    procedure LocalisaionClick(Sender: TObject); 
    procedure Timer2Timer(Sender: TObject); 
    procedure AlertDblClick(Sender: TObject); 
    procedure SpeedButton15Click(Sender: TObject); 
    procedure HistoriquedesVentes1Click(Sender: TObject); 
    procedure HistoriquedesStocks1Click(Sender: TObject); 
    procedure Modifier1Click(Sender: TObject); 
    procedure Cl1Click(Sender: TObject); 
    procedure MatierPremier1Click(Sender: TObject); 
    procedure Model1041Click(Sender: TObject); 
    procedure Model104FOURNISSEURS1Click(Sender: TObject); 
    procedure Configurationdelimpriment1Click(Sender: TObject); 
    procedure FormClose(Sender: TObject; var Action: TCloseAction); 
    procedure CommandesnonLivres1Click(Sender: TObject); 
    procedure Echancierdesfactures1Click(Sender: TObject); 
    procedure EtatduStock2Click(Sender: TObject); 
    procedure Paiement1Click(Sender: TObject); 
    procedure Importerlesdonnes1Click(Sender: TObject); 
    procedure Analysedesmouvements1Click(Sender: TObject); 
    procedure Agenda1Click(Sender: TObject); 
    procedure Optionrgionaleetlingustique1Click(Sender: TObject); 
    procedure AdministrateurBDE1Click(Sender: TObject); 
    procedure Suivante1Click(Sender: TObject); 
    procedure Prcdente1Click(Sender: TObject); 
    procedure Cascade1Click(Sender: TObject); 
    procedure MosaiqueVertical1Click(Sender: TObject); 
    procedure MosaiqueHorizontal1Click(Sender: TObject); 
    procedure outFermer1Click(Sender: TObject); 
 
  private 
     { Déclarations privées } 
  public 
  Procedure ActiveMenu(orde:boolean); 
  Procedure ActiveBouton; 
  Procedure DesActiveBouton; 
//  clientview,venteview,stockview,achatsview 
//  Procedure DesActiveBouton; 
//  Procedure ActiveBouton; 
 
    { Déclarations publiques } 
  end; 
 
var 
  Face: TFace; 
 
implementation 
 
uses Unit11, Unit4, Unit6, Unit8,Unit12, Unit3, Unit13, Unit14, 
  Unit15, Unit16, Unit17,  Unit21, Unit26, Unit31,  Unit36, 
  Unit40, Unit41, Unit46, Unit37, Unit44, Unit43, Unit48, Unit50, Unit63, 
  Unit65, Unit57,  Unit68, Unit70, Unit72, Unit76,Unit66, Unit77, Unit29, Unit80, Unit81, Unit82, 
  StockAlert, Unit18, Unit10, Unit45, Unit54, Unit59, Unit61, Unit69, 
  Unit84, Unit86, Unit88, Unit75, venteAuComptoi_U; 
 
 
{$R *.DFM} 
function NomUtilisateur:string; 
var 
  Buffer : array[0..255] of char; 
  BufferSize : DWORD; 
begin 
  BufferSize := sizeOf(Buffer); 
  GetUserName(@buffer, BufferSize); 
  Result:=Buffer; 
end; 
 
function NomReseau:string; 
var 
  Buffer : array[0..255] of char; 
  BufferSize : DWORD; 
begin 
  BufferSize := sizeOf(Buffer); 
  GetComputerName(@buffer, BufferSize); 
  Result:=Buffer; 
end; 
 
Procedure TFace.DesActiveBouton; 
        begin 
        Face.Btclients.Enabled:=false; 
        face.BtFournisseurs.Enabled:=false; 
        face.BtArticles.Enabled:=false; 
     //   face.BtMatireP.Enabled:=false; 
        face.BtPVente.Enabled:=false; 
        face.BtPStock.Enabled:=false; 
        Face.BtFAbrication.Enabled:=False; 
        Face.BtSelectionnerLot.Enabled:=False; 
         face.btlocal.Enabled:=false; 
         fermer1.Enabled:=false; 
        end; 
Procedure TFace.ActiveBouton; 
        begin 
        Face.Btclients.Enabled:=True; 
        face.BtFournisseurs.Enabled:=True; 
        face.BtArticles.Enabled:=True; 
       // face.BtMatireP.Enabled:=True; 
        face.BtPVente.Enabled:=True; 
        face.BtPStock.Enabled:=True; 
        Face.BtFAbrication.Enabled:=True; 
        Face.BtSelectionnerLot.Enabled:=True; 
        face.btlocal.Enabled:=True; 
        fermer1.Enabled:=True; 
        end; 
 
procedure TFace.Quitter1Click(Sender: TObject); 
begin 
{if FileExists('Del1.MB') then DeleteFile('Del1.MB); 
if FileExists('Del2.MB') then DeleteFile('Del2.MB); 
if FileExists('Del3.MB') then DeleteFile('Del3.MB); 
if FileExists('Del4.MB') then DeleteFile('Del4.MB); 
if FileExists('Del5.MB') then DeleteFile('Del5.MB); 
if FileExists('Del6.MB') then DeleteFile('Del6.MB); 
if FileExists('Del7.MB') then DeleteFile('Del7.MB); 
if FileExists('Del8.MB') then DeleteFile('Del8.MB); 
if FileExists('Del9.MB') then DeleteFile('Del9.MB); 
if FileExists('Del10.MB') then DeleteFile('Del10.MB); 
if FileExists('Del11.MB') then DeleteFile('Del11.MB); 
if FileExists('Del12.MB') then DeleteFile('Del12.MB); 
if FileExists('Del13.MB') then DeleteFile('Del13.MB); 
if FileExists('Del14.MB') then DeleteFile('Del14.MB); 
if FileExists('Del115.MB') then DeleteFile('Del15.MB); 
if FileExists('Del16.MB') then DeleteFile('Del16.MB); 
} 
//if MessageDlg('Désirez-Vous Quitter L''Application',mtConfirmation, [mbYes, mbNo], 0) = mrYes then 
Close; 
end; 
 
procedure TFace.Aproposde1Click(Sender: TObject); 
begin 
Apropos.ShowModal; 
end; 
 
procedure TFace.Clients1Click(Sender: TObject); 
begin 
//  clients:=Tclients.Create(face); 
//clients.Show; 
Clients.ShowModal; 
end; 
 
procedure TFace.Fournisseurs1Click(Sender: TObject); 
begin 
//Fournisseurs:=TFournisseurs.Create(face) 
fournisseurs.ShowModal; 
end; 
 
procedure TFace.Articles1Click(Sender: TObject); 
begin 
//Articles:=TArticles.Create(face); {création} 
//articles.Show; 
Articles.ShowModal; 
end; 
 
procedure TFace.FormActivate(Sender: TObject); 
begin 
//Poste.Caption:=NomReseau; 
END; 
 
 
procedure TFace.Ovrire1Click(Sender: TObject); 
begin 
if data.Dossiers.RecordCount=0 then 
Raise exception.Create('Créez Un Dossier d''abord'); 
O_dossier.ShowModal; 
 
//ActiveBouton; 
 
end; 
 
procedure TFace.Nouveau1Click(Sender: TObject); 
begin 
//if Not FileExists('C:\Windows\System\_sqldb.dll')then  RAise exception.Create('Version Démo !'); 
//data.FermerBase; 
//activemenu(false); 
data.Dossiers.Append; 
N_dossier.ShowModal; 
end; 
 
Procedure Tface.ActiveMenu(orde:boolean); 
begin 
if orde=False then 
   begin 
        face.Fichier1.Visible:=False; 
        face.Ventes1.Visible:=False; 
        face.Imprimer1.Visible:=False; 
        face.Agenda1.Enabled:=False; 
        face.RindexationdesFichiers1.Enabled:=false; 
   end 
 else 
   begin 
        face.Fichier1.Visible:=true; 
        face.Ventes1.Visible:=true; 
        face.Imprimer1.Visible:=true; 
       // face.Outils.Visible:=true; 
       face.Agenda1.Enabled:=true; 
        face.RindexationdesFichiers1.Enabled:=true;        
   end; 
end; 
procedure TFace.Fermer1Click(Sender: TObject); 
begin 
activemenu(false); 
outFermer1Click(Sender); 
Face.StatusBar1.Panels[0].Text:='Dossier -> : '; 
DesActiveBouton; 
//face.PageScroller.Visible:=False; 
fermer1.Enabled:=false; 
 
end; 
 
procedure TFace.Timer1Timer(Sender: TObject); 
begin 
//Alert.Visible:=False; 
StatusBar1.Panels[3].Text := '      '+(FormatDateTime('dddddd ', Now)); 
StatusBar1.Panels[2].Text := (FormatDateTime('hh:mm', Now)); 
 
end; 
 
procedure TFace.Supprimer1Click(Sender: TObject); 
begin 
//if Not FileExists('C:\Windows\System\_sqldb.dll')then  RAise exception.Create('Version Démo !'); 
if data.Dossiers.RecordCount=0 then 
Raise exception.Create('Aucun Dossier a supprimer'); 
S_Dossier.ShowModal; 
end; 
 
procedure TFace.PiceVenteClick(Sender: TObject); 
begin 
//Ventes:=TVentes.Create(Face); {création} 
 
Ventes.Showmodal; 
end; 
 
procedure TFace.PieceStockClick(Sender: TObject); 
begin 
if Not( FileExists('C:\Windows\System\_sqldb.dll'))  AND (data.CompteurSortie.Value>10) then 
 RAise exception.Create('Version Démo !'); 
//Stockform:=TStockform.Create(face) 
Stockform.Showmodal; 
end; 
 
procedure TFace.PramtreRseau1Click(Sender: TObject); 
begin 
//Reseau.Showmodal; 
end; 
 
procedure TFace.CalculatriceClick(Sender: TObject); 
begin 
 ShellExecute(GetDesktopWindow, 'open', PChar('Calc'), nil, nil, SW_SHOWNORMAL); 
end; 
 
procedure TFace.SpeedButton12Click(Sender: TObject); 
begin 
Etat_Reglement.ShowModal; 
 
end; 
 
procedure TFace.Analyse_ClientsClick(Sender: TObject); 
begin 
His_Client.ShowModal; 
end; 
 
procedure TFace.SpeedButton2Click(Sender: TObject); 
begin 
Echeancier.ShowModal; 
end; 
  //--------------------------------------------------------------------------- 
procedure TFace.Configurationdelimpriment2Click(Sender: TObject); 
begin 
 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.Articles2Click(Sender: TObject); 
begin 
Imp_ListArticles.Print; 
end; 
  //--------------------------------------------------------------------------- 
procedure TFace.Clients2Click(Sender: TObject); 
begin 
///Imp_ListClients.Print; 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.SpeedButton10Click(Sender: TObject); 
begin 
Vente_Comptoir.ShowModal; 
end; 
  //--------------------------------------------------------------------------- 
procedure TFace.Familles2Click(Sender: TObject); 
begin 
His_Familles.ShowModal; 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.SpeedButton6Click(Sender: TObject); 
begin 
His_Ventes.ShowModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.EtatdeRglements1Click(Sender: TObject); 
begin 
 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.CommandenonLivres1Click(Sender: TObject); 
begin 
CommandeNonLivree.ShowModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.Inventaire1Click(Sender: TObject); 
begin 
Choix_Inventaire.ShowModal; 
{  Inventaire.Articles.DatabaseName:=Data.Database.DatabaseName; 
  Inventaire.Articles.Open; 
  Inventaire.Preview; 
  Inventaire.Articles.Close; 
 } 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.HistoriqueFournisseur1Click(Sender: TObject); 
begin 
His_Fournisseur.ShowModal; 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.HistoriquedesAchats1Click(Sender: TObject); 
begin 
His_Achats.showmodal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.HistoriqueClient1Click(Sender: TObject); 
begin 
His_Client.showModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.StatistiquedesVentes1Click(Sender: TObject); 
begin 
 
end; 
 //--------------------------------------------------------------------------- 
procedure TFace.PicedeFabrication1Click(Sender: TObject); 
begin 
//Achats:=Tachats.Create(face) 
achats.showmodal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.RindexationdesFichiers1Click(Sender: TObject); 
begin 
regeneration.showModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.EtatdesClients1Click(Sender: TObject); 
Begin 
Choix_Etat.showmodal; 
End; 
//------------------------------------------------------------------------------- 
procedure TFace.ProtectionMotdePasse1Click(Sender: TObject); 
begin 
Protection.showModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.EtatdeTVAetTIMBREaPayer1Click(Sender: TObject); 
begin 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.SpeedButton9Click(Sender: TObject); 
begin 
 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.Resturation1Click(Sender: TObject); 
begin 
if Not FileExists('C:\Windows\System\_sqldb.dll')then  RAise exception.Create('Version Démo !'); 
Restauration.showModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.Sauvegarder1Click(Sender: TObject); 
begin 
//if Not FileExists('C:\Windows\System\_sqldb.dll')then  RAise exception.Create('Version Démo !'); 
Sauvegarder.ShowModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.EtatdesFournissseurs1Click(Sender: TObject); 
 
 
begin 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.Statistique1Click(Sender: TObject); 
begin 
Choix_Stat.showmodal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.LocalisaionClick(Sender: TObject); 
begin 
Tva.ShowModal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.Timer2Timer(Sender: TObject); 
begin 
 
//Alert.Visible:=True; 
//Alert.Picture.LoadFromFile('C:\ges-com\parametre\Alert.Bmp'); 
//Sleep(1000); 
//alert.Picture.LoadFromFile('C:\ges-com\parametre\alert.Bmp'); 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.AlertDblClick(Sender: TObject); 
begin 
StockenAlert.Showmodal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.SpeedButton15Click(Sender: TObject); 
begin 
Etat_Reglement.showmodal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.HistoriquedesVentes1Click(Sender: TObject); 
begin 
His_Ventes.showmodal; 
end; 
//--------------------------------------------------------------------------- 
procedure TFace.HistoriquedesStocks1Click(Sender: TObject); 
begin 
His_Stock.showmodal; 
end; 
 
procedure TFace.Modifier1Click(Sender: TObject); 
begin 
//if Not FileExists('C:\Windows\System\_sqldb.dll')then  RAise exception.Create('Version Démo !'); 
if data.Dossiers.RecordCount=0 then 
Raise exception.Create('Créez Un Dossier d''abord'); 
M_Dossier.showmodal; 
end; 
 
procedure TFace.Cl1Click(Sender: TObject); 
begin 
Cle.showmodal; 
end; 
 
procedure TFace.MatierPremier1Click(Sender: TObject); 
begin 
Matier_P.showmodal; 
end; 
 
procedure TFace.Model1041Click(Sender: TObject); 
VAR 
Total:Double; 
begin 
  Total:=0; 
  Traitement_Dossier.Show; 
  Traitement_Dossier.Update; 
  DAta.Clients.First; 
  While Not data.Clients.Eof DO 
     BEGIN 
      data.T_Ventes.Filter:='Type=''Facture'' AND Code_cli='+DAta.Clientscode_cli.AsString; 
      data.T_Ventes.Filtered:=TRUE; 
     Total:=0;DATA.T_Ventes.First; 
      WHILE  not data.T_Ventes.Eof DO 
         BEGIN 
         Total:=Total+data.T_VentesTotal_HT.Value; 
         DATA.T_Ventes.Next; 
         END; 
      data.Clients.edit; 
      data.ClientsCA.Value:=0; 
      DATA.ClientsCA.Value:=TOTAL; 
      DATA.Clients.POST; 
  DATA.Clients.Next; 
  END; 
Traitement_Dossier.Close; 
Model104.Preview; 
data.T_Ventes.Filtered:=False; 
end; 
procedure TFace.Model104FOURNISSEURS1Click(Sender: TObject); 
VAR 
Total:Double; 
begin 
  Total:=0; 
  Traitement_Dossier.Show; 
  Traitement_Dossier.Update; 
  DAta.Clients.First; 
  While Not data.Fournisseurs.Eof DO 
     BEGIN 
      data.T_aCHATS.Filter:='Type=''Facture'' AND code_FRN='+DAta.Fournisseurscode_FR.AsString; 
      data.T_Achats.Filtered:=TRUE; 
     Total:=0;DATA.T_Achats.First; 
      WHILE  not data.T_Achats.Eof DO 
         BEGIN 
         Total:=Total+data.T_AchatsTotal_HT.Value; 
         DATA.T_Achats.Next; 
         END; 
      data.Fournisseurs.edit; 
      data.FournisseursCA.Value:=0; 
      DATA.FournisseursCA.Value:=TOTAL; 
      DATA.Fournisseurs.POST; 
  DATA.Fournisseurs.Next; 
  END; 
Traitement_Dossier.Close; 
Model104FRN.Preview; 
data.T_Achats.Filtered:=False; 
end; 
 
procedure TFace.Configurationdelimpriment1Click(Sender: TObject); 
begin 
PrinterSetup.Execute; 
end; 
 
procedure TFace.FormClose(Sender: TObject; var Action: TCloseAction); 
begin 
data.FermerBase; 
data.Dossiers.Close; 
data.Socite.Close; 
Application.Terminate; 
end; 
 
procedure TFace.CommandesnonLivres1Click(Sender: TObject); 
begin 
CommandeNonLivree.ShowModal; 
end; 
 
procedure TFace.Echancierdesfactures1Click(Sender: TObject); 
begin 
Echeancier.ShowModal; 
end; 
 
procedure TFace.EtatduStock2Click(Sender: TObject); 
begin 
StockenAlert.Showmodal; 
end; 
 
procedure TFace.Paiement1Click(Sender: TObject); 
begin 
Etat_Reglement.showmodal; 
end; 
 
procedure TFace.Importerlesdonnes1Click(Sender: TObject); 
begin 
Importerdonnees.showModal; 
end; 
 
procedure TFace.Analysedesmouvements1Click(Sender: TObject); 
begin 
Analyse_Mouvement.showmodal; 
end; 
 
procedure TFace.Agenda1Click(Sender: TObject); 
begin 
E_Mail.ShowModal; 
end; 
 
procedure TFace.Optionrgionaleetlingustique1Click(Sender: TObject); 
begin 
WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL intl.cpl'), SW_SHOWNORMAL); 
 
end; 
 
procedure TFace.AdministrateurBDE1Click(Sender: TObject); 
begin 
WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL BDEADMIN.CPL'), SW_SHOWNORMAL); 
end; 
 
procedure TFace.Suivante1Click(Sender: TObject); 
begin 
face.Next; 
end; 
 
procedure TFace.Prcdente1Click(Sender: TObject); 
begin 
face.Previous; 
end; 
 
procedure TFace.Cascade1Click(Sender: TObject); 
begin 
face.Cascade; 
end; 
 
procedure TFace.MosaiqueVertical1Click(Sender: TObject); 
begin 
Face.TileMode:=tbVertical; 
Face.Tile; 
 
end; 
 
procedure TFace.MosaiqueHorizontal1Click(Sender: TObject); 
begin 
face.TileMode:=tbHorizontal; 
face.Tile; 
 
end; 
 
procedure TFace.outFermer1Click(Sender: TObject); 
var i: integer; 
begin 
for i:= 0 to MdiChildCount - 1 do 
  MDIChildren[i].Close; 
end; 
 
end.