Método que obtiene los datos para generar los tags de Resumen del
consumo de folios
@return Arreglo con los datos para generar los tags Resumen
@author Esteban De La Fuente Rubio, DeLaF (esteban[at]sasco.cl)
@version 2016-02-14
188301
private function getResumen()
    {
        // si hay detalles generar resumen
        $Resumen = [];
        $RangoUtilizados = [];
        //$RangoAnulados = [];
        foreach ($this->detalles as &$d) {
            // si no existe el tipo de documento se utiliza
            if (!isset($Resumen[$d['TpoDoc']])) {
                $key = array_search($d['TpoDoc'], $this->documentos);
                if ($key!==false) {
                    unset($this->documentos[$key]);
                }
                $Resumen[$d['TpoDoc']] = [
                    'TipoDocumento' => $d['TpoDoc'],
                    'MntNeto' => false,
                    'MntIva' => false,
                    'TasaIVA' => $d['TasaImp'] ? $d['TasaImp'] : false,
                    'MntExento' => false,
                    'MntTotal' => 0,
                    'FoliosEmitidos' => 0,
                    'FoliosAnulados' => 0,
                    'FoliosUtilizados' => false,
                    'RangoUtilizados' => false,
                    //'RangoAnulados' => false,
                ];
                $RangoUtilizados[$d['TpoDoc']] = [];
                //$RangoAnulados[$d['TpoDoc']] = [];
            }
            // ir agregando al resumen cada detalle
            if ($d['MntNeto']) {
                $Resumen[$d['TpoDoc']]['MntNeto'] += $d['MntNeto'];
                $Resumen[$d['TpoDoc']]['MntIva'] += $d['MntIVA'];
            }
            if ($d['MntExe']) {
                $Resumen[$d['TpoDoc']]['MntExento'] += $d['MntExe'];
            }
            $Resumen[$d['TpoDoc']]['MntTotal'] += $d['MntTotal'];
            $Resumen[$d['TpoDoc']]['FoliosEmitidos']++;
            // ir guardando folios emitidos para luego crear rangos
            $RangoUtilizados[$d['TpoDoc']][] = $d['NroDoc'];
        }
        // ajustes post agregar detalles
        foreach ($Resumen as &$r) {
            // obtener folios utilizados = emitidos + anulados
            $r['FoliosUtilizados'] = $r['FoliosEmitidos'] + $r['FoliosAnulados'];
            $r['RangoUtilizados'] = $this->getRangos($RangoUtilizados[$r['TipoDocumento']]);
        }
        // completar con los resumenes que no se colocaron
        foreach ($this->documentos as $tipo) {
            $Resumen[$tipo] = [
                'TipoDocumento' => $tipo,
                'MntTotal' => 0,
                'FoliosEmitidos' => 0,
                'FoliosAnulados' => 0,
                'FoliosUtilizados' => 0,
            ];
        }
        // entregar resumen
        return $Resumen;
    }
788583
public function getPhotoTags() {
		$tags = [];
		$annotations = elgg_get_annotations([
			'guid' => $this->getGUID(),
			'annotation_name' => 'phototag',
		]);
		foreach ($annotations as $annotation) {
			$tag = unserialize($annotation->value);
			$tag->annotation_id = $annotation->id;
			$tags[] = $tag;
		}

		return $tags;
	}
821171
public function getTagFilters()
    {
        if ($this->tagFilters === ['none']) {
            $result = null;
        } elseif ($this->tagFilters === ['all']) {
            $result = [];
        } else {
            $result = $this->tagFilters;
        }

        return $result;
    }
807579
public function getTags()
    {
        $tags = array();
        foreach ($this->getTokenParsers()->getParsers() as $parser) {
            if ($parser instanceof Twig_TokenParserInterface) {
                $tags[$parser->getTag()] = $parser;
            }
        }

        return $tags;
    }
