-- MySQL dump 10.13  Distrib 5.7.33, for Linux (x86_64)
--
-- Host: localhost    Database: gold
-- ------------------------------------------------------
-- Server version	5.7.33-0ubuntu0.18.04.1

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!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' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `master_cliente`
--

DROP TABLE IF EXISTS `master_cliente`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `master_cliente` (
  `codi_clie` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `codi_depe` int(10) unsigned NOT NULL,
  `nomb_clie` char(50) NOT NULL,
  `codi_esta` char(20) NOT NULL,
  `dire_fisc` char(250) NOT NULL,
  `nume_drif` char(15) NOT NULL,
  `vendedor_id` int(10) unsigned NOT NULL,
  `tarifa_id` int(10) unsigned NOT NULL,
  `ciclo_id` int(10) unsigned NOT NULL,
  `nume_dnit` char(15) DEFAULT NULL,
  `pers_cona` char(50) NOT NULL,
  `tele_cona` char(50) NOT NULL,
  `pers_conb` char(50) DEFAULT NULL,
  `tele_conb` char(15) DEFAULT NULL,
  `dire_mail` char(50) DEFAULT NULL,
  `dire_reco` char(250) DEFAULT NULL,
  `hora_lune` char(5) DEFAULT NULL,
  `hora_mart` char(5) DEFAULT NULL,
  `hora_mier` char(5) DEFAULT NULL,
  `hora_juev` char(5) DEFAULT NULL,
  `hora_vier` char(5) DEFAULT NULL,
  `hora_saba` char(5) DEFAULT NULL,
  `codi_stat` int(10) unsigned NOT NULL,
  `codi_sino` int(10) unsigned NOT NULL,
  `text_obse` char(250) DEFAULT NULL,
  `nume_dfax` varchar(50) DEFAULT NULL,
  `codigo_interno` varchar(50) NOT NULL,
  `tipo_cliente` int(10) unsigned NOT NULL,
  `ruta_recolecta` int(10) unsigned DEFAULT NULL,
  `ruta_entrega` int(10) unsigned DEFAULT NULL,
  `porcentaje_dsctoincr` decimal(5,2) NOT NULL DEFAULT '0.00',
  `hora_cierre` char(5) DEFAULT NULL,
  `status_credito_id` int(10) unsigned NOT NULL,
  `dscto_por_volumen` decimal(5,2) DEFAULT '0.00',
  `volumen_para_dscto` int(11) DEFAULT NULL,
  `dscto_por_peso` decimal(5,2) DEFAULT '0.00',
  `peso_para_dscto` decimal(10,2) DEFAULT NULL,
  `descuento_caduca_el` date DEFAULT NULL,
  `porcentaje_seguro` decimal(5,2) DEFAULT NULL,
  `dir_entrega_factura` varchar(250) NOT NULL,
  `clave_servicios_web` varchar(45) DEFAULT NULL,
  `caducidad_de_guias` int(11) DEFAULT NULL,
  `mostrar_guia_externa` int(10) unsigned DEFAULT NULL,
  `carga_masiva` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `cm_guias_yamaguchi` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `guias_yamaguchi_por_carga` int(11) DEFAULT '0',
  `guias_yamaguchi_por_dia` int(11) DEFAULT '0',
  `pago_ppd` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `pago_crd` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `pago_cod` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `cm_destinatario_frecuente` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `clientes_por_carga` int(11) DEFAULT '0',
  `clientes_por_dia` int(11) DEFAULT '0',
  `usuario_api` varchar(8) DEFAULT NULL,
  `password_api` varchar(100) DEFAULT NULL,
  `maneja_api` tinyint(1) DEFAULT '0',
  `token_api` varchar(25) DEFAULT NULL,
  `guia_retorno` tinyint(1) DEFAULT '1',
  `proceso_api` int(10) unsigned DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  `motivo_eliminacion_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`codi_clie`),
  UNIQUE KEY `codigo_interno` (`codigo_interno`),
  UNIQUE KEY `mastclie_procapix_idxu` (`proceso_api`),
  KEY `master_cliente_FKIndex1` (`codi_esta`),
  KEY `master_cliente_FKIndex2` (`codi_sino`),
  KEY `master_cliente_FKIndex3` (`codi_stat`),
  KEY `master_cliente_FKIndex4` (`tarifa_id`),
  KEY `codi_depe` (`codi_depe`),
  KEY `nomb_clie` (`nomb_clie`),
  KEY `tipo_cliente_type_id` (`tipo_cliente`),
  KEY `vendedor_id` (`vendedor_id`),
  KEY `ruta_recolecta` (`ruta_recolecta`),
  KEY `idx_rutaentr` (`ruta_entrega`),
  KEY `status_credito_id` (`status_credito_id`),
  KEY `ciclo_id` (`ciclo_id`),
  KEY `guia_externa_idx` (`mostrar_guia_externa`),
  KEY `clie_deleted_idx` (`deleted_at`),
  KEY `motielim_idx` (`motivo_eliminacion_id`),
  CONSTRAINT `master_cliente_guia_externa_fk` FOREIGN KEY (`mostrar_guia_externa`) REFERENCES `sino_type` (`codi_sino`),
  CONSTRAINT `master_cliente_ibfk_65` FOREIGN KEY (`codi_depe`) REFERENCES `master_cliente` (`codi_clie`),
  CONSTRAINT `master_cliente_ibfk_66` FOREIGN KEY (`codi_esta`) REFERENCES `estacion` (`codi_esta`),
  CONSTRAINT `master_cliente_ibfk_67` FOREIGN KEY (`vendedor_id`) REFERENCES `fac_vendedor` (`id`),
  CONSTRAINT `master_cliente_ibfk_68` FOREIGN KEY (`tarifa_id`) REFERENCES `fac_tarifa` (`id`),
  CONSTRAINT `master_cliente_ibfk_69` FOREIGN KEY (`ciclo_id`) REFERENCES `ciclo_fact_type` (`id`),
  CONSTRAINT `master_cliente_ibfk_70` FOREIGN KEY (`codi_stat`) REFERENCES `status_type` (`codi_stat`),
  CONSTRAINT `master_cliente_ibfk_71` FOREIGN KEY (`codi_sino`) REFERENCES `sino_type` (`codi_sino`),
  CONSTRAINT `master_cliente_ibfk_72` FOREIGN KEY (`tipo_cliente`) REFERENCES `tipo_cliente_type` (`id`),
  CONSTRAINT `master_cliente_ibfk_73` FOREIGN KEY (`ruta_recolecta`) REFERENCES `sde_operacion` (`codi_oper`),
  CONSTRAINT `master_cliente_ibfk_74` FOREIGN KEY (`ruta_entrega`) REFERENCES `sde_operacion` (`codi_oper`),
  CONSTRAINT `master_cliente_ibfk_75` FOREIGN KEY (`status_credito_id`) REFERENCES `status_credito_type` (`id`),
  CONSTRAINT `motielim_fk` FOREIGN KEY (`motivo_eliminacion_id`) REFERENCES `motivo_eliminacion` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=1693 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2021-02-15 20:43:26
