Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Tax_Block_Adminhtml_Frontend_Region_Updater
  • Mage_Tax_Block_Checkout_Discount
  • Mage_Tax_Block_Checkout_Grandtotal
  • Mage_Tax_Block_Checkout_Shipping
  • Mage_Tax_Block_Checkout_Subtotal
  • Mage_Tax_Block_Checkout_Tax
  • Mage_Tax_Block_Sales_Order_Tax
  • Mage_Tax_Helper_Data
  • Mage_Tax_Model_Calculation
  • Mage_Tax_Model_Calculation_Rate
  • Mage_Tax_Model_Calculation_Rate_Title
  • Mage_Tax_Model_Calculation_Rule
  • Mage_Tax_Model_Class
  • Mage_Tax_Model_Class_Source_Customer
  • Mage_Tax_Model_Class_Source_Product
  • Mage_Tax_Model_Config
  • Mage_Tax_Model_Config_Price_Include
  • Mage_Tax_Model_Mysql4_Calculation
  • Mage_Tax_Model_Mysql4_Calculation_Collection
  • Mage_Tax_Model_Mysql4_Calculation_Rate
  • Mage_Tax_Model_Mysql4_Calculation_Rate_Collection
  • Mage_Tax_Model_Mysql4_Calculation_Rate_Title
  • Mage_Tax_Model_Mysql4_Calculation_Rate_Title_Collection
  • Mage_Tax_Model_Mysql4_Calculation_Rule
  • Mage_Tax_Model_Mysql4_Calculation_Rule_Collection
  • Mage_Tax_Model_Mysql4_Class
  • Mage_Tax_Model_Mysql4_Class_Collection
  • Mage_Tax_Model_Mysql4_Report_Collection
  • Mage_Tax_Model_Mysql4_Report_Tax
  • Mage_Tax_Model_Mysql4_Report_Updatedat_Collection
  • Mage_Tax_Model_Mysql4_Sales_Order_Tax
  • Mage_Tax_Model_Mysql4_Sales_Order_Tax_Collection
  • Mage_Tax_Model_Mysql4_Setup
  • Mage_Tax_Model_Observer
  • Mage_Tax_Model_Resource_Calculation
  • Mage_Tax_Model_Resource_Calculation_Collection
  • Mage_Tax_Model_Resource_Calculation_Rate
  • Mage_Tax_Model_Resource_Calculation_Rate_Collection
  • Mage_Tax_Model_Resource_Calculation_Rate_Title
  • Mage_Tax_Model_Resource_Calculation_Rate_Title_Collection
  • Mage_Tax_Model_Resource_Calculation_Rule
  • Mage_Tax_Model_Resource_Calculation_Rule_Collection
  • Mage_Tax_Model_Resource_Class
  • Mage_Tax_Model_Resource_Class_Collection
  • Mage_Tax_Model_Resource_Report_Collection
  • Mage_Tax_Model_Resource_Report_Tax
  • Mage_Tax_Model_Resource_Report_Tax_Createdat
  • Mage_Tax_Model_Resource_Report_Tax_Updatedat
  • Mage_Tax_Model_Resource_Report_Updatedat_Collection
  • Mage_Tax_Model_Resource_Sales_Order_Tax
  • Mage_Tax_Model_Resource_Sales_Order_Tax_Collection
  • Mage_Tax_Model_Resource_Sales_Order_Tax_Item
  • Mage_Tax_Model_Resource_Sales_Order_Tax_Item_Collection
  • Mage_Tax_Model_Resource_Setup
  • Mage_Tax_Model_Sales_Order_Tax
  • Mage_Tax_Model_Sales_Order_Tax_Item
  • Mage_Tax_Model_Sales_Pdf_Grandtotal
  • Mage_Tax_Model_Sales_Pdf_Shipping
  • Mage_Tax_Model_Sales_Pdf_Subtotal
  • Mage_Tax_Model_Sales_Pdf_Tax
  • Mage_Tax_Model_Sales_Total_Quote_Discount
  • Mage_Tax_Model_Sales_Total_Quote_Nominal_Subtotal
  • Mage_Tax_Model_Sales_Total_Quote_Nominal_Tax
  • Mage_Tax_Model_Sales_Total_Quote_Shipping
  • Mage_Tax_Model_Sales_Total_Quote_Subtotal
  • Mage_Tax_Model_Sales_Total_Quote_Tax
  • Mage_Tax_Model_System_Config_Source_Algorithm
  • Mage_Tax_Model_System_Config_Source_Apply
  • Mage_Tax_Model_System_Config_Source_PriceType
  • Mage_Tax_Model_System_Config_Source_Tax_Country
  • Mage_Tax_Model_System_Config_Source_Tax_Display_Type
  • Mage_Tax_Model_System_Config_Source_Tax_Region

