CREATE VIEW `outbound_report_account`  AS SELECT `accounts`.`id` AS `id_cuenta`, `accounts_cstm`.`tipo_documento_c` AS `tipo_documento`, `accounts_cstm`.`numero_de_documento_c` AS `numero_de_documento`, `accounts`.`name` AS `nombre_cuenta`, `accounts_cstm`.`cumpleanos_c` AS `cumpleanos`, `accounts_cstm`.`edad_c` AS `edad`, `accounts_cstm`.`genero_c` AS `genero`, `accounts_cstm`.`barrio_c` AS `barrio`, `accounts_cstm`.`telefono_movil_c` AS `telefono_movil`, `accounts_cstm`.`telefono_fijo_c` AS `telefono_fijo`, `accounts`.`phone_alternate` AS `telefono_alternativo`, `accounts`.`billing_address_street` AS `direccion`, `accounts`.`billing_address_city` AS `ciudad`, `accounts`.`billing_address_state` AS `departamento`, `accounts`.`billing_address_postalcode` AS `codigo_postal`, `accounts`.`billing_address_country` AS `pais`, `accounts`.`account_type` AS `tipo_cuenta`, `accounts_cstm`.`entidad_c` AS `entidad`, `accounts_cstm`.`plan_complementario_c` AS `plan_complementario`, `accounts_cstm`.`paciente_fallecido_c` AS `paciente_fallecido`, `accounts`.`campaign_id` AS `campana`, `accounts`.`parent_id` AS `miembro_de`, `accounts`.`description` AS `observaciones`, `ip_outbound_plantillas_callbell`.`id` AS `id_outbound`, `ip_outbound_plantillas_callbell`.`name` AS `nombre_outbound`, `ip_outbound_plantillas_callbell`.`fecha_inicio` AS `fecha_inicio`, `ip_outbound_plantillas_callbell`.`fecha_fin` AS `fecha_fin`, `ip_outbound_plantillas_callbell`.`estado` AS `estado`, `ip_outbound_plantillas_callbell`.`url_adjunto` AS `url_adjunto`, `ip_plantillas_callbell`.`id` AS `id_plantilla`, `ip_plantillas_callbell`.`name` AS `nombre_plantilla`, `ip_plantillas_callbell`.`type_template` AS `tipo_plantilla`, `ip_plantillas_callbell`.`uuid_template` AS `uuid_plantilla`, `log_outbound`.`id` AS `id_log`, `log_outbound`.`fecha` AS `fecha_log`, `log_outbound`.`proceso` AS `proceso_log`, `log_outbound`.`observaciones` AS `observaciones_log`, `log_outbound`.`type_client` AS `tipo_log`, `log_outbound`.`uuid_message` AS `uuid_mensaje`, `log_outbound`.`status_message` AS `estado_mensaje` FROM (((((`log_outbound` join `accounts` on(`log_outbound`.`id_client` = `accounts`.`id`)) join `accounts_cstm` on(`accounts`.`id` = `accounts_cstm`.`id_c`)) join `ip_outbound_plantillas_callbell` on(`log_outbound`.`id_outbound` = `ip_outbound_plantillas_callbell`.`id`)) join `ip_outbound_plantillas_callbell_cstm` on(`ip_outbound_plantillas_callbell`.`id` = `ip_outbound_plantillas_callbell_cstm`.`id_c`)) join `ip_plantillas_callbell` on(`ip_outbound_plantillas_callbell_cstm`.`ip_plantillas_callbell_id_c` = `ip_plantillas_callbell`.`id`)) WHERE `ip_outbound_plantillas_callbell`.`deleted` = 0 ;
