/*
SQLyog Community Edition- MySQL GUI v8.05 
MySQL - 5.6.16 : Database - cafeteria
*********************************************************************
*/

/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;

CREATE DATABASE /*!32312 IF NOT EXISTS*/`cafeteria` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;

USE `cafeteria`;

/*Table structure for table `auditoria` */

DROP TABLE IF EXISTS `auditoria`;

CREATE TABLE `auditoria` (
  `idAuditoria_bodega` int(11) NOT NULL,
  `bodega_idinventario` int(11) NOT NULL,
  `Usuario_idUsuario` int(11) NOT NULL,
  `Descripcion_bodega` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`idAuditoria_bodega`),
  KEY `fk_Auditoria_bodega_bodega1_idx` (`bodega_idinventario`),
  KEY `fk_Auditoria_bodega_Usuario1_idx` (`Usuario_idUsuario`),
  CONSTRAINT `FK_auditoria` FOREIGN KEY (`bodega_idinventario`) REFERENCES `bodega` (`idinventario`),
  CONSTRAINT `fk_Auditoria_bodega_Usuario1` FOREIGN KEY (`Usuario_idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `auditoria` */

/*Table structure for table `auditoria_tienda` */

DROP TABLE IF EXISTS `auditoria_tienda`;

CREATE TABLE `auditoria_tienda` (
  `idAuditoria_Tienda` int(11) NOT NULL,
  `Tienda_idTienda` int(11) NOT NULL,
  `Usuario_idUsuario` int(11) NOT NULL,
  `Descripcion` varchar(240) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`idAuditoria_Tienda`),
  KEY `fk_Auditoria_Tienda_Tienda1_idx` (`Tienda_idTienda`),
  KEY `fk_Auditoria_Tienda_Usuario1_idx` (`Usuario_idUsuario`),
  CONSTRAINT `fk_Auditoria_Tienda_Usuario1` FOREIGN KEY (`Usuario_idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `auditoria_tienda` */

/*Table structure for table `bodega` */

DROP TABLE IF EXISTS `bodega`;

CREATE TABLE `bodega` (
  `idinventario` int(11) NOT NULL AUTO_INCREMENT,
  `cantidad_bodega` int(11) DEFAULT NULL,
  `cantidad_minima` int(11) DEFAULT NULL,
  `Producto_idProducto` varchar(50) CHARACTER SET latin1 NOT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idinventario`),
  KEY `FK_bodega` (`Producto_idProducto`),
  CONSTRAINT `FK_bodega` FOREIGN KEY (`Producto_idProducto`) REFERENCES `producto` (`idProducto`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `bodega` */

insert  into `bodega`(`idinventario`,`cantidad_bodega`,`cantidad_minima`,`Producto_idProducto`,`updated_at`,`created_at`) values (11,NULL,3,'yy34yy56','2016-03-03 16:46:28','2016-03-03 16:46:28');

/*Table structure for table `caja` */

DROP TABLE IF EXISTS `caja`;

CREATE TABLE `caja` (
  `IdCaja` int(10) NOT NULL AUTO_INCREMENT,
  `Nombre_Caja` varchar(150) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`IdCaja`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `caja` */

insert  into `caja`(`IdCaja`,`Nombre_Caja`) values (1,'Caja01'),(2,'Caja02'),(3,'Caja03');

/*Table structure for table `cliente` */

DROP TABLE IF EXISTS `cliente`;

CREATE TABLE `cliente` (
  `Cedula` int(11) NOT NULL,
  `Nombres` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Apellidos` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Telefono` int(11) DEFAULT NULL,
  `Direccion` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `PuntosAcumulados` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`Cedula`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `cliente` */

insert  into `cliente`(`Cedula`,`Nombres`,`Apellidos`,`Telefono`,`Direccion`,`PuntosAcumulados`,`updated_at`,`created_at`) values (0,'0000','0000',0,'0000',1,'2016-03-02 15:13:58',NULL),(999,'yyy','eee',2222222,'ddd',NULL,'2016-02-19 21:33:57','2016-02-19 21:33:57'),(1070961211,'yudy','nieto',2147483647,'carrera22 #45-23',NULL,'2016-02-19 21:06:43','2016-02-19 21:06:43'),(1070961234,'ggg','ggg',11111111,'ggg',NULL,'2016-02-19 21:32:47','2016-02-19 21:32:47');

/*Table structure for table `combos` */

DROP TABLE IF EXISTS `combos`;

CREATE TABLE `combos` (
  `idCombos` varchar(50) CHARACTER SET latin1 NOT NULL,
  `nombre_combo` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `id_producto` int(11) DEFAULT NULL,
  `valor_combo` int(11) DEFAULT NULL,
  `puntos` int(11) DEFAULT NULL,
  `Estado_combo` int(2) DEFAULT '1',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idCombos`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `combos` */

insert  into `combos`(`idCombos`,`nombre_combo`,`id_producto`,`valor_combo`,`puntos`,`Estado_combo`,`updated_at`,`created_at`) values ('34','sdasdas',NULL,1200,2,1,'2016-03-03 16:55:31','2016-03-03 16:55:31'),('45','pruebas',NULL,5000,2,1,'2016-02-23 17:45:17','2016-02-23 17:19:36');

/*Table structure for table `descuento` */

DROP TABLE IF EXISTS `descuento`;

CREATE TABLE `descuento` (
  `iddescuento` int(11) NOT NULL,
  `observacion` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Usuario_idUsuario` int(11) NOT NULL,
  `Producto_idProducto` varchar(50) CHARACTER SET latin1 NOT NULL,
  `Estado` int(2) DEFAULT '1',
  PRIMARY KEY (`iddescuento`),
  KEY `fk_descuento_Usuario1_idx` (`Usuario_idUsuario`),
  KEY `fk_descuento_Producto1_idx` (`Producto_idProducto`),
  CONSTRAINT `fk_descuento_Usuario1` FOREIGN KEY (`Usuario_idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `descuento` */

insert  into `descuento`(`iddescuento`,`observacion`,`Usuario_idUsuario`,`Producto_idProducto`,`Estado`) values (0,'0',33333,'1',0);

/*Table structure for table `estado_caja` */

DROP TABLE IF EXISTS `estado_caja`;

CREATE TABLE `estado_caja` (
  `Id_EstadoCaja` int(10) NOT NULL AUTO_INCREMENT,
  `Estado_Caja` int(10) DEFAULT NULL,
  `SaldoInicial_Caja` int(10) DEFAULT NULL,
  `SaldoFinal_Caja` int(10) DEFAULT NULL,
  `Id_Caja` int(10) DEFAULT NULL,
  `IdUsuario` int(10) DEFAULT NULL,
  `Administrador` int(10) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`Id_EstadoCaja`),
  KEY `FK_estado_caja` (`Id_Caja`),
  CONSTRAINT `FK_estado_caja` FOREIGN KEY (`Id_Caja`) REFERENCES `caja` (`IdCaja`)
) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `estado_caja` */

insert  into `estado_caja`(`Id_EstadoCaja`,`Estado_Caja`,`SaldoInicial_Caja`,`SaldoFinal_Caja`,`Id_Caja`,`IdUsuario`,`Administrador`,`updated_at`,`created_at`) values (12,2,12344,12344,2,33333,1070961211,'2016-02-19 22:05:20','2016-02-16 15:30:19'),(19,2,12450,12450,1,33333,1070961211,'2016-02-24 19:54:52','2016-02-19 22:24:04'),(22,2,12340,NULL,2,33333,1070961211,'2016-03-01 15:55:33','2016-03-01 15:55:33'),(23,1,13000,NULL,2,33333,1070961211,'2016-03-03 14:26:10','2016-03-03 14:26:10');

/*Table structure for table `formapago` */

DROP TABLE IF EXISTS `formapago`;

CREATE TABLE `formapago` (
  `idFormaPago` int(11) NOT NULL AUTO_INCREMENT,
  `Nombre` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`idFormaPago`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `formapago` */

insert  into `formapago`(`idFormaPago`,`Nombre`) values (1,'Efectivo'),(2,'Tarjeta'),(3,'Cortesia');

/*Table structure for table `inventario` */

DROP TABLE IF EXISTS `inventario`;

CREATE TABLE `inventario` (
  `idinventario` int(11) NOT NULL AUTO_INCREMENT,
  `cantidad_inventario` int(11) DEFAULT NULL,
  `cantidad minima` int(11) DEFAULT NULL,
  `descuento` int(11) DEFAULT NULL,
  `Producto_idProducto` varchar(50) DEFAULT NULL,
  `canidad_almacen` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`idinventario`),
  KEY `fk_inventario_Producto1_idx` (`Producto_idProducto`),
  CONSTRAINT `FK_inventario` FOREIGN KEY (`Producto_idProducto`) REFERENCES `producto` (`idProducto`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `inventario` */

/*Table structure for table `marca` */

DROP TABLE IF EXISTS `marca`;

CREATE TABLE `marca` (
  `idMarca` int(11) NOT NULL AUTO_INCREMENT,
  `Nombre` varchar(250) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Estado` int(1) DEFAULT NULL,
  `Descripcion` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idMarca`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `marca` */

insert  into `marca`(`idMarca`,`Nombre`,`Estado`,`Descripcion`,`updated_at`,`created_at`) values (1,'Cocacola',1,NULL,'2016-02-05 14:01:55','2016-02-04 22:38:33'),(2,'Postobon',2,NULL,'2016-02-05 14:02:11','2016-02-04 22:39:25'),(3,'BigCola',1,NULL,'2016-02-04 22:44:28','2016-02-04 22:44:28'),(4,'Ramo',1,NULL,'2016-03-02 16:08:49','2016-03-02 16:08:49');

/*Table structure for table `presentacion` */

DROP TABLE IF EXISTS `presentacion`;

CREATE TABLE `presentacion` (
  `idpresentacion` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(45) DEFAULT NULL,
  `Estado` int(1) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idpresentacion`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

/*Data for the table `presentacion` */

insert  into `presentacion`(`idpresentacion`,`nombre`,`Estado`,`updated_at`,`created_at`) values (1,'Caja',1,'2016-03-02 16:16:14',NULL),(2,'Botella',NULL,NULL,NULL),(3,'Bolsa',NULL,NULL,NULL),(4,'Caja 2x5',1,'2016-02-05 14:31:21','2016-02-05 14:31:21');

/*Table structure for table `product_combo` */

DROP TABLE IF EXISTS `product_combo`;

CREATE TABLE `product_combo` (
  `idProduct_Combo` int(11) NOT NULL AUTO_INCREMENT,
  `Producto_idProducto` varchar(50) CHARACTER SET latin1 NOT NULL,
  `Combos_idCombos` varchar(50) CHARACTER SET latin1 NOT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idProduct_Combo`),
  KEY `fk_Product_Combo_Producto1_idx` (`Producto_idProducto`),
  KEY `fk_Product_Combo_Combos1_idx` (`Combos_idCombos`),
  CONSTRAINT `FK_product_combo` FOREIGN KEY (`Producto_idProducto`) REFERENCES `producto` (`idProducto`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `product_combo` */

/*Table structure for table `producto` */

DROP TABLE IF EXISTS `producto`;

CREATE TABLE `producto` (
  `idProducto` varchar(50) NOT NULL,
  `Nombre_Produc` varchar(45) DEFAULT NULL,
  `cantidad` int(11) DEFAULT '0',
  `valor_unitario` int(11) DEFAULT NULL,
  `Volumen_idVolumen` int(11) DEFAULT NULL,
  `presentacion_idpresentacion` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `Estado_Producto` int(2) DEFAULT '1',
  `puntos` int(11) DEFAULT '0',
  `idMarca` int(11) DEFAULT NULL,
  PRIMARY KEY (`idProducto`),
  KEY `fk_Producto_presentacion1_idx` (`presentacion_idpresentacion`),
  KEY `FK_producto1` (`Volumen_idVolumen`),
  CONSTRAINT `FK_producto` FOREIGN KEY (`presentacion_idpresentacion`) REFERENCES `presentacion` (`idpresentacion`),
  CONSTRAINT `FK_producto1` FOREIGN KEY (`Volumen_idVolumen`) REFERENCES `volumen` (`idVolumen`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `producto` */

insert  into `producto`(`idProducto`,`Nombre_Produc`,`cantidad`,`valor_unitario`,`Volumen_idVolumen`,`presentacion_idpresentacion`,`updated_at`,`created_at`,`Estado_Producto`,`puntos`,`idMarca`) values ('0','pastel',0,800,1,1,'2016-03-02 16:32:44',NULL,1,1,1),('1','cafe',0,1600,2,1,'2016-03-01 15:17:31','2015-09-17 20:56:16',1,1,NULL),('208','Uva Postobon',0,1200,1,1,'2016-03-02 16:33:20','2016-02-29 16:31:38',2,2,3),('209','Manzana Postobon',0,1200,1,2,'2016-03-01 15:17:32','2016-02-29 20:30:46',1,9,NULL),('4','vino',0,10000,2,2,'2016-03-01 15:17:32','2016-02-01 16:00:25',1,1,NULL),('5','vino',0,30000,3,2,'2016-03-01 15:17:32','2016-02-01 17:09:28',1,1,NULL),('6','te',0,1200,1,2,'2016-03-01 15:17:32','2016-02-01 17:24:26',1,1,NULL),('7','hhh',0,1200,1,2,'2016-03-01 15:17:32',NULL,1,6,NULL),('908','te',0,1500,2,1,'2016-03-02 16:34:26','2016-03-02 16:34:26',1,2,1),('yy34yy56','te',0,1200,1,1,'2016-03-03 16:46:43','2016-03-03 16:46:28',2,2,1);

/*Table structure for table `producto_ventau` */

DROP TABLE IF EXISTS `producto_ventau`;

CREATE TABLE `producto_ventau` (
  `id_table` int(11) NOT NULL AUTO_INCREMENT,
  `idusuario` int(11) DEFAULT NULL,
  `idproducto` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
  `Producto` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  `Cantidad` int(11) DEFAULT NULL,
  `Valor_unidad` int(11) DEFAULT NULL,
  `Valor_Total` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `Cliente` int(11) DEFAULT NULL,
  `Puntos` int(11) DEFAULT NULL,
  `idFormaPago` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_table`),
  KEY `FK_producto_ventau` (`idproducto`),
  CONSTRAINT `FK_producto_ventau` FOREIGN KEY (`idproducto`) REFERENCES `producto` (`idProducto`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `producto_ventau` */

/*Table structure for table `rol` */

DROP TABLE IF EXISTS `rol`;

CREATE TABLE `rol` (
  `idRol` int(11) NOT NULL,
  `Nombre_Rol` varchar(45) DEFAULT NULL,
  PRIMARY KEY (`idRol`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `rol` */

insert  into `rol`(`idRol`,`Nombre_Rol`) values (0,'Administrador'),(1,'Almacenista'),(2,'Cajero');

/*Table structure for table `tienda` */

DROP TABLE IF EXISTS `tienda`;

CREATE TABLE `tienda` (
  `idTienda` int(11) NOT NULL AUTO_INCREMENT,
  `cantidad_producto` int(11) DEFAULT NULL,
  `Producto_idProducto` varchar(50) CHARACTER SET latin1 NOT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idTienda`),
  KEY `fk_Tienda_Producto1_idx` (`Producto_idProducto`),
  CONSTRAINT `FK_tienda` FOREIGN KEY (`Producto_idProducto`) REFERENCES `producto` (`idProducto`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `tienda` */

/*Table structure for table `usuario` */

DROP TABLE IF EXISTS `usuario`;

CREATE TABLE `usuario` (
  `idUsuario` int(11) NOT NULL,
  `Nombres` varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `Apellidos` varchar(45) DEFAULT NULL,
  `Rol_idRol` int(11) DEFAULT NULL,
  `email` varchar(100) DEFAULT NULL,
  `password` varchar(60) DEFAULT NULL,
  `estado` int(1) NOT NULL DEFAULT '1',
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `remember_token` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`idUsuario`),
  KEY `fk_Usuario_Rol_idx` (`Rol_idRol`),
  CONSTRAINT `fk_Usuario_Rol` FOREIGN KEY (`Rol_idRol`) REFERENCES `rol` (`idRol`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `usuario` */

insert  into `usuario`(`idUsuario`,`Nombres`,`Apellidos`,`Rol_idRol`,`email`,`password`,`estado`,`updated_at`,`created_at`,`remember_token`) values (33333,'tatha','tatha',2,'tatha@gmail.com','$2y$10$Uafn4WP70QBlpUFMXws2quSZAddueEhGCfay3r1d.GA/mtgVQ1xGW',1,'2016-03-03 16:00:08','2016-02-12 21:06:40','v0T3OBLpl3kBrB8pr3HXLxMhVmlfed0xReE6JtbwoYFaglEPXZKiYCjZfzWk'),(123456,'tathamaria','nieto',1,'katerinn@hotmail.com','$2y$10$QnK0U28qvQ0ZynMSAObDuOkUZk0NHOuS3OYSTYnFS2KTd53nGd.d.',1,'2016-03-03 15:59:33','2015-09-11 15:35:26','VtQMyURy9vJ37Kmtj1Dreg8gwSwEzqu3ScZaagu9RU5rQpgo7LbzmszfpuQm'),(1070961211,'katerinne','nieto',0,'katerinn_152@hotmail.com','$2y$10$3hus53ej.HE9JzRWuYqTZuzAKU1wDPSTT96zbDItlFOImKdEHuBkC',1,'2016-03-03 16:03:07','2015-08-24 20:01:10','rhVcVrlKuHy51GSCpVTJCXTHv5QTfRd5mO09rHBHxnhTi0eShZXtaEYZdgZ9'),(1234567890,'Jean','Montilla',0,'carlos.montilla@ciscsas.com','$2y$10$0jQidBWY8mfq8KmnYcGxYesTdX5eJ9z5c/SvQ7RFoVbcPj5UOEuY6',1,'2016-03-03 14:01:23','2016-03-03 14:01:23',NULL);

/*Table structure for table `venta_factura` */

DROP TABLE IF EXISTS `venta_factura`;

CREATE TABLE `venta_factura` (
  `idVenta_factura` int(11) NOT NULL AUTO_INCREMENT,
  `Cantidad` int(11) DEFAULT NULL,
  `Valor_Total` int(11) DEFAULT NULL,
  `Cliente_Cedula` int(11) NOT NULL,
  `idProducto` varchar(50) CHARACTER SET latin1 NOT NULL,
  `Usuario_idUsuario` int(11) NOT NULL,
  `descuento_iddescuento` int(11) NOT NULL,
  `Id_Caja` int(10) DEFAULT NULL,
  `Fecha` date DEFAULT NULL,
  `Idventa` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idVenta_factura`),
  KEY `fk_venta_factura_Cliente1_idx` (`Cliente_Cedula`),
  KEY `fk_venta_factura_Producto1_idx` (`idProducto`),
  KEY `fk_venta_factura_Usuario1_idx` (`Usuario_idUsuario`),
  KEY `fk_venta_factura_descuento1_idx` (`descuento_iddescuento`),
  KEY `FK_venta_factura_caja` (`Id_Caja`),
  CONSTRAINT `FK_venta_factura` FOREIGN KEY (`idProducto`) REFERENCES `producto` (`idProducto`),
  CONSTRAINT `FK_venta_factura_caja` FOREIGN KEY (`Id_Caja`) REFERENCES `caja` (`IdCaja`),
  CONSTRAINT `fk_venta_factura_Cliente1` FOREIGN KEY (`Cliente_Cedula`) REFERENCES `cliente` (`Cedula`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_venta_factura_descuento1` FOREIGN KEY (`descuento_iddescuento`) REFERENCES `descuento` (`iddescuento`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_venta_factura_Usuario1` FOREIGN KEY (`Usuario_idUsuario`) REFERENCES `usuario` (`idUsuario`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `venta_factura` */

/*Table structure for table `ventasf` */

DROP TABLE IF EXISTS `ventasf`;

CREATE TABLE `ventasf` (
  `IdVenta_Fin` int(11) NOT NULL,
  `Valor_Total` int(11) DEFAULT NULL,
  `Cliente_Cedula` int(11) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `idFormaPago` int(11) DEFAULT NULL,
  PRIMARY KEY (`IdVenta_Fin`),
  KEY `FK_ventasf` (`Cliente_Cedula`),
  KEY `FK_ventaspago` (`idFormaPago`),
  CONSTRAINT `FK_ventasf` FOREIGN KEY (`Cliente_Cedula`) REFERENCES `cliente` (`Cedula`),
  CONSTRAINT `FK_ventaspago` FOREIGN KEY (`idFormaPago`) REFERENCES `formapago` (`idFormaPago`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

/*Data for the table `ventasf` */

insert  into `ventasf`(`IdVenta_Fin`,`Valor_Total`,`Cliente_Cedula`,`updated_at`,`created_at`,`idFormaPago`) values (1,5000,0,'2016-02-26 16:01:42','2016-02-26 16:01:42',NULL),(2,3200,0,'2016-02-26 16:02:00','2016-02-26 16:02:00',NULL),(3,5000,0,'2016-02-26 16:02:42','2016-02-26 16:02:42',NULL),(4,2400,0,'2016-02-26 16:12:38','2016-02-26 16:12:38',NULL),(5,2400,0,'2016-02-26 16:13:01','2016-02-26 16:13:01',NULL),(6,10000,0,'2016-02-26 16:13:32','2016-02-26 16:13:32',NULL),(7,44200,0,'2016-02-26 16:15:24','2016-02-26 16:15:24',NULL),(8,14400,0,'2016-02-26 19:56:21','2016-02-26 19:56:21',NULL),(9,1200,0,'2016-03-02 15:13:59','2016-03-02 15:13:59',2);

/*Table structure for table `volumen` */

DROP TABLE IF EXISTS `volumen`;

CREATE TABLE `volumen` (
  `idVolumen` int(11) NOT NULL AUTO_INCREMENT,
  `nombre` varchar(45) DEFAULT NULL,
  `Estado` int(1) DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idVolumen`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

/*Data for the table `volumen` */

insert  into `volumen`(`idVolumen`,`nombre`,`Estado`,`updated_at`,`created_at`) values (1,'500 ml',1,NULL,NULL),(2,'1000 ml',1,NULL,NULL),(3,'250grm',1,NULL,NULL),(4,'800 mls',2,'2016-02-05 15:30:19',NULL),(5,'500 Lts',1,'2016-02-05 15:21:29','2016-02-05 15:21:29');

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
