Tabla Mysql

TABLA: proveedores

CREATE TABLE `proveedores` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `identificacion` varchar(100) NOT NULL,
  `nombre` varchar(100) NULL,
  `direccion` varchar(50) NULL,
  `telefono` varchar(50) NULL,
  `cuil` varchar(50) NOT NULL,
  `codigo_banco` varchar(50) NULL,
  `cbu` varchar(50) NULL,
  `idposicioniva` int(11) NOT NULL default 0,
  `email` varchar(80) NULL,
  `actividad` varchar(80) NULL,
  `observaciones` varchar(200) NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `identificacion` (`identificacion`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

TABLA: posiciones_iva

Esta tabla puede ser un arreglo de valores fijos


CREATE TABLE `posiciones_iva` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `descripcion` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

TABLA: cuentas

CREATE TABLE `cuentas` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `codigo` varchar(8) NOT NULL,
  `descripcion` varchar(200) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

TABLA: compras

CREATE TABLE `compras` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idproveedor` int(11) NOT NULL,
  `idcuenta` int(11) NOT NULL,
  `fecha_factura` date NULL,
  `factura` varchar(20) NOT NULL,
  `descripcion` varchar(200) NOT NULL,
  `importe` float NOT NULL DEFAULT '0.0',
  `fecha_recepcion` date NULL,
  `completo` int(1) NOT NULL DEFAULT '0',
  `contabilizado` int(1) NOT NULL DEFAULT '0',
  `observaciones` varchar(200) NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

TABLA: pagos

CREATE TABLE `pagos` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idcompra` int(11) NOT NULL,
  `descripcion` varchar(200) NOT NULL,
  `fecha_pago` date NULL,
  `importe` float unsigned NOT NULL DEFAULT '0',
  `comprobante` varchar(80) NULL,
  `pagado` int(1) NOT NULL DEFAULT '0',
  `modo_pago` varchar(200) NULL, 
  `observaciones` varchar(200) NULL,
  PRIMARY KEY (`id`),
FOREIGN KEY (idcompra) REFERENCES compras(id) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;

Redmine Appliance - Powered by TurnKey Linux