-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version	5.7.18


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;

/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!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 schema factura
--

-- CREATE DATABASE IF NOT EXISTS factura;
-- USE factura;

--
-- Definition of table `cliente`
--

DROP TABLE IF EXISTS `cliente`;
CREATE TABLE `cliente` (
  `idcliente` int(11) NOT NULL AUTO_INCREMENT,
  `Nif` varchar(12) NOT NULL,
  `NombreRazonSocial` varchar(120) NOT NULL,
  `Domicilio` varchar(100) NOT NULL,
  `RestoDomicilio` varchar(100) NOT NULL,
  `Email` varchar(100) NOT NULL,
  PRIMARY KEY (`idcliente`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `cliente`
--

/*!40000 ALTER TABLE `cliente` DISABLE KEYS */;
INSERT INTO `cliente` (`idcliente`,`Nif`,`NombreRazonSocial`,`Domicilio`,`RestoDomicilio`,`Email`) VALUES 
 (1,'00000003M','Cliente 1','C/ del Pino Verde, 1 áéíúó ñ','2045 Madrid','info@fhumanes.com'),
 (2,'00000002E','Cliente 2','Avda. de Gracia, 23','08001 Barcelona','info@fhumanes.com');
/*!40000 ALTER TABLE `cliente` ENABLE KEYS */;


--
-- Definition of table `factura`
--

DROP TABLE IF EXISTS `factura`;
CREATE TABLE `factura` (
  `idfactura` int(11) NOT NULL AUTO_INCREMENT,
  `cliente_idcliente` int(11) NOT NULL,
  `Nif` varchar(12) NOT NULL,
  `NombreRazonSocial` varchar(120) NOT NULL,
  `Domicilio` varchar(100) NOT NULL,
  `RestoDomicilio` varchar(100) NOT NULL,
  `FechaFactura` date NOT NULL,
  `TotalFactura` decimal(12,2) DEFAULT '0.00',
  `Email` varchar(100) NOT NULL,
  PRIMARY KEY (`idfactura`),
  KEY `fk_factura_cliente_idx` (`cliente_idcliente`),
  CONSTRAINT `fk_factura_cliente` FOREIGN KEY (`cliente_idcliente`) REFERENCES `cliente` (`idcliente`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `factura`
--

/*!40000 ALTER TABLE `factura` DISABLE KEYS */;
INSERT INTO `factura` (`idfactura`,`cliente_idcliente`,`Nif`,`NombreRazonSocial`,`Domicilio`,`RestoDomicilio`,`FechaFactura`,`TotalFactura`,`Email`) VALUES 
 (1,1,'00000003M','Cliente 1','C/ del Pino Verde, 1 áéíúó ñ','2045 Madrid','2021-03-31','86.20','info@fhumanes.com'),
 (2,2,'00000002E','Cliente 2','Avda. de Gracia, 23','Cliente 2','2021-05-06','52498.67','info@fhumanes.com'),
 (6,1,'00000003M','Cliente 1','C/ del Pino Verde, 1 áéíúó ñ','2045 Madrid','2021-07-09','61.43','info@fhumanes.com'),
 (8,2,'00000002E','Cliente 2','Avda. de Gracia, 23','08001 Barcelona','2021-09-24','35.21','info@fhumanes.com'),
 (9,1,'00000003M','Cliente 1','C/ del Pino Verde, 1 áéíúó ñ','2045 Madrid','2021-10-08','52.10','info@fhumanes.com');
/*!40000 ALTER TABLE `factura` ENABLE KEYS */;


--
-- Definition of table `invoice_settings`
--

DROP TABLE IF EXISTS `invoice_settings`;
CREATE TABLE `invoice_settings` (
  `ID` int(11) NOT NULL AUTO_INCREMENT,
  `TYPE` int(11) DEFAULT '1',
  `NAME` mediumtext,
  `USERNAME` mediumtext,
  `COOKIE` varchar(500) DEFAULT NULL,
  `SEARCH` mediumtext,
  `TABLENAME` varchar(300) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `invoice_settings`
--

/*!40000 ALTER TABLE `invoice_settings` DISABLE KEYS */;
INSERT INTO `invoice_settings` (`ID`,`TYPE`,`NAME`,`USERNAME`,`COOKIE`,`SEARCH`,`TABLENAME`) VALUES 
 (1,2,NULL,NULL,'5dieboouy0s3054leclssq0z','{\"gridWidth\":362.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_details\":33.4,\"grid_headcell_field\":9.4,\"grid_headcell_field1\":121.4,\"grid_headcell_field2\":94.4}}','producto'),
 (2,2,NULL,NULL,'5dieboouy0s3054leclssq0z','{\"gridWidth\":484,\"thWidths\":{\"grid_headcell_field\":10,\"grid_headcell_field1\":38,\"grid_headcell_field2\":50,\"grid_headcell_field3\":62,\"grid_headcell_field4\":30,\"grid_headcell_field5\":47,\"grid_headcell_field6\":190}}','linea_factura'),
 (3,2,NULL,NULL,'5dieboouy0s3054leclssq0z','{\"gridWidth\":639.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_details\":33.4,\"grid_headcell_field\":9.4,\"grid_headcell_field1\":78.4,\"grid_headcell_field2\":84.4,\"grid_headcell_field3\":184.4,\"grid_headcell_field4\":125.4}}','cliente'),
 (4,2,NULL,NULL,'5dieboouy0s3054leclssq0z','{\"gridWidth\":688.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_field\":9.4,\"grid_headcell_field1\":84.4,\"grid_headcell_field2\":66.4,\"grid_headcell_field3\":59.4,\"grid_headcell_field4\":199.4,\"grid_headcell_field6\":67.4,\"grid_headcell_field7\":68.4}}','factura'),
 (5,2,NULL,NULL,'f1piy038w1nf3hhoh03a7nib','{\"gridWidth\":709.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_field\":9.4,\"grid_headcell_field1\":84.4,\"grid_headcell_field2\":66.4,\"grid_headcell_field3\":59.4,\"grid_headcell_field4\":220.4,\"grid_headcell_field6\":67.4,\"grid_headcell_field7\":68.4}}','factura'),
 (6,2,NULL,NULL,'6mh2spov5uk76mowqj8apd8n','{\"gridWidth\":326.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_field\":9.4,\"grid_headcell_field1\":135.4,\"grid_headcell_field2\":87.4}}','producto'),
 (7,2,NULL,NULL,'9mro60yo7k08rjybkgdo5taa','{\"gridWidth\":985.4,\"thWidths\":{\"grid_headcell_icons\":27.4,\"grid_headcell_checkbox\":13.399999999999999,\"grid_headcell_details\":58.4,\"grid_headcell_field\":43.4,\"grid_headcell_field1\":141.4,\"grid_headcell_field2\":149.4,\"grid_headcell_field3\":149.4,\"grid_headcell_field4\":149.4,\"grid_headcell_field5\":149.4}}','cliente'),
 (8,2,NULL,NULL,'lruelcso14t5hxxt6bri39ga','{\"gridWidth\":787.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_field\":56.4,\"grid_headcell_field1\":131.4,\"grid_headcell_field2\":84.4,\"grid_headcell_field3\":59.4,\"grid_headcell_field4\":170.4,\"grid_headcell_field6\":79.4,\"grid_headcell_field7\":72.4}}','factura'),
 (9,2,NULL,NULL,'x573w6d7et3ugsel7mwnl2fm','{\"gridWidth\":421.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":19.4,\"grid_headcell_field\":105.4,\"grid_headcell_field1\":104.4,\"grid_headcell_field2\":118.4}}','producto'),
 (10,2,NULL,NULL,'x573w6d7et3ugsel7mwnl2fm','{\"gridWidth\":691.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":20.4,\"grid_headcell_field\":9.4,\"grid_headcell_field1\":84.4,\"grid_headcell_field2\":66.4,\"grid_headcell_field3\":59.4,\"grid_headcell_field4\":202.4,\"grid_headcell_field6\":67.4,\"grid_headcell_field7\":68.4}}','factura'),
 (11,2,NULL,NULL,'23nnlmxpyk5wphhrss7hcqsh','{\"gridWidth\":744.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":18.4,\"grid_headcell_field\":9.399999999999999,\"grid_headcell_field1\":84.4,\"grid_headcell_field2\":66.4,\"grid_headcell_field3\":97.4,\"grid_headcell_field4\":190.4,\"grid_headcell_field6\":72.4,\"grid_headcell_field7\":75.4}}','factura'),
 (12,2,NULL,NULL,'1l4closjsdbs360glww626rp','{\"gridWidth\":726.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":18.4,\"grid_headcell_field\":9.399999999999999,\"grid_headcell_field1\":84.4,\"grid_headcell_field2\":66.4,\"grid_headcell_field3\":59.4,\"grid_headcell_field4\":221.4,\"grid_headcell_field6\":67.4,\"grid_headcell_field7\":68.4}}','factura'),
 (13,2,NULL,NULL,'1l4closjsdbs360glww626rp','{\"gridWidth\":397.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":18.4,\"grid_headcell_field\":9.399999999999999,\"grid_headcell_field1\":181.4,\"grid_headcell_field2\":28.4,\"grid_headcell_field3\":64.4}}','producto'),
 (14,2,NULL,NULL,'1l4closjsdbs360glww626rp','{\"gridWidth\":861.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":18.4,\"grid_headcell_details\":33.4,\"grid_headcell_field\":9.399999999999999,\"grid_headcell_field1\":59.4,\"grid_headcell_field2\":84.4,\"grid_headcell_field3\":221.4,\"grid_headcell_field4\":114.4,\"grid_headcell_field5\":189.4}}','cliente'),
 (15,2,NULL,NULL,'b35r3zyec3d54ndqaa18wwvl','{\"gridWidth\":509.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":18.4,\"grid_headcell_field\":9.399999999999999,\"grid_headcell_field1\":208.4,\"grid_headcell_field2\":189.4}}','producto'),
 (16,2,NULL,NULL,'0q8t5l4706nljzlhww2q8kt7','{\"gridWidth\":715.4,\"thWidths\":{\"grid_headcell_icons\":26.4,\"grid_headcell_checkbox\":18.4,\"grid_headcell_field\":9.399999999999999,\"grid_headcell_field1\":84.4,\"grid_headcell_field2\":66.4,\"grid_headcell_field3\":59.4,\"grid_headcell_field4\":200.4,\"grid_headcell_field6\":67.4,\"grid_headcell_field7\":79.4}}','factura');
/*!40000 ALTER TABLE `invoice_settings` ENABLE KEYS */;


--
-- Definition of table `linea_factura`
--

DROP TABLE IF EXISTS `linea_factura`;
CREATE TABLE `linea_factura` (
  `idlinea_factura` int(11) NOT NULL AUTO_INCREMENT,
  `factura_idfactura` int(11) NOT NULL,
  `producto_idproducto` int(11) NOT NULL,
  `Nombre` varchar(50) NOT NULL,
  `Precio` decimal(12,2) NOT NULL,
  `Cantidad` int(11) NOT NULL,
  `Valor` decimal(12,2) NOT NULL,
  PRIMARY KEY (`idlinea_factura`),
  KEY `fk_linea_factura_factura1_idx` (`factura_idfactura`),
  KEY `fk_linea_factura_producto1_idx` (`producto_idproducto`),
  CONSTRAINT `fk_linea_factura_factura1` FOREIGN KEY (`factura_idfactura`) REFERENCES `factura` (`idfactura`) ON DELETE CASCADE ON UPDATE NO ACTION,
  CONSTRAINT `fk_linea_factura_producto1` FOREIGN KEY (`producto_idproducto`) REFERENCES `producto` (`idproducto`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `linea_factura`
--

/*!40000 ALTER TABLE `linea_factura` DISABLE KEYS */;
INSERT INTO `linea_factura` (`idlinea_factura`,`factura_idfactura`,`producto_idproducto`,`Nombre`,`Precio`,`Cantidad`,`Valor`) VALUES 
 (1,1,3,'Artículo 3\r\nSegunda línea','3.00',20,'60.00'),
 (2,1,2,'Artículo 2','1.25',10,'12.50'),
 (3,1,5,'Artículo 5','1.00',5,'5.00'),
 (4,1,4,'Artículo 4','0.58',15,'8.70'),
 (6,2,3,'Artículo 3','3.00',10,'30.00'),
 (7,2,2,'Artículo 2','1.25',10,'12.50'),
 (13,2,1,'Artículo 1','5.21',10,'52.10'),
 (16,6,1,'Artículo 1','5.21',1,'8.75'),
 (17,6,1,'Artículo 1','5.21',10,'52.10'),
 (18,2,4,'Artículo 4','0.58',10,'5.80'),
 (19,8,1,'Artículo 1','5.21',1,'5.21'),
 (20,8,3,'Artículo 3','3.00',10,'30.00'),
 (21,9,1,'Artículo 1','5.21',10,'52.10'),
 (22,6,4,'Artículo 4','0.58',1,'0.58'),
 (23,2,1,'Artículo 1','5.21',10000,'52100.00'),
 (24,2,2,'Artículo 2','1.25',10,'12.50'),
 (25,2,3,'Artículo 3\r\nSegunda línea','3.00',15,'45.00'),
 (26,2,4,'Artículo 4','0.58',5,'2.90'),
 (27,2,5,'Artículo 5','1.00',10,'10.00'),
 (28,2,1,'Artículo 1','5.21',15,'78.15'),
 (29,2,2,'Artículo 2','1.25',10,'12.50'),
 (30,2,3,'Artículo 3\r\nSegunda línea','3.00',5,'15.00'),
 (31,2,5,'Artículo 5','1.00',1,'1.00'),
 (32,2,1,'Artículo 1','5.21',10,'52.10'),
 (33,2,2,'Artículo 2','1.25',10,'12.50'),
 (34,2,4,'Artículo 4','0.58',1,'0.58'),
 (35,2,3,'Artículo 3\r\nSegunda línea','3.00',15,'45.00'),
 (36,2,1,'Artículo 1','5.21',1,'5.21'),
 (37,2,2,'Artículo 2','1.25',1,'1.25'),
 (38,2,4,'Artículo 4','0.58',1,'0.58'),
 (39,2,3,'Artículo 3\r\nSegunda línea','3.00',1,'3.00'),
 (40,2,5,'Artículo 5','1.00',1,'1.00');
/*!40000 ALTER TABLE `linea_factura` ENABLE KEYS */;


--
-- Definition of table `producto`
--

DROP TABLE IF EXISTS `producto`;
CREATE TABLE `producto` (
  `idproducto` int(11) NOT NULL AUTO_INCREMENT,
  `Nombre` varchar(50) NOT NULL,
  `Precio` decimal(12,2) NOT NULL,
  `Existencias` decimal(12,2) NOT NULL DEFAULT '0.00',
  PRIMARY KEY (`idproducto`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

--
-- Dumping data for table `producto`
--

/*!40000 ALTER TABLE `producto` DISABLE KEYS */;
INSERT INTO `producto` (`idproducto`,`Nombre`,`Precio`,`Existencias`) VALUES 
 (1,'Artículo 1','5.21','10.00'),
 (2,'Artículo 2','1.25','5.00'),
 (3,'Artículo 3\r\nSegunda línea','3.00','0.00'),
 (4,'Artículo 4','0.58','0.00'),
 (5,'Artículo 5','1.00','0.00');
/*!40000 ALTER TABLE `producto` ENABLE KEYS */;




/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
