forked from routablehq/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpurchaseorder.py
More file actions
124 lines (105 loc) · 3.29 KB
/
purchaseorder.py
File metadata and controls
124 lines (105 loc) · 3.29 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
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, Address, QuickbooksManagedObject, LinkedTxnMixin, \
QuickbooksTransactionEntity, CustomField, LinkedTxn, MarkupInfo
from .tax import TxnTaxDetail
class ItemBasedExpenseLineDetail(QuickbooksBaseObject):
class_dict = {
"CustomerRef": Ref,
"ClassRef": Ref,
"PriceLevelRef": Ref,
"TaxCodeRef": Ref,
"MarkupInfo": MarkupInfo
}
def __init__(self):
super(ItemBasedExpenseLineDetail, self).__init__()
self.UnitPrice = 0
self.Qty = 0
self.BillableStatus = ""
self.TaxInclusiveAmt = 0
self.PriceLevelRef = None
self.CustomerRef = None
self.ClassRef = None
self.TaxCodeRef = None
self.MarkupInfo = None
@python_2_unicode_compatible
class PurchaseOrderLine(QuickbooksBaseObject):
class_dict = {
"ItemBasedExpenseLineDetail": ItemBasedExpenseLineDetail,
"ItemRef": Ref,
"ClassRef": Ref,
"TaxCodeRef": Ref,
}
list_dict = {
"LinkedTxn": LinkedTxn,
"CustomField": CustomField
}
def __init__(self):
super(PurchaseOrderLine, self).__init__()
self.Id = 0
self.LineNum = 0
self.Description = ""
self.Amount = 0
self.DetailType = "ItemBasedExpenseLineDetail"
self.BillableStatus = ""
self.UnitPrice = 0
self.Qty = 0
self.ItemBasedExpenseLineDetail = None
self.AccountBasedExpenseLineDetail = None
self.ItemRef = None
self.ClassRef = None
self.TaxCodeRef = None
self.LinkedTxn = []
self.CustomField = []
def __str__(self):
return str(self.Amount)
@python_2_unicode_compatible
class PurchaseOrder(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: The PurchaseOrder entity is a non-posting transaction representing a request to purchase
goods or services from a third party.
"""
class_dict = {
"VendorAddr": Address,
"ShipAddr": Address,
"VendorRef": Ref,
"APAccountRef": Ref,
"AttachableRef": Ref,
"ClassRef": Ref,
"SalesTermRef": Ref,
"ShipMethodRef": Ref,
"TaxCodeRef": Ref,
"CurrencyRef": Ref,
"TxnTaxDetail": TxnTaxDetail
}
list_dict = {
"Line": PurchaseOrderLine,
"CustomField": CustomField,
"LinkedTxn": LinkedTxn,
}
qbo_object_name = "PurchaseOrder"
def __init__(self):
super(PurchaseOrder, self).__init__()
self.POStatus = ""
self.DocNumber = ""
self.TxnDate = ""
self.PrivateNote = ""
self.TotalAmt = 0
self.DueDate = ""
self.ExchangeRate = 1
self.GlobalTaxCalculation = "TaxExcluded"
self.TxnTaxDetail = None
self.VendorAddr = None
self.ShipAddr = None
self.VendorRef = None
self.APAccountRef = None
self.AttachableRef = None
self.ClassRef = None
self.SalesTermRef = None
self.TaxCodeRef = None
self.CurrencyRef = None
self.TxnTaxDetail = None
self.Line = []
self.CustomField = []
self.LinkedTxn = []
def __str__(self):
return str(self.TotalAmt)