--
-- Host: mysql    Database: db27-36680092-7
-- ------------------------------------------------------


--
-- Table structure for table `activities`
--

CREATE TABLE `activities` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `activities`
--

INSERT INTO `activities` VALUES (1,NULL,NULL,'Actividad 1'),(2,NULL,NULL,'Actividad 2');

--
-- Table structure for table `claves`
--

CREATE TABLE `claves` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `claves`
--

INSERT INTO `claves` VALUES (1,'Clave Fiscal',NULL,NULL),(2,'Clave Ciudad',NULL,NULL),(3,'Clave ARBA',NULL,NULL),(4,'Clave ANSES',NULL,NULL),(5,'Catedral',NULL,NULL),(6,'CEMIBA',NULL,NULL),(7,'COMPRA ARG',NULL,NULL),(8,'Consejo Ciencias Economicas',NULL,NULL),(9,'Correo',NULL,NULL),(10,'CUR',NULL,NULL),(11,'Firma Digital',NULL,NULL),(12,'Interbanking',NULL,NULL),(13,'Banco Citibank',NULL,NULL),(14,'Banco Ciudad',NULL,NULL),(15,'Banco Frances',NULL,NULL),(16,'Banco Galicia',NULL,NULL),(17,'Banco HSBC',NULL,NULL),(18,'Banco Itau',NULL,NULL),(19,'Banco Nacion',NULL,NULL),(20,'Banco Macro',NULL,NULL),(21,'Banco Patagonia',NULL,NULL),(22,'Banco Provincia',NULL,NULL),(23,'Banco Santander',NULL,NULL),(24,'Banco Supervielle',NULL,NULL),(25,'Seguridad e Higiene',NULL,NULL),(26,'Sindicato - ANSES',NULL,NULL),(27,'Sindicato - AOT',NULL,NULL),(28,'Sindicato - ATSA',NULL,NULL),(29,'Sindicato - Camioneros',NULL,NULL),(30,'Sindicato - Guinchero',NULL,NULL),(31,'Sindicato - IERIC',NULL,NULL),(32,'Sindicato - La Estrella',NULL,NULL),(33,'Sindicato - Nemesis',NULL,NULL),(34,'Sindicato - Pasta',NULL,NULL),(35,'Sindicato - SEC',NULL,NULL),(36,'Sindicato - SICOP',NULL,NULL),(37,'Sindicato - SOCAYA',NULL,NULL),(38,'Sindicato - UTHGRA',NULL,NULL),(39,'Otra',NULL,NULL);

--
-- Table structure for table `claves_details`
--

CREATE TABLE `claves_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `clave` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `valor` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `comentario` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `clave_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `status` int(10) unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `claves_details_clave_id_foreign` (`clave_id`),
  KEY `claves_details_person_id_foreign` (`person_id`),
  CONSTRAINT `claves_details_clave_id_foreign` FOREIGN KEY (`clave_id`) REFERENCES `claves` (`id`),
  CONSTRAINT `claves_details_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `claves_details`
--


--
-- Table structure for table `claves_mails`
--

CREATE TABLE `claves_mails` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class` int(10) unsigned NOT NULL,
  `class_description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `claves_mails`
--

INSERT INTO `claves_mails` VALUES (1,'Listado de Claves',1,'Claves','claves_mails/claves_listado',NULL,NULL),(3,'Listado de Mails',2,'Mails','claves_mails/mails_listado',NULL,NULL);

--
-- Table structure for table `control_general`
--

CREATE TABLE `control_general` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class` int(10) unsigned NOT NULL,
  `class_description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `control_general_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `control_general`
--

INSERT INTO `control_general` VALUES (1,'Ingresos - Egresos - Resultado',1,'Proyeccion Ganancias','control_general/proyecGanancias',NULL,NULL),(2,'IVA',2,'IVA','control_general/iva',NULL,NULL),(3,'IIBB',3,'IIBB','control_general/iibb',NULL,NULL);

--
-- Table structure for table `data_types`
--

CREATE TABLE `data_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class` int(10) unsigned NOT NULL,
  `class_description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `data_types_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `data_types`
--

INSERT INTO `data_types` VALUES (1,'Comprobantes XLS',1,'Importación','XLS','data/imports/receipts/xls',NULL,NULL),(2,'CITI-Ventas',1,'Importación','TXT','data/imports/receipts/CitiVentas',NULL,NULL),(3,'CITI Compras',2,'Exportación','TXT','data/exports/receipts/citi',NULL,NULL),(4,'CITI Ventas',2,'Exportación','TXT','data/exports/receipts/CitiVentasExport',NULL,NULL),(5,'Convenio Multilateral',2,'Exportación','TXT','data/exports/receipts/convenio',NULL,NULL),(6,'SICOL',2,'Exportación','TXT','data/exports/receipts/sicol',NULL,NULL);

--
-- Table structure for table `file_upload_details`
--

CREATE TABLE `file_upload_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `file_upload_id` int(10) unsigned NOT NULL,
  `detail` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `file_upload_details_file_upload_id_foreign` (`file_upload_id`),
  CONSTRAINT `file_upload_details_file_upload_id_foreign` FOREIGN KEY (`file_upload_id`) REFERENCES `file_uploads` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `file_upload_details`
--


--
-- Table structure for table `file_uploads`
--

CREATE TABLE `file_uploads` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `data_type_id` int(10) unsigned NOT NULL,
  `user_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `period_id` int(10) unsigned DEFAULT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `status` int(10) unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `file_uploads_data_type_id_foreign` (`data_type_id`),
  KEY `file_uploads_user_id_foreign` (`user_id`),
  KEY `file_uploads_person_id_foreign` (`person_id`),
  KEY `file_uploads_period_id_foreign` (`period_id`),
  CONSTRAINT `file_uploads_data_type_id_foreign` FOREIGN KEY (`data_type_id`) REFERENCES `data_types` (`id`),
  CONSTRAINT `file_uploads_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `file_uploads_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `file_uploads_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `tUsers` (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `file_uploads`
--


--
-- Table structure for table `iibb_perceptions`
--

CREATE TABLE `iibb_perceptions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `iibb_perceptions`
--

INSERT INTO `iibb_perceptions` VALUES (1,NULL,NULL,'IIBB CABA','IIBBCABA'),(2,NULL,NULL,'IIBB Bs. As.','IIBBBSAS'),(3,NULL,NULL,'Percepcion IIBB Tucuman','IIBBTucuman'),(4,NULL,NULL,'Perc IIBB Misiones','IIBBMisiones'),(5,NULL,NULL,'Perc IIBB Cordoba','IIBBCba'),(6,NULL,NULL,'Pec IIBB La Pampa','IIBB La Pampa'),(7,NULL,NULL,'Perc IIBB Rio Negro','IIBB Rio Negro'),(8,NULL,NULL,'Perc IIBB Corrientes','IIIBB Corrientes'),(9,NULL,NULL,'Perc IIBB Santiago del Estero','IIBBSantiago');

--
-- Table structure for table `iva_conditions`
--

CREATE TABLE `iva_conditions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `iva_conditions_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `iva_conditions`
--

INSERT INTO `iva_conditions` VALUES (1,'Monotributo',NULL,NULL),(2,'Responsable Inscripto',NULL,NULL),(3,'Otro',NULL,NULL);

--
-- Table structure for table `liquidators`
--

CREATE TABLE `liquidators` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `liquidators_name_unique` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `liquidators`
--


--
-- Table structure for table `log_debug`
--

CREATE TABLE `log_debug` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `function_name` varchar(255) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `date` datetime DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `log_debug`
--


--
-- Table structure for table `mails`
--

CREATE TABLE `mails` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `mails`
--

INSERT INTO `mails` VALUES (1,'Principal',NULL,NULL),(2,'Segundo',NULL,NULL),(3,'Tercero',NULL,NULL),(4,'Cuarto',NULL,NULL),(5,'Quinto',NULL,NULL),(6,'Sexto',NULL,NULL),(7,'Septimo',NULL,NULL),(8,'Octavo',NULL,NULL),(9,'Noveno',NULL,NULL),(10,'Decimo',NULL,NULL),(11,'Otro',NULL,NULL);

--
-- Table structure for table `mails_details`
--

CREATE TABLE `mails_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `mail` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `telefono` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `comentario` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mail_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `status` int(10) unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `mails_details_mail_id_foreign` (`mail_id`),
  KEY `mails_details_person_id_foreign` (`person_id`),
  CONSTRAINT `mails_details_mail_id_foreign` FOREIGN KEY (`mail_id`) REFERENCES `mails` (`id`),
  CONSTRAINT `mails_details_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `mails_details`
--


--
-- Table structure for table `migrations`
--

CREATE TABLE `migrations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `migrations`
--

INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1),(2,'2014_10_12_100000_create_password_resets_table',1),(3,'2017_09_15_000000_CreateCountrysTable',1),(4,'2017_09_15_100000_CreateStatesTable',1),(5,'2017_09_15_221521_create_modules_table',1),(6,'2017_09_15_224048_create_usermodules_table',1),(7,'2017_12_04_172644_CreateTableActivitites',1),(8,'2017_12_04_181801_CreateTableReceiptTypes',1),(9,'2017_12_04_182416_CreateTableRetentionType',1),(10,'2017_12_04_190828_CreateTableTypes',1),(11,'2017_12_04_191413_CreateTableRetentions',1),(12,'2017_12_04_191537_CreateTableIIBBRetentions',1),(13,'2017_12_04_192126_CreateTableSystemTaxes',1),(14,'2017_12_04_202132_CreateTableZones',1),(15,'2017_12_04_210000_CreateTableOtherTaxes',1),(16,'2017_12_07_200000_CreateTableTaxAccounts',1),(17,'2017_12_07_202200_CreateTableStatus',1),(18,'2017_12_07_204438_CreateTablePersons',1),(19,'2017_12_07_204500_CreateTablePersonZones',1),(20,'2017_12_07_205029_CreateTablePeriods',1),(21,'2017_12_07_205700_CreateTableReceipts',1),(22,'2017_12_07_205819_CreateTableReceiptTaxes',1),(23,'2017_12_16_025744_CreateTableUserPersons',1),(24,'2018_02_01_205100_CreateTablePeriodLiquidation',1),(25,'2018_02_02_150420_ModPeriodLiq_CreateDetail',1),(26,'2018_02_06_162435_CreateTablePersonConfigurations',1),(27,'2018_03_07_162435_CreateTablesLiqIVA',1),(28,'2018_03_18_000010_IVAGroups',1),(29,'2018_03_20_000010_InsertsRT',1),(30,'2018_03_21_000010_UpdateRT',1),(31,'2018_03_26_232558_InsertsModules',1),(32,'2018_03_28_151014_CreateTablesBusinessModule',1),(33,'2018_04_11_124200_ModBusinessModule',1),(34,'2018_04_17_153900_ModBusinessModule2',1),(35,'2018_04_20_115000_TableBaseMonthsForPeriods',1),(36,'2018_04_24_155000_ModAddUsersBusiness',1),(37,'2018_04_27_162700_BusinessFieldsEmpresaMadre',1),(38,'2018_05_04_144100_BusinessViewValidateSave',1),(39,'2018_05_18_110400_FileUplodsBase_XLS',1),(40,'2018_05_30_183700_alter__system_taxes_to_system_taxese',1),(41,'2018_05_30_220512_alter__system_taxes__add__status',1),(42,'2018_05_31_221821_update_data_types',1),(43,'2018_06_03_1341_ProcedureAssingPeriodsTo',1),(44,'2018_06_04_001420_create_reportes_table',1),(45,'2018_06_04_2159_ProcedureReportesComprobantes',1),(46,'2018_06_05_104818_update_receipt_types__column__code',1),(47,'2018_06_05_171044_update__system__taxes__gravado0',1),(48,'2018_06_06_010459_create_procedure_creacion_empresa_usuario',1),(49,'2018_06_06_110700_UpdateReportesRutas',1),(50,'2018_06_07_011985_create_procedure_eliminasion_masiva_comprobantes',1),(51,'2018_06_09_141500_UpdateReportesRutasTableroAndModules',1),(52,'2018_06_10_203200_CreateViewReceiptsReports',1),(53,'2018_06_11_114580_UpdateTypesEliminacionMasiva',1),(54,'2018_06_19_110400_TableControlGeneral',1),(55,'2018_06_19_158985_InsertsModules_Control_General',1),(56,'2018_06_22_203200_CreateViewLiquidacionesIVA',1),(57,'2018_06_27_204436_CreateTableMails',1),(58,'2018_06_27_204437_CreateTableMailsDetails',1),(59,'2018_06_27_204438_CreateTableClaves',1),(60,'2018_06_27_204439_CreateTableClavesDetails',1),(61,'2018_06_27_204440_alter_Table_Person_Configuration',1),(62,'2018_06_29_114600_CreateView_Proyeccion_Ganancias',1),(63,'2018_07_01_110400_TableClavesYMails',1),(64,'2018_07_01_110401_InsertsModules_ClavesYMails',1),(65,'2018_07_07_011985_alter_procedure_eliminasion_masiva_comprobantes',1),(66,'2018_07_08_110400_UpdateTableClavesYMails',1),(67,'2018_07_11_010459_alter_procedure_creacion_empresa_usuario',1),(68,'2018_07_11_011985_alter_procedure_eliminasion_masiva_comprobantes2',1);

--
-- Table structure for table `months`
--

CREATE TABLE `months` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `month` int(11) DEFAULT NULL,
  `date_to` varchar(6) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `months`
--

INSERT INTO `months` VALUES (1,1,'-01-31'),(2,2,'-02-28'),(3,3,'-03-31'),(4,4,'-04-30'),(5,5,'-05-31'),(6,6,'-06-30'),(7,7,'-07-31'),(8,8,'-08-31'),(9,9,'-09-30'),(10,10,'-10-31'),(11,11,'-11-30'),(12,12,'-12-31');

--
-- Table structure for table `other_taxes`
--

CREATE TABLE `other_taxes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `section` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `percent_tax` decimal(16,2) NOT NULL DEFAULT '0.00',
  `zone_id` int(10) unsigned DEFAULT NULL,
  `aliases` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `section_name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1030 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `other_taxes`
--

INSERT INTO `other_taxes` VALUES (1000,NULL,NULL,'Perc IVA -RG3337','iva',0.00,NULL,NULL,'IVA'),(1001,NULL,NULL,'Imps. Internos','gas',0.00,NULL,NULL,'Imp. Combustibles'),(1002,NULL,NULL,'Imp. Gasoil','gas',0.00,NULL,NULL,'Imp. Combustibles'),(1003,NULL,NULL,'Imp. Hídricos','gas',0.00,NULL,NULL,'Imp. Combustibles'),(1004,NULL,NULL,'ITC','gas',0.00,NULL,NULL,'Imp. Combustibles'),(1005,NULL,NULL,'Perc IIBB  Buenos Aires','iibb',0.00,23,NULL,'IIBB'),(1006,NULL,NULL,'Perc IIBB  Capital Federal','iibb',0.00,22,NULL,'IIBB'),(1007,NULL,NULL,'Perc IIBB  Catamarca','iibb',0.00,24,NULL,'IIBB'),(1008,NULL,NULL,'Perc IIBB  Chaco','iibb',0.00,3,NULL,'IIBB'),(1009,NULL,NULL,'Perc IIBB  Chubut','iibb',0.00,4,NULL,'IIBB'),(1010,NULL,NULL,'Perc IIBB  Córdoba','iibb',0.00,1,NULL,'IIBB'),(1011,NULL,NULL,'Perc IIBB  Corrientes','iibb',0.00,2,NULL,'IIBB'),(1012,NULL,NULL,'Perc IIBB  Entre Ríos','iibb',0.00,5,NULL,'IIBB'),(1013,NULL,NULL,'Perc IIBB  Formosa','iibb',0.00,6,NULL,'IIBB'),(1014,NULL,NULL,'Perc IIBB  Jujuy','iibb',0.00,7,NULL,'IIBB'),(1015,NULL,NULL,'Perc IIBB  La Pampa','iibb',0.00,8,NULL,'IIBB'),(1016,NULL,NULL,'Perc IIBB  La Rioja','iibb',0.00,9,NULL,'IIBB'),(1017,NULL,NULL,'Perc IIBB  Mendoza','iibb',0.00,10,NULL,'IIBB'),(1018,NULL,NULL,'Perc IIBB  Misiones','iibb',0.00,11,NULL,'IIBB'),(1019,NULL,NULL,'Perc IIBB  Neuquén','iibb',0.00,12,NULL,'IIBB'),(1020,NULL,NULL,'Perc IIBB  Pascua Lama','iibb',0.00,25,NULL,'IIBB'),(1021,NULL,NULL,'Perc IIBB  Río Negro','iibb',0.00,13,NULL,'IIBB'),(1022,NULL,NULL,'Perc IIBB  Salta','iibb',0.00,14,NULL,'IIBB'),(1023,NULL,NULL,'Perc IIBB  San Juan','iibb',0.00,15,NULL,'IIBB'),(1024,NULL,NULL,'Perc IIBB  San Luis','iibb',0.00,16,NULL,'IIBB'),(1025,NULL,NULL,'Perc IIBB  Santa Cruz','iibb',0.00,17,NULL,'IIBB'),(1026,NULL,NULL,'Perc IIBB  Santa Fe','iibb',0.00,18,NULL,'IIBB'),(1027,NULL,NULL,'Perc IIBB  Santiago del Estero','iibb',0.00,19,NULL,'IIBB'),(1028,NULL,NULL,'Perc IIBB  Tierra del Fuego','iibb',0.00,20,NULL,'IIBB'),(1029,NULL,NULL,'Perc IIBB  Tucuman','iibb',0.00,21,NULL,'IIBB');

--
-- Table structure for table `password_resets`
--

CREATE TABLE `password_resets` (
  `email` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `token` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  UNIQUE KEY `password_resets_email_token_unique` (`email`,`token`),
  KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `password_resets`
--


--
-- Table structure for table `pay_methods`
--

CREATE TABLE `pay_methods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `pay_methods_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `pay_methods`
--

INSERT INTO `pay_methods` VALUES (1,'INTERBANKING',NULL,NULL),(2,'VEP PAGOMISCUENTAS',NULL,NULL),(3,'VEP REDLINK',NULL,NULL),(4,'FORMULARIO',NULL,NULL);

--
-- Table structure for table `period_liquidation_details`
--

CREATE TABLE `period_liquidation_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `period_liquidation_id` int(10) unsigned NOT NULL,
  `period_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `zone_id` int(10) unsigned NOT NULL,
  `coef` decimal(16,2) NOT NULL DEFAULT '0.00',
  `aliquot` decimal(16,2) NOT NULL DEFAULT '0.00',
  `base_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `tax_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `previous_period_balance` decimal(16,2) NOT NULL DEFAULT '0.00',
  `sircreb_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `perception_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `retention_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `positive_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `negative_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `balance` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `period_liquidation_details_period_liquidation_id_foreign` (`period_liquidation_id`),
  KEY `period_liquidation_details_period_id_foreign` (`period_id`),
  KEY `period_liquidation_details_person_id_foreign` (`person_id`),
  KEY `period_liquidation_details_zone_id_foreign` (`zone_id`),
  CONSTRAINT `period_liquidation_details_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `period_liquidation_details_period_liquidation_id_foreign` FOREIGN KEY (`period_liquidation_id`) REFERENCES `period_liquidations` (`id`),
  CONSTRAINT `period_liquidation_details_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `period_liquidation_details_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `period_liquidation_details`
--


--
-- Table structure for table `period_liquidation_iva`
--

CREATE TABLE `period_liquidation_iva` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `period_liquidation_id` int(10) unsigned NOT NULL,
  `period_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `total_debit` decimal(16,2) NOT NULL DEFAULT '0.00',
  `total_credit` decimal(16,2) NOT NULL DEFAULT '0.00',
  `previous_technical` decimal(16,2) NOT NULL DEFAULT '0.00',
  `technical_balance` decimal(16,2) NOT NULL DEFAULT '0.00',
  `previous_free_availability` decimal(16,2) NOT NULL DEFAULT '0.00',
  `retention_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `perception_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `compensation_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `total_perceptions_retentions` decimal(16,2) NOT NULL DEFAULT '0.00',
  `free_availability_balance` decimal(16,2) NOT NULL DEFAULT '0.00',
  `negative_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `positive_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `total_free_availability` decimal(16,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `period_liquidation_iva_period_liquidation_id_foreign` (`period_liquidation_id`),
  KEY `period_liquidation_iva_period_id_foreign` (`period_id`),
  KEY `period_liquidation_iva_person_id_foreign` (`person_id`),
  CONSTRAINT `period_liquidation_iva_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `period_liquidation_iva_period_liquidation_id_foreign` FOREIGN KEY (`period_liquidation_id`) REFERENCES `period_liquidations` (`id`),
  CONSTRAINT `period_liquidation_iva_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `period_liquidation_iva`
--


--
-- Table structure for table `period_liquidation_iva_details`
--

CREATE TABLE `period_liquidation_iva_details` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `period_liquidation_id` int(10) unsigned NOT NULL,
  `period_liquidation_iva_id` int(10) unsigned NOT NULL,
  `period_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `activity_id` int(10) unsigned DEFAULT NULL,
  `type` int(10) unsigned NOT NULL,
  `tax_id` int(10) unsigned NOT NULL DEFAULT '0',
  `taxabled_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `iva_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `ordr` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `period_liquidation_iva_details_period_liquidation_iva_id_foreign` (`period_liquidation_iva_id`),
  KEY `period_liquidation_iva_details_period_liquidation_id_foreign` (`period_liquidation_id`),
  KEY `period_liquidation_iva_details_period_id_foreign` (`period_id`),
  KEY `period_liquidation_iva_details_person_id_foreign` (`person_id`),
  KEY `period_liquidation_iva_details_activity_id_foreign` (`activity_id`),
  CONSTRAINT `period_liquidation_iva_details_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`),
  CONSTRAINT `period_liquidation_iva_details_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `period_liquidation_iva_details_period_liquidation_id_foreign` FOREIGN KEY (`period_liquidation_id`) REFERENCES `period_liquidations` (`id`),
  CONSTRAINT `period_liquidation_iva_details_period_liquidation_iva_id_foreign` FOREIGN KEY (`period_liquidation_iva_id`) REFERENCES `period_liquidation_iva` (`id`),
  CONSTRAINT `period_liquidation_iva_details_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `period_liquidation_iva_details`
--


--
-- Table structure for table `period_liquidations`
--

CREATE TABLE `period_liquidations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `apply_to` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `period_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned DEFAULT NULL,
  `status` int(10) unsigned NOT NULL DEFAULT '1',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `period_liquidations_period_id_foreign` (`period_id`),
  KEY `period_liquidations_person_id_foreign` (`person_id`),
  CONSTRAINT `period_liquidations_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `period_liquidations_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `period_liquidations`
--


--
-- Table structure for table `periods`
--

