-- Table structure for table `document_payments`
--

CREATE TABLE `document_payments` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `document_id` int(10) unsigned NOT NULL,
  `date_of_payment` date NOT NULL,
  `payment_method_type_id` char(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `has_card` tinyint(1) NOT NULL DEFAULT 0,
  `card_brand_id` char(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `reference` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_received` tinyint(1) DEFAULT NULL,
  `change` decimal(12,2) DEFAULT NULL,
  `payment` decimal(12,2) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `document_payments_document_id_foreign` (`document_id`),
  KEY `document_payments_card_brand_id_foreign` (`card_brand_id`),
  KEY `document_payments_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `document_payments_date_of_payment_index` (`date_of_payment`),
  CONSTRAINT `document_payments_card_brand_id_foreign` FOREIGN KEY (`card_brand_id`) REFERENCES `card_brands` (`id`),
  CONSTRAINT `document_payments_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE,
  CONSTRAINT `document_payments_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `document_payments`
--

INSERT INTO `document_payments` VALUES (1,1,'2022-06-26','01',0,NULL,NULL,NULL,NULL,690.00),(2,2,'2022-06-26','01',0,NULL,NULL,NULL,NULL,450.00),(3,3,'2022-06-27','01',0,NULL,NULL,NULL,NULL,1350.00),(4,4,'2022-06-28','01',0,NULL,NULL,NULL,NULL,125.00),(5,5,'2022-06-28','01',0,NULL,NULL,NULL,NULL,120.00),(6,6,'2022-06-30','01',0,NULL,NULL,NULL,NULL,1450.00),(7,7,'2022-06-30','01',0,NULL,NULL,NULL,NULL,75.00),(8,8,'2022-06-30','01',0,NULL,NULL,NULL,NULL,1380.00),(9,9,'2022-07-01','01',0,NULL,NULL,NULL,NULL,450.00),(10,10,'2022-07-05','01',0,NULL,NULL,NULL,NULL,700.00),(11,11,'2022-07-06','01',0,NULL,NULL,NULL,NULL,600.00),(12,12,'2022-07-09','01',0,NULL,NULL,NULL,NULL,630.00),(13,13,'2022-07-11','01',0,NULL,NULL,NULL,NULL,450.00),(14,14,'2022-07-12','01',0,NULL,NULL,NULL,NULL,2500.00),(15,15,'2022-07-16','01',0,NULL,NULL,NULL,NULL,1380.00),(16,16,'2022-07-16','01',0,NULL,NULL,NULL,NULL,2500.00),(17,17,'2022-07-18','01',0,NULL,NULL,NULL,NULL,1280.00),(18,18,'2022-07-18','01',0,NULL,NULL,NULL,NULL,1240.00),(19,19,'2022-07-19','01',0,NULL,NULL,NULL,NULL,630.00),(20,20,'2022-07-20','01',0,NULL,NULL,NULL,NULL,4800.00),(21,21,'2022-07-25','01',0,NULL,NULL,NULL,NULL,450.00),(22,22,'2022-07-25','01',0,NULL,NULL,NULL,NULL,660.00),(23,23,'2022-07-27','01',0,NULL,NULL,NULL,NULL,1450.00),(24,24,'2022-07-28','01',0,NULL,NULL,NULL,NULL,890.00),(25,25,'2022-07-28','01',0,NULL,NULL,NULL,NULL,450.00),(26,26,'2022-07-28','01',0,NULL,NULL,NULL,NULL,120.00),(27,27,'2022-07-28','01',0,NULL,NULL,NULL,NULL,750.00),(28,28,'2022-07-29','01',0,NULL,NULL,NULL,NULL,490.00),(29,29,'2022-07-30','01',0,NULL,NULL,NULL,NULL,890.00),(30,30,'2022-07-30','01',0,NULL,NULL,NULL,NULL,1350.00),(31,31,'2022-08-01','01',0,NULL,NULL,NULL,NULL,1500.00),(32,32,'2022-08-01','01',0,NULL,NULL,NULL,NULL,14660.00),(33,33,'2022-08-02','01',0,NULL,NULL,NULL,NULL,3590.00),(34,34,'2022-08-03','01',0,NULL,NULL,NULL,NULL,740.00),(35,35,'2022-08-03','01',0,NULL,NULL,NULL,NULL,450.00),(36,36,'2022-08-04','01',0,NULL,NULL,NULL,NULL,980.00),(37,37,'2022-08-08','01',0,NULL,NULL,NULL,NULL,110.00),(38,38,'2022-08-09','01',0,NULL,NULL,NULL,NULL,480.00),(39,39,'2022-08-10','01',0,NULL,NULL,NULL,NULL,450.00),(40,40,'2022-08-12','01',0,NULL,NULL,NULL,NULL,450.00),(41,41,'2022-08-13','01',0,NULL,NULL,NULL,NULL,980.00),(42,42,'2022-08-17','01',0,NULL,NULL,NULL,NULL,75.00),(43,43,'2022-08-17','01',0,NULL,NULL,NULL,NULL,2580.00),(44,44,'2022-08-19','01',0,NULL,NULL,NULL,NULL,1370.00),(45,45,'2022-08-23','01',0,NULL,NULL,NULL,NULL,800.00),(46,46,'2022-08-26','01',0,NULL,NULL,NULL,NULL,490.00),(47,47,'2022-08-27','01',0,NULL,NULL,NULL,NULL,450.00),(48,48,'2022-08-29','01',0,NULL,NULL,NULL,NULL,1530.00),(49,49,'2022-08-30','01',0,NULL,NULL,NULL,NULL,780.00),(50,50,'2022-08-31','01',0,NULL,NULL,NULL,NULL,1030.00),(51,51,'2022-08-31','01',0,NULL,NULL,NULL,NULL,450.00),(52,52,'2022-09-01','01',0,NULL,NULL,NULL,NULL,2220.00),(53,53,'2022-09-01','01',0,NULL,NULL,NULL,NULL,60.00),(54,54,'2022-09-02','01',0,NULL,NULL,NULL,NULL,1080.00),(55,55,'2022-09-03','01',0,NULL,NULL,NULL,NULL,1230.00),(56,56,'2022-09-03','01',0,NULL,NULL,NULL,NULL,890.00),(57,57,'2022-09-05','01',0,NULL,NULL,NULL,NULL,450.00),(58,58,'2022-09-07','01',0,NULL,NULL,NULL,NULL,730.00),(59,59,'2022-09-12','01',0,NULL,NULL,NULL,NULL,4990.00),(60,60,'2022-09-13','01',0,NULL,NULL,NULL,NULL,600.00),(61,61,'2022-09-14','01',0,NULL,NULL,NULL,NULL,430.00),(62,62,'2022-09-16','01',0,NULL,NULL,NULL,NULL,1290.00),(63,63,'2022-09-16','01',0,NULL,NULL,NULL,NULL,1290.00),(64,64,'2022-09-16','01',0,NULL,NULL,NULL,NULL,10.00),(65,65,'2022-09-23','01',0,NULL,NULL,NULL,NULL,980.00),(66,66,'2022-10-05','01',0,NULL,NULL,NULL,NULL,1380.00),(67,67,'2022-10-06','01',0,NULL,NULL,NULL,NULL,1000.00),(68,68,'2022-10-17','01',0,NULL,NULL,NULL,NULL,20.00),(81,81,'2022-11-10','01',0,NULL,NULL,NULL,NULL,60.00),(82,82,'2022-11-10','01',0,NULL,NULL,NULL,NULL,1200.00),(83,83,'2022-11-25','01',0,NULL,NULL,NULL,NULL,1500.00),(84,84,'2022-12-05','01',0,NULL,NULL,NULL,NULL,530.00),(85,85,'2022-12-05','01',0,NULL,NULL,NULL,NULL,560.00),(86,86,'2022-12-17','01',0,NULL,NULL,NULL,NULL,450.00),(87,87,'2022-12-23','01',0,NULL,NULL,NULL,NULL,450.00),(88,88,'2022-12-30','01',0,NULL,NULL,NULL,NULL,450.00),(89,89,'2022-12-30','01',0,NULL,NULL,NULL,NULL,720.00),(90,90,'2023-01-02','01',0,NULL,NULL,NULL,NULL,1230.00),(91,91,'2023-01-09','01',0,NULL,NULL,NULL,NULL,15.00),(92,92,'2023-01-14','01',0,NULL,NULL,NULL,NULL,400.00),(93,93,'2023-01-20','01',0,NULL,NULL,NULL,NULL,95.00),(94,94,'2023-01-20','01',0,NULL,NULL,NULL,NULL,1670.00),(95,95,'2023-01-23','01',0,NULL,NULL,NULL,NULL,1120.00),(96,96,'2023-01-27','01',0,NULL,NULL,NULL,NULL,1100.00),(97,97,'2023-02-06','01',0,NULL,NULL,NULL,NULL,390.00),(98,98,'2023-02-13','01',0,NULL,NULL,NULL,NULL,120.00),(99,99,'2023-02-15','01',0,NULL,NULL,NULL,NULL,980.00),(100,100,'2023-02-16','01',0,NULL,NULL,NULL,NULL,90.00),(101,101,'2023-02-16','01',0,NULL,NULL,NULL,NULL,440.00),(102,102,'2023-02-18','01',0,NULL,NULL,NULL,NULL,390.00),(103,103,'2023-02-21','01',0,NULL,NULL,NULL,NULL,780.00),(104,104,'2023-02-25','01',0,NULL,NULL,NULL,NULL,450.00),(105,105,'2023-03-01','01',0,NULL,NULL,NULL,NULL,700.00);

--
-- Table structure for table `document_transports`
--

CREATE TABLE `document_transports` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `document_id` int(10) unsigned NOT NULL,
  `seat_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `passenger_manifest` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `identity_document_type_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `number_identity_document` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `passenger_fullname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `origin_district_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`origin_district_id`)),
  `origin_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `destinatation_district_id` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`destinatation_district_id`)),
  `destinatation_address` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `start_date` date DEFAULT NULL,
  `start_time` time DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `document_transports_document_id_foreign` (`document_id`),
  KEY `document_transports_identity_document_type_id_foreign` (`identity_document_type_id`),
  CONSTRAINT `document_transports_document_id_foreign` FOREIGN KEY (`document_id`) REFERENCES `documents` (`id`) ON DELETE CASCADE,
  CONSTRAINT `document_transports_identity_document_type_id_foreign` FOREIGN KEY (`identity_document_type_id`) REFERENCES `cat_identity_document_types` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `document_transports`
--


--
-- Table structure for table `documentary_actions`
--

CREATE TABLE `documentary_actions` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `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 `documentary_actions`
--


