forked from ej2/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtaxcode.py
More file actions
71 lines (53 loc) · 2.04 KB
/
taxcode.py
File metadata and controls
71 lines (53 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
from six import python_2_unicode_compatible
from quickbooks.mixins import ListMixin, ReadMixin
from .base import QuickbooksTransactionEntity, Ref, QuickbooksBaseObject
class TaxRateDetail(QuickbooksBaseObject):
class_dict = {
"TaxRateRef": Ref
}
qbo_object_name = "TaxRateDetail"
def __init__(self):
super(TaxRateDetail, self).__init__()
self.TaxTypeApplicable = ""
self.TaxOrder = 0
self.TaxRateRef = None
class TaxRateList(QuickbooksBaseObject):
list_dict = {
"TaxRateDetail": TaxRateDetail
}
qbo_object_name = "TaxRateList"
def __init__(self):
super(TaxRateList, self).__init__()
self.TaxRateDetail = []
@python_2_unicode_compatible
class TaxCode(QuickbooksTransactionEntity, QuickbooksBaseObject, ReadMixin, ListMixin):
"""
QBO definition: A TaxCode object is used to track the taxable or non-taxable status of products,
services, and customers. You can assign a sales tax code to each of your products, services,
and customers based on their taxable or non-taxable status. You can then use these codes to generate
reports that provide information to the tax agencies about the taxable or non-taxable status of
certain sales. See Global tax model for more information about using TaxCode objects and the tax model in general.
"""
class_dict = {
"SalesTaxRateList": TaxRateList,
"PurchaseTaxRateList": TaxRateList,
}
qbo_object_name = "TaxCode"
def __init__(self):
super(TaxCode, self).__init__()
# All values are readonly - TaxCodes are created with the taxservice api
self.Name = None
self.Description = None
self.Taxable = None
self.TaxGroup = None
self.Active = True
self.SalesTaxRateList = None
self.PurchaseTaxRateList = None
def __str__(self):
return self.Name
def to_ref(self):
ref = Ref()
ref.type = self.qbo_object_name
ref.value = self.Id
ref.name = self.Name
return ref