ePages 7.48.0 - DE_EPAGES/Tax/API/Object/TaxMatrixDigital.pm

Package DE_EPAGES::Tax::API::Object::TaxMatrixDigital

object interface for TaxMatrixDigital.

Base
DE_EPAGES::Shop::API::Object::ShopObject

Functions

className
clone
dbPackage
defaultTaxAreaDigital
defaultTaxClassDigital
gross2net
net2gross
taxAreaDigitalByCountry
taxRateDigital

className

Returns the class name, used for DAL access.

Syntax
$ClassName = $TaxMatrixDigital->className;
Return
$ClassName (String)
class name

clone

Inserts a new object into the database as copy from old object. This function copies also tax rates of the matrix, which are no objects.

Syntax
$Clone = $Object->clone( $hInfo );
$Clone = $Object->clone( $hInfo, $Recursive );
Input
$hInfo (hash ref)
hash with mandatory attribute values.
  • ClassID - class id - int
  • Alias - alias - varchar(255)
  • ParentID - parent objectid - int
  • Inherit - (optional) inherit permissions from parent object - boolean
$Recursive (boolean)
clone child object too (optional, default is false)
Return
$Clone (object)
the new object

dbPackage

Returns the database package, used for DAL access.

Syntax
$DbPackage = $TaxMatrixDigital->dbPackage;
Return
$DbPackage (String)
database package name

defaultTaxAreaDigital

Gets the default tax area digital of the matrix digital

Syntax
$TaxAreaDigital = $TaxMatrix->defaultTaxAreaDigital;
Return
$Area (object)
tax area

defaultTaxClassDigital

Gets the default tax class digital of the matrix digital

Syntax
$TaxClassDigital = $TaxMatrix->defaultTaxClassDigital;
Return
$TaxClass (object)
tax class

gross2net

Calculates the net price from the gross price if required by the given tax model. Uses the tax rate for the given tax class from the default tax area if no area is given. Adds one extra digit of precision for example: 16.798 EUR (unless Precision is passed as parameter).

Syntax
$NetPrice = $TaxMatrix->gross2net($CurrencyID, $GrossPrice, $hTaxParams);
Example
$NetPrice = $TaxMatrix->gross2net('EUR', 19.99, {
     'TaxModel' => $TaxModel,
     'TaxArea'  => $TaxAreaDigital,
     'TaxClass' => $TaxMatrix->defaultTaxClassDigital
});
Input
$hTaxParams (hash ref)
hash with tax parameters.
  • TaxModel - tax model - object
  • TaxAreaDigital - (optional) tax area - object
  • TaxClassDigital - tax class - object
  • Precision - (optional) number of digits after comma - integer
$CurrencyID (object)
currency id
$GrossPrice (float)
gross price
Return
$NetPrice (float)
net price

net2gross

Calculates the gross price from the net price if required by the given tax model. Uses the tax rate for the given tax class from the default tax area if no tax area is given. Rounds the result to the standard precision of the currency, for example: 19.99 EUR.

Syntax
$GrossPrice = $TaxMatrixDigital->net2gross($CurrencyID, $NetPrice,$hTaxParams,$ExtraPrecision);
Example
$GrossPrice = $TaxMatrixDigital->net2gross('EUR', 16.798,
     'TaxModel' => $TaxModel,
     'TaxArea'  => $TaxAreaDigital,
     'TaxClass' => $TaxMatrix->defaultTaxClassDigital
});
Input
$hTaxParams (hash ref)
hash with tax parameters.
  • TaxModel - tax model - object
  • TaxArea - (optional) tax area - object
  • TaxClass - tax class - object
  • Precision - (optional) number of digits after comma - integer
$CurrencyID (object)
currency id
$NetPrice (float)
net price
$ExtraPrecision (int)
extra precision
Return
$GrossPrice (float)
gross price

taxAreaDigitalByCountry

Returns the TaxAreaDigital by country id .

Syntax
$TaxArea = $TaxMatrixDigital->taxAreaDigitalByCountry($CountryID);
Input
$CountryID (int)
country id
Return
$TaxAreaDigital (object)
tax area digital

taxRateDigital

Tax rate digital of matrix digital defined by tax area digital and class.

Syntax
$TaxRateDigital = $TaxMatrixDigital->taxRateDigital($Area, $Class);
Input
$AreaDigital (object)
tax area digital
$ClassDigital (object)
tax class digital
Return
$TaxRateDigital (float)
percentage of tax (eg 0.16 for 16 %)