vat.vrws package¶
Functions¶
-
vat.vrws.
get_rates
()¶ Obtain VAT rates for the specified country. Returns a
Rates
on success, or in case of error raises an exception.The two character EU VAT country code.
If set, only dates in force on the specified date will be returned (optional).
If True, the default, include reduced rates (optional).
If True, the default, include category rates (optional).
If True, the default, include regional rates (optional).
Note
You should probably use the
vat.RateCache
object rather than this function. Not only does this avoid hitting the EU web service more often than necessary, butvat.RateCache
keeps back-up information on reduced rates that were not (as of 1st September 2015) available through the web service.
-
vat.vrws.
get_changes
()¶ Retrieve any VAT rates that changed during the specified period. Returns a
Rates
on success, or in case of error raises an exception.Returns VAT rates that changed after this date.
Returns only VAT rates that changed before this date (optional).
A two character EU VAT country code (optional). If specified, restricts results to that country only.
Classes¶
-
class
vat.vrws.
VRWSException
¶ The base class of all exceptions raised by this module.
-
class
vat.vrws.
VRWSSOAPException
¶ Represents a SOAP fault encountered when trying to talk to VIES.
-
code
¶
The SOAP fault code.
-
string
¶
A description of the fault.
-
actor
¶
Used to indicate the source of the fault.
-
detail
¶
Provides additional information about the fault.
-
-
class
vat.vrws.
VRWSErrorException
¶ Represents an error raised by the VRWS system.
-
code
¶
A numeric code identifying the error.
-
reason
¶
A string describing the error.
-
-
class
vat.vrws.
Rates
¶ A collection of VAT rate information.
-
types
¶
A dictionary keyed on rate type. Each entry is a list of applicable
Rate
objects. The module includes constants for the following rate types:Note
In general there can be more than one rate per type. You may need to inspect the attributes of the
Rate
object to determine which rate is applicable.-
categories
¶
A dictionary keyed on rate category. Each entry is a list of applicable
Rate
objects. The module includes constants for the following categories:Constant Meaning BROADCASTING
Broadcasting TELECOMS
Telecommunication Services ESERVICES
E-Services Note
Again, there can be multiple rates in each category, and you may need to use
Rate.detail
to distinguish them.-
regions
¶
A dictionary keyed on region. Each entry is a
Rates
object.-
-
class
vat.vrws.
Rate
¶ Represents an individual VAT rate.
-
rate
¶
A
decimal.Decimal
holding the percentage rate.-
application_date
¶
The date from which this rate applies.
-
detail
¶
Any notes that apply to this rate. For instance, if this rate applies to a specific type of product, or has special requirements associated with it.
Note
There is no standard format for the
Rate.detail
attribute and it may be written in the language of the associated member state.-