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

Package DE_EPAGES::Shop::API::Address

This module includes a function to update VATID

@EXPORT_OK
CheckVATID
UpdateVATID
IsTaxModelNet

Functions

CheckVATID
IsTaxModelNet
UpdateVATID

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

IsTaxModelNet

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

Syntax
my $IsNet = IsTaxModelNet( $Address ));
Input
$Address (object)
address object
Return
$IsNet (boolean)
true if country 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"