CREATE TABLE `periods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `code` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL,
  `year` int(10) unsigned NOT NULL,
  `period_number` int(10) unsigned NOT NULL,
  `date_from` date NOT NULL,
  `date_to` date NOT NULL,
  `perception_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `previous_period_balance` decimal(16,2) NOT NULL DEFAULT '0.00',
  `free_balance` decimal(16,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `person_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `periods_person_id_foreign` (`person_id`),
  CONSTRAINT `periods_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `periods`
--


--
-- Table structure for table `person_activities`
--

CREATE TABLE `person_activities` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `activity_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `person_activities_person_id_foreign` (`person_id`),
  KEY `person_activities_activity_id_foreign` (`activity_id`),
  CONSTRAINT `person_activities_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`),
  CONSTRAINT `person_activities_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_activities`
--


--
-- Table structure for table `person_configurations`
--

CREATE TABLE `person_configurations` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `period_id` int(10) unsigned DEFAULT NULL,
  `zone_id` int(10) unsigned DEFAULT NULL,
  `settle_calc_by_coef` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `active` int(10) unsigned DEFAULT NULL,
  `month_close` int(10) unsigned DEFAULT NULL,
  `iva_condition_id` int(10) unsigned DEFAULT NULL,
  `obligation_sell` int(10) unsigned DEFAULT NULL,
  `obligation_buy` int(10) unsigned DEFAULT NULL,
  `obligation_iva` int(10) unsigned DEFAULT NULL,
  `obligation_electronic_receipt` int(10) unsigned DEFAULT NULL,
  `obligation_iibb` int(10) unsigned DEFAULT NULL,
  `obligation_other_taxes` int(10) unsigned DEFAULT NULL,
  `liquidation_start_period` varchar(7) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `obligation_salaries` int(10) unsigned DEFAULT NULL,
  `priority_order` int(10) unsigned DEFAULT NULL,
  `person_id_administrador` int(11) DEFAULT NULL,
  `person_id_titular` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `person_configurations_person_id_foreign` (`person_id`),
  KEY `person_configurations_period_id_foreign` (`period_id`),
  KEY `person_configurations_zone_id_foreign` (`zone_id`),
  KEY `person_configurations_iva_condition_id_foreign` (`iva_condition_id`),
  CONSTRAINT `person_configurations_iva_condition_id_foreign` FOREIGN KEY (`iva_condition_id`) REFERENCES `iva_conditions` (`id`),
  CONSTRAINT `person_configurations_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `person_configurations_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `person_configurations_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_configurations`
--


--
-- Table structure for table `person_liquidators`
--

CREATE TABLE `person_liquidators` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `liquidator_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `person_liquidators_person_id_foreign` (`person_id`),
  KEY `person_liquidators_liquidator_id_foreign` (`liquidator_id`),
  CONSTRAINT `person_liquidators_liquidator_id_foreign` FOREIGN KEY (`liquidator_id`) REFERENCES `liquidators` (`id`),
  CONSTRAINT `person_liquidators_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_liquidators`
--


--
-- Table structure for table `person_pay_methods`
--

CREATE TABLE `person_pay_methods` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `person_id` int(10) unsigned NOT NULL,
  `pay_method_id` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `person_pay_methods_person_id_foreign` (`person_id`),
  KEY `person_pay_methods_pay_method_id_foreign` (`pay_method_id`),
  CONSTRAINT `person_pay_methods_pay_method_id_foreign` FOREIGN KEY (`pay_method_id`) REFERENCES `pay_methods` (`id`),
  CONSTRAINT `person_pay_methods_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_pay_methods`
--


--
-- Table structure for table `person_types`
--

CREATE TABLE `person_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `person_types_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_types`
--

INSERT INTO `person_types` VALUES (1,'Persona Natural',NULL,NULL),(2,'Persona Juridica',NULL,NULL);

--
-- Table structure for table `person_zones`
--

CREATE TABLE `person_zones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `sifere_coef` decimal(8,4) NOT NULL DEFAULT '0.0000',
  `iibb_aliquot` decimal(8,4) NOT NULL DEFAULT '0.0000',
  `zone_id` int(10) unsigned NOT NULL,
  `iibb_perception_id` int(10) unsigned DEFAULT NULL,
  `retention_id` int(10) unsigned DEFAULT NULL,
  `activity_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `person_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `person_zones_zone_id_foreign` (`zone_id`),
  KEY `person_zones_person_id_foreign` (`person_id`),
  CONSTRAINT `person_zones_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `person_zones_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `person_zones`
--


--
-- Table structure for table `persons`
--

CREATE TABLE `persons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `field_name1` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `field_name2` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `document_type` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL,
  `country_id` int(10) unsigned DEFAULT NULL,
  `state_id` int(10) unsigned DEFAULT NULL,
  `zone_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `activity_id` int(10) unsigned DEFAULT NULL,
  `address` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `person_type_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `persons_document_unique` (`document`),
  KEY `persons_zone_id_foreign` (`zone_id`),
  KEY `persons_person_type_id_foreign` (`person_type_id`),
  CONSTRAINT `persons_person_type_id_foreign` FOREIGN KEY (`person_type_id`) REFERENCES `person_types` (`id`),
  CONSTRAINT `persons_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `persons`
--


--
-- Table structure for table `receipt_taxes`
--

CREATE TABLE `receipt_taxes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `receipt_id` int(10) unsigned NOT NULL,
  `tax_id` int(10) unsigned DEFAULT NULL,
  `amount` decimal(16,2) NOT NULL,
  `tax_amount` decimal(16,2) NOT NULL DEFAULT '0.00',
  `taxable_iibb` int(11) NOT NULL DEFAULT '0',
  `iva_iibb` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receipt_taxes_receipt_id_foreign` (`receipt_id`),
  CONSTRAINT `receipt_taxes_receipt_id_foreign` FOREIGN KEY (`receipt_id`) REFERENCES `receipts` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_taxes`
--


--
-- Table structure for table `receipt_types`
--

CREATE TABLE `receipt_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `credit` int(11) DEFAULT '0',
  `agroup_iva_module` int(10) unsigned DEFAULT NULL,
  `sell_no_taxabled` int(11) DEFAULT '0',
  `buy_no_taxabled` int(11) DEFAULT '0',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipt_types`
--

INSERT INTO `receipt_types` VALUES (1,NULL,NULL,'Factura A','1',0,1,0,0),(2,NULL,NULL,'Nota de débito A','2',0,1,0,0),(3,NULL,NULL,'Nota de crédito A','3',1,NULL,0,0),(4,NULL,NULL,'Factura B','6',0,2,0,1),(5,NULL,NULL,'Nota de débito B','7',0,2,0,1),(6,NULL,NULL,'Nota de crédito B','8',1,NULL,0,1),(7,NULL,NULL,'Factura C','11',0,0,1,1),(8,NULL,NULL,'Nota de débito C','12',0,0,1,1),(9,NULL,NULL,'Nota de crédito C','13',1,NULL,1,1),(10,NULL,NULL,'RECIBO A','4',0,1,0,0),(11,NULL,NULL,'RECIBO B','9',0,2,0,1),(12,NULL,NULL,'RECIBO C','15',0,0,1,1),(13,NULL,NULL,'Factura E','19',0,0,1,0),(14,NULL,NULL,'Nota de débito E','20',0,0,1,0),(15,NULL,NULL,'Nota de Crédito E','21',1,NULL,1,0),(16,NULL,NULL,'Factura M','51',0,1,0,0),(17,NULL,NULL,'Despacho de Importacion','66',0,NULL,0,0),(18,NULL,NULL,'Nota de Credito M','53',1,NULL,0,0),(19,NULL,NULL,'Nota de Debito M','52',1,1,0,0),(20,NULL,NULL,'Recibo M','54',0,1,0,0),(21,NULL,NULL,'Recibo E',NULL,1,0,1,0);

--
-- Table structure for table `receipts`
--

CREATE TABLE `receipts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `type_id` int(10) unsigned NOT NULL,
  `type_receipt_id` int(10) unsigned DEFAULT NULL,
  `period_id` int(10) unsigned NOT NULL,
  `zone_id` int(10) unsigned DEFAULT NULL,
  `activity_id` int(10) unsigned DEFAULT NULL,
  `retention_type_id` int(10) unsigned DEFAULT NULL,
  `person_id_owner` int(10) unsigned NOT NULL,
  `person_id_relationed` int(10) unsigned DEFAULT NULL,
  `number` int(8) unsigned zerofill DEFAULT NULL,
  `reference` int(11) DEFAULT NULL,
  `receipt_date` date DEFAULT NULL,
  `expiration_date` date DEFAULT NULL,
  `code_ticket` int(4) unsigned zerofill DEFAULT NULL,
  `status_id` int(10) unsigned DEFAULT NULL,
  `tax_account_id` int(10) unsigned DEFAULT NULL,
  `amount` decimal(16,2) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `deleted_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `receipts_type_id_foreign` (`type_id`),
  KEY `receipts_type_receipt_id_foreign` (`type_receipt_id`),
  KEY `receipts_tax_account_id_foreign` (`tax_account_id`),
  KEY `receipts_zone_id_foreign` (`zone_id`),
  KEY `receipts_activity_id_foreign` (`activity_id`),
  KEY `receipts_retention_type_id_foreign` (`retention_type_id`),
  KEY `receipts_status_id_foreign` (`status_id`),
  KEY `receipts_person_id_owner_foreign` (`person_id_owner`),
  KEY `receipts_person_id_relationed_foreign` (`person_id_relationed`),
  KEY `receipts_period_id_foreign` (`period_id`),
  CONSTRAINT `receipts_activity_id_foreign` FOREIGN KEY (`activity_id`) REFERENCES `activities` (`id`),
  CONSTRAINT `receipts_period_id_foreign` FOREIGN KEY (`period_id`) REFERENCES `periods` (`id`),
  CONSTRAINT `receipts_person_id_owner_foreign` FOREIGN KEY (`person_id_owner`) REFERENCES `persons` (`id`),
  CONSTRAINT `receipts_person_id_relationed_foreign` FOREIGN KEY (`person_id_relationed`) REFERENCES `persons` (`id`),
  CONSTRAINT `receipts_retention_type_id_foreign` FOREIGN KEY (`retention_type_id`) REFERENCES `retention_types` (`id`),
  CONSTRAINT `receipts_status_id_foreign` FOREIGN KEY (`status_id`) REFERENCES `status` (`id`),
  CONSTRAINT `receipts_tax_account_id_foreign` FOREIGN KEY (`tax_account_id`) REFERENCES `tax_accounts` (`id`),
  CONSTRAINT `receipts_type_id_foreign` FOREIGN KEY (`type_id`) REFERENCES `types` (`id`),
  CONSTRAINT `receipts_type_receipt_id_foreign` FOREIGN KEY (`type_receipt_id`) REFERENCES `receipt_types` (`id`),
  CONSTRAINT `receipts_zone_id_foreign` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `receipts`
--


--
-- Table structure for table `reportes`
--

CREATE TABLE `reportes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `class` int(10) unsigned NOT NULL,
  `class_description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `data_type` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `path` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `reportes_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `reportes`
--

INSERT INTO `reportes` VALUES (1,'Comprobantes',1,'informes','','reportes/informes/comprobantes/comprobantes',NULL,NULL),(2,'Proyeccion de Ganancias',2,'calculados','','reportes/calculados/proyecGanancias/proyecGanancias',NULL,NULL),(3,'Ingresos Brutos',1,'informes','','reportes/informes/iibb/iibb',NULL,NULL),(4,'Tablero de Control',3,'tablero','','reportes/tablero/index',NULL,NULL);

--
-- Table structure for table `retention_types`
--

CREATE TABLE `retention_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apply_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'iibb',
  `code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `zone_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=29 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `retention_types`
--

INSERT INTO `retention_types` VALUES (1,NULL,NULL,'Retenciones de Ganancias','ganancias','GAN',NULL),(2,NULL,NULL,'Retenciones de SUSS','sus','SUSS',NULL),(3,NULL,NULL,'Retenciones de IVA','iva','Ret IVA',NULL),(4,NULL,NULL,'Retenciones de Buenos Aires','iibb',NULL,23),(5,NULL,NULL,'Retenciones de Capital Federal','iibb',NULL,22),(6,NULL,NULL,'Retenciones de Catamarca','iibb',NULL,24),(7,NULL,NULL,'Retenciones de Chaco','iibb',NULL,3),(8,NULL,NULL,'Retenciones de Chubut','iibb',NULL,4),(9,NULL,NULL,'Retenciones de Córdoba','iibb',NULL,1),(10,NULL,NULL,'Retenciones de Corrientes','iibb',NULL,2),(11,NULL,NULL,'Retenciones de Entre Ríos','iibb',NULL,5),(12,NULL,NULL,'Retenciones de Formosa','iibb',NULL,6),(13,NULL,NULL,'Retenciones de Jujuy','iibb',NULL,7),(14,NULL,NULL,'Retenciones de La Pampa','iibb',NULL,8),(15,NULL,NULL,'Retenciones de La Rioja','iibb',NULL,9),(16,NULL,NULL,'Retenciones de Mendoza','iibb',NULL,10),(17,NULL,NULL,'Retenciones de Misiones','iibb',NULL,11),(18,NULL,NULL,'Retenciones de Neuquén','iibb',NULL,12),(19,NULL,NULL,'Retenciones de Pascua Lama','iibb',NULL,25),(20,NULL,NULL,'Retenciones de Río Negro','iibb',NULL,13),(21,NULL,NULL,'Retenciones de Salta','iibb',NULL,14),(22,NULL,NULL,'Retenciones de San Juan','iibb',NULL,15),(23,NULL,NULL,'Retenciones de San Luis','iibb',NULL,16),(24,NULL,NULL,'Retenciones de Santa Cruz','iibb',NULL,17),(25,NULL,NULL,'Retenciones de Santa Fe','iibb',NULL,18),(26,NULL,NULL,'Retenciones de Santiago del Estero','iibb',NULL,19),(27,NULL,NULL,'Retenciones de Tierra del Fuego','iibb',NULL,20),(28,NULL,NULL,'Retenciones de Tucuman','iibb',NULL,21);

--
-- Table structure for table `retentions`
--

CREATE TABLE `retentions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `retentions`
--


--
-- Table structure for table `status`
--

CREATE TABLE `status` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `receipt_type_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `status_receipt_type_id_foreign` (`receipt_type_id`),
  CONSTRAINT `status_receipt_type_id_foreign` FOREIGN KEY (`receipt_type_id`) REFERENCES `receipt_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `status`
--

INSERT INTO `status` VALUES (1,'Activo',NULL,NULL,NULL),(2,'Anulado',NULL,NULL,NULL),(3,'Liquidado',NULL,NULL,NULL);

--
-- Table structure for table `system_taxes`
--

CREATE TABLE `system_taxes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apply_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ammount_permited` int(11) NOT NULL DEFAULT '1',
  `percent_iva` decimal(16,2) NOT NULL DEFAULT '0.00',
  `taxable_iibb` int(11) NOT NULL DEFAULT '1',
  `taxable_iva` int(11) NOT NULL DEFAULT '1',
  `code` int(11) NOT NULL,
  `status` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `system_taxes`
--

INSERT INTO `system_taxes` VALUES (1,NULL,NULL,'gravado al 10,5%','iva',1,10.50,1,1,4,1),(2,NULL,NULL,'gravado al 21%','iva',1,21.00,1,1,5,1),(3,NULL,NULL,'gravado al 27%','iva',1,27.00,1,1,6,1),(4,NULL,NULL,'gravado al 2,5%','iva',1,2.50,1,1,9,1),(5,NULL,NULL,'gravado al 5%','iva',1,5.00,1,1,8,1),(6,NULL,NULL,'gravado al 0%','iva',1,0.00,1,0,3,1),(7,NULL,NULL,'no gravado','iva',1,0.00,1,0,1,1);

--
-- Table structure for table `tCountrys`
--

CREATE TABLE `tCountrys` (
  `idCountry` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `countryName` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idCountry`),
  UNIQUE KEY `tcountrys_countryname_unique` (`countryName`)
) ENGINE=InnoDB AUTO_INCREMENT=247 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tCountrys`
--

INSERT INTO `tCountrys` VALUES (1,'Australia',NULL,NULL),(2,'Austria',NULL,NULL),(3,'Azerbaiyán',NULL,NULL),(4,'Anguilla',NULL,NULL),(5,'Argentina',NULL,NULL),(6,'Armenia',NULL,NULL),(7,'Bielorrusia',NULL,NULL),(8,'Belice',NULL,NULL),(9,'Bélgica',NULL,NULL),(10,'Bermudas',NULL,NULL),(11,'Bulgaria',NULL,NULL),(12,'Brasil',NULL,NULL),(13,'Reino Unido',NULL,NULL),(14,'Hungría',NULL,NULL),(15,'Vietnam',NULL,NULL),(16,'Haiti',NULL,NULL),(17,'Guadalupe',NULL,NULL),(18,'Alemania',NULL,NULL),(19,'Países Bajos - Holanda',NULL,NULL),(20,'Grecia',NULL,NULL),(21,'Georgia',NULL,NULL),(22,'Dinamarca',NULL,NULL),(23,'Egipto',NULL,NULL),(24,'Israel',NULL,NULL),(25,'India',NULL,NULL),(26,'Irán',NULL,NULL),(27,'Irlanda',NULL,NULL),(28,'España',NULL,NULL),(29,'Italia',NULL,NULL),(30,'Kazajstán',NULL,NULL),(31,'Camerún',NULL,NULL),(32,'Canadá',NULL,NULL),(33,'Chipre',NULL,NULL),(34,'Kirguistán',NULL,NULL),(35,'China',NULL,NULL),(36,'Costa Rica',NULL,NULL),(37,'Kuwait',NULL,NULL),(38,'Letonia',NULL,NULL),(39,'Libia',NULL,NULL),(40,'Lituania',NULL,NULL),(41,'Luxemburgo',NULL,NULL),(42,'México',NULL,NULL),(43,'Moldavia',NULL,NULL),(44,'Mónaco',NULL,NULL),(45,'Nueva Zelanda',NULL,NULL),(46,'Noruega',NULL,NULL),(47,'Polonia',NULL,NULL),(48,'Portugal',NULL,NULL),(49,'Reunión',NULL,NULL),(50,'Rusia',NULL,NULL),(51,'El Salvador',NULL,NULL),(52,'Eslovaquia',NULL,NULL),(53,'Eslovenia',NULL,NULL),(54,'Surinam',NULL,NULL),(55,'Estados Unidos',NULL,NULL),(56,'Tadjikistan',NULL,NULL),(57,'Turkmenistan',NULL,NULL),(58,'Islas Turcas y Caicos',NULL,NULL),(59,'Turquía',NULL,NULL),(60,'Uganda',NULL,NULL),(61,'Uzbekistán',NULL,NULL),(62,'Ucrania',NULL,NULL),(63,'Finlandia',NULL,NULL),(64,'Francia',NULL,NULL),(65,'República Checa',NULL,NULL),(66,'Suiza',NULL,NULL),(67,'Suecia',NULL,NULL),(68,'Estonia',NULL,NULL),(69,'Corea del Sur',NULL,NULL),(70,'Japón',NULL,NULL),(71,'Croacia',NULL,NULL),(72,'Rumanía',NULL,NULL),(73,'Hong Kong',NULL,NULL),(74,'Indonesia',NULL,NULL),(75,'Jordania',NULL,NULL),(76,'Malasia',NULL,NULL),(77,'Singapur',NULL,NULL),(78,'Taiwan',NULL,NULL),(79,'Bosnia y Herzegovina',NULL,NULL),(80,'Bahamas',NULL,NULL),(81,'Chile',NULL,NULL),(82,'Colombia',NULL,NULL),(83,'Islandia',NULL,NULL),(84,'Corea del Norte',NULL,NULL),(85,'Macedonia',NULL,NULL),(86,'Malta',NULL,NULL),(87,'Pakistán',NULL,NULL),(88,'Papúa-Nueva Guinea',NULL,NULL),(89,'Perú',NULL,NULL),(90,'Filipinas',NULL,NULL),(91,'Arabia Saudita',NULL,NULL),(92,'Tailandia',NULL,NULL),(93,'Emiratos árabes Unidos',NULL,NULL),(94,'Groenlandia',NULL,NULL),(95,'Venezuela',NULL,NULL),(96,'Zimbabwe',NULL,NULL),(97,'Kenia',NULL,NULL),(98,'Algeria',NULL,NULL),(99,'Líbano',NULL,NULL),(100,'Botsuana',NULL,NULL),(101,'Tanzania',NULL,NULL),(102,'Namibia',NULL,NULL),(103,'Ecuador',NULL,NULL),(104,'Marruecos',NULL,NULL),(105,'Ghana',NULL,NULL),(106,'Siria',NULL,NULL),(107,'Nepal',NULL,NULL),(108,'Mauritania',NULL,NULL),(109,'Seychelles',NULL,NULL),(110,'Paraguay',NULL,NULL),(111,'Uruguay',NULL,NULL),(112,'Congo (Brazzaville)',NULL,NULL),(113,'Cuba',NULL,NULL),(114,'Albania',NULL,NULL),(115,'Nigeria',NULL,NULL),(116,'Zambia',NULL,NULL),(117,'Mozambique',NULL,NULL),(119,'Angola',NULL,NULL),(120,'Sri Lanka',NULL,NULL),(121,'Etiopía',NULL,NULL),(122,'Túnez',NULL,NULL),(123,'Bolivia',NULL,NULL),(124,'Panamá',NULL,NULL),(125,'Malawi',NULL,NULL),(126,'Liechtenstein',NULL,NULL),(127,'Bahrein',NULL,NULL),(128,'Barbados',NULL,NULL),(130,'Chad',NULL,NULL),(131,'Man, Isla de',NULL,NULL),(132,'Jamaica',NULL,NULL),(133,'Malí',NULL,NULL),(134,'Madagascar',NULL,NULL),(135,'Senegal',NULL,NULL),(136,'Togo',NULL,NULL),(137,'Honduras',NULL,NULL),(138,'República Dominicana',NULL,NULL),(139,'Mongolia',NULL,NULL),(140,'Irak',NULL,NULL),(141,'Sudáfrica',NULL,NULL),(142,'Aruba',NULL,NULL),(143,'Gibraltar',NULL,NULL),(144,'Afganistán',NULL,NULL),(145,'Andorra',NULL,NULL),(147,'Antigua y Barbuda',NULL,NULL),(149,'Bangladesh',NULL,NULL);
INSERT INTO `tCountrys` VALUES (151,'Benín',NULL,NULL),(152,'Bután',NULL,NULL),(154,'Islas Virgenes Británicas',NULL,NULL),(155,'Brunéi',NULL,NULL),(156,'Burkina Faso',NULL,NULL),(157,'Burundi',NULL,NULL),(158,'Camboya',NULL,NULL),(159,'Cabo Verde',NULL,NULL),(164,'Comores',NULL,NULL),(165,'Congo (Kinshasa)',NULL,NULL),(166,'Cook, Islas',NULL,NULL),(168,'Costa de Marfil',NULL,NULL),(169,'Djibouti, Yibuti',NULL,NULL),(171,'Timor Oriental',NULL,NULL),(172,'Guinea Ecuatorial',NULL,NULL),(173,'Eritrea',NULL,NULL),(175,'Feroe, Islas',NULL,NULL),(176,'Fiyi',NULL,NULL),(178,'Polinesia Francesa',NULL,NULL),(180,'Gabón',NULL,NULL),(181,'Gambia',NULL,NULL),(184,'Granada',NULL,NULL),(185,'Guatemala',NULL,NULL),(186,'Guernsey',NULL,NULL),(187,'Guinea',NULL,NULL),(188,'Guinea-Bissau',NULL,NULL),(189,'Guyana',NULL,NULL),(193,'Jersey',NULL,NULL),(195,'Kiribati',NULL,NULL),(196,'Laos',NULL,NULL),(197,'Lesotho',NULL,NULL),(198,'Liberia',NULL,NULL),(200,'Maldivas',NULL,NULL),(201,'Martinica',NULL,NULL),(202,'Mauricio',NULL,NULL),(205,'Myanmar',NULL,NULL),(206,'Nauru',NULL,NULL),(207,'Antillas Holandesas',NULL,NULL),(208,'Nueva Caledonia',NULL,NULL),(209,'Nicaragua',NULL,NULL),(210,'Níger',NULL,NULL),(212,'Norfolk Island',NULL,NULL),(213,'Omán',NULL,NULL),(215,'Isla Pitcairn',NULL,NULL),(216,'Qatar',NULL,NULL),(217,'Ruanda',NULL,NULL),(218,'Santa Elena',NULL,NULL),(219,'San Cristobal y Nevis',NULL,NULL),(220,'Santa Lucía',NULL,NULL),(221,'San Pedro y Miquelón',NULL,NULL),(222,'San Vincente y Granadinas',NULL,NULL),(223,'Samoa',NULL,NULL),(224,'San Marino',NULL,NULL),(225,'San Tomé y Príncipe',NULL,NULL),(226,'Serbia y Montenegro',NULL,NULL),(227,'Sierra Leona',NULL,NULL),(228,'Islas Salomón',NULL,NULL),(229,'Somalia',NULL,NULL),(232,'Sudán',NULL,NULL),(234,'Swazilandia',NULL,NULL),(235,'Tokelau',NULL,NULL),(236,'Tonga',NULL,NULL),(237,'Trinidad y Tobago',NULL,NULL),(239,'Tuvalu',NULL,NULL),(240,'Vanuatu',NULL,NULL),(241,'Wallis y Futuna',NULL,NULL),(242,'Sáhara Occidental',NULL,NULL),(243,'Yemen',NULL,NULL),(246,'Puerto Rico',NULL,NULL);

--
-- Table structure for table `tModules`
--

CREATE TABLE `tModules` (
  `idModule` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `nameModule` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `pathModule` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `idParent` int(11) NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `classIcon` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`idModule`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tModules`
--

INSERT INTO `tModules` VALUES (7,'Seguridad','security',7,NULL,NULL,'fa-lock'),(8,'Usuarios','security/users',7,NULL,NULL,'fa-user'),(9,'Modulos','security/modules',7,NULL,NULL,'fa-list-alt'),(13,'Impuestos','taxes',13,NULL,NULL,'fa-usd'),(14,'Tablero de Control','taxes/dashboard',13,NULL,NULL,'fa-dashboard'),(15,'Deudas de Clientes','taxes/customerdebt',13,NULL,NULL,'fa-list-alt'),(16,'Liquidar Impuestos','taxes/settle',13,NULL,NULL,'fa-play'),(17,'Configuración','taxes/config',13,NULL,NULL,'fa-cogs'),(18,'Reportes','taxes/reports',13,NULL,NULL,'fa-file-pdf-o'),(19,'Comprobantes','taxes/receipt',13,NULL,NULL,'fa-clipboard'),(20,'Monotributo','taxes/mono',13,NULL,NULL,'fa-user'),(21,'Datos','taxes/data',13,NULL,NULL,'fa-database'),(22,'Masters','masters',22,NULL,NULL,'fa-cogs'),(23,'Empresas','masters/business',22,NULL,NULL,'fa-building'),(24,'Prov-Clientes','masters/persons',22,NULL,NULL,'fa-users'),(25,'Reportes','taxes/reportes',22,NULL,NULL,'fa-download'),(26,'Tablero de Control','control/general',13,NULL,NULL,'fa-eye'),(27,'Claves y Mails','claves/mails',13,NULL,NULL,'fa-info-circle');

--
-- Table structure for table `tStates`
--

CREATE TABLE `tStates` (
  `idState` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idCountry` int(10) unsigned NOT NULL,
  `stateName` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idState`),
  KEY `tstates_idcountry_foreign` (`idCountry`),
  CONSTRAINT `tstates_idcountry_foreign` FOREIGN KEY (`idCountry`) REFERENCES `tCountrys` (`idCountry`)
) ENGINE=InnoDB AUTO_INCREMENT=2202 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tStates`
--

INSERT INTO `tStates` VALUES (1,3,'Azerbaijan',NULL,NULL),(2,3,'Nargorni Karabakh',NULL,NULL),(3,3,'Nakhichevanskaya Region',NULL,NULL),(4,4,'Anguilla',NULL,NULL),(5,7,'Brestskaya obl.',NULL,NULL),(6,7,'Vitebskaya obl.',NULL,NULL),(7,7,'Gomelskaya obl.',NULL,NULL),(8,7,'Grodnenskaya obl.',NULL,NULL),(9,7,'Minskaya obl.',NULL,NULL),(10,7,'Mogilevskaya obl.',NULL,NULL),(11,8,'Belize',NULL,NULL),(12,10,'Hamilton',NULL,NULL),(13,15,'Dong Bang Song Cuu Long',NULL,NULL),(14,15,'Dong Bang Song Hong',NULL,NULL),(15,15,'Dong Nam Bo',NULL,NULL),(16,15,'Duyen Hai Mien Trung',NULL,NULL),(17,15,'Khu Bon Cu',NULL,NULL),(18,15,'Mien Nui Va Trung Du',NULL,NULL),(19,15,'Thai Nguyen',NULL,NULL),(20,16,'Artibonite',NULL,NULL),(21,16,'Grand&#039;Anse',NULL,NULL),(22,16,'North West',NULL,NULL),(23,16,'West',NULL,NULL),(24,16,'South',NULL,NULL),(25,16,'South  East',NULL,NULL),(26,17,'Grande-Terre',NULL,NULL),(27,17,'Basse-Terre',NULL,NULL),(28,21,'Abkhazia',NULL,NULL),(29,21,'Ajaria',NULL,NULL),(30,21,'Georgia',NULL,NULL),(31,21,'South Ossetia',NULL,NULL),(32,23,'Al QÄhira',NULL,NULL),(33,23,'Aswan',NULL,NULL),(34,23,'Asyut',NULL,NULL),(35,23,'Beni Suef',NULL,NULL),(36,23,'Gharbia',NULL,NULL),(37,23,'Damietta',NULL,NULL),(38,24,'Southern District',NULL,NULL),(39,24,'Central District',NULL,NULL),(40,24,'Northern District',NULL,NULL),(41,24,'Haifa',NULL,NULL),(42,24,'Tel Aviv',NULL,NULL),(43,24,'Jerusalem',NULL,NULL),(44,25,'Bangala',NULL,NULL),(45,25,'Chhattisgarh',NULL,NULL),(46,25,'Karnataka',NULL,NULL),(47,25,'Uttaranchal',NULL,NULL),(48,25,'Andhara Pradesh',NULL,NULL),(49,25,'Assam',NULL,NULL),(50,25,'Bihar',NULL,NULL),(51,25,'Gujarat',NULL,NULL),(52,25,'Jammu and Kashmir',NULL,NULL),(53,25,'Kerala',NULL,NULL),(54,25,'Madhya Pradesh',NULL,NULL),(55,25,'Manipur',NULL,NULL),(56,25,'Maharashtra',NULL,NULL),(57,25,'Megahalaya',NULL,NULL),(58,25,'Orissa',NULL,NULL),(59,25,'Punjab',NULL,NULL),(60,25,'Pondisheri',NULL,NULL),(61,25,'Rajasthan',NULL,NULL),(62,25,'Tamil Nadu',NULL,NULL),(63,25,'Tripura',NULL,NULL),(64,25,'Uttar Pradesh',NULL,NULL),(65,25,'Haryana',NULL,NULL),(66,25,'Chandigarh',NULL,NULL),(67,26,'Azarbayjan-e Khavari',NULL,NULL),(68,26,'Esfahan',NULL,NULL),(69,26,'Hamadan',NULL,NULL),(70,26,'Kordestan',NULL,NULL),(71,26,'Markazi',NULL,NULL),(72,26,'Sistan-e Baluches',NULL,NULL),(73,26,'Yazd',NULL,NULL),(74,26,'Kerman',NULL,NULL),(75,26,'Kermanshakhan',NULL,NULL),(76,26,'Mazenderan',NULL,NULL),(77,26,'Tehran',NULL,NULL),(78,26,'Fars',NULL,NULL),(79,26,'Horasan',NULL,NULL),(80,26,'Husistan',NULL,NULL),(81,30,'Aktyubinskaya obl.',NULL,NULL),(82,30,'Alma-Atinskaya obl.',NULL,NULL),(83,30,'Vostochno-Kazahstanskaya obl.',NULL,NULL),(84,30,'Gurevskaya obl.',NULL,NULL),(85,30,'Zhambylskaya obl. (Dzhambulskaya obl.)',NULL,NULL),(86,30,'Dzhezkazganskaya obl.',NULL,NULL),(87,30,'Karagandinskaya obl.',NULL,NULL),(88,30,'Kzyl-Ordinskaya obl.',NULL,NULL),(89,30,'Kokchetavskaya obl.',NULL,NULL),(90,30,'Kustanaiskaya obl.',NULL,NULL),(91,30,'Mangystauskaya (Mangyshlakskaya obl.)',NULL,NULL),(92,30,'Pavlodarskaya obl.',NULL,NULL),(93,30,'Severo-Kazahstanskaya obl.',NULL,NULL),(94,30,'Taldy-Kurganskaya obl.',NULL,NULL),(95,30,'Turgaiskaya obl.',NULL,NULL),(96,30,'Akmolinskaya obl. (Tselinogradskaya obl.)',NULL,NULL),(97,30,'Chimkentskaya obl.',NULL,NULL),(98,31,'Littoral',NULL,NULL),(99,31,'Southwest Region',NULL,NULL),(100,31,'North',NULL,NULL),(101,31,'Central',NULL,NULL),(102,33,'Government controlled area',NULL,NULL),(103,33,'Turkish controlled area',NULL,NULL),(104,34,'Issik Kulskaya Region',NULL,NULL),(105,34,'Kyrgyzstan',NULL,NULL),(106,34,'Narinskaya Region',NULL,NULL),(107,34,'Oshskaya Region',NULL,NULL),(108,34,'Tallaskaya Region',NULL,NULL),(109,37,'al-Jahra',NULL,NULL),(110,37,'al-Kuwait',NULL,NULL),(111,38,'Latviya',NULL,NULL),(112,39,'Tarabulus',NULL,NULL),(113,39,'Bengasi',NULL,NULL),(114,40,'Litva',NULL,NULL),(115,43,'Moldova',NULL,NULL),(116,45,'Auckland',NULL,NULL),(117,45,'Bay of Plenty',NULL,NULL);
INSERT INTO `tStates` VALUES (118,45,'Canterbury',NULL,NULL),(119,45,'Gisborne',NULL,NULL),(120,45,'Hawke&#039;s Bay',NULL,NULL),(121,45,'Manawatu-Wanganui',NULL,NULL),(122,45,'Marlborough',NULL,NULL),(123,45,'Nelson',NULL,NULL),(124,45,'Northland',NULL,NULL),(125,45,'Otago',NULL,NULL),(126,45,'Southland',NULL,NULL),(127,45,'Taranaki',NULL,NULL),(128,45,'Tasman',NULL,NULL),(129,45,'Waikato',NULL,NULL),(130,45,'Wellington',NULL,NULL),(131,45,'West Coast',NULL,NULL),(132,49,'Saint-Denis',NULL,NULL),(133,50,'Altaiskii krai',NULL,NULL),(134,50,'Amurskaya obl.',NULL,NULL),(135,50,'Arhangelskaya obl.',NULL,NULL),(136,50,'Astrahanskaya obl.',NULL,NULL),(137,50,'Bashkiriya obl.',NULL,NULL),(138,50,'Belgorodskaya obl.',NULL,NULL),(139,50,'Bryanskaya obl.',NULL,NULL),(140,50,'Buryatiya',NULL,NULL),(141,50,'Vladimirskaya obl.',NULL,NULL),(142,50,'Volgogradskaya obl.',NULL,NULL),(143,50,'Vologodskaya obl.',NULL,NULL),(144,50,'Voronezhskaya obl.',NULL,NULL),(145,50,'Nizhegorodskaya obl.',NULL,NULL),(146,50,'Dagestan',NULL,NULL),(147,50,'Evreiskaya obl.',NULL,NULL),(148,50,'Ivanovskaya obl.',NULL,NULL),(149,50,'Irkutskaya obl.',NULL,NULL),(150,50,'Kabardino-Balkariya',NULL,NULL),(151,50,'Kaliningradskaya obl.',NULL,NULL),(152,50,'Tverskaya obl.',NULL,NULL),(153,50,'Kalmykiya',NULL,NULL),(154,50,'Kaluzhskaya obl.',NULL,NULL),(155,50,'Kamchatskaya obl.',NULL,NULL),(156,50,'Kareliya',NULL,NULL),(157,50,'Kemerovskaya obl.',NULL,NULL),(158,50,'Kirovskaya obl.',NULL,NULL),(159,50,'Komi',NULL,NULL),(160,50,'Kostromskaya obl.',NULL,NULL),(161,50,'Krasnodarskii krai',NULL,NULL),(162,50,'Krasnoyarskii krai',NULL,NULL),(163,50,'Kurganskaya obl.',NULL,NULL),(164,50,'Kurskaya obl.',NULL,NULL),(165,50,'Lipetskaya obl.',NULL,NULL),(166,50,'Magadanskaya obl.',NULL,NULL),(167,50,'Marii El',NULL,NULL),(168,50,'Mordoviya',NULL,NULL),(169,50,'Moscow &amp; Moscow Region',NULL,NULL),(170,50,'Murmanskaya obl.',NULL,NULL),(171,50,'Novgorodskaya obl.',NULL,NULL),(172,50,'Novosibirskaya obl.',NULL,NULL),(173,50,'Omskaya obl.',NULL,NULL),(174,50,'Orenburgskaya obl.',NULL,NULL),(175,50,'Orlovskaya obl.',NULL,NULL),(176,50,'Penzenskaya obl.',NULL,NULL),(177,50,'Permskiy krai',NULL,NULL),(178,50,'Primorskii krai',NULL,NULL),(179,50,'Pskovskaya obl.',NULL,NULL),(180,50,'Rostovskaya obl.',NULL,NULL),(181,50,'Ryazanskaya obl.',NULL,NULL),(182,50,'Samarskaya obl.',NULL,NULL),(183,50,'Saint-Petersburg and Region',NULL,NULL),(184,50,'Saratovskaya obl.',NULL,NULL),(185,50,'Saha (Yakutiya)',NULL,NULL),(186,50,'Sahalin',NULL,NULL),(187,50,'Sverdlovskaya obl.',NULL,NULL),(188,50,'Severnaya Osetiya',NULL,NULL),(189,50,'Smolenskaya obl.',NULL,NULL),(190,50,'Stavropolskii krai',NULL,NULL),(191,50,'Tambovskaya obl.',NULL,NULL),(192,50,'Tatarstan',NULL,NULL),(193,50,'Tomskaya obl.',NULL,NULL),(195,50,'Tulskaya obl.',NULL,NULL),(196,50,'Tyumenskaya obl. i Hanty-Mansiiskii AO',NULL,NULL),(197,50,'Udmurtiya',NULL,NULL),(198,50,'Ulyanovskaya obl.',NULL,NULL),(199,50,'Uralskaya obl.',NULL,NULL),(200,50,'Habarovskii krai',NULL,NULL),(201,50,'Chelyabinskaya obl.',NULL,NULL),(202,50,'Checheno-Ingushetiya',NULL,NULL),(203,50,'Chitinskaya obl.',NULL,NULL),(204,50,'Chuvashiya',NULL,NULL),(205,50,'Yaroslavskaya obl.',NULL,NULL),(206,51,'Ahuachapán',NULL,NULL),(207,51,'Cuscatlán',NULL,NULL),(208,51,'La Libertad',NULL,NULL),(209,51,'La Paz',NULL,NULL),(210,51,'La Unión',NULL,NULL),(211,51,'San Miguel',NULL,NULL),(212,51,'San Salvador',NULL,NULL),(213,51,'Santa Ana',NULL,NULL),(214,51,'Sonsonate',NULL,NULL),(215,54,'Paramaribo',NULL,NULL),(216,56,'Gorno-Badakhshan Region',NULL,NULL),(217,56,'Kuljabsk Region',NULL,NULL),(218,56,'Kurgan-Tjube Region',NULL,NULL),(219,56,'Sughd Region',NULL,NULL),(220,56,'Tajikistan',NULL,NULL),(221,57,'Ashgabat Region',NULL,NULL),(222,57,'Krasnovodsk Region',NULL,NULL),(223,57,'Mary Region',NULL,NULL),(224,57,'Tashauz Region',NULL,NULL),(225,57,'Chardzhou Region',NULL,NULL),(226,58,'Grand Turk',NULL,NULL),(227,59,'Bartin',NULL,NULL);
INSERT INTO `tStates` VALUES (228,59,'Bayburt',NULL,NULL),(229,59,'Karabuk',NULL,NULL),(230,59,'Adana',NULL,NULL),(231,59,'Aydin',NULL,NULL),(232,59,'Amasya',NULL,NULL),(233,59,'Ankara',NULL,NULL),(234,59,'Antalya',NULL,NULL),(235,59,'Artvin',NULL,NULL),(236,59,'Afion',NULL,NULL),(237,59,'Balikesir',NULL,NULL),(238,59,'Bilecik',NULL,NULL),(239,59,'Bursa',NULL,NULL),(240,59,'Gaziantep',NULL,NULL),(241,59,'Denizli',NULL,NULL),(242,59,'Izmir',NULL,NULL),(243,59,'Isparta',NULL,NULL),(244,59,'Icel',NULL,NULL),(245,59,'Kayseri',NULL,NULL),(246,59,'Kars',NULL,NULL),(247,59,'Kodjaeli',NULL,NULL),(248,59,'Konya',NULL,NULL),(249,59,'Kirklareli',NULL,NULL),(250,59,'Kutahya',NULL,NULL),(251,59,'Malatya',NULL,NULL),(252,59,'Manisa',NULL,NULL),(253,59,'Sakarya',NULL,NULL),(254,59,'Samsun',NULL,NULL),(255,59,'Sivas',NULL,NULL),(256,59,'Istanbul',NULL,NULL),(257,59,'Trabzon',NULL,NULL),(258,59,'Corum',NULL,NULL),(259,59,'Edirne',NULL,NULL),(260,59,'Elazig',NULL,NULL),(261,59,'Erzincan',NULL,NULL),(262,59,'Erzurum',NULL,NULL),(263,59,'Eskisehir',NULL,NULL),(264,60,'Jinja',NULL,NULL),(265,60,'Kampala',NULL,NULL),(266,61,'Andijon Region',NULL,NULL),(267,61,'Buxoro Region',NULL,NULL),(268,61,'Jizzac Region',NULL,NULL),(269,61,'Qaraqalpaqstan',NULL,NULL),(270,61,'Qashqadaryo Region',NULL,NULL),(271,61,'Navoiy Region',NULL,NULL),(272,61,'Namangan Region',NULL,NULL),(273,61,'Samarqand Region',NULL,NULL),(274,61,'Surxondaryo Region',NULL,NULL),(275,61,'Sirdaryo Region',NULL,NULL),(276,61,'Tashkent Region',NULL,NULL),(277,61,'Fergana Region',NULL,NULL),(278,61,'Xorazm Region',NULL,NULL),(279,62,'Vinnitskaya obl.',NULL,NULL),(280,62,'Volynskaya obl.',NULL,NULL),(281,62,'Dnepropetrovskaya obl.',NULL,NULL),(282,62,'Donetskaya obl.',NULL,NULL),(283,62,'Zhitomirskaya obl.',NULL,NULL),(284,62,'Zakarpatskaya obl.',NULL,NULL),(285,62,'Zaporozhskaya obl.',NULL,NULL),(286,62,'Ivano-Frankovskaya obl.',NULL,NULL),(287,62,'Kievskaya obl.',NULL,NULL),(288,62,'Kirovogradskaya obl.',NULL,NULL),(289,62,'Krymskaya obl.',NULL,NULL),(290,62,'Luganskaya obl.',NULL,NULL),(291,62,'Lvovskaya obl.',NULL,NULL),(292,62,'Nikolaevskaya obl.',NULL,NULL),(293,62,'Odesskaya obl.',NULL,NULL),(294,62,'Poltavskaya obl.',NULL,NULL),(295,62,'Rovenskaya obl.',NULL,NULL),(296,62,'Sumskaya obl.',NULL,NULL),(297,62,'Ternopolskaya obl.',NULL,NULL),(298,62,'Harkovskaya obl.',NULL,NULL),(299,62,'Hersonskaya obl.',NULL,NULL),(300,62,'Hmelnitskaya obl.',NULL,NULL),(301,62,'Cherkasskaya obl.',NULL,NULL),(302,62,'Chernigovskaya obl.',NULL,NULL),(303,62,'Chernovitskaya obl.',NULL,NULL),(304,68,'Estoniya',NULL,NULL),(305,69,'Cheju',NULL,NULL),(306,69,'Chollabuk',NULL,NULL),(307,69,'Chollanam',NULL,NULL),(308,69,'Chungcheongbuk',NULL,NULL),(309,69,'Chungcheongnam',NULL,NULL),(310,69,'Incheon',NULL,NULL),(311,69,'Kangweon',NULL,NULL),(312,69,'Kwangju',NULL,NULL),(313,69,'Kyeonggi',NULL,NULL),(314,69,'Kyeongsangbuk',NULL,NULL),(315,69,'Kyeongsangnam',NULL,NULL),(316,69,'Pusan',NULL,NULL),(317,69,'Seoul',NULL,NULL),(318,69,'Taegu',NULL,NULL),(319,69,'Taejeon',NULL,NULL),(320,69,'Ulsan',NULL,NULL),(321,70,'Aichi',NULL,NULL),(322,70,'Akita',NULL,NULL),(323,70,'Aomori',NULL,NULL),(324,70,'Wakayama',NULL,NULL),(325,70,'Gifu',NULL,NULL),(326,70,'Gunma',NULL,NULL),(327,70,'Ibaraki',NULL,NULL),(328,70,'Iwate',NULL,NULL),(329,70,'Ishikawa',NULL,NULL),(330,70,'Kagawa',NULL,NULL),(331,70,'Kagoshima',NULL,NULL),(332,70,'Kanagawa',NULL,NULL),(333,70,'Kyoto',NULL,NULL),(334,70,'Kochi',NULL,NULL),(335,70,'Kumamoto',NULL,NULL),(336,70,'Mie',NULL,NULL),(337,70,'Miyagi',NULL,NULL),(338,70,'Miyazaki',NULL,NULL),(339,70,'Nagano',NULL,NULL),(340,70,'Nagasaki',NULL,NULL),(341,70,'Nara',NULL,NULL),(342,70,'Niigata',NULL,NULL),(343,70,'Okayama',NULL,NULL),(344,70,'Okinawa',NULL,NULL),(345,70,'Osaka',NULL,NULL),(346,70,'Saga',NULL,NULL),(347,70,'Saitama',NULL,NULL),(348,70,'Shiga',NULL,NULL),(349,70,'Shizuoka',NULL,NULL),(350,70,'Shimane',NULL,NULL),(351,70,'Tiba',NULL,NULL);
INSERT INTO `tStates` VALUES (352,70,'Tokyo',NULL,NULL),(353,70,'Tokushima',NULL,NULL),(354,70,'Tochigi',NULL,NULL),(355,70,'Tottori',NULL,NULL),(356,70,'Toyama',NULL,NULL),(357,70,'Fukui',NULL,NULL),(358,70,'Fukuoka',NULL,NULL),(359,70,'Fukushima',NULL,NULL),(360,70,'Hiroshima',NULL,NULL),(361,70,'Hokkaido',NULL,NULL),(362,70,'Hyogo',NULL,NULL),(363,70,'Yoshimi',NULL,NULL),(364,70,'Yamagata',NULL,NULL),(365,70,'Yamaguchi',NULL,NULL),(366,70,'Yamanashi',NULL,NULL),(368,73,'Hong Kong',NULL,NULL),(369,74,'Indonesia',NULL,NULL),(370,75,'Jordan',NULL,NULL),(371,76,'Malaysia',NULL,NULL),(372,77,'Singapore',NULL,NULL),(373,78,'Taiwan',NULL,NULL),(374,30,'Kazahstan',NULL,NULL),(375,62,'Ukraina',NULL,NULL),(376,25,'India',NULL,NULL),(377,23,'Egypt',NULL,NULL),(378,106,'Damascus',NULL,NULL),(379,131,'Isle of Man',NULL,NULL),(380,30,'Zapadno-Kazahstanskaya obl.',NULL,NULL),(381,50,'Adygeya',NULL,NULL),(382,50,'Hakasiya',NULL,NULL),(383,93,'Dubai',NULL,NULL),(384,50,'Chukotskii AO',NULL,NULL),(385,99,'Beirut',NULL,NULL),(386,137,'Tegucigalpa',NULL,NULL),(387,138,'Santo Domingo',NULL,NULL),(388,139,'Ulan Bator',NULL,NULL),(389,23,'Sinai',NULL,NULL),(390,140,'Baghdad',NULL,NULL),(391,140,'Basra',NULL,NULL),(392,140,'Mosul',NULL,NULL),(393,141,'Johannesburg',NULL,NULL),(394,104,'Morocco',NULL,NULL),(395,104,'Tangier',NULL,NULL),(396,50,'Yamalo-Nenetskii AO',NULL,NULL),(397,122,'Tunisia',NULL,NULL),(398,92,'Thailand',NULL,NULL),(399,117,'Mozambique',NULL,NULL),(400,84,'Korea',NULL,NULL),(401,87,'Pakistan',NULL,NULL),(402,142,'Aruba',NULL,NULL),(403,80,'Bahamas',NULL,NULL),(404,69,'South Korea',NULL,NULL),(405,132,'Jamaica',NULL,NULL),(406,93,'Sharjah',NULL,NULL),(407,93,'Abu Dhabi',NULL,NULL),(409,24,'Ramat Hagolan',NULL,NULL),(410,115,'Nigeria',NULL,NULL),(411,64,'Ain',NULL,NULL),(412,64,'Haute-Savoie',NULL,NULL),(413,64,'Aisne',NULL,NULL),(414,64,'Allier',NULL,NULL),(415,64,'Alpes-de-Haute-Provence',NULL,NULL),(416,64,'Hautes-Alpes',NULL,NULL),(417,64,'Alpes-Maritimes',NULL,NULL),(418,64,'Ard&egrave;che',NULL,NULL),(419,64,'Ardennes',NULL,NULL),(420,64,'Ari&egrave;ge',NULL,NULL),(421,64,'Aube',NULL,NULL),(422,64,'Aude',NULL,NULL),(423,64,'Aveyron',NULL,NULL),(424,64,'Bouches-du-Rh&ocirc;ne',NULL,NULL),(425,64,'Calvados',NULL,NULL),(426,64,'Cantal',NULL,NULL),(427,64,'Charente',NULL,NULL),(428,64,'Charente Maritime',NULL,NULL),(429,64,'Cher',NULL,NULL),(430,64,'Corr&egrave;ze',NULL,NULL),(431,64,'Dordogne',NULL,NULL),(432,64,'Corse',NULL,NULL),(433,64,'C&ocirc;te d&#039;Or',NULL,NULL),(434,64,'Sa&ocirc;ne et Loire',NULL,NULL),(435,64,'C&ocirc;tes d&#039;Armor',NULL,NULL),(436,64,'Creuse',NULL,NULL),(437,64,'Doubs',NULL,NULL),(438,64,'Dr&ocirc;me',NULL,NULL),(439,64,'Eure',NULL,NULL),(440,64,'Eure-et-Loire',NULL,NULL),(441,64,'Finist&egrave;re',NULL,NULL),(442,64,'Gard',NULL,NULL),(443,64,'Haute-Garonne',NULL,NULL),(444,64,'Gers',NULL,NULL),(445,64,'Gironde',NULL,NULL),(446,64,'Hérault',NULL,NULL),(447,64,'Ille et Vilaine',NULL,NULL),(448,64,'Indre',NULL,NULL),(449,64,'Indre-et-Loire',NULL,NULL),(450,64,'Isère',NULL,NULL),(451,64,'Jura',NULL,NULL),(452,64,'Landes',NULL,NULL),(453,64,'Loir-et-Cher',NULL,NULL),(454,64,'Loire',NULL,NULL),(455,64,'Rh&ocirc;ne',NULL,NULL),(456,64,'Haute-Loire',NULL,NULL),(457,64,'Loire Atlantique',NULL,NULL),(458,64,'Loiret',NULL,NULL),(459,64,'Lot',NULL,NULL),(460,64,'Lot-et-Garonne',NULL,NULL),(461,64,'Loz&egrave;re',NULL,NULL),(462,64,'Maine et Loire',NULL,NULL),(463,64,'Manche',NULL,NULL),(464,64,'Marne',NULL,NULL),(465,64,'Haute-Marne',NULL,NULL),(466,64,'Mayenne',NULL,NULL),(467,64,'Meurthe-et-Moselle',NULL,NULL),(468,64,'Meuse',NULL,NULL),(469,64,'Morbihan',NULL,NULL),(470,64,'Moselle',NULL,NULL),(471,64,'Ni&egrave;vre',NULL,NULL),(472,64,'Nord',NULL,NULL),(473,64,'Oise',NULL,NULL),(474,64,'Orne',NULL,NULL),(475,64,'Pas-de-Calais',NULL,NULL),(476,64,'Puy-de-D&ocirc;me',NULL,NULL),(477,64,'Pyrénées-Atlantiques',NULL,NULL),(478,64,'Hautes-Pyrénées',NULL,NULL);
INSERT INTO `tStates` VALUES (479,64,'Pyrénées-Orientales',NULL,NULL),(480,64,'Bas Rhin',NULL,NULL),(481,64,'Haut Rhin',NULL,NULL),(482,64,'Haute-Sa&ocirc;ne',NULL,NULL),(483,64,'Sarthe',NULL,NULL),(484,64,'Savoie',NULL,NULL),(485,64,'Paris',NULL,NULL),(486,64,'Seine-Maritime',NULL,NULL),(487,64,'Seine-et-Marne',NULL,NULL),(488,64,'Yvelines',NULL,NULL),(489,64,'Deux-S&egrave;vres',NULL,NULL),(490,64,'Somme',NULL,NULL),(491,64,'Tarn',NULL,NULL),(492,64,'Tarn-et-Garonne',NULL,NULL),(493,64,'Var',NULL,NULL),(494,64,'Vaucluse',NULL,NULL),(495,64,'Vendée',NULL,NULL),(496,64,'Vienne',NULL,NULL),(497,64,'Haute-Vienne',NULL,NULL),(498,64,'Vosges',NULL,NULL),(499,64,'Yonne',NULL,NULL),(500,64,'Territoire de Belfort',NULL,NULL),(501,64,'Essonne',NULL,NULL),(502,64,'Hauts-de-Seine',NULL,NULL),(503,64,'Seine-Saint-Denis',NULL,NULL),(504,64,'Val-de-Marne',NULL,NULL),(505,64,'Val-d&#039;Oise',NULL,NULL),(506,29,'Piemonte - Torino',NULL,NULL),(507,29,'Piemonte - Alessandria',NULL,NULL),(508,29,'Piemonte - Asti',NULL,NULL),(509,29,'Piemonte - Biella',NULL,NULL),(510,29,'Piemonte - Cuneo',NULL,NULL),(511,29,'Piemonte - Novara',NULL,NULL),(512,29,'Piemonte - Verbania',NULL,NULL),(513,29,'Piemonte - Vercelli',NULL,NULL),(514,29,'Valle d&#039;Aosta - Aosta',NULL,NULL),(515,29,'Lombardia - Milano',NULL,NULL),(516,29,'Lombardia - Bergamo',NULL,NULL),(517,29,'Lombardia - Brescia',NULL,NULL),(518,29,'Lombardia - Como',NULL,NULL),(519,29,'Lombardia - Cremona',NULL,NULL),(520,29,'Lombardia - Lecco',NULL,NULL),(521,29,'Lombardia - Lodi',NULL,NULL),(522,29,'Lombardia - Mantova',NULL,NULL),(523,29,'Lombardia - Pavia',NULL,NULL),(524,29,'Lombardia - Sondrio',NULL,NULL),(525,29,'Lombardia - Varese',NULL,NULL),(526,29,'Trentino Alto Adige - Trento',NULL,NULL),(527,29,'Trentino Alto Adige - Bolzano',NULL,NULL),(528,29,'Veneto - Venezia',NULL,NULL),(529,29,'Veneto - Belluno',NULL,NULL),(530,29,'Veneto - Padova',NULL,NULL),(531,29,'Veneto - Rovigo',NULL,NULL),(532,29,'Veneto - Treviso',NULL,NULL),(533,29,'Veneto - Verona',NULL,NULL),(534,29,'Veneto - Vicenza',NULL,NULL),(535,29,'Friuli Venezia Giulia - Trieste',NULL,NULL),(536,29,'Friuli Venezia Giulia - Gorizia',NULL,NULL),(537,29,'Friuli Venezia Giulia - Pordenone',NULL,NULL),(538,29,'Friuli Venezia Giulia - Udine',NULL,NULL),(539,29,'Liguria - Genova',NULL,NULL),(540,29,'Liguria - Imperia',NULL,NULL),(541,29,'Liguria - La Spezia',NULL,NULL),(542,29,'Liguria - Savona',NULL,NULL),(543,29,'Emilia Romagna - Bologna',NULL,NULL),(544,29,'Emilia Romagna - Ferrara',NULL,NULL),(545,29,'Emilia Romagna - Forlì-Cesena',NULL,NULL),(546,29,'Emilia Romagna - Modena',NULL,NULL),(547,29,'Emilia Romagna - Parma',NULL,NULL),(548,29,'Emilia Romagna - Piacenza',NULL,NULL),(549,29,'Emilia Romagna - Ravenna',NULL,NULL),(550,29,'Emilia Romagna - Reggio Emilia',NULL,NULL),(551,29,'Emilia Romagna - Rimini',NULL,NULL),(552,29,'Toscana - Firenze',NULL,NULL),(553,29,'Toscana - Arezzo',NULL,NULL),(554,29,'Toscana - Grosseto',NULL,NULL),(555,29,'Toscana - Livorno',NULL,NULL),(556,29,'Toscana - Lucca',NULL,NULL),(557,29,'Toscana - Massa Carrara',NULL,NULL),(558,29,'Toscana - Pisa',NULL,NULL),(559,29,'Toscana - Pistoia',NULL,NULL),(560,29,'Toscana - Prato',NULL,NULL),(561,29,'Toscana - Siena',NULL,NULL),(562,29,'Umbria - Perugia',NULL,NULL),(563,29,'Umbria - Terni',NULL,NULL),(564,29,'Marche - Ancona',NULL,NULL),(565,29,'Marche - Ascoli Piceno',NULL,NULL),(566,29,'Marche - Macerata',NULL,NULL),(567,29,'Marche - Pesaro - Urbino',NULL,NULL),(568,29,'Lazio - Roma',NULL,NULL),(569,29,'Lazio - Frosinone',NULL,NULL),(570,29,'Lazio - Latina',NULL,NULL),(571,29,'Lazio - Rieti',NULL,NULL),(572,29,'Lazio - Viterbo',NULL,NULL),(573,29,'Abruzzo - L´Aquila',NULL,NULL),(574,29,'Abruzzo - Chieti',NULL,NULL),(575,29,'Abruzzo - Pescara',NULL,NULL),(576,29,'Abruzzo - Teramo',NULL,NULL),(577,29,'Molise - Campobasso',NULL,NULL),(578,29,'Molise - Isernia',NULL,NULL),(579,29,'Campania - Napoli',NULL,NULL),(580,29,'Campania - Avellino',NULL,NULL);
INSERT INTO `tStates` VALUES (581,29,'Campania - Benevento',NULL,NULL),(582,29,'Campania - Caserta',NULL,NULL),(583,29,'Campania - Salerno',NULL,NULL),(584,29,'Puglia - Bari',NULL,NULL),(585,29,'Puglia - Brindisi',NULL,NULL),(586,29,'Puglia - Foggia',NULL,NULL),(587,29,'Puglia - Lecce',NULL,NULL),(588,29,'Puglia - Taranto',NULL,NULL),(589,29,'Basilicata - Potenza',NULL,NULL),(590,29,'Basilicata - Matera',NULL,NULL),(591,29,'Calabria - Catanzaro',NULL,NULL),(592,29,'Calabria - Cosenza',NULL,NULL),(593,29,'Calabria - Crotone',NULL,NULL),(594,29,'Calabria - Reggio Calabria',NULL,NULL),(595,29,'Calabria - Vibo Valentia',NULL,NULL),(596,29,'Sicilia - Palermo',NULL,NULL),(597,29,'Sicilia - Agrigento',NULL,NULL),(598,29,'Sicilia - Caltanissetta',NULL,NULL),(599,29,'Sicilia - Catania',NULL,NULL),(600,29,'Sicilia - Enna',NULL,NULL),(601,29,'Sicilia - Messina',NULL,NULL),(602,29,'Sicilia - Ragusa',NULL,NULL),(603,29,'Sicilia - Siracusa',NULL,NULL),(604,29,'Sicilia - Trapani',NULL,NULL),(605,29,'Sardegna - Cagliari',NULL,NULL),(606,29,'Sardegna - Nuoro',NULL,NULL),(607,29,'Sardegna - Oristano',NULL,NULL),(608,29,'Sardegna - Sassari',NULL,NULL),(609,28,'Las Palmas',NULL,NULL),(610,28,'Soria',NULL,NULL),(611,28,'Palencia',NULL,NULL),(612,28,'Zamora',NULL,NULL),(613,28,'Cádiz',NULL,NULL),(614,28,'Navarra',NULL,NULL),(615,28,'Ourense',NULL,NULL),(616,28,'Segovia',NULL,NULL),(617,28,'Guip&uacute;zcoa',NULL,NULL),(618,28,'Ciudad Real',NULL,NULL),(619,28,'Vizcaya',NULL,NULL),(620,28,'álava',NULL,NULL),(621,28,'A Coruña',NULL,NULL),(622,28,'Cantabria',NULL,NULL),(623,28,'Almería',NULL,NULL),(624,28,'Zaragoza',NULL,NULL),(625,28,'Santa Cruz de Tenerife',NULL,NULL),(626,28,'Cáceres',NULL,NULL),(627,28,'Guadalajara',NULL,NULL),(628,28,'ávila',NULL,NULL),(629,28,'Toledo',NULL,NULL),(630,28,'Castellón',NULL,NULL),(631,28,'Tarragona',NULL,NULL),(632,28,'Lugo',NULL,NULL),(633,28,'La Rioja',NULL,NULL),(634,28,'Ceuta',NULL,NULL),(635,28,'Murcia',NULL,NULL),(636,28,'Salamanca',NULL,NULL),(637,28,'Valladolid',NULL,NULL),(638,28,'Jaén',NULL,NULL),(639,28,'Girona',NULL,NULL),(640,28,'Granada',NULL,NULL),(641,28,'Alacant',NULL,NULL),(642,28,'Córdoba',NULL,NULL),(643,28,'Albacete',NULL,NULL),(644,28,'Cuenca',NULL,NULL),(645,28,'Pontevedra',NULL,NULL),(646,28,'Teruel',NULL,NULL),(647,28,'Melilla',NULL,NULL),(648,28,'Barcelona',NULL,NULL),(649,28,'Badajoz',NULL,NULL),(650,28,'Madrid',NULL,NULL),(651,28,'Sevilla',NULL,NULL),(652,28,'Val&egrave;ncia',NULL,NULL),(653,28,'Huelva',NULL,NULL),(654,28,'Lleida',NULL,NULL),(655,28,'León',NULL,NULL),(656,28,'Illes Balears',NULL,NULL),(657,28,'Burgos',NULL,NULL),(658,28,'Huesca',NULL,NULL),(659,28,'Asturias',NULL,NULL),(660,28,'Málaga',NULL,NULL),(661,144,'Afghanistan',NULL,NULL),(662,210,'Niger',NULL,NULL),(663,133,'Mali',NULL,NULL),(664,156,'Burkina Faso',NULL,NULL),(665,136,'Togo',NULL,NULL),(666,151,'Benin',NULL,NULL),(667,119,'Angola',NULL,NULL),(668,102,'Namibia',NULL,NULL),(669,100,'Botswana',NULL,NULL),(670,134,'Madagascar',NULL,NULL),(671,202,'Mauritius',NULL,NULL),(672,196,'Laos',NULL,NULL),(673,158,'Cambodia',NULL,NULL),(674,90,'Philippines',NULL,NULL),(675,88,'Papua New Guinea',NULL,NULL),(676,228,'Solomon Islands',NULL,NULL),(677,240,'Vanuatu',NULL,NULL),(678,176,'Fiji',NULL,NULL),(679,223,'Samoa',NULL,NULL),(680,206,'Nauru',NULL,NULL),(681,168,'Cote D&#039;Ivoire',NULL,NULL),(682,198,'Liberia',NULL,NULL),(683,187,'Guinea',NULL,NULL),(684,189,'Guyana',NULL,NULL),(685,98,'Algeria',NULL,NULL),(686,147,'Antigua and Barbuda',NULL,NULL),(687,127,'Bahrain',NULL,NULL),(688,149,'Bangladesh',NULL,NULL),(689,128,'Barbados',NULL,NULL),(690,152,'Bhutan',NULL,NULL),(691,155,'Brunei',NULL,NULL),(692,157,'Burundi',NULL,NULL),(693,159,'Cape Verde',NULL,NULL),(694,130,'Chad',NULL,NULL),(695,164,'Comoros',NULL,NULL),(696,112,'Congo (Brazzaville)',NULL,NULL),(697,169,'Djibouti',NULL,NULL),(698,171,'East Timor',NULL,NULL),(699,173,'Eritrea',NULL,NULL),(700,121,'Ethiopia',NULL,NULL);
INSERT INTO `tStates` VALUES (701,180,'Gabon',NULL,NULL),(702,181,'Gambia',NULL,NULL),(703,105,'Ghana',NULL,NULL),(704,197,'Lesotho',NULL,NULL),(705,125,'Malawi',NULL,NULL),(706,200,'Maldives',NULL,NULL),(707,205,'Myanmar (Burma)',NULL,NULL),(708,107,'Nepal',NULL,NULL),(709,213,'Oman',NULL,NULL),(710,217,'Rwanda',NULL,NULL),(711,91,'Saudi Arabia',NULL,NULL),(712,120,'Sri Lanka',NULL,NULL),(713,232,'Sudan',NULL,NULL),(714,234,'Swaziland',NULL,NULL),(715,101,'Tanzania',NULL,NULL),(716,236,'Tonga',NULL,NULL),(717,239,'Tuvalu',NULL,NULL),(718,242,'Western Sahara',NULL,NULL),(719,243,'Yemen',NULL,NULL),(720,116,'Zambia',NULL,NULL),(721,96,'Zimbabwe',NULL,NULL),(722,66,'Aargau',NULL,NULL),(723,66,'Appenzell Innerrhoden',NULL,NULL),(724,66,'Appenzell Ausserrhoden',NULL,NULL),(725,66,'Bern',NULL,NULL),(726,66,'Basel-Landschaft',NULL,NULL),(727,66,'Basel-Stadt',NULL,NULL),(728,66,'Fribourg',NULL,NULL),(729,66,'Gen&egrave;ve',NULL,NULL),(730,66,'Glarus',NULL,NULL),(731,66,'Graubünden',NULL,NULL),(732,66,'Jura',NULL,NULL),(733,66,'Luzern',NULL,NULL),(734,66,'Neuch&acirc;tel',NULL,NULL),(735,66,'Nidwalden',NULL,NULL),(736,66,'Obwalden',NULL,NULL),(737,66,'Sankt Gallen',NULL,NULL),(738,66,'Schaffhausen',NULL,NULL),(739,66,'Solothurn',NULL,NULL),(740,66,'Schwyz',NULL,NULL),(741,66,'Thurgau',NULL,NULL),(742,66,'Ticino',NULL,NULL),(743,66,'Uri',NULL,NULL),(744,66,'Vaud',NULL,NULL),(745,66,'Valais',NULL,NULL),(746,66,'Zug',NULL,NULL),(747,66,'Zürich',NULL,NULL),(749,48,'Aveiro',NULL,NULL),(750,48,'Beja',NULL,NULL),(751,48,'Braga',NULL,NULL),(752,48,'Braganca',NULL,NULL),(753,48,'Castelo Branco',NULL,NULL),(754,48,'Coimbra',NULL,NULL),(755,48,'Evora',NULL,NULL),(756,48,'Faro',NULL,NULL),(757,48,'Madeira',NULL,NULL),(758,48,'Guarda',NULL,NULL),(759,48,'Leiria',NULL,NULL),(760,48,'Lisboa',NULL,NULL),(761,48,'Portalegre',NULL,NULL),(762,48,'Porto',NULL,NULL),(763,48,'Santarem',NULL,NULL),(764,48,'Setubal',NULL,NULL),(765,48,'Viana do Castelo',NULL,NULL),(766,48,'Vila Real',NULL,NULL),(767,48,'Viseu',NULL,NULL),(768,48,'Azores',NULL,NULL),(769,55,'Armed Forces Americas',NULL,NULL),(770,55,'Armed Forces Europe',NULL,NULL),(771,55,'Alaska',NULL,NULL),(772,55,'Alabama',NULL,NULL),(773,55,'Armed Forces Pacific',NULL,NULL),(774,55,'Arkansas',NULL,NULL),(775,55,'American Samoa',NULL,NULL),(776,55,'Arizona',NULL,NULL),(777,55,'California',NULL,NULL),(778,55,'Colorado',NULL,NULL),(779,55,'Connecticut',NULL,NULL),(780,55,'District of Columbia',NULL,NULL),(781,55,'Delaware',NULL,NULL),(782,55,'Florida',NULL,NULL),(783,55,'Federated States of Micronesia',NULL,NULL),(784,55,'Georgia',NULL,NULL),(786,55,'Hawaii',NULL,NULL),(787,55,'Iowa',NULL,NULL),(788,55,'Idaho',NULL,NULL),(789,55,'Illinois',NULL,NULL),(790,55,'Indiana',NULL,NULL),(791,55,'Kansas',NULL,NULL),(792,55,'Kentucky',NULL,NULL),(793,55,'Louisiana',NULL,NULL),(794,55,'Massachusetts',NULL,NULL),(795,55,'Maryland',NULL,NULL),(796,55,'Maine',NULL,NULL),(797,55,'Marshall Islands',NULL,NULL),(798,55,'Michigan',NULL,NULL),(799,55,'Minnesota',NULL,NULL),(800,55,'Missouri',NULL,NULL),(801,55,'Northern Mariana Islands',NULL,NULL),(802,55,'Mississippi',NULL,NULL),(803,55,'Montana',NULL,NULL),(804,55,'North Carolina',NULL,NULL),(805,55,'North Dakota',NULL,NULL),(806,55,'Nebraska',NULL,NULL),(807,55,'New Hampshire',NULL,NULL),(808,55,'New Jersey',NULL,NULL),(809,55,'New Mexico',NULL,NULL),(810,55,'Nevada',NULL,NULL),(811,55,'New York',NULL,NULL),(812,55,'Ohio',NULL,NULL),(813,55,'Oklahoma',NULL,NULL),(814,55,'Oregon',NULL,NULL),(815,55,'Pennsylvania',NULL,NULL),(816,246,'Puerto Rico',NULL,NULL),(817,55,'Palau',NULL,NULL),(818,55,'Rhode Island',NULL,NULL),(819,55,'South Carolina',NULL,NULL),(820,55,'South Dakota',NULL,NULL),(821,55,'Tennessee',NULL,NULL),(822,55,'Texas',NULL,NULL),(823,55,'Utah',NULL,NULL),(824,55,'Virginia',NULL,NULL),(825,55,'Virgin Islands',NULL,NULL),(826,55,'Vermont',NULL,NULL),(827,55,'Washington',NULL,NULL),(828,55,'West Virginia',NULL,NULL);
INSERT INTO `tStates` VALUES (829,55,'Wisconsin',NULL,NULL),(830,55,'Wyoming',NULL,NULL),(831,94,'Greenland',NULL,NULL),(832,18,'Brandenburg',NULL,NULL),(833,18,'Baden-Württemberg',NULL,NULL),(834,18,'Bayern',NULL,NULL),(835,18,'Hessen',NULL,NULL),(836,18,'Hamburg',NULL,NULL),(837,18,'Mecklenburg-Vorpommern',NULL,NULL),(838,18,'Niedersachsen',NULL,NULL),(839,18,'Nordrhein-Westfalen',NULL,NULL),(840,18,'Rheinland-Pfalz',NULL,NULL),(841,18,'Schleswig-Holstein',NULL,NULL),(842,18,'Sachsen',NULL,NULL),(843,18,'Sachsen-Anhalt',NULL,NULL),(844,18,'Thüringen',NULL,NULL),(845,18,'Berlin',NULL,NULL),(846,18,'Bremen',NULL,NULL),(847,18,'Saarland',NULL,NULL),(848,13,'Scotland North',NULL,NULL),(849,13,'England - East',NULL,NULL),(850,13,'England - West Midlands',NULL,NULL),(851,13,'England - South West',NULL,NULL),(852,13,'England - North West',NULL,NULL),(853,13,'England - Yorks &amp; Humber',NULL,NULL),(854,13,'England - South East',NULL,NULL),(855,13,'England - London',NULL,NULL),(856,13,'Northern Ireland',NULL,NULL),(857,13,'England - North East',NULL,NULL),(858,13,'Wales South',NULL,NULL),(859,13,'Wales North',NULL,NULL),(860,13,'England - East Midlands',NULL,NULL),(861,13,'Scotland Central',NULL,NULL),(862,13,'Scotland South',NULL,NULL),(863,13,'Channel Islands',NULL,NULL),(864,13,'Isle of Man',NULL,NULL),(865,2,'Burgenland',NULL,NULL),(866,2,'Kärnten',NULL,NULL),(867,2,'Niederösterreich',NULL,NULL),(868,2,'Oberösterreich',NULL,NULL),(869,2,'Salzburg',NULL,NULL),(870,2,'Steiermark',NULL,NULL),(871,2,'Tirol',NULL,NULL),(872,2,'Vorarlberg',NULL,NULL),(873,2,'Wien',NULL,NULL),(874,9,'Bruxelles',NULL,NULL),(875,9,'West-Vlaanderen',NULL,NULL),(876,9,'Oost-Vlaanderen',NULL,NULL),(877,9,'Limburg',NULL,NULL),(878,9,'Vlaams Brabant',NULL,NULL),(879,9,'Antwerpen',NULL,NULL),(880,9,'LiÄge',NULL,NULL),(881,9,'Namur',NULL,NULL),(882,9,'Hainaut',NULL,NULL),(883,9,'Luxembourg',NULL,NULL),(884,9,'Brabant Wallon',NULL,NULL),(887,67,'Blekinge Lan',NULL,NULL),(888,67,'Gavleborgs Lan',NULL,NULL),(890,67,'Gotlands Lan',NULL,NULL),(891,67,'Hallands Lan',NULL,NULL),(892,67,'Jamtlands Lan',NULL,NULL),(893,67,'Jonkopings Lan',NULL,NULL),(894,67,'Kalmar Lan',NULL,NULL),(895,67,'Dalarnas Lan',NULL,NULL),(897,67,'Kronobergs Lan',NULL,NULL),(899,67,'Norrbottens Lan',NULL,NULL),(900,67,'Orebro Lan',NULL,NULL),(901,67,'Ostergotlands Lan',NULL,NULL),(903,67,'Sodermanlands Lan',NULL,NULL),(904,67,'Uppsala Lan',NULL,NULL),(905,67,'Varmlands Lan',NULL,NULL),(906,67,'Vasterbottens Lan',NULL,NULL),(907,67,'Vasternorrlands Lan',NULL,NULL),(908,67,'Vastmanlands Lan',NULL,NULL),(909,67,'Stockholms Lan',NULL,NULL),(910,67,'Skane Lan',NULL,NULL),(911,67,'Vastra Gotaland',NULL,NULL),(913,46,'Akershus',NULL,NULL),(914,46,'Aust-Agder',NULL,NULL),(915,46,'Buskerud',NULL,NULL),(916,46,'Finnmark',NULL,NULL),(917,46,'Hedmark',NULL,NULL),(918,46,'Hordaland',NULL,NULL),(919,46,'More og Romsdal',NULL,NULL),(920,46,'Nordland',NULL,NULL),(921,46,'Nord-Trondelag',NULL,NULL),(922,46,'Oppland',NULL,NULL),(923,46,'Oslo',NULL,NULL),(924,46,'Ostfold',NULL,NULL),(925,46,'Rogaland',NULL,NULL),(926,46,'Sogn og Fjordane',NULL,NULL),(927,46,'Sor-Trondelag',NULL,NULL),(928,46,'Telemark',NULL,NULL),(929,46,'Troms',NULL,NULL),(930,46,'Vest-Agder',NULL,NULL),(931,46,'Vestfold',NULL,NULL),(933,63,'&ETH;&bull;land',NULL,NULL),(934,63,'Lapland',NULL,NULL),(935,63,'Oulu',NULL,NULL),(936,63,'Southern Finland',NULL,NULL),(937,63,'Eastern Finland',NULL,NULL),(938,63,'Western Finland',NULL,NULL),(940,22,'Arhus',NULL,NULL),(941,22,'Bornholm',NULL,NULL),(942,22,'Frederiksborg',NULL,NULL),(943,22,'Fyn',NULL,NULL),(944,22,'Kobenhavn',NULL,NULL),(945,22,'Staden Kobenhavn',NULL,NULL),(946,22,'Nordjylland',NULL,NULL),(947,22,'Ribe',NULL,NULL),(948,22,'Ringkobing',NULL,NULL),(949,22,'Roskilde',NULL,NULL),(950,22,'Sonderjylland',NULL,NULL),(951,22,'Storstrom',NULL,NULL),(952,22,'Vejle',NULL,NULL),(953,22,'Vestsjalland',NULL,NULL),(954,22,'Viborg',NULL,NULL);
INSERT INTO `tStates` VALUES (956,65,'Hlavni Mesto Praha',NULL,NULL),(957,65,'Jihomoravsky Kraj',NULL,NULL),(958,65,'Jihocesky Kraj',NULL,NULL),(959,65,'Vysocina',NULL,NULL),(960,65,'Karlovarsky Kraj',NULL,NULL),(961,65,'Kralovehradecky Kraj',NULL,NULL),(962,65,'Liberecky Kraj',NULL,NULL),(963,65,'Olomoucky Kraj',NULL,NULL),(964,65,'Moravskoslezsky Kraj',NULL,NULL),(965,65,'Pardubicky Kraj',NULL,NULL),(966,65,'Plzensky Kraj',NULL,NULL),(967,65,'Stredocesky Kraj',NULL,NULL),(968,65,'Ustecky Kraj',NULL,NULL),(969,65,'Zlinsky Kraj',NULL,NULL),(971,114,'Berat',NULL,NULL),(972,114,'Diber',NULL,NULL),(973,114,'Durres',NULL,NULL),(974,114,'Elbasan',NULL,NULL),(975,114,'Fier',NULL,NULL),(976,114,'Gjirokaster',NULL,NULL),(977,114,'Korce',NULL,NULL),(978,114,'Kukes',NULL,NULL),(979,114,'Lezhe',NULL,NULL),(980,114,'Shkoder',NULL,NULL),(981,114,'Tirane',NULL,NULL),(982,114,'Vlore',NULL,NULL),(984,145,'Canillo',NULL,NULL),(985,145,'Encamp',NULL,NULL),(986,145,'La Massana',NULL,NULL),(987,145,'Ordino',NULL,NULL),(988,145,'Sant Julia de Loria',NULL,NULL),(989,145,'Andorra la Vella',NULL,NULL),(990,145,'Escaldes-Engordany',NULL,NULL),(992,6,'Aragatsotn',NULL,NULL),(993,6,'Ararat',NULL,NULL),(994,6,'Armavir',NULL,NULL),(995,6,'Geghark&#039;unik&#039;',NULL,NULL),(996,6,'Kotayk&#039;',NULL,NULL),(997,6,'Lorri',NULL,NULL),(998,6,'Shirak',NULL,NULL),(999,6,'Syunik&#039;',NULL,NULL),(1000,6,'Tavush',NULL,NULL),(1001,6,'Vayots&#039; Dzor',NULL,NULL),(1002,6,'Yerevan',NULL,NULL),(1004,79,'Federation of Bosnia and Herzegovina',NULL,NULL),(1005,79,'Republika Srpska',NULL,NULL),(1007,11,'Mikhaylovgrad',NULL,NULL),(1008,11,'Blagoevgrad',NULL,NULL),(1009,11,'Burgas',NULL,NULL),(1010,11,'Dobrich',NULL,NULL),(1011,11,'Gabrovo',NULL,NULL),(1012,11,'Grad Sofiya',NULL,NULL),(1013,11,'Khaskovo',NULL,NULL),(1014,11,'Kurdzhali',NULL,NULL),(1015,11,'Kyustendil',NULL,NULL),(1016,11,'Lovech',NULL,NULL),(1017,11,'Montana',NULL,NULL),(1018,11,'Pazardzhik',NULL,NULL),(1019,11,'Pernik',NULL,NULL),(1020,11,'Pleven',NULL,NULL),(1021,11,'Plovdiv',NULL,NULL),(1022,11,'Razgrad',NULL,NULL),(1023,11,'Ruse',NULL,NULL),(1024,11,'Shumen',NULL,NULL),(1025,11,'Silistra',NULL,NULL),(1026,11,'Sliven',NULL,NULL),(1027,11,'Smolyan',NULL,NULL),(1028,11,'Sofiya',NULL,NULL),(1029,11,'Stara Zagora',NULL,NULL),(1030,11,'Turgovishte',NULL,NULL),(1031,11,'Varna',NULL,NULL),(1032,11,'Veliko Turnovo',NULL,NULL),(1033,11,'Vidin',NULL,NULL),(1034,11,'Vratsa',NULL,NULL),(1035,11,'Yambol',NULL,NULL),(1037,71,'Bjelovarsko-Bilogorska',NULL,NULL),(1038,71,'Brodsko-Posavska',NULL,NULL),(1039,71,'Dubrovacko-Neretvanska',NULL,NULL),(1040,71,'Istarska',NULL,NULL),(1041,71,'Karlovacka',NULL,NULL),(1042,71,'Koprivnicko-Krizevacka',NULL,NULL),(1043,71,'Krapinsko-Zagorska',NULL,NULL),(1044,71,'Licko-Senjska',NULL,NULL),(1045,71,'Medimurska',NULL,NULL),(1046,71,'Osjecko-Baranjska',NULL,NULL),(1047,71,'Pozesko-Slavonska',NULL,NULL),(1048,71,'Primorsko-Goranska',NULL,NULL),(1049,71,'Sibensko-Kninska',NULL,NULL),(1050,71,'Sisacko-Moslavacka',NULL,NULL),(1051,71,'Splitsko-Dalmatinska',NULL,NULL),(1052,71,'Varazdinska',NULL,NULL),(1053,71,'Viroviticko-Podravska',NULL,NULL),(1054,71,'Vukovarsko-Srijemska',NULL,NULL),(1055,71,'Zadarska',NULL,NULL),(1056,71,'Zagrebacka',NULL,NULL),(1057,71,'Grad Zagreb',NULL,NULL),(1059,143,'Gibraltar',NULL,NULL),(1060,20,'Evros',NULL,NULL),(1061,20,'Rodhopi',NULL,NULL),(1062,20,'Xanthi',NULL,NULL),(1063,20,'Drama',NULL,NULL),(1064,20,'Serrai',NULL,NULL),(1065,20,'Kilkis',NULL,NULL),(1066,20,'Pella',NULL,NULL),(1067,20,'Florina',NULL,NULL),(1068,20,'Kastoria',NULL,NULL),(1069,20,'Grevena',NULL,NULL),(1070,20,'Kozani',NULL,NULL),(1071,20,'Imathia',NULL,NULL),(1072,20,'Thessaloniki',NULL,NULL),(1073,20,'Kavala',NULL,NULL),(1074,20,'Khalkidhiki',NULL,NULL),(1075,20,'Pieria',NULL,NULL),(1076,20,'Ioannina',NULL,NULL),(1077,20,'Thesprotia',NULL,NULL),(1078,20,'Preveza',NULL,NULL),(1079,20,'Arta',NULL,NULL),(1080,20,'Larisa',NULL,NULL);
INSERT INTO `tStates` VALUES (1081,20,'Trikala',NULL,NULL),(1082,20,'Kardhitsa',NULL,NULL),(1083,20,'Magnisia',NULL,NULL),(1084,20,'Kerkira',NULL,NULL),(1085,20,'Levkas',NULL,NULL),(1086,20,'Kefallinia',NULL,NULL),(1087,20,'Zakinthos',NULL,NULL),(1088,20,'Fthiotis',NULL,NULL),(1089,20,'Evritania',NULL,NULL),(1090,20,'Aitolia kai Akarnania',NULL,NULL),(1091,20,'Fokis',NULL,NULL),(1092,20,'Voiotia',NULL,NULL),(1093,20,'Evvoia',NULL,NULL),(1094,20,'Attiki',NULL,NULL),(1095,20,'Argolis',NULL,NULL),(1096,20,'Korinthia',NULL,NULL),(1097,20,'Akhaia',NULL,NULL),(1098,20,'Ilia',NULL,NULL),(1099,20,'Messinia',NULL,NULL),(1100,20,'Arkadhia',NULL,NULL),(1101,20,'Lakonia',NULL,NULL),(1102,20,'Khania',NULL,NULL),(1103,20,'Rethimni',NULL,NULL),(1104,20,'Iraklion',NULL,NULL),(1105,20,'Lasithi',NULL,NULL),(1106,20,'Dhodhekanisos',NULL,NULL),(1107,20,'Samos',NULL,NULL),(1108,20,'Kikladhes',NULL,NULL),(1109,20,'Khios',NULL,NULL),(1110,20,'Lesvos',NULL,NULL),(1112,14,'Bacs-Kiskun',NULL,NULL),(1113,14,'Baranya',NULL,NULL),(1114,14,'Bekes',NULL,NULL),(1115,14,'Borsod-Abauj-Zemplen',NULL,NULL),(1116,14,'Budapest',NULL,NULL),(1117,14,'Csongrad',NULL,NULL),(1118,14,'Debrecen',NULL,NULL),(1119,14,'Fejer',NULL,NULL),(1120,14,'Gyor-Moson-Sopron',NULL,NULL),(1121,14,'Hajdu-Bihar',NULL,NULL),(1122,14,'Heves',NULL,NULL),(1123,14,'Komarom-Esztergom',NULL,NULL),(1124,14,'Miskolc',NULL,NULL),(1125,14,'Nograd',NULL,NULL),(1126,14,'Pecs',NULL,NULL),(1127,14,'Pest',NULL,NULL),(1128,14,'Somogy',NULL,NULL),(1129,14,'Szabolcs-Szatmar-Bereg',NULL,NULL),(1130,14,'Szeged',NULL,NULL),(1131,14,'Jasz-Nagykun-Szolnok',NULL,NULL),(1132,14,'Tolna',NULL,NULL),(1133,14,'Vas',NULL,NULL),(1134,14,'Veszprem',NULL,NULL),(1135,14,'Zala',NULL,NULL),(1136,14,'Gyor',NULL,NULL),(1150,14,'Veszprem',NULL,NULL),(1152,126,'Balzers',NULL,NULL),(1153,126,'Eschen',NULL,NULL),(1154,126,'Gamprin',NULL,NULL),(1155,126,'Mauren',NULL,NULL),(1156,126,'Planken',NULL,NULL),(1157,126,'Ruggell',NULL,NULL),(1158,126,'Schaan',NULL,NULL),(1159,126,'Schellenberg',NULL,NULL),(1160,126,'Triesen',NULL,NULL),(1161,126,'Triesenberg',NULL,NULL),(1162,126,'Vaduz',NULL,NULL),(1163,41,'Diekirch',NULL,NULL),(1164,41,'Grevenmacher',NULL,NULL),(1165,41,'Luxembourg',NULL,NULL),(1167,85,'Aracinovo',NULL,NULL),(1168,85,'Bac',NULL,NULL),(1169,85,'Belcista',NULL,NULL),(1170,85,'Berovo',NULL,NULL),(1171,85,'Bistrica',NULL,NULL),(1172,85,'Bitola',NULL,NULL),(1173,85,'Blatec',NULL,NULL),(1174,85,'Bogdanci',NULL,NULL),(1175,85,'Bogomila',NULL,NULL),(1176,85,'Bogovinje',NULL,NULL),(1177,85,'Bosilovo',NULL,NULL),(1179,85,'Cair',NULL,NULL),(1180,85,'Capari',NULL,NULL),(1181,85,'Caska',NULL,NULL),(1182,85,'Cegrane',NULL,NULL),(1184,85,'Centar Zupa',NULL,NULL),(1187,85,'Debar',NULL,NULL),(1188,85,'Delcevo',NULL,NULL),(1190,85,'Demir Hisar',NULL,NULL),(1191,85,'Demir Kapija',NULL,NULL),(1195,85,'Dorce Petrov',NULL,NULL),(1198,85,'Gazi Baba',NULL,NULL),(1199,85,'Gevgelija',NULL,NULL),(1200,85,'Gostivar',NULL,NULL),(1201,85,'Gradsko',NULL,NULL),(1204,85,'Jegunovce',NULL,NULL),(1205,85,'Kamenjane',NULL,NULL),(1207,85,'Karpos',NULL,NULL),(1208,85,'Kavadarci',NULL,NULL),(1209,85,'Kicevo',NULL,NULL),(1210,85,'Kisela Voda',NULL,NULL),(1211,85,'Klecevce',NULL,NULL),(1212,85,'Kocani',NULL,NULL),(1214,85,'Kondovo',NULL,NULL),(1217,85,'Kratovo',NULL,NULL),(1219,85,'Krivogastani',NULL,NULL),(1220,85,'Krusevo',NULL,NULL),(1223,85,'Kumanovo',NULL,NULL),(1224,85,'Labunista',NULL,NULL),(1225,85,'Lipkovo',NULL,NULL),(1228,85,'Makedonska Kamenica',NULL,NULL),(1229,85,'Makedonski Brod',NULL,NULL),(1234,85,'Murtino',NULL,NULL),(1235,85,'Negotino',NULL,NULL),(1238,85,'Novo Selo',NULL,NULL),(1240,85,'Ohrid',NULL,NULL),(1242,85,'Orizari',NULL,NULL),(1245,85,'Petrovec',NULL,NULL),(1248,85,'Prilep',NULL,NULL),(1249,85,'Probistip',NULL,NULL),(1250,85,'Radovis',NULL,NULL),(1252,85,'Resen',NULL,NULL),(1253,85,'Rosoman',NULL,NULL),(1256,85,'Saraj',NULL,NULL),(1260,85,'Srbinovo',NULL,NULL),(1262,85,'Star Dojran',NULL,NULL);
INSERT INTO `tStates` VALUES (1264,85,'Stip',NULL,NULL),(1265,85,'Struga',NULL,NULL),(1266,85,'Strumica',NULL,NULL),(1267,85,'Studenicani',NULL,NULL),(1268,85,'Suto Orizari',NULL,NULL),(1269,85,'Sveti Nikole',NULL,NULL),(1270,85,'Tearce',NULL,NULL),(1271,85,'Tetovo',NULL,NULL),(1273,85,'Valandovo',NULL,NULL),(1275,85,'Veles',NULL,NULL),(1277,85,'Vevcani',NULL,NULL),(1278,85,'Vinica',NULL,NULL),(1281,85,'Vrapciste',NULL,NULL),(1286,85,'Zelino',NULL,NULL),(1289,85,'Zrnovci',NULL,NULL),(1291,86,'Malta',NULL,NULL),(1292,44,'La Condamine',NULL,NULL),(1293,44,'Monaco',NULL,NULL),(1294,44,'Monte-Carlo',NULL,NULL),(1295,47,'Biala Podlaska',NULL,NULL),(1296,47,'Bialystok',NULL,NULL),(1297,47,'Bielsko',NULL,NULL),(1298,47,'Bydgoszcz',NULL,NULL),(1299,47,'Chelm',NULL,NULL),(1300,47,'Ciechanow',NULL,NULL),(1301,47,'Czestochowa',NULL,NULL),(1302,47,'Elblag',NULL,NULL),(1303,47,'Gdansk',NULL,NULL),(1304,47,'Gorzow',NULL,NULL),(1305,47,'Jelenia Gora',NULL,NULL),(1306,47,'Kalisz',NULL,NULL),(1307,47,'Katowice',NULL,NULL),(1308,47,'Kielce',NULL,NULL),(1309,47,'Konin',NULL,NULL),(1310,47,'Koszalin',NULL,NULL),(1311,47,'Krakow',NULL,NULL),(1312,47,'Krosno',NULL,NULL),(1313,47,'Legnica',NULL,NULL),(1314,47,'Leszno',NULL,NULL),(1315,47,'Lodz',NULL,NULL),(1316,47,'Lomza',NULL,NULL),(1317,47,'Lublin',NULL,NULL),(1318,47,'Nowy Sacz',NULL,NULL),(1319,47,'Olsztyn',NULL,NULL),(1320,47,'Opole',NULL,NULL),(1321,47,'Ostroleka',NULL,NULL),(1322,47,'Pila',NULL,NULL),(1323,47,'Piotrkow',NULL,NULL),(1324,47,'Plock',NULL,NULL),(1325,47,'Poznan',NULL,NULL),(1326,47,'Przemysl',NULL,NULL),(1327,47,'Radom',NULL,NULL),(1328,47,'Rzeszow',NULL,NULL),(1329,47,'Siedlce',NULL,NULL),(1330,47,'Sieradz',NULL,NULL),(1331,47,'Skierniewice',NULL,NULL),(1332,47,'Slupsk',NULL,NULL),(1333,47,'Suwalki',NULL,NULL),(1335,47,'Tarnobrzeg',NULL,NULL),(1336,47,'Tarnow',NULL,NULL),(1337,47,'Torun',NULL,NULL),(1338,47,'Walbrzych',NULL,NULL),(1339,47,'Warszawa',NULL,NULL),(1340,47,'Wloclawek',NULL,NULL),(1341,47,'Wroclaw',NULL,NULL),(1342,47,'Zamosc',NULL,NULL),(1343,47,'Zielona Gora',NULL,NULL),(1344,47,'Dolnoslaskie',NULL,NULL),(1345,47,'Kujawsko-Pomorskie',NULL,NULL),(1346,47,'Lodzkie',NULL,NULL),(1347,47,'Lubelskie',NULL,NULL),(1348,47,'Lubuskie',NULL,NULL),(1349,47,'Malopolskie',NULL,NULL),(1350,47,'Mazowieckie',NULL,NULL),(1351,47,'Opolskie',NULL,NULL),(1352,47,'Podkarpackie',NULL,NULL),(1353,47,'Podlaskie',NULL,NULL),(1354,47,'Pomorskie',NULL,NULL),(1355,47,'Slaskie',NULL,NULL),(1356,47,'Swietokrzyskie',NULL,NULL),(1357,47,'Warminsko-Mazurskie',NULL,NULL),(1358,47,'Wielkopolskie',NULL,NULL),(1359,47,'Zachodniopomorskie',NULL,NULL),(1361,72,'Alba',NULL,NULL),(1362,72,'Arad',NULL,NULL),(1363,72,'Arges',NULL,NULL),(1364,72,'Bacau',NULL,NULL),(1365,72,'Bihor',NULL,NULL),(1366,72,'Bistrita-Nasaud',NULL,NULL),(1367,72,'Botosani',NULL,NULL),(1368,72,'Braila',NULL,NULL),(1369,72,'Brasov',NULL,NULL),(1370,72,'Bucuresti',NULL,NULL),(1371,72,'Buzau',NULL,NULL),(1372,72,'Caras-Severin',NULL,NULL),(1373,72,'Cluj',NULL,NULL),(1374,72,'Constanta',NULL,NULL),(1375,72,'Covasna',NULL,NULL),(1376,72,'Dambovita',NULL,NULL),(1377,72,'Dolj',NULL,NULL),(1378,72,'Galati',NULL,NULL),(1379,72,'Gorj',NULL,NULL),(1380,72,'Harghita',NULL,NULL),(1381,72,'Hunedoara',NULL,NULL),(1382,72,'Ialomita',NULL,NULL),(1383,72,'Iasi',NULL,NULL),(1384,72,'Maramures',NULL,NULL),(1385,72,'Mehedinti',NULL,NULL),(1386,72,'Mures',NULL,NULL),(1387,72,'Neamt',NULL,NULL),(1388,72,'Olt',NULL,NULL),(1389,72,'Prahova',NULL,NULL),(1390,72,'Salaj',NULL,NULL),(1391,72,'Satu Mare',NULL,NULL),(1392,72,'Sibiu',NULL,NULL),(1393,72,'Suceava',NULL,NULL),(1394,72,'Teleorman',NULL,NULL),(1395,72,'Timis',NULL,NULL),(1396,72,'Tulcea',NULL,NULL),(1397,72,'Vaslui',NULL,NULL),(1398,72,'Valcea',NULL,NULL),(1399,72,'Vrancea',NULL,NULL),(1400,72,'Calarasi',NULL,NULL),(1401,72,'Giurgiu',NULL,NULL),(1404,224,'Acquaviva',NULL,NULL),(1405,224,'Chiesanuova',NULL,NULL),(1406,224,'Domagnano',NULL,NULL);
INSERT INTO `tStates` VALUES (1407,224,'Faetano',NULL,NULL),(1408,224,'Fiorentino',NULL,NULL),(1409,224,'Borgo Maggiore',NULL,NULL),(1410,224,'San Marino',NULL,NULL),(1411,224,'Monte Giardino',NULL,NULL),(1412,224,'Serravalle',NULL,NULL),(1413,52,'Banska Bystrica',NULL,NULL),(1414,52,'Bratislava',NULL,NULL),(1415,52,'Kosice',NULL,NULL),(1416,52,'Nitra',NULL,NULL),(1417,52,'Presov',NULL,NULL),(1418,52,'Trencin',NULL,NULL),(1419,52,'Trnava',NULL,NULL),(1420,52,'Zilina',NULL,NULL),(1423,53,'Beltinci',NULL,NULL),(1425,53,'Bohinj',NULL,NULL),(1426,53,'Borovnica',NULL,NULL),(1427,53,'Bovec',NULL,NULL),(1428,53,'Brda',NULL,NULL),(1429,53,'Brezice',NULL,NULL),(1430,53,'Brezovica',NULL,NULL),(1432,53,'Cerklje na Gorenjskem',NULL,NULL),(1434,53,'Cerkno',NULL,NULL),(1436,53,'Crna na Koroskem',NULL,NULL),(1437,53,'Crnomelj',NULL,NULL),(1438,53,'Divaca',NULL,NULL),(1439,53,'Dobrepolje',NULL,NULL),(1440,53,'Dol pri Ljubljani',NULL,NULL),(1443,53,'Duplek',NULL,NULL),(1447,53,'Gornji Grad',NULL,NULL),(1450,53,'Hrastnik',NULL,NULL),(1451,53,'Hrpelje-Kozina',NULL,NULL),(1452,53,'Idrija',NULL,NULL),(1453,53,'Ig',NULL,NULL),(1454,53,'Ilirska Bistrica',NULL,NULL),(1455,53,'Ivancna Gorica',NULL,NULL),(1462,53,'Komen',NULL,NULL),(1463,53,'Koper-Capodistria',NULL,NULL),(1464,53,'Kozje',NULL,NULL),(1465,53,'Kranj',NULL,NULL),(1466,53,'Kranjska Gora',NULL,NULL),(1467,53,'Krsko',NULL,NULL),(1469,53,'Lasko',NULL,NULL),(1470,53,'Ljubljana',NULL,NULL),(1471,53,'Ljubno',NULL,NULL),(1472,53,'Logatec',NULL,NULL),(1475,53,'Medvode',NULL,NULL),(1476,53,'Menges',NULL,NULL),(1478,53,'Mezica',NULL,NULL),(1480,53,'Moravce',NULL,NULL),(1482,53,'Mozirje',NULL,NULL),(1483,53,'Murska Sobota',NULL,NULL),(1487,53,'Nova Gorica',NULL,NULL),(1489,53,'Ormoz',NULL,NULL),(1491,53,'Pesnica',NULL,NULL),(1494,53,'Postojna',NULL,NULL),(1497,53,'Radece',NULL,NULL),(1498,53,'Radenci',NULL,NULL),(1500,53,'Radovljica',NULL,NULL),(1502,53,'Rogaska Slatina',NULL,NULL),(1505,53,'Sencur',NULL,NULL),(1506,53,'Sentilj',NULL,NULL),(1508,53,'Sevnica',NULL,NULL),(1509,53,'Sezana',NULL,NULL),(1511,53,'Skofja Loka',NULL,NULL),(1513,53,'Slovenj Gradec',NULL,NULL),(1514,53,'Slovenske Konjice',NULL,NULL),(1515,53,'Smarje pri Jelsah',NULL,NULL),(1521,53,'Tolmin',NULL,NULL),(1522,53,'Trbovlje',NULL,NULL),(1524,53,'Trzic',NULL,NULL),(1526,53,'Velenje',NULL,NULL),(1528,53,'Vipava',NULL,NULL),(1531,53,'Vrhnika',NULL,NULL),(1532,53,'Vuzenica',NULL,NULL),(1533,53,'Zagorje ob Savi',NULL,NULL),(1535,53,'Zelezniki',NULL,NULL),(1536,53,'Ziri',NULL,NULL),(1537,53,'Zrece',NULL,NULL),(1539,53,'Domzale',NULL,NULL),(1540,53,'Jesenice',NULL,NULL),(1541,53,'Kamnik',NULL,NULL),(1542,53,'Kocevje',NULL,NULL),(1544,53,'Lenart',NULL,NULL),(1545,53,'Litija',NULL,NULL),(1546,53,'Ljutomer',NULL,NULL),(1550,53,'Maribor',NULL,NULL),(1552,53,'Novo Mesto',NULL,NULL),(1553,53,'Piran',NULL,NULL),(1554,53,'Preddvor',NULL,NULL),(1555,53,'Ptuj',NULL,NULL),(1556,53,'Ribnica',NULL,NULL),(1558,53,'Sentjur pri Celju',NULL,NULL),(1559,53,'Slovenska Bistrica',NULL,NULL),(1560,53,'Videm',NULL,NULL),(1562,53,'Zalec',NULL,NULL),(1564,109,'Seychelles',NULL,NULL),(1565,108,'Mauritania',NULL,NULL),(1566,135,'Senegal',NULL,NULL),(1567,154,'Road Town',NULL,NULL),(1568,165,'Congo',NULL,NULL),(1569,166,'Avarua',NULL,NULL),(1570,172,'Malabo',NULL,NULL),(1571,175,'Torshavn',NULL,NULL),(1572,178,'Papeete',NULL,NULL),(1573,184,'St George&#039;s',NULL,NULL),(1574,186,'St Peter Port',NULL,NULL),(1575,188,'Bissau',NULL,NULL),(1576,193,'Saint Helier',NULL,NULL),(1577,201,'Fort-de-France',NULL,NULL),(1578,207,'Willemstad',NULL,NULL),(1579,208,'Noumea',NULL,NULL),(1580,212,'Kingston',NULL,NULL),(1581,215,'Adamstown',NULL,NULL),(1582,216,'Doha',NULL,NULL),(1583,218,'Jamestown',NULL,NULL),(1584,219,'Basseterre',NULL,NULL),(1585,220,'Castries',NULL,NULL),(1586,221,'Saint Pierre',NULL,NULL),(1587,222,'Kingstown',NULL,NULL),(1588,225,'San Tome',NULL,NULL),(1589,226,'Belgrade',NULL,NULL),(1590,227,'Freetown',NULL,NULL);
INSERT INTO `tStates` VALUES (1591,229,'Mogadishu',NULL,NULL),(1592,235,'Fakaofo',NULL,NULL),(1593,237,'Port of Spain',NULL,NULL),(1594,241,'Mata-Utu',NULL,NULL),(1596,89,'Amazonas',NULL,NULL),(1597,89,'Ancash',NULL,NULL),(1598,89,'Apurímac',NULL,NULL),(1599,89,'Arequipa',NULL,NULL),(1600,89,'Ayacucho',NULL,NULL),(1601,89,'Cajamarca',NULL,NULL),(1602,89,'Callao',NULL,NULL),(1603,89,'Cusco',NULL,NULL),(1604,89,'Huancavelica',NULL,NULL),(1605,89,'Huánuco',NULL,NULL),(1606,89,'Ica',NULL,NULL),(1607,89,'Junín',NULL,NULL),(1608,89,'La Libertad',NULL,NULL),(1609,89,'Lambayeque',NULL,NULL),(1610,89,'Lima',NULL,NULL),(1611,89,'Loreto',NULL,NULL),(1612,89,'Madre de Dios',NULL,NULL),(1613,89,'Moquegua',NULL,NULL),(1614,89,'Pasco',NULL,NULL),(1615,89,'Piura',NULL,NULL),(1616,89,'Puno',NULL,NULL),(1617,89,'San Martín',NULL,NULL),(1618,89,'Tacna',NULL,NULL),(1619,89,'Tumbes',NULL,NULL),(1620,89,'Ucayali',NULL,NULL),(1622,110,'Alto Paraná',NULL,NULL),(1623,110,'Amambay',NULL,NULL),(1624,110,'Boquerón',NULL,NULL),(1625,110,'Caaguaz&uacute;',NULL,NULL),(1626,110,'Caazapá',NULL,NULL),(1627,110,'Central',NULL,NULL),(1628,110,'Concepción',NULL,NULL),(1629,110,'Cordillera',NULL,NULL),(1630,110,'Guairá',NULL,NULL),(1631,110,'Itap&uacute;a',NULL,NULL),(1632,110,'Misiones',NULL,NULL),(1633,110,'Neembuc&uacute;',NULL,NULL),(1634,110,'Paraguarí',NULL,NULL),(1635,110,'Presidente Hayes',NULL,NULL),(1636,110,'San Pedro',NULL,NULL),(1637,110,'Alto Paraguay',NULL,NULL),(1638,110,'Canindey&uacute;',NULL,NULL),(1639,110,'Chaco',NULL,NULL),(1642,111,'Artigas',NULL,NULL),(1643,111,'Canelones',NULL,NULL),(1644,111,'Cerro Largo',NULL,NULL),(1645,111,'Colonia',NULL,NULL),(1646,111,'Durazno',NULL,NULL),(1647,111,'Flores',NULL,NULL),(1648,111,'Florida',NULL,NULL),(1649,111,'Lavalleja',NULL,NULL),(1650,111,'Maldonado',NULL,NULL),(1651,111,'Montevideo',NULL,NULL),(1652,111,'Paysand&uacute;',NULL,NULL),(1653,111,'Río Negro',NULL,NULL),(1654,111,'Rivera',NULL,NULL),(1655,111,'Rocha',NULL,NULL),(1656,111,'Salto',NULL,NULL),(1657,111,'San José',NULL,NULL),(1658,111,'Soriano',NULL,NULL),(1659,111,'Tacuarembó',NULL,NULL),(1660,111,'Treinta y Tres',NULL,NULL),(1662,81,'Valparaíso',NULL,NULL),(1663,81,'Aisén del General Carlos Ibánez del Campo',NULL,NULL),(1664,81,'Antofagasta',NULL,NULL),(1665,81,'Araucanía',NULL,NULL),(1666,81,'Atacama',NULL,NULL),(1667,81,'Bío-Bío',NULL,NULL),(1668,81,'Coquimbo',NULL,NULL),(1669,81,'Libertador General Bernardo O&#039;Higgins',NULL,NULL),(1670,81,'Los Lagos',NULL,NULL),(1671,81,'Magallanes y de la Antártica Chilena',NULL,NULL),(1672,81,'Maule',NULL,NULL),(1673,81,'Region Metropolitana',NULL,NULL),(1674,81,'Tarapacá',NULL,NULL),(1676,185,'Alta Verapaz',NULL,NULL),(1677,185,'Baja Verapaz',NULL,NULL),(1678,185,'Chimaltenango',NULL,NULL),(1679,185,'Chiquimula',NULL,NULL),(1680,185,'El Progreso',NULL,NULL),(1681,185,'Escuintla',NULL,NULL),(1682,185,'Guatemala',NULL,NULL),(1683,185,'Huehuetenango',NULL,NULL),(1684,185,'Izabal',NULL,NULL),(1685,185,'Jalapa',NULL,NULL),(1686,185,'Jutiapa',NULL,NULL),(1687,185,'Petén',NULL,NULL),(1688,185,'Quetzaltenango',NULL,NULL),(1689,185,'Quiché',NULL,NULL),(1690,185,'Retalhuleu',NULL,NULL),(1691,185,'Sacatepéquez',NULL,NULL),(1692,185,'San Marcos',NULL,NULL),(1693,185,'Santa Rosa',NULL,NULL),(1694,185,'Sololá',NULL,NULL),(1695,185,'Suchitepequez',NULL,NULL),(1696,185,'Totonicapán',NULL,NULL),(1697,185,'Zacapa',NULL,NULL),(1699,82,'Amazonas',NULL,NULL),(1700,82,'Antioquia',NULL,NULL),(1701,82,'Arauca',NULL,NULL),(1702,82,'Atlántico',NULL,NULL),(1703,82,'Caquetá',NULL,NULL),(1704,82,'Cauca',NULL,NULL),(1705,82,'César',NULL,NULL),(1706,82,'Chocó',NULL,NULL),(1707,82,'Córdoba',NULL,NULL),(1708,82,'Guaviare',NULL,NULL),(1709,82,'Guainía',NULL,NULL),(1710,82,'Huila',NULL,NULL),(1711,82,'La Guajira',NULL,NULL),(1712,82,'Meta',NULL,NULL),(1713,82,'Narino',NULL,NULL),(1714,82,'Norte de Santander',NULL,NULL),(1715,82,'Putumayo',NULL,NULL);
INSERT INTO `tStates` VALUES (1716,82,'Quindío',NULL,NULL),(1717,82,'Risaralda',NULL,NULL),(1718,82,'San Andrés y Providencia',NULL,NULL),(1719,82,'Santander',NULL,NULL),(1720,82,'Sucre',NULL,NULL),(1721,82,'Tolima',NULL,NULL),(1722,82,'Valle del Cauca',NULL,NULL),(1723,82,'Vaupés',NULL,NULL),(1724,82,'Vichada',NULL,NULL),(1725,82,'Casanare',NULL,NULL),(1726,82,'Cundinamarca',NULL,NULL),(1727,82,'Distrito Especial',NULL,NULL),(1730,82,'Caldas',NULL,NULL),(1731,82,'Magdalena',NULL,NULL),(1733,42,'Aguascalientes',NULL,NULL),(1734,42,'Baja California',NULL,NULL),(1735,42,'Baja California Sur',NULL,NULL),(1736,42,'Campeche',NULL,NULL),(1737,42,'Chiapas',NULL,NULL),(1738,42,'Chihuahua',NULL,NULL),(1739,42,'Coahuila de Zaragoza',NULL,NULL),(1740,42,'Colima',NULL,NULL),(1741,42,'Distrito Federal',NULL,NULL),(1742,42,'Durango',NULL,NULL),(1743,42,'Guanajuato',NULL,NULL),(1744,42,'Guerrero',NULL,NULL),(1745,42,'Hidalgo',NULL,NULL),(1746,42,'Jalisco',NULL,NULL),(1747,42,'México',NULL,NULL),(1748,42,'Michoacán de Ocampo',NULL,NULL),(1749,42,'Morelos',NULL,NULL),(1750,42,'Nayarit',NULL,NULL),(1751,42,'Nuevo León',NULL,NULL),(1752,42,'Oaxaca',NULL,NULL),(1753,42,'Puebla',NULL,NULL),(1754,42,'Querétaro de Arteaga',NULL,NULL),(1755,42,'Quintana Roo',NULL,NULL),(1756,42,'San Luis Potosí',NULL,NULL),(1757,42,'Sinaloa',NULL,NULL),(1758,42,'Sonora',NULL,NULL),(1759,42,'Tabasco',NULL,NULL),(1760,42,'Tamaulipas',NULL,NULL),(1761,42,'Tlaxcala',NULL,NULL),(1762,42,'Veracruz-Llave',NULL,NULL),(1763,42,'Yucatán',NULL,NULL),(1764,42,'Zacatecas',NULL,NULL),(1766,124,'Bocas del Toro',NULL,NULL),(1767,124,'Chiriquí',NULL,NULL),(1768,124,'Coclé',NULL,NULL),(1769,124,'Colón',NULL,NULL),(1770,124,'Darién',NULL,NULL),(1771,124,'Herrera',NULL,NULL),(1772,124,'Los Santos',NULL,NULL),(1773,124,'Panamá',NULL,NULL),(1774,124,'San Blas',NULL,NULL),(1775,124,'Veraguas',NULL,NULL),(1777,123,'Chuquisaca',NULL,NULL),(1778,123,'Cochabamba',NULL,NULL),(1779,123,'El Beni',NULL,NULL),(1780,123,'La Paz',NULL,NULL),(1781,123,'Oruro',NULL,NULL),(1782,123,'Pando',NULL,NULL),(1783,123,'Potosí',NULL,NULL),(1784,123,'Santa Cruz',NULL,NULL),(1785,123,'Tarija',NULL,NULL),(1787,36,'Alajuela',NULL,NULL),(1788,36,'Cartago',NULL,NULL),(1789,36,'Guanacaste',NULL,NULL),(1790,36,'Heredia',NULL,NULL),(1791,36,'Limón',NULL,NULL),(1792,36,'Puntarenas',NULL,NULL),(1793,36,'San José',NULL,NULL),(1795,103,'Galápagos',NULL,NULL),(1796,103,'Azuay',NULL,NULL),(1797,103,'Bolívar',NULL,NULL),(1798,103,'Canar',NULL,NULL),(1799,103,'Carchi',NULL,NULL),(1800,103,'Chimborazo',NULL,NULL),(1801,103,'Cotopaxi',NULL,NULL),(1802,103,'El Oro',NULL,NULL),(1803,103,'Esmeraldas',NULL,NULL),(1804,103,'Guayas',NULL,NULL),(1805,103,'Imbabura',NULL,NULL),(1806,103,'Loja',NULL,NULL),(1807,103,'Los Ríos',NULL,NULL),(1808,103,'Manabí',NULL,NULL),(1809,103,'Morona-Santiago',NULL,NULL),(1810,103,'Pastaza',NULL,NULL),(1811,103,'Pichincha',NULL,NULL),(1812,103,'Tungurahua',NULL,NULL),(1813,103,'Zamora-Chinchipe',NULL,NULL),(1814,103,'Sucumbíos',NULL,NULL),(1815,103,'Napo',NULL,NULL),(1816,103,'Orellana',NULL,NULL),(1818,5,'Buenos Aires',NULL,NULL),(1819,5,'Catamarca',NULL,NULL),(1820,5,'Chaco',NULL,NULL),(1821,5,'Chubut',NULL,NULL),(1822,5,'Córdoba',NULL,NULL),(1823,5,'Corrientes',NULL,NULL),(1824,5,'Distrito Federal',NULL,NULL),(1825,5,'Entre Ríos',NULL,NULL),(1826,5,'Formosa',NULL,NULL),(1827,5,'Jujuy',NULL,NULL),(1828,5,'La Pampa',NULL,NULL),(1829,5,'La Rioja',NULL,NULL),(1830,5,'Mendoza',NULL,NULL),(1831,5,'Misiones',NULL,NULL),(1832,5,'Neuquén',NULL,NULL),(1833,5,'Río Negro',NULL,NULL),(1834,5,'Salta',NULL,NULL),(1835,5,'San Juan',NULL,NULL),(1836,5,'San Luis',NULL,NULL),(1837,5,'Santa Cruz',NULL,NULL),(1838,5,'Santa Fe',NULL,NULL),(1839,5,'Santiago del Estero',NULL,NULL),(1840,5,'Tierra del Fuego',NULL,NULL),(1841,5,'Tucumán',NULL,NULL),(1843,95,'Amazonas',NULL,NULL),(1844,95,'Anzoategui',NULL,NULL),(1845,95,'Apure',NULL,NULL),(1846,95,'Aragua',NULL,NULL);
INSERT INTO `tStates` VALUES (1847,95,'Barinas',NULL,NULL),(1848,95,'Bolívar',NULL,NULL),(1849,95,'Carabobo',NULL,NULL),(1850,95,'Cojedes',NULL,NULL),(1851,95,'Delta Amacuro',NULL,NULL),(1852,95,'Falcón',NULL,NULL),(1853,95,'Guárico',NULL,NULL),(1854,95,'Lara',NULL,NULL),(1855,95,'Mérida',NULL,NULL),(1856,95,'Miranda',NULL,NULL),(1857,95,'Monagas',NULL,NULL),(1858,95,'Nueva Esparta',NULL,NULL),(1859,95,'Portuguesa',NULL,NULL),(1860,95,'Sucre',NULL,NULL),(1861,95,'Táchira',NULL,NULL),(1862,95,'Trujillo',NULL,NULL),(1863,95,'Yaracuy',NULL,NULL),(1864,95,'Zulia',NULL,NULL),(1865,95,'Dependencias Federales',NULL,NULL),(1866,95,'Distrito Capital',NULL,NULL),(1867,95,'Vargas',NULL,NULL),(1869,209,'Boaco',NULL,NULL),(1870,209,'Carazo',NULL,NULL),(1871,209,'Chinandega',NULL,NULL),(1872,209,'Chontales',NULL,NULL),(1873,209,'Estelí',NULL,NULL),(1874,209,'Granada',NULL,NULL),(1875,209,'Jinotega',NULL,NULL),(1876,209,'León',NULL,NULL),(1877,209,'Madriz',NULL,NULL),(1878,209,'Managua',NULL,NULL),(1879,209,'Masaya',NULL,NULL),(1880,209,'Matagalpa',NULL,NULL),(1881,209,'Nueva Segovia',NULL,NULL),(1882,209,'Rio San Juan',NULL,NULL),(1883,209,'Rivas',NULL,NULL),(1884,209,'Zelaya',NULL,NULL),(1886,113,'Pinar del Rio',NULL,NULL),(1887,113,'Ciudad de la Habana',NULL,NULL),(1888,113,'Matanzas',NULL,NULL),(1889,113,'Isla de la Juventud',NULL,NULL),(1890,113,'Camaguey',NULL,NULL),(1891,113,'Ciego de Avila',NULL,NULL),(1892,113,'Cienfuegos',NULL,NULL),(1893,113,'Granma',NULL,NULL),(1894,113,'Guantanamo',NULL,NULL),(1895,113,'La Habana',NULL,NULL),(1896,113,'Holguin',NULL,NULL),(1897,113,'Las Tunas',NULL,NULL),(1898,113,'Sancti Spiritus',NULL,NULL),(1899,113,'Santiago de Cuba',NULL,NULL),(1900,113,'Villa Clara',NULL,NULL),(1901,12,'Acre',NULL,NULL),(1902,12,'Alagoas',NULL,NULL),(1903,12,'Amapa',NULL,NULL),(1904,12,'Amazonas',NULL,NULL),(1905,12,'Bahia',NULL,NULL),(1906,12,'Ceara',NULL,NULL),(1907,12,'Distrito Federal',NULL,NULL),(1908,12,'Espirito Santo',NULL,NULL),(1909,12,'Mato Grosso do Sul',NULL,NULL),(1910,12,'Maranhao',NULL,NULL),(1911,12,'Mato Grosso',NULL,NULL),(1912,12,'Minas Gerais',NULL,NULL),(1913,12,'Para',NULL,NULL),(1914,12,'Paraiba',NULL,NULL),(1915,12,'Parana',NULL,NULL),(1916,12,'Piaui',NULL,NULL),(1917,12,'Rio de Janeiro',NULL,NULL),(1918,12,'Rio Grande do Norte',NULL,NULL),(1919,12,'Rio Grande do Sul',NULL,NULL),(1920,12,'Rondonia',NULL,NULL),(1921,12,'Roraima',NULL,NULL),(1922,12,'Santa Catarina',NULL,NULL),(1923,12,'Sao Paulo',NULL,NULL),(1924,12,'Sergipe',NULL,NULL),(1925,12,'Goias',NULL,NULL),(1926,12,'Pernambuco',NULL,NULL),(1927,12,'Tocantins',NULL,NULL),(1930,83,'Akureyri',NULL,NULL),(1931,83,'Arnessysla',NULL,NULL),(1932,83,'Austur-Bardastrandarsysla',NULL,NULL),(1933,83,'Austur-Hunavatnssysla',NULL,NULL),(1934,83,'Austur-Skaftafellssysla',NULL,NULL),(1935,83,'Borgarfjardarsysla',NULL,NULL),(1936,83,'Dalasysla',NULL,NULL),(1937,83,'Eyjafjardarsysla',NULL,NULL),(1938,83,'Gullbringusysla',NULL,NULL),(1939,83,'Hafnarfjordur',NULL,NULL),(1943,83,'Kjosarsysla',NULL,NULL),(1944,83,'Kopavogur',NULL,NULL),(1945,83,'Myrasysla',NULL,NULL),(1946,83,'Neskaupstadur',NULL,NULL),(1947,83,'Nordur-Isafjardarsysla',NULL,NULL),(1948,83,'Nordur-Mulasysla',NULL,NULL),(1949,83,'Nordur-Tingeyjarsysla',NULL,NULL),(1950,83,'Olafsfjordur',NULL,NULL),(1951,83,'Rangarvallasysla',NULL,NULL),(1952,83,'Reykjavik',NULL,NULL),(1953,83,'Saudarkrokur',NULL,NULL),(1954,83,'Seydisfjordur',NULL,NULL),(1956,83,'Skagafjardarsysla',NULL,NULL),(1957,83,'Snafellsnes- og Hnappadalssysla',NULL,NULL),(1958,83,'Strandasysla',NULL,NULL),(1959,83,'Sudur-Mulasysla',NULL,NULL),(1960,83,'Sudur-Tingeyjarsysla',NULL,NULL),(1961,83,'Vestmannaeyjar',NULL,NULL),(1962,83,'Vestur-Bardastrandarsysla',NULL,NULL),(1964,83,'Vestur-Isafjardarsysla',NULL,NULL),(1965,83,'Vestur-Skaftafellssysla',NULL,NULL),(1966,35,'Anhui',NULL,NULL),(1967,35,'Zhejiang',NULL,NULL),(1968,35,'Jiangxi',NULL,NULL),(1969,35,'Jiangsu',NULL,NULL),(1970,35,'Jilin',NULL,NULL);
INSERT INTO `tStates` VALUES (1971,35,'Qinghai',NULL,NULL),(1972,35,'Fujian',NULL,NULL),(1973,35,'Heilongjiang',NULL,NULL),(1974,35,'Henan',NULL,NULL),(1975,35,'Hebei',NULL,NULL),(1976,35,'Hunan',NULL,NULL),(1977,35,'Hubei',NULL,NULL),(1978,35,'Xinjiang',NULL,NULL),(1979,35,'Xizang',NULL,NULL),(1980,35,'Gansu',NULL,NULL),(1981,35,'Guangxi',NULL,NULL),(1982,35,'Guizhou',NULL,NULL),(1983,35,'Liaoning',NULL,NULL),(1984,35,'Nei Mongol',NULL,NULL),(1985,35,'Ningxia',NULL,NULL),(1986,35,'Beijing',NULL,NULL),(1987,35,'Shanghai',NULL,NULL),(1988,35,'Shanxi',NULL,NULL),(1989,35,'Shandong',NULL,NULL),(1990,35,'Shaanxi',NULL,NULL),(1991,35,'Sichuan',NULL,NULL),(1992,35,'Tianjin',NULL,NULL),(1993,35,'Yunnan',NULL,NULL),(1994,35,'Guangdong',NULL,NULL),(1995,35,'Hainan',NULL,NULL),(1996,35,'Chongqing',NULL,NULL),(1997,97,'Central',NULL,NULL),(1998,97,'Coast',NULL,NULL),(1999,97,'Eastern',NULL,NULL),(2000,97,'Nairobi Area',NULL,NULL),(2001,97,'North-Eastern',NULL,NULL),(2002,97,'Nyanza',NULL,NULL),(2003,97,'Rift Valley',NULL,NULL),(2004,97,'Western',NULL,NULL),(2006,195,'Gilbert Islands',NULL,NULL),(2007,195,'Line Islands',NULL,NULL),(2008,195,'Phoenix Islands',NULL,NULL),(2010,1,'Australian Capital Territory',NULL,NULL),(2011,1,'New South Wales',NULL,NULL),(2012,1,'Northern Territory',NULL,NULL),(2013,1,'Queensland',NULL,NULL),(2014,1,'South Australia',NULL,NULL),(2015,1,'Tasmania',NULL,NULL),(2016,1,'Victoria',NULL,NULL),(2017,1,'Western Australia',NULL,NULL),(2018,27,'Dublin',NULL,NULL),(2019,27,'Galway',NULL,NULL),(2020,27,'Kildare',NULL,NULL),(2021,27,'Leitrim',NULL,NULL),(2022,27,'Limerick',NULL,NULL),(2023,27,'Mayo',NULL,NULL),(2024,27,'Meath',NULL,NULL),(2025,27,'Carlow',NULL,NULL),(2026,27,'Kilkenny',NULL,NULL),(2027,27,'Laois',NULL,NULL),(2028,27,'Longford',NULL,NULL),(2029,27,'Louth',NULL,NULL),(2030,27,'Offaly',NULL,NULL),(2031,27,'Westmeath',NULL,NULL),(2032,27,'Wexford',NULL,NULL),(2033,27,'Wicklow',NULL,NULL),(2034,27,'Roscommon',NULL,NULL),(2035,27,'Sligo',NULL,NULL),(2036,27,'Clare',NULL,NULL),(2037,27,'Cork',NULL,NULL),(2038,27,'Kerry',NULL,NULL),(2039,27,'Tipperary',NULL,NULL),(2040,27,'Waterford',NULL,NULL),(2041,27,'Cavan',NULL,NULL),(2042,27,'Donegal',NULL,NULL),(2043,27,'Monaghan',NULL,NULL),(2044,50,'Karachaeva-Cherkesskaya Respublica',NULL,NULL),(2045,50,'Raimirskii (Dolgano-Nenetskii) AO',NULL,NULL),(2046,50,'Respublica Tiva',NULL,NULL),(2047,32,'Newfoundland',NULL,NULL),(2048,32,'Nova Scotia',NULL,NULL),(2049,32,'Prince Edward Island',NULL,NULL),(2050,32,'New Brunswick',NULL,NULL),(2051,32,'Quebec',NULL,NULL),(2052,32,'Ontario',NULL,NULL),(2053,32,'Manitoba',NULL,NULL),(2054,32,'Saskatchewan',NULL,NULL),(2055,32,'Alberta',NULL,NULL),(2056,32,'British Columbia',NULL,NULL),(2057,32,'Nunavut',NULL,NULL),(2058,32,'Northwest Territories',NULL,NULL),(2059,32,'Yukon Territory',NULL,NULL),(2060,19,'Drenthe',NULL,NULL),(2061,19,'Friesland',NULL,NULL),(2062,19,'Gelderland',NULL,NULL),(2063,19,'Groningen',NULL,NULL),(2064,19,'Limburg',NULL,NULL),(2065,19,'Noord-Brabant',NULL,NULL),(2066,19,'Noord-Holland',NULL,NULL),(2067,19,'Utrecht',NULL,NULL),(2068,19,'Zeeland',NULL,NULL),(2069,19,'Zuid-Holland',NULL,NULL),(2071,19,'Overijssel',NULL,NULL),(2072,19,'Flevoland',NULL,NULL),(2073,138,'Duarte',NULL,NULL),(2074,138,'Puerto Plata',NULL,NULL),(2075,138,'Valverde',NULL,NULL),(2076,138,'María Trinidad Sánchez',NULL,NULL),(2077,138,'Azua',NULL,NULL),(2078,138,'Santiago',NULL,NULL),(2079,138,'San Cristóbal',NULL,NULL),(2080,138,'Peravia',NULL,NULL),(2081,138,'Elías Piña',NULL,NULL),(2082,138,'Barahona',NULL,NULL),(2083,138,'Monte Plata',NULL,NULL),(2084,138,'Salcedo',NULL,NULL),(2085,138,'La Altagracia',NULL,NULL),(2086,138,'San Juan',NULL,NULL),(2087,138,'Monseñor Nouel',NULL,NULL),(2088,138,'Monte Cristi',NULL,NULL),(2089,138,'Espaillat',NULL,NULL),(2090,138,'Sánchez Ramírez',NULL,NULL),(2091,138,'La Vega',NULL,NULL),(2092,138,'San Pedro de Macorís',NULL,NULL);
INSERT INTO `tStates` VALUES (2093,138,'Independencia',NULL,NULL),(2094,138,'Dajabón',NULL,NULL),(2095,138,'Baoruco',NULL,NULL),(2096,138,'El Seibo',NULL,NULL),(2097,138,'Hato Mayor',NULL,NULL),(2098,138,'La Romana',NULL,NULL),(2099,138,'Pedernales',NULL,NULL),(2100,138,'Samaná',NULL,NULL),(2101,138,'Santiago Rodríguez',NULL,NULL),(2102,138,'San José de Ocoa',NULL,NULL),(2103,70,'Chiba',NULL,NULL),(2104,70,'Ehime',NULL,NULL),(2105,70,'Oita',NULL,NULL),(2106,85,'Skopje',NULL,NULL),(2108,35,'Schanghai',NULL,NULL),(2109,35,'Hongkong',NULL,NULL),(2110,35,'Neimenggu',NULL,NULL),(2111,35,'Aomen',NULL,NULL),(2112,92,'Amnat Charoen',NULL,NULL),(2113,92,'Ang Thong',NULL,NULL),(2114,92,'Bangkok',NULL,NULL),(2115,92,'Buri Ram',NULL,NULL),(2116,92,'Chachoengsao',NULL,NULL),(2117,92,'Chai Nat',NULL,NULL),(2118,92,'Chaiyaphum',NULL,NULL),(2119,92,'Chanthaburi',NULL,NULL),(2120,92,'Chiang Mai',NULL,NULL),(2121,92,'Chiang Rai',NULL,NULL),(2122,92,'Chon Buri',NULL,NULL),(2124,92,'Kalasin',NULL,NULL),(2126,92,'Kanchanaburi',NULL,NULL),(2127,92,'Khon Kaen',NULL,NULL),(2128,92,'Krabi',NULL,NULL),(2129,92,'Lampang',NULL,NULL),(2131,92,'Loei',NULL,NULL),(2132,92,'Lop Buri',NULL,NULL),(2133,92,'Mae Hong Son',NULL,NULL),(2134,92,'Maha Sarakham',NULL,NULL),(2137,92,'Nakhon Pathom',NULL,NULL),(2139,92,'Nakhon Ratchasima',NULL,NULL),(2140,92,'Nakhon Sawan',NULL,NULL),(2141,92,'Nakhon Si Thammarat',NULL,NULL),(2143,92,'Narathiwat',NULL,NULL),(2144,92,'Nong Bua Lam Phu',NULL,NULL),(2145,92,'Nong Khai',NULL,NULL),(2146,92,'Nonthaburi',NULL,NULL),(2147,92,'Pathum Thani',NULL,NULL),(2148,92,'Pattani',NULL,NULL),(2149,92,'Phangnga',NULL,NULL),(2150,92,'Phatthalung',NULL,NULL),(2154,92,'Phichit',NULL,NULL),(2155,92,'Phitsanulok',NULL,NULL),(2156,92,'Phra Nakhon Si Ayutthaya',NULL,NULL),(2157,92,'Phrae',NULL,NULL),(2158,92,'Phuket',NULL,NULL),(2159,92,'Prachin Buri',NULL,NULL),(2160,92,'Prachuap Khiri Khan',NULL,NULL),(2162,92,'Ratchaburi',NULL,NULL),(2163,92,'Rayong',NULL,NULL),(2164,92,'Roi Et',NULL,NULL),(2165,92,'Sa Kaeo',NULL,NULL),(2166,92,'Sakon Nakhon',NULL,NULL),(2167,92,'Samut Prakan',NULL,NULL),(2168,92,'Samut Sakhon',NULL,NULL),(2169,92,'Samut Songkhran',NULL,NULL),(2170,92,'Saraburi',NULL,NULL),(2172,92,'Si Sa Ket',NULL,NULL),(2173,92,'Sing Buri',NULL,NULL),(2174,92,'Songkhla',NULL,NULL),(2175,92,'Sukhothai',NULL,NULL),(2176,92,'Suphan Buri',NULL,NULL),(2177,92,'Surat Thani',NULL,NULL),(2178,92,'Surin',NULL,NULL),(2180,92,'Trang',NULL,NULL),(2182,92,'Ubon Ratchathani',NULL,NULL),(2183,92,'Udon Thani',NULL,NULL),(2184,92,'Uthai Thani',NULL,NULL),(2185,92,'Uttaradit',NULL,NULL),(2186,92,'Yala',NULL,NULL),(2187,92,'Yasothon',NULL,NULL),(2188,69,'Busan',NULL,NULL),(2189,69,'Daegu',NULL,NULL),(2191,69,'Gangwon',NULL,NULL),(2192,69,'Gwangju',NULL,NULL),(2193,69,'Gyeonggi',NULL,NULL),(2194,69,'Gyeongsangbuk',NULL,NULL),(2195,69,'Gyeongsangnam',NULL,NULL),(2196,69,'Jeju',NULL,NULL),(2201,25,'Delhi',NULL,NULL);

--
-- Table structure for table `tUserModules`
--

CREATE TABLE `tUserModules` (
  `idUserModule` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `idUser` int(10) unsigned NOT NULL,
  `idModule` int(10) unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`idUserModule`),
  KEY `tusermodules_iduser_foreign` (`idUser`),
  KEY `tusermodules_idmodule_foreign` (`idModule`),
  CONSTRAINT `tusermodules_idmodule_foreign` FOREIGN KEY (`idModule`) REFERENCES `tModules` (`idModule`),
  CONSTRAINT `tusermodules_iduser_foreign` FOREIGN KEY (`idUser`) REFERENCES `tUsers` (`idUser`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tUserModules`
--

INSERT INTO `tUserModules` VALUES (2,1,8,NULL,NULL),(7,1,16,NULL,NULL),(10,1,19,NULL,NULL),(12,1,21,NULL,NULL),(13,1,22,'2021-09-16 18:44:40','2021-09-16 18:44:40'),(14,1,23,'2021-09-16 18:44:40','2021-09-16 18:44:40'),(15,1,24,'2021-09-16 18:44:40','2021-09-16 18:44:40'),(16,1,25,NULL,NULL),(17,1,26,NULL,NULL),(18,1,27,NULL,NULL);

--
-- Table structure for table `tUsers`
--

CREATE TABLE `tUsers` (
  `idUser` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `loginUser` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `emailUser` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `claveUser` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `statusUser` int(11) NOT NULL DEFAULT '1',
  `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `user_type_id` int(10) unsigned DEFAULT NULL,
  PRIMARY KEY (`idUser`),
  UNIQUE KEY `tusers_loginuser_unique` (`loginUser`),
  UNIQUE KEY `tusers_emailuser_unique` (`emailUser`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tUsers`
--

INSERT INTO `tUsers` VALUES (1,'admin','admin@admin.com','$2y$10$STkVOGUoqFuysS6UTcIU5udWXGfivahbCF4Fou7lLGPORBsiyctG.',1,NULL,'2017-01-01 00:00:00','2017-01-01 00:00:00',1);

--
-- Table structure for table `tax_accounts`
--

CREATE TABLE `tax_accounts` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `extra_description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `iibb_aliquot` decimal(16,2) NOT NULL DEFAULT '0.00',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `tax_accounts`
--


--
-- Table structure for table `types`
--

CREATE TABLE `types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  `apply_to` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `types`
--

INSERT INTO `types` VALUES (1,NULL,NULL,'Venta','iibb'),(2,NULL,NULL,'Compra','iibb'),(3,NULL,NULL,'Retencion','iibb'),(4,NULL,NULL,'SIRCREB','iibb'),(5,NULL,NULL,'Compensacion','iibb'),(6,NULL,NULL,'Anticipos de Ganancias','iibb'),(7,NULL,NULL,'Eliminacion Masiva','iibb');

--
-- Table structure for table `user_persons`
--

CREATE TABLE `user_persons` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `parent_person_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_persons_user_id_foreign` (`user_id`),
  KEY `user_persons_person_id_foreign` (`person_id`),
  KEY `user_persons_parent_person_id_foreign` (`parent_person_id`),
  CONSTRAINT `user_persons_parent_person_id_foreign` FOREIGN KEY (`parent_person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `user_persons_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `user_persons_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `tUsers` (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_persons`
--


--
-- Table structure for table `user_types`
--

CREATE TABLE `user_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `description` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cas_view_business` int(10) unsigned NOT NULL DEFAULT '0',
  `admin` int(10) unsigned NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `user_types_description_unique` (`description`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `user_types`
--

INSERT INTO `user_types` VALUES (1,'admin',1,1,NULL,NULL);

--
-- Temporary table structure for view `v_business`
--

/*!50001 DROP VIEW IF EXISTS `v_business`*/;
/*!50001 CREATE TABLE `v_business` (
  `id` tinyint NOT NULL,
  `field_name1` tinyint NOT NULL,
  `field_name2` tinyint NOT NULL,
  `document_type` tinyint NOT NULL,
  `document` tinyint NOT NULL,
  `country_id` tinyint NOT NULL,
  `state_id` tinyint NOT NULL,
  `zone_id` tinyint NOT NULL,
  `created_at` tinyint NOT NULL,
  `updated_at` tinyint NOT NULL,
  `activity_id` tinyint NOT NULL,
  `address` tinyint NOT NULL,
  `person_type_id` tinyint NOT NULL,
  `person_configuration_id` tinyint NOT NULL,
  `settle_calc_by_coef` tinyint NOT NULL,
  `active` tinyint NOT NULL,
  `month_close` tinyint NOT NULL,
  `iva_condition_id` tinyint NOT NULL,
  `obligation_buy` tinyint NOT NULL,
  `obligation_electronic_receipt` tinyint NOT NULL,
  `obligation_iibb` tinyint NOT NULL,
  `obligation_iva` tinyint NOT NULL,
  `obligation_other_taxes` tinyint NOT NULL,
  `obligation_salaries` tinyint NOT NULL,
  `obligation_sell` tinyint NOT NULL,
  `liquidation_start_period` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `v_consultacomprobantes`
--

/*!50001 DROP VIEW IF EXISTS `v_consultacomprobantes`*/;
/*!50001 CREATE TABLE `v_consultacomprobantes` (
  `IdComprobante` tinyint NOT NULL,
  `IdTipoComprobante` tinyint NOT NULL,
  `IdProveedorCliente` tinyint NOT NULL,
  `IdEmpresa` tinyint NOT NULL,
  `DocumentoEmpresa` tinyint NOT NULL,
  `NombreEmpresa` tinyint NOT NULL,
  `IdPeriodo` tinyint NOT NULL,
  `Desde` tinyint NOT NULL,
  `Hasta` tinyint NOT NULL,
  `Periodo` tinyint NOT NULL,
  `Operacion` tinyint NOT NULL,
  `Proveedor` tinyint NOT NULL,
  `TipoDocumento` tinyint NOT NULL,
  `Documento` tinyint NOT NULL,
  `Zona` tinyint NOT NULL,
  `Estado` tinyint NOT NULL,
  `Actividad` tinyint NOT NULL,
  `FechaComprobante` tinyint NOT NULL,
  `Referencia` tinyint NOT NULL,
  `TipoDeRetencion` tinyint NOT NULL,
  `TipoComprobante` tinyint NOT NULL,
  `Suc` tinyint NOT NULL,
  `Numero` tinyint NOT NULL,
  `Total` tinyint NOT NULL,
  `gravado_27` tinyint NOT NULL,
  `IVA_27` tinyint NOT NULL,
  `gravado_21` tinyint NOT NULL,
  `IVA_21` tinyint NOT NULL,
  `gravado_105` tinyint NOT NULL,
  `IVA_105` tinyint NOT NULL,
  `gravado_5` tinyint NOT NULL,
  `IVA_5` tinyint NOT NULL,
  `gravado_0` tinyint NOT NULL,
  `IVA_0` tinyint NOT NULL,
  `gravado_2_5` tinyint NOT NULL,
  `IVA_2_5` tinyint NOT NULL,
  `no_gravado` tinyint NOT NULL,
  `percepIva` tinyint NOT NULL,
  `Imps_Internos` tinyint NOT NULL,
  `Imp_Gasoil` tinyint NOT NULL,
  `Imp_Hidricos` tinyint NOT NULL,
  `ITC` tinyint NOT NULL,
  `Perc_IIBB_Buenos_Aires` tinyint NOT NULL,
  `Perc_IIBB_Capital_Federal` tinyint NOT NULL,
  `Perc_IIBB_Catamarca` tinyint NOT NULL,
  `Perc_IIBB_Chaco` tinyint NOT NULL,
  `Perc_IIBB_Chubut` tinyint NOT NULL,
  `Perc_IIBB_Cordoba` tinyint NOT NULL,
  `Perc_IIBB_Corrientes` tinyint NOT NULL,
  `Perc_IIBB_Entre_Rios` tinyint NOT NULL,
  `Perc_IIBB_Formosa` tinyint NOT NULL,
  `Perc_IIBB_Jujuy` tinyint NOT NULL,
  `Perc_IIBB_La_Pampa` tinyint NOT NULL,
  `Perc_IIBB_La_Rioja` tinyint NOT NULL,
  `Perc_IIBB_Mendoza` tinyint NOT NULL,
  `Perc_IIBB_Misiones` tinyint NOT NULL,
  `Perc_IIBB_Neuquen` tinyint NOT NULL,
  `Perc_IIBB_Pascua_Lama` tinyint NOT NULL,
  `Perc_IIBB_Rio_Negro` tinyint NOT NULL,
  `Perc_IIBB_Salta` tinyint NOT NULL,
  `Perc_IIBB_San_Juan` tinyint NOT NULL,
  `Perc_IIBB_San_Luis` tinyint NOT NULL,
  `Perc_IIBB_Santa_Cruz` tinyint NOT NULL,
  `Perc_IIBB_Santa_Fe` tinyint NOT NULL,
  `Perc_IIBB_Santiago_del_Estero` tinyint NOT NULL,
  `Perc_IIBB_Tierra_del_Fuego` tinyint NOT NULL,
  `Perc_IIBB_Tucuman` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `v_consultaproyeccionganancias`
--

/*!50001 DROP VIEW IF EXISTS `v_consultaproyeccionganancias`*/;
/*!50001 CREATE TABLE `v_consultaproyeccionganancias` (
  `IdOperacion` tinyint NOT NULL,
  `Operacion` tinyint NOT NULL,
  `IdEmpresa` tinyint NOT NULL,
  `DocumentoEmpresa` tinyint NOT NULL,
  `NombreEmpresa` tinyint NOT NULL,
  `anioPeriodo` tinyint NOT NULL,
  `UNO` tinyint NOT NULL,
  `DOS` tinyint NOT NULL,
  `TRES` tinyint NOT NULL,
  `CUATRO` tinyint NOT NULL,
  `CINCO` tinyint NOT NULL,
  `SEIS` tinyint NOT NULL,
  `SIETE` tinyint NOT NULL,
  `OCHO` tinyint NOT NULL,
  `NUEVE` tinyint NOT NULL,
  `DIEZ` tinyint NOT NULL,
  `ONCE` tinyint NOT NULL,
  `DOCE` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Temporary table structure for view `v_liquidaciones_iva`
--

/*!50001 DROP VIEW IF EXISTS `v_liquidaciones_iva`*/;
/*!50001 CREATE TABLE `v_liquidaciones_iva` (
  `Status` tinyint NOT NULL,
  `IdLiquidacionIVA` tinyint NOT NULL,
  `period_liquidation_id` tinyint NOT NULL,
  `IdPeriodo` tinyint NOT NULL,
  `IdEmpresa` tinyint NOT NULL,
  `DocumentoEmpresa` tinyint NOT NULL,
  `NombreEmpresa` tinyint NOT NULL,
  `Desde` tinyint NOT NULL,
  `Hasta` tinyint NOT NULL,
  `Periodo` tinyint NOT NULL,
  `total_debit` tinyint NOT NULL,
  `total_credit` tinyint NOT NULL,
  `previous_technical` tinyint NOT NULL,
  `previous_free_availability` tinyint NOT NULL,
  `retention_amount` tinyint NOT NULL,
  `perception_amount` tinyint NOT NULL,
  `compensation_amount` tinyint NOT NULL,
  `total_perceptions_retentions` tinyint NOT NULL,
  `free_availability_balance` tinyint NOT NULL,
  `A_PAGAR` tinyint NOT NULL,
  `SaldoTecnicoAFavor` tinyint NOT NULL,
  `SaldoLibreDisponibilidadAFavor` tinyint NOT NULL
) ENGINE=MyISAM */;

--
-- Table structure for table `zones`
--

CREATE TABLE `zones` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(180) COLLATE utf8mb4_unicode_ci NOT NULL,
  `sifere_coef` decimal(16,2) DEFAULT '0.00',
  `iibb_aliquot` decimal(16,2) DEFAULT '0.00',
  `iibb_perception_id` int(10) unsigned DEFAULT NULL,
  `retention_id` int(10) unsigned DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `code` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `zones_name_unique` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `zones`
--

INSERT INTO `zones` VALUES (1,'Córdoba',0.00,0.00,NULL,NULL,NULL,NULL,'10'),(2,'Corrientes',0.00,0.00,NULL,NULL,NULL,NULL,'20'),(3,'Chaco',0.00,0.00,NULL,NULL,NULL,NULL,'26'),(4,'Chubut',0.00,0.00,NULL,NULL,NULL,NULL,'29'),(5,'Entre Ríos',0.00,0.00,NULL,NULL,NULL,NULL,'30'),(6,'Formosa',0.00,0.00,NULL,NULL,NULL,NULL,'35'),(7,'Jujuy',0.00,0.00,NULL,NULL,NULL,NULL,'37'),(8,'La Pampa',0.00,0.00,NULL,NULL,NULL,NULL,'38'),(9,'La Rioja',0.00,0.00,NULL,NULL,NULL,NULL,'47'),(10,'Mendoza',0.00,0.00,NULL,NULL,NULL,NULL,'49'),(11,'Misiones',0.00,0.00,NULL,NULL,NULL,NULL,'51'),(12,'Neuquén',0.00,0.00,NULL,NULL,NULL,NULL,'56'),(13,'Río Negro',0.00,0.00,NULL,NULL,NULL,NULL,'57'),(14,'Salta',0.00,0.00,NULL,NULL,NULL,NULL,'62'),(15,'San Juan',0.00,0.00,NULL,NULL,NULL,NULL,'64'),(16,'San Luis',0.00,0.00,NULL,NULL,NULL,NULL,'66'),(17,'Santa Cruz',0.00,0.00,NULL,NULL,NULL,NULL,'69'),(18,'Santa Fe',0.00,0.00,NULL,NULL,NULL,NULL,'70'),(19,'Santiago del Estero',0.00,0.00,NULL,NULL,NULL,NULL,'76'),(20,'Tierra del Fuego',0.00,0.00,NULL,NULL,NULL,NULL,'83'),(21,'Tucuman',0.00,0.00,NULL,NULL,NULL,NULL,'85'),(22,'Capital Federal',0.00,0.00,NULL,NULL,NULL,NULL,'01'),(23,'Buenos Aires',0.00,0.00,NULL,NULL,NULL,NULL,'02'),(24,'Catamarca',0.00,0.00,NULL,NULL,NULL,NULL,'09'),(25,'Pascua Lama',0.00,0.00,NULL,NULL,NULL,NULL,'E3');

--
-- Dumping routines for database 'db27-36680092-7'
--
/*!50003 DROP PROCEDURE IF EXISTS `assingMorePeriods` */;
DELIMITER ;;
CREATE DEFINER=`forge`@`10.136.21.165` PROCEDURE `assingMorePeriods`(to_year int)
BEGIN
          declare done int default 0;
          declare counter int default 0;
          declare end_year, initial_month, person_ids, endMonth int;
          declare code_period varchar(20);
          DECLARE currents CURSOR FOR
        	SELECT case when max(code) is not null then max(code) else pc.liquidation_start_period end as code, pc.person_id
        	  FROM person_configurations pc
        	  left join periods pd on pc.person_id = pd.person_id
              where pc.liquidation_start_period is not null
              GROUP BY person_id, pc.liquidation_start_period
          ;

          DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET done = 1;

          insert into log_debug (function_name, message, date) VALUES('assingMorePeriods', concat('ejecutando funcion'), now() );

          OPEN currents;
          REPEAT
            FETCH currents INTO code_period, person_ids;

            IF NOT done THEN
        	set counter = 0;
        	set end_year = CAST(SUBSTRING(code_period,1,4) AS SIGNED);
            set initial_month = CAST(SUBSTRING(code_period,6,LENGTH(code_period)) AS SIGNED) + 1;

            insert into log_debug (function_name, message, date) VALUES('assingMorePeriods', concat('Iterando cada empresa, Empres id->', person_ids,', periodo->', code_period), now() );


        	 while end_year <= to_year do
        		insert into log_debug (function_name, message, date) VALUES('assingMorePeriods', concat('While de empresa, year->', end_year,', initial_month->', initial_month, ', contador->', counter), now() );

        		IF counter > 0 then set initial_month = 1; end if;
        		set endMonth = 12;

               insert Into periods (code, year, period_number, date_from, date_to, person_id)
                 select concat(end_year, '-', lpad(m.month, 2, '0')), end_year, m.month,
                  concat(end_year, '-', m.month, '-01'), concat(end_year, m.date_to),
                  p.id from persons p, months m
                  where p.id = person_ids
                  and (m.month >= initial_month and m.month <= endMonth)
                   order by 2,3;
               set end_year = end_year + 1;
               set counter = counter +1;
        	 END WHILE;
            END IF;

          UNTIL done END REPEAT;

          CLOSE currents;
        END ;;
DELIMITER ;
/*!50003 DROP PROCEDURE IF EXISTS `CreacionUsuarioEmpresa` */;
DELIMITER ;;
CREATE DEFINER=`forge`@`10.136.21.165` PROCEDURE `CreacionUsuarioEmpresa`(
            in usuario varchar(100),
            in email varchar(100),
            in empresa varchar(100)
            )
BEGIN

            START TRANSACTION;

            -- este prar registrar el usuario, solo cambia el "aaaaaa" por el nombre de usuario y el mail, la clave será 123456
            insert into tUsers (loginUser, claveUser, emailUser, user_type_id)
            values (usuario, "$2y$10$STkVOGUoqFuysS6UTcIU5udWXGfivahbCF4Fou7lLGPORBsiyctG.", email, 2);

            -- este para registrar el modulo al que tendra acceso, ademas pon el aaaaaa del nombre del usuario que creaste
            insert into tUserModules (idUser, idModule)
            select u.idUser, m.idModule
            from tUsers u, tModules m
            where u.loginUser= usuario
            and m.idModule in (19,26,27);

            -- este para asignar como unica empresa a la empresa que le create el usuario, pon el nombre de la empresa
            insert into user_persons (user_id, person_id)
            select u.idUser, p.id
            from tUsers u, persons p
            where u.loginUser= usuario
            and p.id = empresa;

            COMMIT;

            END ;;
DELIMITER ;
/*!50003 DROP PROCEDURE IF EXISTS `procedureComprobantes` */;
DELIMITER ;;
CREATE DEFINER=`forge`@`10.136.21.165` PROCEDURE `procedureComprobantes`(
          in operacion varchar(35),
          in periodoID varchar(35),
          in periodo varchar(20),
          in empresa varchar(20),
          in date_from varchar(20),
          in date_to varchar(20)
        )
BEGIN

        SELECT
   receipts.id as IdComprobante,
     persons.id as IdProveedorCliente,
     receipts.person_id_owner as IdEmpresa,
     b.document as DocumentoEmpresa,
     b.field_name1 as NombreEmpresa,
     periods.id as IdPeriodo,
   periods.date_from as Desde,
     periods.date_to as Hasta,
   periods.code as Periodo,
     types.name as Operacion,
   persons.field_name1 as Proveedor,
     persons.document_type as TipoDocumento,
     persons.document as Documento,
     zones.name as Zona,
     status.name as Estado,
     activities.name as Actividad,
     receipts.receipt_date as FechaComprobante,
     receipts.reference as Referencia,
     retention_types.name as TipoDeRetencion,
     receipt_types.name as TipoComprobante,
     receipts.code_ticket as Suc,
     receipts.number as Numero,
     receipts.amount as Total,
   sum(case when receipt_taxes.tax_id=3 then (receipt_taxes.amount) else 0 end) as gravado_27,
   sum(case when receipt_taxes.tax_id=3 then (receipt_taxes.tax_amount) else 0 end) as IVA_27,
     sum(case when receipt_taxes.tax_id=2 then (receipt_taxes.amount) else 0 end) as gravado_21,
   sum(case when receipt_taxes.tax_id=2 then (receipt_taxes.tax_amount) else 0 end) as IVA_21,
   sum(case when receipt_taxes.tax_id=1 then (receipt_taxes.amount) else 0 end) as gravado_105,
   sum(case when receipt_taxes.tax_id=1 then (receipt_taxes.tax_amount) else 0 end) as IVA_105,
     sum(case when receipt_taxes.tax_id=5 then (receipt_taxes.amount) else 0 end) as gravado_5,
   sum(case when receipt_taxes.tax_id=5 then (receipt_taxes.tax_amount) else 0 end) as IVA_5,
     sum(case when receipt_taxes.tax_id=6 then (receipt_taxes.amount) else 0 end) as gravado_0,
   sum(case when receipt_taxes.tax_id=6 then (receipt_taxes.tax_amount) else 0 end) as IVA_0,
     sum(case when receipt_taxes.tax_id=4 then (receipt_taxes.amount) else 0 end) as gravado_2_5,
   sum(case when receipt_taxes.tax_id=4 then (receipt_taxes.tax_amount) else 0 end) as IVA_2_5,
     sum(case when receipt_taxes.tax_id=7 then (receipt_taxes.amount) else 0 end) as no_gravado,
     sum(case when receipt_taxes.tax_id=1000 then (receipt_taxes.amount) else 0 end) as percepIva,
     sum(case when receipt_taxes.tax_id=1001 then (receipt_taxes.amount) else 0 end) as Imps_Internos,
   sum(case when receipt_taxes.tax_id=1002 then (receipt_taxes.amount) else 0 end) as Imp_Gasoil,
   sum(case when receipt_taxes.tax_id=1003 then (receipt_taxes.amount) else 0 end) as Imp_Hidricos,
   sum(case when receipt_taxes.tax_id=1004 then (receipt_taxes.amount) else 0 end) as ITC,
   sum(case when receipt_taxes.tax_id=1005 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Buenos_Aires,
   sum(case when receipt_taxes.tax_id=1006 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Capital_Federal,
   sum(case when receipt_taxes.tax_id=1007 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Catamarca,
   sum(case when receipt_taxes.tax_id=1008 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Chaco,
   sum(case when receipt_taxes.tax_id=1009 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Chubut,
   sum(case when receipt_taxes.tax_id=1010 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Cordoba,
   sum(case when receipt_taxes.tax_id=1011 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Corrientes,
   sum(case when receipt_taxes.tax_id=1012 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Entre_Rios,
   sum(case when receipt_taxes.tax_id=1013 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Formosa,
   sum(case when receipt_taxes.tax_id=1014 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Jujuy,
   sum(case when receipt_taxes.tax_id=1015 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_La_Pampa,
   sum(case when receipt_taxes.tax_id=1016 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_La_Rioja,
   sum(case when receipt_taxes.tax_id=1017 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Mendoza,
   sum(case when receipt_taxes.tax_id=1018 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Misiones,
   sum(case when receipt_taxes.tax_id=1019 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Neuquen,
   sum(case when receipt_taxes.tax_id=1020 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Pascua_Lama,
   sum(case when receipt_taxes.tax_id=1021 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Rio_Negro,
   sum(case when receipt_taxes.tax_id=1022 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Salta,
   sum(case when receipt_taxes.tax_id=1023 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_San_Juan,
   sum(case when receipt_taxes.tax_id=1024 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_San_Luis,
   sum(case when receipt_taxes.tax_id=1025 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Santa_Cruz,
   sum(case when receipt_taxes.tax_id=1026 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Santa_Fe,
   sum(case when receipt_taxes.tax_id=1027 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Santiago_del_Estero,
   sum(case when receipt_taxes.tax_id=1028 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Tierra_del_Fuego,
   sum(case when receipt_taxes.tax_id=1029 then (receipt_taxes.amount) else 0 end) as Perc_IIBB_Tucuman

 from receipts
 left join persons as b on receipts.person_id_owner = b.id
 left join periods on receipts.period_id = periods.id
 left join receipt_types on receipts.type_receipt_id = receipt_types.id
 left join retention_types on receipts.retention_type_id =retention_types.id
 left join status on receipts.status_id = status.id
 left join persons on receipts.person_id_relationed = persons.id
 left join receipt_taxes on receipts.id = receipt_taxes.receipt_id
 left join zones on receipts.zone_id = zones.id
 left join activities on receipts.activity_id = activities.id
 left join types on receipts.type_id = types.id
 left join system_taxes on  receipt_taxes.tax_id = system_taxes.id
 left join other_taxes on  receipt_taxes.tax_id = other_taxes.id

 where 	receipts.type_id LIKE operacion
   and periods.id LIKE '%'
     and periods.code LIKE periodo
   and receipts.person_id_owner LIKE empresa
   and periods.date_from LIKE '%'
     and periods.date_to LIKE '%'

 group by  1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19
 order by Periodo,persons.document, code_ticket,number
        ;
        END ;;
DELIMITER ;
/*!50003 DROP PROCEDURE IF EXISTS `procedure_eliminar_comprobantes_masivamente` */;
DELIMITER ;;
CREATE DEFINER=`forge`@`10.136.21.165` PROCEDURE `procedure_eliminar_comprobantes_masivamente`(

in operacion varchar(35),
in empresa varchar(20),
in desde date,
in hasta date

)
BEGIN

-- delete in receipt_taxes
DELETE from receipt_taxes where id IN
    (
    SELECT * FROM
        (
        SELECT receipt_taxes.id as eliminar
        FROM receipt_taxes
        WHERE receipt_taxes.receipt_id IN
            (
            -- Aca agarro el ID para luego buscarlo en receipt_taxes
            SELECT IdComprobante
                from
                (
               -- esta consulta lo que hace es listar todos los comprobantes con los filtros
                SELECT
                    receipts.id as IdComprobante,
                    persons.id as IdProveedorCliente,
                    receipts.person_id_owner as Empresa,
                    periods.id as IdPeriodo,
                    periods.date_from as Desde,
                    periods.date_to as Hasta,
                    periods.code as Periodo,
                    types.name as Operacion,
                    persons.field_name1 as Proveedor,
                    receipts.number as Numero,
                    receipt_taxes.id as IDreceipt_taxes

                from receipts
                left join periods on receipts.period_id = periods.id
                left join receipt_types on receipts.type_receipt_id = receipt_types.id
                left join retention_types on receipts.retention_type_id =retention_types.id
                left join status on receipts.status_id = status.id
                left join persons on receipts.person_id_relationed = persons.id
                left join receipt_taxes on receipts.id = receipt_taxes.receipt_id
                left join zones on receipts.zone_id = zones.id
                left join activities on receipts.activity_id = activities.id
                left join types on receipts.type_id = types.id
                left join system_taxes on  receipt_taxes.tax_id = system_taxes.id
                left join other_taxes on  receipt_taxes.tax_id = other_taxes.id

                where   receipts.type_id LIKE operacion
                    and receipts.person_id_owner LIKE empresa
                    and periods.date_from between desde and hasta

                group by  1,2,3,4,5,6,7,8,9,10,11
                )foo
            )
        )
        as tablanueva
    );

-- delete in receipts
        DELETE from receipts where id IN
            (
            -- Aca agarro el ID para luego buscarlo en receipt_taxes
            SELECT IdComprobante
                from
                (
               -- esta consulta lo que hace es listar todos los comprobantes con los filtros
                SELECT
                    receipts.id as IdComprobante,
                    persons.id as IdProveedorCliente,
                    receipts.person_id_owner as Empresa,
                    periods.id as IdPeriodo,
                    periods.date_from as Desde,
                    periods.date_to as Hasta,
                    periods.code as Periodo,
                    types.name as Operacion,
                    persons.field_name1 as Proveedor,
                    receipts.number as Numero,
                    receipt_taxes.id as IDreceipt_taxes

                from receipts
                left join periods on receipts.period_id = periods.id
                left join receipt_types on receipts.type_receipt_id = receipt_types.id
                left join retention_types on receipts.retention_type_id =retention_types.id
                left join status on receipts.status_id = status.id
                left join persons on receipts.person_id_relationed = persons.id
                left join receipt_taxes on receipts.id = receipt_taxes.receipt_id
                left join zones on receipts.zone_id = zones.id
                left join activities on receipts.activity_id = activities.id
                left join types on receipts.type_id = types.id
                left join system_taxes on  receipt_taxes.tax_id = system_taxes.id
                left join other_taxes on  receipt_taxes.tax_id = other_taxes.id

                where   receipts.type_id LIKE operacion
                    and receipts.person_id_owner LIKE empresa
                    and periods.date_from between desde and hasta

                group by  1,2,3,4,5,6,7,8,9,10,11
                )foo
            )
    ;

END ;;
DELIMITER ;

--
-- Final view structure for view `v_business`
--

/*!50001 DROP TABLE IF EXISTS `v_business`*/;
/*!50001 DROP VIEW IF EXISTS `v_business`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`forge`@`10.136.21.165` SQL SECURITY DEFINER */
/*!50001 VIEW `v_business` AS select `p`.`id` AS `id`,`p`.`field_name1` AS `field_name1`,`p`.`field_name2` AS `field_name2`,`p`.`document_type` AS `document_type`,`p`.`document` AS `document`,`p`.`country_id` AS `country_id`,`p`.`state_id` AS `state_id`,`p`.`zone_id` AS `zone_id`,`p`.`created_at` AS `created_at`,`p`.`updated_at` AS `updated_at`,`p`.`activity_id` AS `activity_id`,`p`.`address` AS `address`,`p`.`person_type_id` AS `person_type_id`,`pc`.`id` AS `person_configuration_id`,`pc`.`settle_calc_by_coef` AS `settle_calc_by_coef`,`pc`.`active` AS `active`,`pc`.`month_close` AS `month_close`,`pc`.`iva_condition_id` AS `iva_condition_id`,`pc`.`obligation_buy` AS `obligation_buy`,`pc`.`obligation_electronic_receipt` AS `obligation_electronic_receipt`,`pc`.`obligation_iibb` AS `obligation_iibb`,`pc`.`obligation_iva` AS `obligation_iva`,`pc`.`obligation_other_taxes` AS `obligation_other_taxes`,`pc`.`obligation_salaries` AS `obligation_salaries`,`pc`.`obligation_sell` AS `obligation_sell`,`pc`.`liquidation_start_period` AS `liquidation_start_period` from (`persons` `p` join `person_configurations` `pc` on((`p`.`id` = `pc`.`person_id`))) */;

--
-- Final view structure for view `v_consultacomprobantes`
--

/*!50001 DROP TABLE IF EXISTS `v_consultacomprobantes`*/;
/*!50001 DROP VIEW IF EXISTS `v_consultacomprobantes`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`forge`@`10.136.21.165` SQL SECURITY DEFINER */
/*!50001 VIEW `v_consultacomprobantes` AS select `receipts`.`id` AS `IdComprobante`,`receipts`.`type_id` AS `IdTipoComprobante`,`persons`.`id` AS `IdProveedorCliente`,`receipts`.`person_id_owner` AS `IdEmpresa`,`b`.`document` AS `DocumentoEmpresa`,`b`.`field_name1` AS `NombreEmpresa`,`p`.`id` AS `IdPeriodo`,`p`.`date_from` AS `Desde`,`p`.`date_to` AS `Hasta`,`p`.`code` AS `Periodo`,`types`.`name` AS `Operacion`,`persons`.`field_name1` AS `Proveedor`,`persons`.`document_type` AS `TipoDocumento`,`persons`.`document` AS `Documento`,`zones`.`name` AS `Zona`,`status`.`name` AS `Estado`,`activities`.`name` AS `Actividad`,`receipts`.`receipt_date` AS `FechaComprobante`,`receipts`.`reference` AS `Referencia`,`retention_types`.`name` AS `TipoDeRetencion`,`receipt_types`.`name` AS `TipoComprobante`,`receipts`.`code_ticket` AS `Suc`,`receipts`.`number` AS `Numero`,(case when (`receipt_types`.`credit` = 1) then -(`receipts`.`amount`) else `receipts`.`amount` end) AS `Total`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 3) then `receipt_taxes`.`amount` else 0 end))) AS `gravado_27`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 3) then `receipt_taxes`.`tax_amount` else 0 end))) AS `IVA_27`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 2) then `receipt_taxes`.`amount` else 0 end))) AS `gravado_21`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 2) then `receipt_taxes`.`tax_amount` else 0 end))) AS `IVA_21`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1) then `receipt_taxes`.`amount` else 0 end))) AS `gravado_105`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1) then `receipt_taxes`.`tax_amount` else 0 end))) AS `IVA_105`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 5) then `receipt_taxes`.`amount` else 0 end))) AS `gravado_5`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 5) then `receipt_taxes`.`tax_amount` else 0 end))) AS `IVA_5`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 6) then `receipt_taxes`.`amount` else 0 end))) AS `gravado_0`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 6) then `receipt_taxes`.`tax_amount` else 0 end))) AS `IVA_0`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 4) then `receipt_taxes`.`amount` else 0 end))) AS `gravado_2_5`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 4) then `receipt_taxes`.`tax_amount` else 0 end))) AS `IVA_2_5`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 7) then `receipt_taxes`.`amount` else 0 end))) AS `no_gravado`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1000) then `receipt_taxes`.`amount` else 0 end))) AS `percepIva`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1001) then `receipt_taxes`.`amount` else 0 end))) AS `Imps_Internos`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1002) then `receipt_taxes`.`amount` else 0 end))) AS `Imp_Gasoil`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1003) then `receipt_taxes`.`amount` else 0 end))) AS `Imp_Hidricos`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1004) then `receipt_taxes`.`amount` else 0 end))) AS `ITC`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1005) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Buenos_Aires`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1006) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Capital_Federal`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1007) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Catamarca`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1008) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Chaco`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1009) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Chubut`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1010) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Cordoba`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1011) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Corrientes`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1012) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Entre_Rios`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1013) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Formosa`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1014) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Jujuy`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1015) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_La_Pampa`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1016) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_La_Rioja`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1017) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Mendoza`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1018) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Misiones`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1019) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Neuquen`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1020) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Pascua_Lama`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1021) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Rio_Negro`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1022) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Salta`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1023) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_San_Juan`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1024) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_San_Luis`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1025) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Santa_Cruz`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1026) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Santa_Fe`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1027) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Santiago_del_Estero`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1028) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Tierra_del_Fuego`,((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * sum((case when (`receipt_taxes`.`tax_id` = 1029) then `receipt_taxes`.`amount` else 0 end))) AS `Perc_IIBB_Tucuman` from ((((((((((((`receipts` left join `persons` `b` on((`receipts`.`person_id_owner` = `b`.`id`))) left join `periods` `p` on((`receipts`.`period_id` = `p`.`id`))) left join `receipt_types` on((`receipts`.`type_receipt_id` = `receipt_types`.`id`))) left join `retention_types` on((`receipts`.`retention_type_id` = `retention_types`.`id`))) left join `status` on((`receipts`.`status_id` = `status`.`id`))) left join `persons` on((`receipts`.`person_id_relationed` = `persons`.`id`))) left join `receipt_taxes` on((`receipts`.`id` = `receipt_taxes`.`receipt_id`))) left join `zones` on((`receipts`.`zone_id` = `zones`.`id`))) left join `activities` on((`receipts`.`activity_id` = `activities`.`id`))) left join `types` on((`receipts`.`type_id` = `types`.`id`))) left join `system_taxes` on((`receipt_taxes`.`tax_id` = `system_taxes`.`id`))) left join `other_taxes` on((`receipt_taxes`.`tax_id` = `other_taxes`.`id`))) group by `receipts`.`id`,`receipts`.`type_id`,`persons`.`id`,`receipts`.`person_id_owner`,`b`.`document`,`b`.`field_name1`,`p`.`id`,`p`.`date_from`,`p`.`date_to`,`p`.`code`,`types`.`name`,`persons`.`field_name1`,`persons`.`document_type`,`persons`.`document`,`zones`.`name`,`status`.`name`,`activities`.`name`,`receipts`.`receipt_date`,`receipts`.`reference`,`retention_types`.`name`,`receipt_types`.`name`,`receipts`.`code_ticket`,`receipts`.`number`,`receipts`.`amount` order by `Periodo`,`persons`.`document`,`receipts`.`code_ticket`,`receipts`.`number` */;

--
-- Final view structure for view `v_consultaproyeccionganancias`
--

/*!50001 DROP TABLE IF EXISTS `v_consultaproyeccionganancias`*/;
/*!50001 DROP VIEW IF EXISTS `v_consultaproyeccionganancias`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`forge`@`10.136.21.165` SQL SECURITY DEFINER */
/*!50001 VIEW `v_consultaproyeccionganancias` AS select `types`.`id` AS `IdOperacion`,`types`.`name` AS `Operacion`,`receipts`.`person_id_owner` AS `IdEmpresa`,`b`.`document` AS `DocumentoEmpresa`,`b`.`field_name1` AS `NombreEmpresa`,`p`.`year` AS `anioPeriodo`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 1)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `UNO`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 2)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `DOS`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 3)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `TRES`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 4)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `CUATRO`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 5)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `CINCO`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 6)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `SEIS`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 7)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `SIETE`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 8)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `OCHO`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 9)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `NUEVE`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 10)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `DIEZ`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 11)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `ONCE`,sum((case when (((`receipt_taxes`.`tax_id` = 3) or (`receipt_taxes`.`tax_id` = 2) or (`receipt_taxes`.`tax_id` = 1) or (`receipt_taxes`.`tax_id` = 7) or (`receipt_taxes`.`tax_id` = 6) or (`receipt_taxes`.`tax_id` = 5) or (`receipt_taxes`.`tax_id` = 4)) and (`p`.`period_number` = 12)) then ((case when (`receipt_types`.`credit` = 1) then -(1) else 1 end) * `receipt_taxes`.`amount`) else 0 end)) AS `DOCE` from (((((((((`receipts` left join `persons` `b` on((`receipts`.`person_id_owner` = `b`.`id`))) left join `periods` `p` on((`receipts`.`period_id` = `p`.`id`))) left join `receipt_types` on((`receipts`.`type_receipt_id` = `receipt_types`.`id`))) left join `status` on((`receipts`.`status_id` = `status`.`id`))) left join `persons` on((`receipts`.`person_id_relationed` = `persons`.`id`))) left join `receipt_taxes` on((`receipts`.`id` = `receipt_taxes`.`receipt_id`))) left join `types` on((`receipts`.`type_id` = `types`.`id`))) left join `system_taxes` on((`receipt_taxes`.`tax_id` = `system_taxes`.`id`))) left join `other_taxes` on((`receipt_taxes`.`tax_id` = `other_taxes`.`id`))) where (`types`.`id` in (1,2)) group by `types`.`id`,`types`.`name`,`receipts`.`person_id_owner`,`b`.`document`,`b`.`field_name1`,`p`.`year` order by `types`.`id`,`p`.`year`,`receipts`.`person_id_owner` */;

--
-- Final view structure for view `v_liquidaciones_iva`
--

/*!50001 DROP TABLE IF EXISTS `v_liquidaciones_iva`*/;
/*!50001 DROP VIEW IF EXISTS `v_liquidaciones_iva`*/;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`forge`@`10.136.21.165` SQL SECURITY DEFINER */
/*!50001 VIEW `v_liquidaciones_iva` AS select `pl`.`status` AS `Status`,`period_liquidation_iva`.`id` AS `IdLiquidacionIVA`,`period_liquidation_iva`.`period_liquidation_id` AS `period_liquidation_id`,`period_liquidation_iva`.`period_id` AS `IdPeriodo`,`period_liquidation_iva`.`person_id` AS `IdEmpresa`,`b`.`document` AS `DocumentoEmpresa`,`b`.`field_name1` AS `NombreEmpresa`,`p`.`date_from` AS `Desde`,`p`.`date_to` AS `Hasta`,`p`.`code` AS `Periodo`,`period_liquidation_iva`.`total_debit` AS `total_debit`,`period_liquidation_iva`.`total_credit` AS `total_credit`,`period_liquidation_iva`.`previous_technical` AS `previous_technical`,`period_liquidation_iva`.`previous_free_availability` AS `previous_free_availability`,`period_liquidation_iva`.`retention_amount` AS `retention_amount`,`period_liquidation_iva`.`perception_amount` AS `perception_amount`,`period_liquidation_iva`.`compensation_amount` AS `compensation_amount`,`period_liquidation_iva`.`total_perceptions_retentions` AS `total_perceptions_retentions`,`period_liquidation_iva`.`free_availability_balance` AS `free_availability_balance`,`period_liquidation_iva`.`negative_amount` AS `A_PAGAR`,`period_liquidation_iva`.`positive_amount` AS `SaldoTecnicoAFavor`,`period_liquidation_iva`.`total_free_availability` AS `SaldoLibreDisponibilidadAFavor` from (((`period_liquidation_iva` left join `persons` `b` on((`period_liquidation_iva`.`person_id` = `b`.`id`))) left join `periods` `p` on((`period_liquidation_iva`.`period_id` = `p`.`id`))) left join `period_liquidations` `pl` on((`period_liquidation_iva`.`period_liquidation_id` = `pl`.`id`))) order by `p`.`code`,`b`.`field_name1` */;


