
CREATE DATABASE `clvgb`;

use clvgb; 

CREATE TABLE `usuario` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `usuario` varchar(20) NOT NULL,
  `clave` varchar(20) NOT NULL,
  `status` tinyint(20) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE `comprobante` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `cuenta` varchar(8) NOT NULL,
  `nombre` varchar(60) NOT NULL,
  `idfacturacion` int(10) NOT NULL,
  `cuota` varchar(7) NOT NULL,
  `servicio` varchar(40) NOT NULL,
  `numero` varchar(20) NOT NULL,
  `vencimiento` date NOT NULL,
  `total` float(15,2) NOT NULL,
  `cobrado` float(15,2) NOT NULL,
  `saldo` float(15,2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

CREATE TABLE `pago` (
  `id` int(10) NOT NULL AUTO_INCREMENT,
  `idfacturacion` int(10) NOT NULL,
  `fecha` date NOT NULL,
  `cobrado` float(15,2) NOT NULL,
  `idreferenciaoperacion` varchar(40) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