1046668
public function getTagsList()
    {
        $tags = explode("\n", str_replace("\r", "\n", trim($this->getTags())));
        $clean_tags = [];
        foreach ($tags as $tag) {
            $tag = trim($tag);
            if ($tag !== '') {
                $clean_tags[] = $tag;
            }
        }

        return $clean_tags;
    }
134227
private function getAllTags(): array
    {
        if ($this->tags === null) {
            $this->tags = $this->loadAllTags();
        }

        return $this->tags;
    }
624249
public function attachmentTaxonomies() {
		$taxonomies = [
			'category' => 'Category',
			'post_tag' => 'Tag'
		];

		$attachTaxes = get_object_taxonomies('attachment');
		if (!empty($attachTaxes)) {
			foreach($attachTaxes as $attachTax) {
				if (!in_array($attachTax, ['post_tag', 'category'])) {
					$taxonomies[$attachTax] = ucwords(str_replace('_', ' ', $attachTax));
				}
			}
		}


		return $taxonomies;
	}
275101
public function getNbResults()
    {
        if (!$this->tag instanceof Tag) {
            return 0;
        }

        if (!isset($this->nbResults)) {
            $this->nbResults = $this->tagsService->getRelatedContentCount($this->tag);
        }

        return $this->nbResults;
    }
979809
public function getTags()
    {
        $tags = [];
        foreach ($this->getFileVersion()->getTags() as $tag) {
            /* @var TagInterface $tag */
            array_push($tags, $tag->getName());
        }

        return $tags;
    }
583271
private function getTags(): array
    {
        $tags = [];
        foreach ($this->referenceStorePool->getStores() as $alias => $referenceStore) {
            $tags = array_merge($tags, $this->getTagsFromStore($alias, $referenceStore));
        }

        return $tags;
    }
879355
public function getReturnTypes() {
    $types = ['void'];
    $doc_comment = $this->getDocComment();
    if (!$doc_comment) {
      return $types;
    }
    $return_tag = $doc_comment->getReturn();
    if (!$return_tag) {
      return $types;
    }
    $types = Types::normalize($return_tag->getTypes());
    if (empty($types)) {
      $types[] = 'void';
    }
    return $types;
  }
882327
static public function fetchLimitations()
    {
        /** @var eZTagsObject[] $tags */
        $tags = self::fetchList( array( 'parent_id' => 0, 'main_tag_id' => 0 ), null, null, true );

        if ( !is_array( $tags ) )
            return array();

        $returnArray = array();
        foreach ( $tags as $tag )
        {
            $returnArray[] = array( 'name' => $tag->attribute( 'keyword' ), 'id' => $tag->attribute( 'id' ) );
        }

        return $returnArray;
    }
