src/OpenCart/Invoice/Creator.php
protected function getVatRateLookupMetadata($taxClassId)
    {
        $result = array();

        $taxClass = $this->getTaxClass($taxClassId);
        if ($taxClass) {
            $result += array(
                Meta::VatClassId => $taxClass['tax_class_id'],
                Meta::VatClassName => $taxClass['title'],
                Meta::VatRateLookup => array(),
                Meta::VatRateLookupLabel => array(),
            );

            $taxRules = $this->getTaxRules($taxClassId);
            foreach ($taxRules as $taxRule) {
                $taxRate = $this->getTaxRate($taxRule['tax_rate_id']);
                if (!empty($taxRate)) {
                    if ($this->isAddressInGeoZone($this->order, $taxRule['based'], $taxRate['geo_zone_id'])) {
                        $result[Meta::VatRateLookup][] = $taxRate['rate'];
                        $result[Meta::VatRateLookupLabel][] = $taxRate['name'];
                    }
                }
            }
        }
        return $result;
    }
protected function getVatRateLookupMetadata($taxClassId)
    {
        $result = array();

        $taxClass = $this->getTaxClass($taxClassId);
        if ($taxClass) {
            $result += array(
                Meta::VatClassId => $taxClass['tax_class_id'],
                Meta::VatClassName => $taxClass['title'],
                Meta::VatRateLookup => array(),
                Meta::VatRateLookupLabel => array(),
            );

            $taxRules = $this->getTaxRules($taxClassId);
            foreach ($taxRules as $taxRule) {
                $taxRate = $this->getTaxRate($taxRule['tax_rate_id']);
                if (!empty($taxRate)) {
                    if ($this->isAddressInGeoZone($this->order, $taxRule['based'], $taxRate['geo_zone_id'])) {
                        $result[Meta::VatRateLookup][] = $taxRate['rate'];
                        $result[Meta::VatRateLookupLabel][] = $taxRate['name'];
                    }
                }
            }
        }
        return $result;
    }
protected function getVatRateLookupMetadata ( $ taxClassId ) { $ result = array ( ) ; $ taxClass = $ this -> getTaxClass ( $ taxClassId ) ; if ( $ taxClass ) { $ result += array ( Meta :: VatClassId => $ taxClass [ 'tax_class_id' ] , Meta :: VatClassName => $ taxClass [ 'title' ] , Meta :: VatRateLookup => array ( ) , Meta :: VatRateLookupLabel => array ( ) , ) ; $ taxRules = $ this -> getTaxRules ( $ taxClassId ) ; foreach ( $ taxRules as $ taxRule ) { $ taxRate = $ this -> getTaxRate ( $ taxRule [ 'tax_rate_id' ] ) ; if ( ! empty ( $ taxRate ) ) { if ( $ this -> isAddressInGeoZone ( $ this -> order , $ taxRule [ 'based' ] , $ taxRate [ 'geo_zone_id' ] ) ) { $ result [ Meta :: VatRateLookup ] [ ] = $ taxRate [ 'rate' ] ; $ result [ Meta :: VatRateLookupLabel ] [ ] = $ taxRate [ 'name' ] ; } } } } return $ result ; }
Looks up and returns vat class and vat rate metadata.

@param int $taxClassId
The tax class to look up.

@return array
An empty array or an array with keys:
- Meta::VatClassId: int
- Meta::VatClassName: string
- Meta::VatRateLookup: float[]
- Meta::VatRateLookupLabel: string[]

@throws \Exception
Looks up and returns vat class and vat rate metadata .