--
-- Host: localhost    Database: vente
-- ------------------------------------------------------


--
-- Table structure for table `achats`
--

CREATE TABLE `achats` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_produit` varchar(200) NOT NULL,
  `montant_total` varchar(50) NOT NULL,
  `quantité` varchar(200) NOT NULL,
  `taxe` varchar(200) NOT NULL,
  `remise` varchar(200) NOT NULL,
  `prix_unitaire` varchar(200) NOT NULL,
  `id_fournisseur` int(11) NOT NULL,
  `methode_paiement` varchar(200) NOT NULL,
  `facture` varchar(50) NOT NULL,
  `a_compte` varchar(50) NOT NULL,
  `reste` varchar(50) NOT NULL,
  `id_magasin` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `FK_fournisseurs_achat` (`id_fournisseur`),
  KEY `FK_magasins_achats` (`id_magasin`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `achats`
--

INSERT INTO `achats` VALUES (1,'1','10.7','2','7','0','5',5,'Espèces','Non','10.7','0',1,1,'2020-09-29 00:06:48'),(2,'2','7735','5','19','0','1300',5,'Espèces','Oui','7735','0',1,1,'2020-10-01 09:55:18'),(3,'1##2','1568.4','4##1','7##19','0##0','5##1300',5,'Espèces','Oui','1568.4','0',1,1,'2020-10-12 17:05:13');

--
-- Table structure for table `catégories`
--

CREATE TABLE `catégories` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) NOT NULL,
  `description` text NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `catégories`
--

INSERT INTO `catégories` VALUES (4,'SMARTPHONES','Smartphones','2020-09-29 00:05:15'),(2,'accessoires','accessoire téléphoniques','2020-09-09 11:32:05');

--
-- Table structure for table `clients`
--

CREATE TABLE `clients` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) NOT NULL,
  `adresse` varchar(100) NOT NULL,
  `ville` varchar(50) NOT NULL,
  `code_postal` varchar(20) NOT NULL,
  `téléphone` varchar(30) NOT NULL,
  `email` varchar(50) NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `clients`
--

INSERT INTO `clients` VALUES (1,'Zied Benzarti','france','Paris','30000','023568974','hmd0@hotmail.com','2020-09-09 15:40:28'),(3,'fares manaa','haouariah','nabeul','8045','2655895','faresmanaa.ff','2020-09-10 03:09:50');

--
-- Table structure for table `config`
--

CREATE TABLE `config` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) NOT NULL,
  `adresse` varchar(200) NOT NULL,
  `matricule` varchar(50) NOT NULL,
  `téléphone` varchar(30) NOT NULL,
  `logo` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `config`
--

INSERT INTO `config` VALUES (1,'GSM Tech ','Tunis Monplaisir 1073','42000065','23568974','avatar1603276499174.png');

--
-- Table structure for table `fournisseurs`
--

CREATE TABLE `fournisseurs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `type` varchar(30) NOT NULL,
  `nom` varchar(100) NOT NULL,
  `adresse` varchar(100) NOT NULL,
  `ville` varchar(50) NOT NULL,
  `code_postal` varchar(20) NOT NULL,
  `TVA` varchar(50) NOT NULL,
  `téléphone` varchar(50) NOT NULL,
  `email` varchar(50) NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `fournisseurs`
--

INSERT INTO `fournisseurs` VALUES (5,'Particulier','Hamadi Abidi','Tunis','Tunis','50000','','023568974','hmd0@hotmail.com','2020-09-15 14:08:09'),(6,'Société','fares manaa','haouariah','nabeul','8045','','23059660','faresmanaa.ff','2020-10-21 13:04:11');

--
-- Table structure for table `magasins`
--

CREATE TABLE `magasins` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `nom` varchar(100) NOT NULL,
  `adresse` varchar(100) NOT NULL,
  `ville` varchar(100) NOT NULL,
  `code_postal` varchar(50) NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `magasins`