--
-- Table structure for table `documentary_documents`
--

CREATE TABLE `documentary_documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `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 `documentary_documents`
--


--
-- Table structure for table `documentary_file_offices`
--

CREATE TABLE `documentary_file_offices` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `documentary_file_id` int(10) unsigned NOT NULL,
  `documentary_office_id` int(10) unsigned NOT NULL,
  `documentary_action_id` int(10) unsigned NOT NULL DEFAULT 0,
  `status` enum('POR DERIVAR','POR RECIBIR','EN PROCESO','FINALIZADO','ARCHIVADO') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'POR DERIVAR',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `office_name` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nombre de la etapa',
  `process_name` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nombre del tramite',
  `documentary_process_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Tramite relacionado',
  `complete` int(11) NOT NULL DEFAULT 0 COMMENT 'Define si la etapa esta completa',
  `start_date` datetime DEFAULT NULL COMMENT 'Fecha de inicio',
  `end_date` datetime DEFAULT NULL COMMENT 'Fecha de finalizacion',
  `days` int(10) unsigned DEFAULT 0 COMMENT 'dias para el tramite',
  `observation` int(11) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `documentary_file_offices_documentary_file_id_foreign` (`documentary_file_id`),
  KEY `documentary_file_offices_documentary_office_id_foreign` (`documentary_office_id`),
  KEY `documentary_file_offices_documentary_action_id_foreign` (`documentary_action_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_file_offices`
--


--
-- Table structure for table `documentary_files`
--

CREATE TABLE `documentary_files` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned DEFAULT NULL,
  `documentary_document_id` int(10) unsigned DEFAULT 0,
  `documentary_process_id` int(10) unsigned NOT NULL,
  `number` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `year` int(10) unsigned NOT NULL,
  `invoice` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_register` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL,
  `time_register` varchar(8) COLLATE utf8mb4_unicode_ci NOT NULL,
  `person_id` int(10) unsigned NOT NULL,
  `sender` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `subject` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `attached_file` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `observation` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` enum('RECIBIDO','DERIVADO','FINALIZADO','ARCHIVADO') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'RECIBIDO',
  `documentary_office_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Define el ultimo proceso',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `requirements` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `is_archive` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'define si el tramite es simplificado',
  `is_simplify` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'define si el tramite es simplificado',
  `documentary_guides_number_status_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Cuando es simplificado, se usará este status',
  `is_completed` tinyint(1) NOT NULL DEFAULT 0,
  `establishment_id` int(10) unsigned NOT NULL DEFAULT 0,
  `date_end` datetime DEFAULT NULL COMMENT 'Fecha de finalización',
  PRIMARY KEY (`id`),
  KEY `documentary_files_documentary_document_id_foreign` (`documentary_document_id`),
  KEY `documentary_files_documentary_process_id_foreign` (`documentary_process_id`),
  KEY `documentary_files_person_id_foreign` (`person_id`),
  KEY `documentary_files_user_id_foreign` (`user_id`),
  CONSTRAINT `documentary_files_documentary_process_id_foreign` FOREIGN KEY (`documentary_process_id`) REFERENCES `documentary_processes` (`id`) ON DELETE CASCADE,
  CONSTRAINT `documentary_files_person_id_foreign` FOREIGN KEY (`person_id`) REFERENCES `persons` (`id`) ON DELETE CASCADE,
  CONSTRAINT `documentary_files_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_files`
--


--
-- Table structure for table `documentary_files_archives`
--

CREATE TABLE `documentary_files_archives` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'usuario asociado',
  `documentary_file_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Solicitud asociada',
  `documentary_office_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'etapa asociada',
  `observation` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'observacion',
  `attached_file` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'etapa asociada',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `documentary_guides_number_id` int(10) unsigned NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_files_archives`
