OXID eShop CE  4.8.10
 All Classes Files Functions Variables Pages
oxVatSelector Class Reference
+ Inheritance diagram for oxVatSelector:
+ Collaboration diagram for oxVatSelector:

Public Member Functions

 getUserVat (oxUser $oUser, $blCacheReset=false)
 getArticleVat (oxArticle $oArticle)
 getBasketItemVat (oxArticle $oArticle, $oBasket)
 getArticleUserVat (oxArticle $oArticle)
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 __construct ()
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Static Public Member Functions

static getInstance ()

Protected Member Functions

 _getForeignCountryUserVat (oxUser $oUser, oxCountry $oCountry)
 _getVatForArticleCategory (oxArticle $oArticle)
 _getVatCountry (oxUser $oUser=null)

Protected Attributes

 $_blCatVatSet = null

Static Protected Attributes

static $_instance = null
static $_aUserVatCache = array()
- Static Protected Attributes inherited from oxSuperCfg
static $_oConfig = null
static $_oSession = null
static $_oRights = null
static $_oActUser = null
static $_blIsAdmin = null

Detailed Description

Class, responsible for retrieving correct vat for users and articles

Definition at line 7 of file oxvatselector.php.

Member Function Documentation

oxVatSelector::_getForeignCountryUserVat ( oxUser  $oUser,
oxCountry  $oCountry 
)
protected

get vat for user of a foreign country

Parameters
oxUser$oUsergiven user object
oxCountry$oCountrygiven country object
Returns
mixed

Definition at line 86 of file oxvatselector.php.

oxVatSelector::_getVatCountry ( oxUser  $oUser = null)
protected

Returns country id which VAT should be applied to. Depending on configuration option either user billing country or shipping country (if available) is returned.

Parameters
oxUser$oUseruser object
Returns
string

Definition at line 202 of file oxvatselector.php.

oxVatSelector::_getVatForArticleCategory ( oxArticle  $oArticle)
protected

return Vat value for oxcategory type assignment only

Parameters
oxArticle$oArticlegiven article
Returns
float | false

Definition at line 105 of file oxvatselector.php.

oxVatSelector::getArticleUserVat ( oxArticle  $oArticle)

get article user vat

Parameters
oxArticle$oArticlearticle object
Returns
double | false

Definition at line 185 of file oxvatselector.php.

oxVatSelector::getArticleVat ( oxArticle  $oArticle)

get VAT for given article, can NOT be null

Parameters
oxArticle$oArticlegiven article
Returns
double

Definition at line 145 of file oxvatselector.php.

oxVatSelector::getBasketItemVat ( oxArticle  $oArticle,
  $oBasket 
)

Currently returns vats percent that can be applied for basket item ( executes oxVatSelector::getArticleVat()). Can be used to override basket price calculation behaviour (oxarticle::getBasketPrice())

Parameters
object$oArticlearticle object
object$oBasketoxbasket object
Returns
double

Definition at line 173 of file oxvatselector.php.

static oxVatSelector::getInstance ( )
static

Returns singleton oxVatSelector object instance or create new if needed

Deprecated:
since v5.0 (2012-08-10); Use oxRegistry::get("oxVatSelector") instead.
Returns
oxVatSelector

Definition at line 29 of file oxvatselector.php.

oxVatSelector::getUserVat ( oxUser  $oUser,
  $blCacheReset = false 
)

get VAT for user, can NOT be null

Parameters
oxUser$oUsergiven user object
bool$blCacheResetreset cache
Exceptions
oxObjectExceptionif wrong country
Returns
double | false

Definition at line 50 of file oxvatselector.php.

Member Data Documentation

oxVatSelector::$_aUserVatCache = array()
staticprotected

Definition at line 39 of file oxvatselector.php.

oxVatSelector::$_blCatVatSet = null
protected

Definition at line 13 of file oxvatselector.php.

oxVatSelector::$_instance = null
staticprotected

Definition at line 20 of file oxvatselector.php.


The documentation for this class was generated from the following file: