forked from routablehq/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvendor.py
More file actions
77 lines (63 loc) · 1.97 KB
/
vendor.py
File metadata and controls
77 lines (63 loc) · 1.97 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
from six import python_2_unicode_compatible
from .base import Address, PhoneNumber, EmailAddress, WebAddress, Ref, QuickbooksBaseObject, \
QuickbooksManagedObject, QuickbooksTransactionEntity
class ContactInfo(QuickbooksBaseObject):
class_dict = {
"Telephone": PhoneNumber
}
def __init__(self):
super(ContactInfo, self).__init__()
self.Type = ""
self.Telephone = None
@python_2_unicode_compatible
class Vendor(QuickbooksManagedObject, QuickbooksTransactionEntity):
"""
QBO definition: The Vendor represents the seller from whom your company purchases any service or product.
"""
class_dict = {
"BillAddr": Address,
"TermRef": Ref,
"PrimaryPhone": PhoneNumber,
"AlternatePhone": PhoneNumber,
"Mobile": PhoneNumber,
"Fax": PhoneNumber,
"PrimaryEmailAddr": EmailAddress,
"WebAddr": WebAddress,
"CurrencyRef": Ref,
"APAccountRef": Ref
}
qbo_object_name = "Vendor"
def __init__(self):
super(Vendor, self).__init__()
self.Title = ""
self.GivenName = ""
self.MiddleName = ""
self.FamilyName = ""
self.Suffix = ""
self.CompanyName = ""
self.DisplayName = ""
self.PrintOnCheckName = ""
self.Active = True
self.TaxIdentifier = ""
self.Balance = 0
self.AcctNum = ""
self.Vendor1099 = True
self.TaxReportingBasis = ""
self.BillAddr = None
self.PrimaryPhone = None
self.AlternatePhone = None
self.Mobile = None
self.Fax = None
self.PrimaryEmailAddr = None
self.WebAddr = None
self.TermRef = None
self.CurrencyRef = None
self.APAccountRef = None
def __str__(self):
return self.DisplayName
def to_ref(self):
ref = Ref()
ref.name = self.DisplayName
ref.type = self.qbo_object_name
ref.value = self.Id
return ref