--


--
-- Table structure for table `documentary_files_requirements`
--

CREATE TABLE `documentary_files_requirements` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Nombre a mostrar',
  `file` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Define si tiene archivo',
  `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 `documentary_files_requirements`
--


--
-- Table structure for table `documentary_guides_number`
--

CREATE TABLE `documentary_guides_number` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doc_file_id` int(10) unsigned DEFAULT 0 COMMENT 'Expediente relacionado',
  `doc_office_id` int(10) unsigned DEFAULT 0 COMMENT 'Etapa observada',
  `guide` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Especifica la guia',
  `origin` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Especifica la instucion',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `date_of_due` datetime DEFAULT NULL,
  `observation` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `date_take` datetime DEFAULT NULL COMMENT 'Fecha estimada de finalización',
  `date_end` datetime DEFAULT NULL COMMENT 'Fecha de finalización',
  `documentary_guides_number_status_id` int(10) unsigned DEFAULT 0 COMMENT 'relacionado con documentary_guides_number_status',
  `user_id` int(10) unsigned NOT NULL DEFAULT 0 COMMENT 'Responsable',
  `total_day` int(10) unsigned DEFAULT 1,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_guides_number`
--


--
-- Table structure for table `documentary_guides_number_status`
--

CREATE TABLE `documentary_guides_number_status` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_guides_number_status`
--

