forked from routablehq/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeposit.py
More file actions
130 lines (102 loc) · 3.27 KB
/
deposit.py
File metadata and controls
130 lines (102 loc) · 3.27 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
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
QuickbooksTransactionEntity, CustomField
class AttachableRef(QuickbooksBaseObject):
class_dict = {
"EntityRef": Ref,
}
list_dict = {
"CustomField": CustomField
}
def __init__(self):
super(AttachableRef, self).__init__()
self.LineInfo = ""
self.IncludeOnSend = False
self.Inactive = False
self.NoRefOnly = False
self.EntityRef = None
self.CustomField = []
class CashBackInfo(QuickbooksBaseObject):
class_dict = {
"AccountRef": None
}
def __init__(self):
super(CashBackInfo, self).__init__()
self.Amount = 0
self.Memo = ""
self.AccountRef = None
class DepositLineDetail(QuickbooksBaseObject):
class_dict = {
"Entity": Ref,
"ClassRef": Ref,
"AccountRef": Ref,
"PaymentMethodRef": Ref,
}
def __init__(self):
super(DepositLineDetail, self).__init__()
self.CheckNum = ""
self.TxnType = ""
self.Entity = None
self.ClassRef = None
self.AccountRef = None
self.PaymentMethodRef = None
@python_2_unicode_compatible
class DepositLine(QuickbooksBaseObject):
class_dict = {
"DepositToAccountRef": Ref,
"DepositLineDetail": DepositLineDetail,
}
list_dict = {
"LinkedTxn": LinkedTxn,
"CustomField": CustomField,
}
qbo_object_name = "Deposit"
def __init__(self):
super(DepositLine, self).__init__()
self.Id = 0
self.LineNum = 0
self.Description = ""
self.Amount = 0
self.DetailType = "DepositLineDetail"
self.LinkedTxn = []
self.CustomField = []
def __str__(self):
return str(self.Amount)
@python_2_unicode_compatible
class Deposit(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: A deposit object is a transaction that records one or more deposits of the following types:
-A customer payment, originally held in the Undeposited Funds account, into the Asset Account specified by
the Deposit.DepositToAccountRef attribute. The Deposit.line.LinkedTxn sub-entity is used in this
case to hold deposit information.
-A new direct deposit specified by Deposit.Line.DepositLineDetail line detail.
"""
class_dict = {
"DepositToAccountRef": Ref,
"DepartmentRef": Ref,
"CurrencyRef": Ref,
"AttachableRef": AttachableRef,
"CashBack": CashBackInfo,
}
list_dict = {
"Line": DepositLine
}
qbo_object_name = "Deposit"
def __init__(self):
super(Deposit, self).__init__()
self.TotalAmt = 0
self.HomeTotalAmt = 0
self.TxnDate = ""
self.DocNumber = ""
self.ExchangeRate = 1
self.GlobalTaxCalculation = "TaxExcluded"
self.PrivateNote = ""
self.TxnStatus = ""
self.TxnSource = ""
self.DepositToAccountRef = None
self.DepartmentRef = None
self.CurrencyRef = None
self.AttachableRef = None
self.Line = []
def __str__(self):
return str(self.TotalAmt)