Exceptions

  • Mage_Tax_Exception
  • Overview
  • Package
  • Class
  • Tree

Class Mage_Tax_Model_Calculation

Tax Calculation Model

Varien_Object
Extended by Mage_Core_Model_Abstract
Extended by Mage_Tax_Model_Calculation
Package: Mage\Tax
Copyright: Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
License: Open Software License (OSL 3.0)
Author: Magento Core Team <core@magentocommerce.com>
Located at code/core/Mage/Tax/Model/Calculation.php
Methods summary
protected
# _construct( )
public Mage_Tax_Model_Calculation
# setCustomer( Mage_Customer_Model_Customer $customer )

Specify customer object which can be used for rate calculation

Specify customer object which can be used for rate calculation

Parameters

$customer
Mage_Customer_Model_Customer
$customer

Returns

Mage_Tax_Model_Calculation
public
# getDefaultCustomerTaxClass( mixed $store = null )
public Mage_Customer_Model_Customer
# getCustomer( )

Get customer object

Get customer object

Returns

Mage_Customer_Model_Customer
| false
public Mage_Tax_Model_Calculation
# deleteByRuleId( integer $ruleId )

Delete calculation settings by rule id

Delete calculation settings by rule id

Parameters

$ruleId
integer
$ruleId

Returns

Mage_Tax_Model_Calculation
public array
# getRates( integer $ruleId )

Get calculation rates by rule id

Get calculation rates by rule id

Parameters

$ruleId
integer
$ruleId

Returns

array
public array
# getCustomerTaxClasses( integer $ruleId )

Get allowed customer tax classes by rule id

Get allowed customer tax classes by rule id

Parameters

$ruleId
integer
$ruleId

Returns

array
public array
# getProductTaxClasses( integer $ruleId )

Get allowed product tax classes by rule id

Get allowed product tax classes by rule id

Parameters

$ruleId
integer
$ruleId

Returns

array
protected array
# _formCalculationProcess( )

Aggregate tax calculation data to array

Aggregate tax calculation data to array

Returns

array
public float
# getRate( Varien_Object $request )

Get calculation tax rate by specific request

Get calculation tax rate by specific request

Parameters

$request
Varien_Object
$request

Returns

float
protected string
# _getRequestCacheKey( mixed $request )

Get cache key value for specific tax rate request

Get cache key value for specific tax rate request

Parameters

$request
mixed
$request

Returns

string
public float
# getStoreRate( Varien_Object $request, mixed $store = null )

Get tax rate based on store shipping origin address settings This rate can be used for conversion store price including tax to store price excluding tax

Get tax rate based on store shipping origin address settings This rate can be used for conversion store price including tax to store price excluding tax

Parameters

$request
Varien_Object
$request
$store

Returns

float
public Varien_Object
# getRateOriginRequest( null|store $store = null )

Get request object for getting tax rate based on store shippig original address

Get request object for getting tax rate based on store shippig original address

Parameters

$store
null|store
$store

Returns

Varien_Object
public Varien_Object
# getRateRequest( null|false|Varien_Object $shippingAddress = null, null|false|Varien_Object $billingAddress = null, null|integer $customerTaxClass = null, null|integer $store = null )

Get request object with information necessary for getting tax rate Request object contain:
country_id (->getCountryId())
region_id (->getRegionId())
postcode (->getPostcode())
customer_class_id (->getCustomerClassId())
store (->getStore())

Get request object with information necessary for getting tax rate Request object contain: country_id (->getCountryId()) region_id (->getRegionId()) postcode (->getPostcode()) customer_class_id (->getCustomerClassId()) store (->getStore())

Parameters