INSERT INTO `documentary_guides_number_status` VALUES (1,'En Calificación',NULL),(2,'Concluidos',NULL),(3,'Observados',NULL),(4,'Archivados',NULL);

--
-- Table structure for table `documentary_observation`
--

CREATE TABLE `documentary_observation` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doc_file_id` int(10) unsigned DEFAULT 0 COMMENT 'Expediente relacionado',
  `observation` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Conjunto de etapas.',
  `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 `documentary_observation`
--


--
-- Table structure for table `documentary_offices`
--

CREATE TABLE `documentary_offices` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` varchar(250) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `days` mediumint(8) unsigned NOT NULL DEFAULT 0,
  `default` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `color` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_offices`
--

INSERT INTO `documentary_offices` VALUES (1,'Caja','',1,'2022-06-21 22:28:23','2022-06-21 22:28:23',0,0,NULL),(2,'Procesos','',1,'2022-06-21 22:28:23','2022-06-21 22:28:23',0,0,NULL),(3,'Seguimiento','',1,'2022-06-21 22:28:23','2022-06-21 22:28:23',0,0,NULL),(4,'Validacion','',1,'2022-06-21 22:28:23','2022-06-21 22:28:23',0,0,NULL);

--
-- Table structure for table `documentary_processes`
--

CREATE TABLE `documentary_processes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `price` decimal(10,5) NOT NULL DEFAULT 0.00000,
  `active` tinyint(1) NOT NULL DEFAULT 1,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `documentary_offices` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'etapas que contiene',
  `documentary_offices_order` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documentary_processes`
--


--
-- Table structure for table `documentary_processes_rel_file`
--

