forked from ej2/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbase.py
More file actions
175 lines (126 loc) · 3.83 KB
/
base.py
File metadata and controls
175 lines (126 loc) · 3.83 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
from six import python_2_unicode_compatible
from ..mixins import ToJsonMixin, FromJsonMixin, ReadMixin, ListMixin, UpdateMixin, ToDictMixin
class QuickbooksBaseObject(ToJsonMixin, FromJsonMixin, ToDictMixin):
class_dict = {}
list_dict = {}
detail_dict = {}
class QuickbooksTransactionEntity(QuickbooksBaseObject):
def __init__(self):
self.Id = None
self.SyncToken = 0
self.sparse = False
self.domain = "QBO"
class QuickbooksManagedObject(QuickbooksBaseObject, ReadMixin, ListMixin, UpdateMixin):
pass
class QuickbooksReadOnlyObject(QuickbooksBaseObject, ReadMixin, ListMixin):
pass
@python_2_unicode_compatible
class MetaData(FromJsonMixin):
def __init__(self):
self.CreateTime = ""
self.LastUpdatedTime = ""
def __str__(self):
return "Created {0}".format(self.CreateTime)
class LinkedTxnMixin(object):
def to_linked_txn(self):
linked_txn = LinkedTxn()
linked_txn.TxnId = self.Id
linked_txn.TxnType = self.qbo_object_name
linked_txn.TxnLineId = 1
return linked_txn
@python_2_unicode_compatible
class Address(QuickbooksBaseObject):
def __init__(self):
self.Id = None
self.Line1 = ""
self.Line2 = ""
self.Line3 = ""
self.Line4 = ""
self.Line5 = ""
self.City = ""
self.CountrySubDivisionCode = ""
self.Country = ""
self.PostalCode = ""
self.Lat = ""
self.Long = ""
self.Note = ""
def __str__(self):
return "{0} {1}, {2} {3}".format(self.Line1, self.City, self.CountrySubDivisionCode, self.PostalCode)
@python_2_unicode_compatible
class PhoneNumber(ToJsonMixin, FromJsonMixin, ToDictMixin):
def __init__(self):
self.FreeFormNumber = ""
def __str__(self):
return self.FreeFormNumber
@python_2_unicode_compatible
class EmailAddress(QuickbooksBaseObject):
def __init__(self):
self.Address = ""
def __str__(self):
return self.Address
@python_2_unicode_compatible
class WebAddress(QuickbooksBaseObject):
def __init__(self):
self.URI = ""
def __str__(self):
return self.URI
@python_2_unicode_compatible
class Ref(QuickbooksBaseObject):
def __init__(self):
self.value = ""
self.name = ""
self.type = ""
def __str__(self):
return self.name
@python_2_unicode_compatible
class CustomField(QuickbooksBaseObject):
def __init__(self):
self.DefinitionId = ""
self.Type = ""
self.Name = ""
self.StringValue = ""
def __str__(self):
return self.Name
@python_2_unicode_compatible
class LinkedTxn(QuickbooksBaseObject):
qbo_object_name = "LinkedTxn"
def __init__(self):
super(LinkedTxn, self).__init__()
self.TxnId = 0
self.TxnType = 0
self.TxnLineId = 0
def __str__(self):
return str(self.TxnId)
@python_2_unicode_compatible
class CustomerMemo(QuickbooksBaseObject):
def __init__(self):
super(CustomerMemo, self).__init__()
self.value = ""
def __str__(self):
return self.value
class MarkupInfo(QuickbooksBaseObject):
class_dict = {
"PriceLevelRef": Ref,
}
def __init__(self):
super(MarkupInfo, self).__init__()
self.PercentBased = False
self.Value = 0
self.Percent = 0
self.PriceLevelRef = None
class AttachableRef(QuickbooksBaseObject):
class_dict = {
"EntityRef": Ref
}
list_dict = {
"CustomField": CustomField
}
qbo_object_name = "AttachableRef"
def __init__(self):
super(AttachableRef, self).__init__()
self.LineInfo = None
self.IncludeOnSend = False
self.Inactive = None
self.NoRefOnly = None
self.EntityRef = None
self.CustomField = []