$shippingAddress
null|false|Varien_Object
$shippingAddress
$billingAddress
null|false|Varien_Object
$billingAddress
$customerTaxClass
null|integer
$customerTaxClass
$store
null|integer
$store

Returns

Varien_Object
public boolean
# compareRequests( Varien_Object $first, Varien_Object $second )

Compare data and rates for two tax rate requests for same products (product tax class ids). Returns true if requests are similar (i.e. equal taxes rates will be applied to them)

Compare data and rates for two tax rate requests for same products (product tax class ids). Returns true if requests are similar (i.e. equal taxes rates will be applied to them)

Notice:

  1. productClassId MUST be identical for both requests, because we intend to check selling SAME products to DIFFERENT locations
  2. due to optimization productClassId can be array of ids, not only single id

Parameters

$first
Varien_Object
$first
$second
Varien_Object
$second

Returns

boolean
protected
# _getRates( mixed $request, mixed $fieldName, mixed $type )
public
# getRatesForAllProductTaxClasses( mixed $request )
public
# getRatesForAllCustomerTaxClasses( mixed $request )
public array
# getAppliedRates( Varien_Object $request )

Get information about tax rates applied to request

Get information about tax rates applied to request

Parameters

$request
Varien_Object
$request

Returns

array
public
# reproduceProcess( mixed $rates )
public
# getRatesByCustomerTaxClass( mixed $customerTaxClass )
public
# getRatesByCustomerAndProductTaxClasses( mixed $customerTaxClass, mixed $productTaxClass )
public float
# calcTaxAmount( float $price, float $taxRate, boolean $priceIncludeTax = false, mixed $round = true )

Calculate rated tax abount based on price and tax rate. If you are using price including tax $priceIncludeTax should be true.

Calculate rated tax abount based on price and tax rate. If you are using price including tax $priceIncludeTax should be true.

Parameters

$price
float
$price
$taxRate
float
$taxRate
$priceIncludeTax
boolean
$priceIncludeTax
$round

Returns

float
public float
# truncate( float $price, integer $precision = 4 )

Truncate number to specified precision

Truncate number to specified precision

Parameters

$price
float
$price
$precision
integer
$precision

Returns

float
public float
# round( float $price )

Round tax amount

Round tax amount

Parameters

$price
float
$price

Returns

float
public float
# roundUp( float $price )

Round price up

Round price up

Parameters

$price
float
$price

Returns

float
Methods inherited from Mage_Core_Model_Abstract
_afterDelete(), _afterDeleteCommit(), _afterLoad(), _afterSave(), _beforeDelete(), _beforeLoad(), _beforeSave(), _clearData(), _clearReferences(), _getEventData(), _getResource(), _hasModelChanged(), _init(), _protectFromNonAdmin(), _setResourceModel(), afterCommitCallback(), afterLoad(), cleanModelCache(), clearInstance(), delete(), getCacheIdTags(), getCacheTags(), getCollection(), getEntityId(), getId(), getIdFieldName(), getResource(), getResourceCollection(), getResourceName(), isObjectNew(), load(), save(), setId()
Constants summary
string CALC_TAX_BEFORE_DISCOUNT_ON_EXCL '0_0'
#
string CALC_TAX_BEFORE_DISCOUNT_ON_INCL '0_1'
#
string CALC_TAX_AFTER_DISCOUNT_ON_EXCL '1_0'
#
string CALC_TAX_AFTER_DISCOUNT_ON_INCL '1_1'
#
string CALC_UNIT_BASE 'UNIT_BASE_CALCULATION'
#
string CALC_ROW_BASE 'ROW_BASE_CALCULATION'
#
string CALC_TOTAL_BASE 'TOTAL_BASE_CALCULATION'
#
Properties summary
protected array $_rates array()
#
protected array $_ctc array()
#
protected array $_ptc array()
#
protected array $_rateCache array()
#
protected array $_rateCalculationProcess array()
#
protected mixed $_customer null
#
protected mixed $_defaultCustomerTaxClass null
#
Properties inherited from Mage_Core_Model_Abstract
$_cacheTag, $_dataSaveAllowed, $_eventObject, $_eventPrefix, $_isObjectNew, $_resource, $_resourceCollectionName, $_resourceName
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0