CREATE TABLE `documentary_processes_rel_file` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doc_processes_id` int(10) unsigned DEFAULT 0 COMMENT 'Requerimiento relacionado',
  `doc_file_id` int(10) unsigned DEFAULT 0 COMMENT 'Expediente relacionado',
  `doc_office_id` int(10) unsigned DEFAULT 0 COMMENT 'Etapa actual',
  `stages` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Conjunto de etapas.',
  `complete` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Define si se ha completado',
  `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 `documentary_processes_rel_file`
--


--
-- Table structure for table `documentary_processes_rel_off`
--

CREATE TABLE `documentary_processes_rel_off` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doc_processes_id` int(10) unsigned DEFAULT 0 COMMENT 'Requerimiento relacionado',
  `doc_offices_id` int(10) unsigned DEFAULT 0 COMMENT 'Proceso relacionado',
  `active` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Status de la relacion',
  `order` int(10) unsigned DEFAULT 1 COMMENT 'Establece el orden del proceso',
  `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 `documentary_processes_rel_off`
--


--
-- Table structure for table `documentary_processes_rel_req`
--

CREATE TABLE `documentary_processes_rel_req` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `doc_processes_id` int(10) unsigned DEFAULT 0 COMMENT 'Requerimiento relacionado',
  `doc_files_requirements_id` int(10) unsigned DEFAULT 0 COMMENT 'Proceso relacionado',
  `active` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Status de la relacion',
  `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 `documentary_processes_rel_req`
--


--
-- Table structure for table `documents`
--

CREATE TABLE `documents` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_id` int(10) unsigned NOT NULL,
  `external_id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL,
  `establishment_id` int(10) unsigned NOT NULL,
  `establishment` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`establishment`)),
  `soap_type_id` char(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `state_type_id` char(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ubl_version` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ticket_single_shipment` tinyint(1) NOT NULL DEFAULT 0,
  `force_send_by_summary` tinyint(1) NOT NULL DEFAULT 0,
  `group_id` char(2) COLLATE utf8mb4_unicode_ci NOT NULL,
  `document_type_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `series` char(4) COLLATE utf8mb4_unicode_ci NOT NULL,
  `number` int(11) NOT NULL,
  `date_of_issue` date NOT NULL,
  `time_of_issue` time NOT NULL,
  `customer_id` int(10) unsigned NOT NULL,
  `customer` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL CHECK (json_valid(`customer`)),
  `currency_type_id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payment_condition_id` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `payment_method_type_id` char(2) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `purchase_order` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `plate_number` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quotation_id` int(10) unsigned DEFAULT NULL,
  `sale_note_id` int(10) unsigned DEFAULT NULL,
  `user_rel_suscription_plan_id` int(10) unsigned DEFAULT 0 COMMENT 'Relacion con suscripciones',
  `technical_service_id` int(10) unsigned DEFAULT NULL,
  `order_note_id` int(10) unsigned DEFAULT NULL,
  `dispatch_id` int(10) unsigned DEFAULT NULL,
  `seller_id` int(10) unsigned DEFAULT NULL,
  `exchange_rate_sale` decimal(13,3) NOT NULL,
  `point_system` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'indica si el documento se uso en sistema por puntos',
  `point_system_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'datos de sistema por puntos' CHECK (json_valid(`point_system_data`)),
  `automatic_date_of_issue` date DEFAULT NULL,
  `type_period` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `quantity_period` int(11) DEFAULT NULL,
  `enabled_concurrency` tinyint(3) unsigned DEFAULT 0,
  `apply_concurrency` tinyint(3) unsigned DEFAULT 0,
  `total_prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_charge` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_discount` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exportation` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_taxed` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_unaffected` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_exonerated` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_igv_free` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_isc` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_base_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_other_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_plastic_bag_taxes` decimal(6,2) NOT NULL DEFAULT 0.00,
  `total_taxes` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_value` decimal(12,2) NOT NULL DEFAULT 0.00,
  `subtotal` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total` decimal(12,2) NOT NULL,
  `dispatch_ticket_pdf` tinyint(1) NOT NULL DEFAULT 0,
  `has_prepayment` tinyint(1) NOT NULL DEFAULT 0,
  `affectation_type_prepayment` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `was_deducted_prepayment` tinyint(1) NOT NULL DEFAULT 0,
  `pending_amount_prepayment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `total_pending_payment` decimal(12,2) NOT NULL DEFAULT 0.00,
  `charges` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`charges`)),
  `discounts` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`discounts`)),
  `prepayments` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`prepayments`)),
  `guides` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`guides`)),
  `related` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`related`)),
  `perception` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`perception`)),
  `detraction` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`detraction`)),
  `retention` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`retention`)),
  `legends` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`legends`)),
  `additional_information` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `additional_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`additional_data`)),
  `filename` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `unique_filename` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `hash` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `qr` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' ',
  `reference_data` varchar(500) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `agent_id` int(10) unsigned DEFAULT NULL,
  `has_xml` tinyint(1) NOT NULL DEFAULT 0,
  `has_pdf` tinyint(1) NOT NULL DEFAULT 0,
  `has_cdr` tinyint(1) NOT NULL DEFAULT 0,
  `data_json` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`data_json`)),
  `send_server` tinyint(1) NOT NULL DEFAULT 1,
  `success_shipping_status` tinyint(1) NOT NULL DEFAULT 0,
  `shipping_status` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`shipping_status`)),
  `success_sunat_shipping_status` tinyint(1) NOT NULL DEFAULT 0,
  `sunat_shipping_status` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`sunat_shipping_status`)),
  `query_status` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`query_status`)),
  `success_query_status` tinyint(1) NOT NULL DEFAULT 0,
  `total_canceled` tinyint(1) NOT NULL DEFAULT 0,
  `soap_shipping_response` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`soap_shipping_response`)),
  `regularize_shipping` tinyint(1) NOT NULL DEFAULT 0,
  `response_regularize_shipping` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_regularize_shipping`)),
  `send_to_pse` tinyint(1) NOT NULL DEFAULT 0,
  `response_signature_pse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_signature_pse`)),
  `response_send_cdr_pse` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`response_send_cdr_pse`)),
  `sale_notes_relateds` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'registros asociados cuando se genera cpe desde multiples notas de venta' CHECK (json_valid(`sale_notes_relateds`)),
  `terms_condition` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `folio` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `is_editable` tinyint(1) NOT NULL DEFAULT 0,
  `grade` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Grado designado - utilizado en matricula',
  `section` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Seccion designado - utilizado en matricula',
  PRIMARY KEY (`id`),
  UNIQUE KEY `documents_unique_filename_unique` (`unique_filename`),
  KEY `documents_user_id_foreign` (`user_id`),
  KEY `documents_establishment_id_foreign` (`establishment_id`),
  KEY `documents_customer_id_foreign` (`customer_id`),
  KEY `documents_soap_type_id_foreign` (`soap_type_id`),
  KEY `documents_state_type_id_foreign` (`state_type_id`),
  KEY `documents_group_id_foreign` (`group_id`),
  KEY `documents_document_type_id_foreign` (`document_type_id`),
  KEY `documents_currency_type_id_foreign` (`currency_type_id`),
  KEY `documents_quotation_id_foreign` (`quotation_id`),
  KEY `documents_external_id_index` (`external_id`),
  KEY `documents_sale_note_id_foreign` (`sale_note_id`),
  KEY `documents_series_index` (`series`),
  KEY `documents_number_index` (`number`),
  KEY `documents_date_of_issue_index` (`date_of_issue`),
  KEY `documents_order_note_id_foreign` (`order_note_id`),
  KEY `documents_payment_method_type_id_foreign` (`payment_method_type_id`),
  KEY `documents_seller_id_foreign` (`seller_id`),
  KEY `documents_payment_condition_id_foreign` (`payment_condition_id`),
  KEY `documents_dispatch_id_foreign` (`dispatch_id`),
  KEY `documents_technical_service_id_foreign` (`technical_service_id`),
  KEY `documents_type_period_index` (`type_period`),
  KEY `documents_regularize_shipping_index` (`regularize_shipping`),
  KEY `documents_ticket_single_shipment_index` (`ticket_single_shipment`),
  KEY `documents_agent_id_foreign` (`agent_id`),
  KEY `documents_force_send_by_summary_index` (`force_send_by_summary`),
  CONSTRAINT `documents_agent_id_foreign` FOREIGN KEY (`agent_id`) REFERENCES `agents` (`id`),
  CONSTRAINT `documents_currency_type_id_foreign` FOREIGN KEY (`currency_type_id`) REFERENCES `cat_currency_types` (`id`),
  CONSTRAINT `documents_customer_id_foreign` FOREIGN KEY (`customer_id`) REFERENCES `persons` (`id`),
  CONSTRAINT `documents_dispatch_id_foreign` FOREIGN KEY (`dispatch_id`) REFERENCES `dispatches` (`id`),
  CONSTRAINT `documents_document_type_id_foreign` FOREIGN KEY (`document_type_id`) REFERENCES `cat_document_types` (`id`),
  CONSTRAINT `documents_establishment_id_foreign` FOREIGN KEY (`establishment_id`) REFERENCES `establishments` (`id`),
  CONSTRAINT `documents_group_id_foreign` FOREIGN KEY (`group_id`) REFERENCES `groups` (`id`),
  CONSTRAINT `documents_order_note_id_foreign` FOREIGN KEY (`order_note_id`) REFERENCES `order_notes` (`id`),
  CONSTRAINT `documents_payment_condition_id_foreign` FOREIGN KEY (`payment_condition_id`) REFERENCES `payment_conditions` (`id`),
  CONSTRAINT `documents_payment_method_type_id_foreign` FOREIGN KEY (`payment_method_type_id`) REFERENCES `payment_method_types` (`id`),
  CONSTRAINT `documents_quotation_id_foreign` FOREIGN KEY (`quotation_id`) REFERENCES `quotations` (`id`),
  CONSTRAINT `documents_sale_note_id_foreign` FOREIGN KEY (`sale_note_id`) REFERENCES `sale_notes` (`id`),
  CONSTRAINT `documents_seller_id_foreign` FOREIGN KEY (`seller_id`) REFERENCES `users` (`id`),
  CONSTRAINT `documents_soap_type_id_foreign` FOREIGN KEY (`soap_type_id`) REFERENCES `soap_types` (`id`),
  CONSTRAINT `documents_state_type_id_foreign` FOREIGN KEY (`state_type_id`) REFERENCES `state_types` (`id`),
  CONSTRAINT `documents_technical_service_id_foreign` FOREIGN KEY (`technical_service_id`) REFERENCES `technical_services` (`id`),
  CONSTRAINT `documents_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=106 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `documents`
