-- 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=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `document_payments` VALUES (6,15,'2022-11-25','01',0,NULL,NULL,NULL,NULL,50.00),(7,16,'2022-11-25','01',0,NULL,NULL,1,NULL,50.00),(8,17,'2022-11-25','01',0,NULL,NULL,1,NULL,89.90),(9,18,'2022-11-25','01',0,NULL,NULL,1,NULL,89.90),(10,19,'2022-11-25','01',0,NULL,NULL,1,NULL,89.90),(11,20,'2022-11-28','01',0,NULL,NULL,1,NULL,70.00),(12,21,'2022-11-28','01',0,NULL,NULL,1,NULL,30.00),(13,22,'2022-11-28','01',0,NULL,NULL,1,NULL,30.00),(14,23,'2022-11-28','01',0,NULL,NULL,1,NULL,30.00),(15,24,'2022-11-30','01',0,NULL,NULL,1,NULL,40.00),(16,25,'2022-12-28','01',0,NULL,NULL,1,NULL,30.00),(17,26,'2022-12-28','01',0,NULL,NULL,1,NULL,30.00),(18,27,'2022-12-28','01',0,NULL,NULL,1,NULL,70.00),(19,28,'2022-12-28','01',0,NULL,NULL,1,NULL,90.00),(20,29,'2022-12-28','01',0,NULL,NULL,1,NULL,90.00),(21,30,'2022-12-28','01',0,NULL,NULL,1,NULL,50.00),(22,31,'2022-12-28','01',0,NULL,NULL,1,NULL,50.00),(23,32,'2022-12-28','01',0,NULL,NULL,1,NULL,50.00),(24,33,'2022-12-28','01',0,NULL,NULL,1,NULL,90.00),(25,34,'2022-12-28','01',0,NULL,NULL,1,NULL,30.00),(26,35,'2023-02-16','01',0,NULL,NULL,1,NULL,90.00),(27,36,'2023-02-16','01',0,NULL,NULL,1,NULL,90.00),(28,37,'2023-02-16','01',0,NULL,NULL,1,NULL,250.00),(29,38,'2023-02-16','01',0,NULL,NULL,1,NULL,90.00),(30,39,'2023-02-16','01',0,NULL,NULL,1,NULL,50.00),(31,40,'2023-02-16','01',0,NULL,NULL,1,NULL,90.00),(32,41,'2023-02-16','01',0,NULL,NULL,1,NULL,60.00),(33,42,'2023-02-16','01',0,NULL,NULL,1,NULL,50.00),(34,43,'2023-02-16','01',0,NULL,NULL,1,NULL,50.00),(35,44,'2023-02-16','01',0,NULL,NULL,1,NULL,135.00),(36,45,'2023-02-16','01',0,NULL,NULL,1,NULL,90.00),(37,46,'2023-02-16','01',0,NULL,NULL,1,NULL,70.00),(38,47,'2023-02-16','01',0,NULL,NULL,1,NULL,30.00),(39,48,'2023-02-16','01',0,NULL,NULL,1,NULL,30.00),(40,49,'2023-02-16','01',0,NULL,NULL,1,NULL,70.00),(41,50,'2023-02-16','01',0,NULL,NULL,1,NULL,60.00),(42,51,'2023-02-16','01',0,NULL,NULL,1,NULL,30.00),(43,52,'2023-02-16','01',0,NULL,NULL,1,NULL,90.00),(44,53,'2023-02-16','01',0,NULL,NULL,1,NULL,30.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-05-23 15:11:59','2022-05-23 15:11:59',0,0,NULL),(2,'Procesos','',1,'2022-05-23 15:11:59','2022-05-23 15:11:59',0,0,NULL),(3,'Seguimiento','',1,'2022-05-23 15:11:59','2022-05-23 15:11:59',0,0,NULL),(4,'Validacion','',1,'2022-05-23 15:11:59','2022-05-23 15:11:59',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=54 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

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

INSERT INTO `documents` VALUES (15,1,'249a2e7b-892a-4ca0-a9f8-47732f5c0f2c',1,'{\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"15\",\"department\":{\"id\":\"15\",\"description\":\"LIMA\"},\"province_id\":\"1501\",\"province\":{\"id\":\"1501\",\"description\":\"Lima\"},\"district_id\":\"150101\",\"district\":{\"id\":\"150101\",\"description\":\"Lima\"},\"urbanization\":null,\"address\":\"-\",\"email\":\"sistemas@softlte.net.pe\",\"telephone\":\"-\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'01','01','F001',1,'2022-11-25','16:52:44',2,'{\"identity_document_type_id\":\"6\",\"identity_document_type\":{\"id\":\"6\",\"description\":\"RUC\"},\"number\":\"10432761091\",\"name\":\"CARRANZA SANCHEZ DAMIAN\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":null,\"department\":{\"id\":null,\"description\":null},\"province_id\":null,\"province\":{\"id\":null,\"description\":null},\"district_id\":null,\"district\":{\"id\":null,\"description\":null},\"address\":null,\"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,1,3.850,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,9.90,0.00,0.00,0.00,0.00,59.90,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,59.90,59.90,50.00,0,0,NULL,0,0.00,0.00,NULL,'[{\"discount_type_id\":\"03\",\"description\":\"Descuentos globales que no afectan la base imponible del IGV\\/IVAP\",\"factor\":0.16528,\"amount\":9.9,\"base\":59.9,\"is_amount\":null}]',NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Cincuenta  con 00\\/100 \"}]',NULL,NULL,'10754789102-01-F001-1','10754789102-01-F001-1','WkxZfsphumwmVeIvsOlGuqLZFrc=','[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-11-25 16:53:27','2022-11-25 16:53:32',1,NULL,NULL),(16,1,'be59cdee-d8b0-4c0d-880e-0ab711afe355',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\":\"Jr. Mara\\u00f1on 900\",\"email\":\"sistemas@softlte.net.pe\",\"telephone\":\"916050559\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'01','01','F001',2,'2022-11-25','17:08:42',7,'{\"identity_document_type_id\":\"6\",\"identity_document_type\":{\"id\":\"6\",\"description\":\"RUC\"},\"number\":\"10444565972\",\"name\":\"BURGA REQUEJO EDWAR ALEXANDER\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"06\",\"department\":{\"id\":\"06\",\"description\":\"CAJAMARCA\"},\"province_id\":\"0609\",\"province\":{\"id\":\"0609\",\"description\":\"San Ignacio\"},\"district_id\":\"060901\",\"district\":{\"id\":\"060901\",\"description\":\"San Ignacio\"},\"address\":\"JR. JUNIN NRO. 116 CENTRO SAN IGNACIO\",\"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,1,3.850,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,50.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,50.00,50.00,50.00,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Cincuenta  con 00\\/100 \"}]',NULL,NULL,'10754789102-01-F001-2','10754789102-01-F001-2','OxmnjRPKbkUIfk37e3Ep5lxzbj8=','[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-2, ha sido aceptada\",\"notes\":[]}',0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-11-25 17:09:17','2022-11-25 17:09:21',1,NULL,NULL),(17,1,'0063eac9-a515-4d91-8842-169b62f4f7cb',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\":\"Jr. Mara\\u00f1on 900\",\"email\":\"sistemas@softlte.net.pe\",\"telephone\":\"916050559\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'01','01','F001',3,'2022-11-25','17:09:21',11,'{\"identity_document_type_id\":\"6\",\"identity_document_type\":{\"id\":\"6\",\"description\":\"RUC\"},\"number\":\"10772336174\",\"name\":\"DURAND ADANAQUE KAREN LIZBET\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"20\",\"department\":{\"id\":\"20\",\"description\":\"PIURA\"},\"province_id\":\"2004\",\"province\":{\"id\":\"2004\",\"description\":\"Morrop\\u00f3n\"},\"district_id\":\"200401\",\"district\":{\"id\":\"200401\",\"description\":\"Chulucanas\"},\"address\":\"JR. TARAPACA NRO. 451\",\"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,1,3.850,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,89.90,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,89.90,89.90,89.90,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Ochenta y nueve  con 90\\/100 \"}]',NULL,NULL,'10754789102-01-F001-3','10754789102-01-F001-3','DRQW1Ns+MNxqaE0bIKxYYEkQddg=','[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-3, ha sido aceptada\",\"notes\":[]}',0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-11-25 17:13:56','2022-11-25 17:14:00',1,NULL,NULL),(18,1,'8adabe3d-8b83-4ad3-bc68-85a6358b730b',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\":\"Jr. Mara\\u00f1on 900\",\"email\":\"sistemas@softlte.net.pe\",\"telephone\":\"916050559\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'01','01','F001',4,'2022-11-25','17:14:00',9,'{\"identity_document_type_id\":\"6\",\"identity_document_type\":{\"id\":\"6\",\"description\":\"RUC\"},\"number\":\"10470588867\",\"name\":\"YRUPAILLA REQUEJO DIEGO ALONSO\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"06\",\"department\":{\"id\":\"06\",\"description\":\"CAJAMARCA\"},\"province_id\":\"0608\",\"province\":{\"id\":\"0608\",\"description\":\"Ja\\u00e9n\"},\"district_id\":\"060801\",\"district\":{\"id\":\"060801\",\"description\":\"Ja\\u00e9n\"},\"address\":\"PRO. MANCO CAPAC NRO. 181 SEC. MORRO SOLAR\",\"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,1,3.850,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,89.90,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,89.90,89.90,89.90,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Ochenta y nueve  con 90\\/100 \"}]',NULL,NULL,'10754789102-01-F001-4','10754789102-01-F001-4','38OF6bMbXhIrKnnn2bev3nnG+E4=','[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-4, ha sido aceptada\",\"notes\":[]}',0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-11-25 17:24:23','2022-11-25 17:24:28',1,NULL,NULL),(19,1,'833c65be-927b-46c4-ba49-4e9caac86c56',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\":\"Jr. Mara\\u00f1on 900\",\"email\":\"sistemas@softlte.net.pe\",\"telephone\":\"916050559\",\"code\":\"0000\",\"trade_address\":null,\"web_address\":null,\"aditional_information\":null,\"logo\":null}','02','05','2.1',0,0,'01','01','F001',5,'2022-11-25','17:24:28',19,'{\"identity_document_type_id\":\"6\",\"identity_document_type\":{\"id\":\"6\",\"description\":\"RUC\"},\"number\":\"20609611643\",\"name\":\"D\'JTAS E.I.R.L.\",\"trade_name\":null,\"country_id\":\"PE\",\"country\":{\"id\":\"PE\",\"description\":\"PERU\"},\"department_id\":\"06\",\"department\":{\"id\":\"06\",\"description\":\"CAJAMARCA\"},\"province_id\":\"0608\",\"province\":{\"id\":\"0608\",\"description\":\"Ja\\u00e9n\"},\"district_id\":\"060801\",\"district\":{\"id\":\"060801\",\"description\":\"Ja\\u00e9n\"},\"address\":\"PRO. MANCO CAPAC NRO. 167\",\"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,1,3.850,0,NULL,NULL,NULL,NULL,0,0,0.00,0.00,0.00,0.00,0.00,0.00,0.00,89.90,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.00,89.90,89.90,89.90,0,0,NULL,0,0.00,0.00,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'[{\"code\":1000,\"value\":\"Ochenta y nueve  con 90\\/100 \"}]',NULL,NULL,'10754789102-01-F001-5','10754789102-01-F001-5','0qA52aKshjGA5kcGKKFoGxb5/P0=','[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-5, ha sido aceptada\",\"notes\":[]}',0,NULL,0,NULL,NULL,NULL,'',NULL,'2022-11-25 17:26:44','2022-11-25 17:26:48',1,NULL,NULL),