--

INSERT INTO `magasins` VALUES (1,'MAG-001','tunis Montplaisir 1078','tunis','2000','2020-09-09 15:55:49');

--
-- Table structure for table `produits`
--

CREATE TABLE `produits` (
  `id_produit` int(11) NOT NULL AUTO_INCREMENT,
  `ref` varchar(30) NOT NULL,
  `code_barre` varchar(50) NOT NULL,
  `nom` varchar(100) NOT NULL,
  `id_catégorie` int(11) NOT NULL,
  `unité` varchar(30) NOT NULL,
  `id_fournisseur` int(11) NOT NULL,
  `seuil` varchar(30) NOT NULL,
  `gestion_stock` varchar(30) NOT NULL,
  `TVA` varchar(30) NOT NULL,
  `prix_achat_HT` varchar(30) NOT NULL,
  `prix_achat_TTC` varchar(30) NOT NULL,
  `marge` varchar(30) NOT NULL,
  `prix_vente_HT` varchar(30) NOT NULL,
  `prix_vente_TTC` varchar(30) NOT NULL,
  `quantité` int(11) NOT NULL DEFAULT '0',
  `id_magasin` int(11) NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id_produit`),
  KEY `FK_produits_categorie` (`id_catégorie`),
  KEY `FK_fournisseurs_produits` (`id_fournisseur`),
  KEY `FK_magasins_produits` (`id_magasin`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `produits`
--

INSERT INTO `produits` VALUES (1,'REF-001','0120101010','KIT Galaxy A70',2,'Pièce',5,'10','Active','7','5','5.35','273.83','18.692','20',13,1,'2020-09-29 00:02:36'),(2,'REF-002','565656565','Galaxy A70',4,'Pièce',5,'10','Active','19','1300','1547','3.43','1344.538','1600',15,1,'2020-09-29 00:06:02');

--
-- Table structure for table `ventes`
--

CREATE TABLE `ventes` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `id_produit` varchar(200) NOT NULL,
  `montant_total` varchar(50) NOT NULL,
  `quantité` varchar(200) NOT NULL,
  `taxe` varchar(200) NOT NULL,
  `remise` varchar(200) NOT NULL,
  `prix_unitaire` varchar(200) NOT NULL,
  `id_client` int(11) NOT NULL,
  `methode_paiement` varchar(200) NOT NULL,
  `facture` varchar(50) NOT NULL,
  `a_compte` varchar(50) NOT NULL,
  `reste` varchar(50) NOT NULL,
  `id_magasin` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `date_ajout` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `FK_magasins_ventes` (`id_magasin`)
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ventes`
--

INSERT INTO `ventes` VALUES (1,'1','40','2','7','0','20',0,'Espèces','Non','40','0',1,1,'2020-09-29 00:07:05'),(2,'1','40','2','7','0','20',0,'Espèces','Oui','40','0',1,1,'2020-10-02 13:12:03'),(3,'1##2','1620','1##1','7##19','0##0','20##1600',1,'Espèces','Non','1620','0',1,1,'2020-10-07 08:53:10'),(4,'2','6400','4','19','0','1600',1,'Espèces','Non','6400','0',1,1,'2020-10-07 10:52:29'),(5,'1##2','1660','3##1','7##19','0##0','20##1600',0,'Espèces','Oui','1660','0',1,1,'2020-10-08 13:23:58'),(6,'1','20','1','7','0','20',3,'Payer Ultérieurement','Non','0','20',1,1,'2020-10-12 17:06:34'),(7,'1','40','2','7','0','20',0,'Espèces','Oui','40','0',1,1,'2020-10-13 14:50:04'),(8,'2','6400','4','19','0','1600',1,'Espèces','Non','6400','0',1,1,'2020-10-13 19:16:51'),(9,'1##2','1640','2##1','7##19','0##0','20##1600',0,'Espèces','Oui','1640','0',1,1,'2020-10-20 11:46:09');