1275792
public function getCompras()
    {
        $detalle = [];
        foreach ($this->detalles as $d) {
            // armar iva no recuperable
            $iva_no_recuperable_codigo = [];
            $iva_no_recuperable_monto = [];
            foreach ((array)$d['IVANoRec'] as $inr) {
                $iva_no_recuperable_codigo[] = $inr['CodIVANoRec'];
                $iva_no_recuperable_monto[] = $inr['MntIVANoRec'];
            }
            // armar impuestos adicionales
            $impuesto_adicional_codigo = [];
            $impuesto_adicional_tasa = [];
            $impuesto_adicional_monto = [];
            foreach ((array)$d['OtrosImp'] as $ia) {
                $impuesto_adicional_codigo[] = $ia['CodImp'];
                $impuesto_adicional_tasa[] = $ia['TasaImp'];
                $impuesto_adicional_monto[] = $ia['MntImp'];
            }
            // armar detalle
            $detalle[] = [
                (int)$d['TpoDoc'],
                (int)$d['NroDoc'],
                $d['RUTDoc'],
                (int)$d['TasaImp'],
                $d['RznSoc'],
                $d['TpoImp']!==false ? $d['TpoImp'] : 1,
                $d['FchDoc'],
                $d['Anulado']!==false ? $d['Anulado'] : null,
                $d['MntExe']!==false ? $d['MntExe'] : null,
                $d['MntNeto']!==false ? $d['MntNeto'] : null,
                (int)$d['MntIVA'],
                $iva_no_recuperable_codigo ? implode(',', $iva_no_recuperable_codigo) : null,
                $iva_no_recuperable_monto ? implode(',', $iva_no_recuperable_monto) : null,
                $d['IVAUsoComun']!==false ? $d['IVAUsoComun'] : null,
                $impuesto_adicional_codigo ? implode(',', $impuesto_adicional_codigo) : null,
                $impuesto_adicional_tasa ? implode(',', $impuesto_adicional_tasa) : null,
                $impuesto_adicional_monto ? implode(',', $impuesto_adicional_monto) : null,
                $d['MntSinCred']!==false ? $d['MntSinCred'] : null,
                $d['MntActivoFijo']!==false ? $d['MntActivoFijo'] : null,
                $d['MntIVAActivoFijo']!==false ? $d['MntIVAActivoFijo'] : null,
                $d['IVANoRetenido']!==false ? $d['IVANoRetenido'] : null,
                $d['TabPuros']!==false ? $d['TabPuros'] : null,
                $d['TabCigarrillos']!==false ? $d['TabCigarrillos'] : null,
                $d['TabElaborado']!==false ? $d['TabElaborado'] : null,
                $d['ImpVehiculo']!==false ? $d['ImpVehiculo'] : null,
                $d['CdgSIISucur']!==false ? $d['CdgSIISucur'] : null,
                $d['NumInt']!==false ? $d['NumInt'] : null,
                $d['Emisor']!==false ? $d['Emisor'] : null,
                $d['MntTotal']!==false ? $d['MntTotal'] : null,
                (isset($d['FctProp']) and $d['FctProp']!==false) ? $d['FctProp'] : null,
            ];
        }
        return $detalle;
    }
697405
public function getTagsFromSearchResult()
    {
        $tags = $tagsForResult = array();
        $tagChar = $this->pObj->extConf['prePostTagChar'];
        $tagDivider = $tagChar . ',' . $tagChar;

        if ($this->sphinxSearchEnabled()) {
            $tagsForResult = $this->getTagsFromSphinx();
        } else {
            $tagsForResult = $this->getTagsFromMySQL();
        }
        foreach ($tagsForResult as $tagSet) {
            $tagSet = explode($tagDivider, trim($tagSet, $tagChar));
            foreach ($tagSet as $tag) {
                $tags[$tag] += 1;
            }
        }
        return $tags;
    }
705753
public function getTags()
    {
        if (!$this->tags) {
            $this->tags = array();

            foreach ($this->events as $event) {
                $this->tags = array_merge($this->tags, $event->getTags());
            }

            $this->tags = array_values(array_unique($this->tags));
        }

        return $this->tags;
    }
1099079
public function getResumenManual()
    {
        $manual = [];
        if (isset($this->toArray()['LibroCompraVenta']['EnvioLibro']['ResumenPeriodo']['TotalesPeriodo'])) {
            $totales = $this->toArray()['LibroCompraVenta']['EnvioLibro']['ResumenPeriodo']['TotalesPeriodo'];
            if (!isset($totales[0]))
                $totales = [$totales];
            foreach ($totales as $total) {
                if (isset($total['TpoDoc']) and in_array($total['TpoDoc'], [35, 38, 48])) {
                    $manual[$total['TpoDoc']] = array_merge($this->total_default, $total);
                }
            }
        }
        return $manual;
    }
1053787
public function getTagList(){
	    if (!$this->access_token && !$this->checkAuth()) return false;
	    $result = $this->http_get(self::API_URL_PREFIX.self::TAG_LIST_URL.'access_token='.$this->access_token);
	    if ($result)
	    {
	        $json = json_decode($result,true);
	        if (!$json || !empty($json['errcode'])) {
	            $this->errCode = $json['errcode'];
	            $this->errMsg = $json['errmsg'];
	            return false;
	        }
	        return $json;
	    }
	    return false;
	}