kernel/classes/vathandlers/ezdefaultvathandler.php

Show: inherited
Table of Contents

File containing the eZDefaultVATHandler class.

Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Package
kernel  
Version
4.6.0  

\eZDefaultVATHandler

Package: kernel

File containing the eZDefaultVATHandler class.

Copyright
Copyright (C) 1999-2011 eZ Systems AS. All rights reserved.  
License
eZ Business Use License Agreement Version 2.0  
Version
4.6.0  

Methods

methodpublicchooseVatType(  $productCategory,  $country ) : void

Choose the best matching VAT type for given product category and country.

We calculate priority for each VAT type and then choose the VAT type having the highest priority (or first of those having the highest priority).

VAT type priority is calculated from county match and category match as following:

CountryMatch = 0 CategoryMatch = 1

if ( there is exact match on country ) CountryMatch = 2 elseif ( there is weak match on country ) CountryMatch = 1

if ( there is exact match on product category ) CategoryMatch = 2 elseif ( there is weak match on product category ) CategoryMatch = 1

if ( there is match on both country and category ) VatTypePriority = CountryMatch * 2 + CategoryMatch - 2 else VatTypePriority = 0

\private \static

Parameters
Name Type Description
$productCategory
$country
methodpublicgetProductCategory(  $object ) : void

Determine object's product category.

\private \static

Parameters
Name Type Description
$object
methodpublicgetVatPercent(  $object,  $country ) : void

\public \static

Parameters
Name Type Description
$object
$country
Documentation was generated by DocBlox 0.18.1.