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
75 lines (65 loc) · 2.19 KB
/
purchaseorder.py
File metadata and controls
75 lines (65 loc) · 2.19 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
from six import python_2_unicode_compatible
from quickbooks.objects.detailline import DetailLine, ItemBasedExpenseLine, AccountBasedExpenseLine, \
TDSLine
from .base import Ref, Address, QuickbooksManagedObject, LinkedTxnMixin, \
QuickbooksTransactionEntity, CustomField, LinkedTxn
from .tax import TxnTaxDetail
from ..mixins import DeleteMixin, SendMixin
@python_2_unicode_compatible
class PurchaseOrder(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin, SendMixin):
"""
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": DetailLine,
"CustomField": CustomField,
"LinkedTxn": LinkedTxn,
}
detail_dict = {
"ItemBasedExpenseLineDetail": ItemBasedExpenseLine,
"AccountBasedExpenseLineDetail": AccountBasedExpenseLine,
"TDSLineDetail": TDSLine,
}
qbo_object_name = "PurchaseOrder"
def __init__(self):
super(PurchaseOrder, self).__init__()
self.POStatus = None
self.DocNumber = None
self.TxnDate = None
self.PrivateNote = None
self.TotalAmt = 0
self.DueDate = None
self.ExchangeRate = 1
self.GlobalTaxCalculation = "TaxExcluded"
self.Memo = None
self.ShipMethodRef = None
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)