--

INSERT INTO `documents` VALUES (1,2,'ed3e83ca-71a9-4e99-9600-2203ddfbc7e1',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"urbanization\":null,\"address\":\"Av h\\u00e9roes del cenepa 1175\",\"email\":\"clever10arevalo@gmail.com\",\"telephone\":\"949251171\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'02','03','B001',1,'2022-06-26','19:06:38',11,'{\"identity_document_type_id\":\"1\",\"identity_document_type\":{\"id\":\"1\",\"description\":\"DNI\"},\"number\":\"74637746\",\"name\":\"GOMEZ CASTRO, ORLANDO ENRIQUE\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"address\":\"JR. CAJAMARCA 316\",\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,2,3.753,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,690.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,690.00,690.00,690.00,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Seiscientos noventa  con 00\\/100 \"}]',NULL,NULL,'10744675451-03-B001-1','10744675451-03-B001-1','HDW5y3wE15A3Lh1Rf2AwvP3uN7M=','[encoded data, 90460 characters]',NULL,NULL,0,0,0,NULL,0,0,NULL,0,NULL,NULL,0,1,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-06-26 19:10:08','2022-06-27 00:30:10',1,NULL,NULL),(2,2,'4e383658-84c5-4ebb-bd44-ab7a239f6f3b',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"urbanization\":null,\"address\":\"Av h\\u00e9roes del cenepa 1175\",\"email\":\"clever10arevalo@gmail.com\",\"telephone\":\"949251171\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'02','03','B001',2,'2022-06-26','19:12:34',12,'{\"identity_document_type_id\":\"1\",\"identity_document_type\":{\"id\":\"1\",\"description\":\"DNI\"},\"number\":\"46438407\",\"name\":\"CHAVEZ POLO, MILCA MAGDALENA\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"address\":\"JR. AYACUCHO 1736\",\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,2,3.753,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,450.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,450.00,450.00,450.00,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Cuatrocientos cincuenta  con 00\\/100 \"}]',NULL,NULL,'10744675451-03-B001-2','10744675451-03-B001-2','umJuFp3xPChWIDGnW5huvwaDxN0=','[encoded data, 90460 characters]',NULL,NULL,0,0,0,NULL,0,0,NULL,0,NULL,NULL,0,1,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-06-26 19:14:00','2022-06-27 00:30:10',1,NULL,NULL),(3,2,'9a8f6881-4971-4c7b-8544-b72a94563b91',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"urbanization\":null,\"address\":\"Av h\\u00e9roes del cenepa 1175\",\"email\":\"clever10arevalo@gmail.com\",\"telephone\":\"949251171\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'02','03','B001',3,'2022-06-27','14:25:52',15,'{\"identity_document_type_id\":\"1\",\"identity_document_type\":{\"id\":\"1\",\"description\":\"DNI\"},\"number\":\"33588498\",\"name\":\"HUAMAN ORTIZ, MARIA LIDIA\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"address\":\"JR.LA VERDAD 1561\",\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,2,3.782,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,1350.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,1350.00,1350.00,1350.00,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Mil trescientos cincuenta  con 00\\/100 \"}]',NULL,NULL,'10744675451-03-B001-3','10744675451-03-B001-3','UK+Mp7k5HK0UNfSM0STFnTmugog=','[encoded data, 90460 characters]',NULL,NULL,0,0,0,NULL,0,0,NULL,0,NULL,NULL,0,1,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-06-27 14:28:48','2022-06-28 00:30:07',1,NULL,NULL),(4,2,'8b00d769-7e19-43ea-ab2a-6fc8a7d21727',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"urbanization\":null,\"address\":\"Av h\\u00e9roes del cenepa 1175\",\"email\":\"clever10arevalo@gmail.com\",\"telephone\":\"949251171\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'01','01','F001',1,'2022-06-28','12:58:21',16,'{\"identity_document_type_id\":\"6\",\"identity_document_type\":{\"id\":\"6\",\"description\":\"RUC\"},\"number\":\"20608959514\",\"name\":\"CORPORATION CB E.I.R.L.\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"address\":\"AV. MARIANO MELGAR NRO. 198\",\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,2,3.791,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,125.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,125.00,125.00,125.00,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Ciento veinticinco  con 00\\/100 \"}]',NULL,NULL,'10744675451-01-F001-1','10744675451-01-F001-1','qntjLAG4nBJWTayNXYgre5IP7ns=','[encoded data, 90460 characters]',NULL,NULL,0,0,0,NULL,0,0,NULL,0,NULL,NULL,0,1,'{\"sent\":true,\"code\":\"0\",\"description\":\"La Factura numero F001-1, ha sido aceptada\",\"notes\":[]}',0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-06-28 12:58:53','2022-06-28 12:58:55',1,NULL,NULL),(5,2,'29ca366d-d7aa-45f4-8154-5128ce727eee',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010201\",\"district\":{\"id\":\"010201\",\"description\":\"Bagua\"},\"urbanization\":null,\"address\":\"Av h\\u00e9roes del cenepa 1175\",\"email\":\"clever10arevalo@gmail.com\",\"telephone\":\"949251171\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'02','03','B001',4,'2022-06-28','18:19:35',17,'{\"identity_document_type_id\":\"1\",\"identity_document_type\":{\"id\":\"1\",\"description\":\"DNI\"},\"number\":\"33585137\",\"name\":\"IGLESIAS MENDOZA, OSCAR\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"01\",\"department\":{\"id\":\"01\",\"description\":\"AMAZONAS\"},\"province_id\":\"0102\",\"province\":{\"id\":\"0102\",\"description\":\"Bagua\"},\"district_id\":\"010206\",\"district\":{\"id\":\"010206\",\"description\":\"La Peca\"},\"address\":\"CPM.LA PECA Z5 CALLE LA FLORIDA S\\/N ARRAYAN\",\"email\":null,\"telephone\":null,\"perception_agent\":false,\"address_id\":null,\"internal_code\":null,\"address_type_id\":null,\"address_type\":{\"id\":null,\"description\":null}}','PEN','01',NULL,NULL,NULL,NULL,NULL,0,NULL,NULL,NULL,2,3.791,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,120.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,120.00,120.00,120.00,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Ciento veinte  con 00\\/100 \"}]',NULL,NULL,'10744675451-03-B001-4','10744675451-03-B001-4','xpn2txNomz8qNwEPbBQ7qjdFvj0=','[encoded data, 90460 characters]',NULL,NULL,0,0,0,NULL,0,0,NULL,0,NULL,NULL,0,1,NULL,0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-06-28 18:25:19','2022-06-29 00:30:07',1,NULL,NULL),