ePages 6.15.1 - DE_EPAGES/Shop/API/Address.pm

Package DE_EPAGES::Shop::API::Address

This module includes a function to update VATID

@EXPORT_OK
CheckStringVATID
CheckVATID
UpdateVATID
IsTaxModelNet
GetTaxCountryIDForShop

Functions

CheckStringVATID
CheckVATID
GetTaxCountryIDForShop
IsTaxModelNet
UpdateVATID

CheckStringVATID

returns 1 if vatid contains not only " " and "-" returns 0 if vatid contain only " " and "-"

Syntax
$check = CheckStringVATID( $VATID );
Example
$check = CheckStringVATID( '118541153' );
Input
$VATID (string)
VATID
Return
$check (int)
valid

CheckVATID

returns 1 if country is not eu country returns 1 if VATID is valid returns -1 if CountryID and country VATID not same returns 0 if VATID is not valid

Syntax
$check = CheckVATID( $VATID, $CountryID );
Input
$VATID (string)
VATID
$CountryID (int)
country id
$Shop (object)
shop object
Return
$check (int)
valid

GetTaxCountryIDForShop

Returns the CountryID for the given shop.

Syntax
my $CountryID = GetTaxCountryIDForShop( $Shop ));
Input
$Shop (object)
shop object
Return
$CountryID (int)
true country for shop

IsTaxModelNet

Checks the address on the basis of shop, countryid and vatid to be net.

Syntax
my $IsNet = IsTaxModelNet( $Shop, $Address );
Input
$Shop (object)
shop object
$Address (object)
address object
Return
$IsNet (boolean)
true if country is non-eu-country
or is eu-country and vatid is defined

UpdateVATID

Adds the country code to the VATID if $CountryID is defined and the country is a member of the European Union.

Syntax
$VATID = UpdateVATID( $VATID, $CountryID, $Shop );
Example
$VATID = UpdateVATID( '118541153', 276, $Shop );
Input
$VATID (string)
VATID
$CountryID (int)
country id
$Shop (object)
shop object
Return
$VATID (string)
VAT ID including country code, e.g. "DE118541153"