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
115 lines (91 loc) · 3 KB
/
deposit.py
File metadata and controls
115 lines (91 loc) · 3 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
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
QuickbooksTransactionEntity, CustomField, AttachableRef
from ..mixins import DeleteMixin
class CashBackInfo(QuickbooksBaseObject):
class_dict = {
"AccountRef": Ref
}
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 = None
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 = None
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(DeleteMixin, 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
}
detail_dict = {
"DepositLineDetail": 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 = None
self.DepositToAccountRef = None
self.DepartmentRef = None
self.CurrencyRef = None
self.AttachableRef = None
self.Line = []
def __str__(self):
return str(self.TotalAmt)