forked from routablehq/python-quickbooks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjournalentry.py
More file actions
97 lines (77 loc) · 2.65 KB
/
journalentry.py
File metadata and controls
97 lines (77 loc) · 2.65 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
from six import python_2_unicode_compatible
from .base import QuickbooksBaseObject, Ref, QuickbooksManagedObject, QuickbooksTransactionEntity, \
LinkedTxnMixin
from .tax import TxnTaxDetail
from .detailline import DetailLine, DescriptionOnlyLine
from ..mixins import DeleteMixin
class Entity(QuickbooksBaseObject):
class_dict = {
"EntityRef": Ref
}
def __init__(self):
super(Entity, self).__init__()
self.Type = ""
self.EntityRef = None
class JournalEntryLineDetail(QuickbooksBaseObject):
class_dict = {
"Entity": Entity,
"AccountRef": Ref,
"ClassRef": Ref,
"DepartmentRef": Ref,
"TaxCodeRef": Ref,
}
def __init__(self):
super(JournalEntryLineDetail, self).__init__()
self.PostingType = ""
self.TaxApplicableOn = "Sales"
self.TaxAmount = 0
self.BillableStatus = None
self.Entity = None
self.AccountRef = None
self.ClassRef = None
self.DepartmentRef = None
self.TaxCodeRef = None
class JournalEntryLine(DetailLine):
class_dict = {
"JournalEntryLineDetail": JournalEntryLineDetail
}
def __init__(self):
super(JournalEntryLine, self).__init__()
self.DetailType = "JournalEntryLineDetail"
self.JournalEntryLineDetail = None
@python_2_unicode_compatible
class JournalEntry(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
"""
QBO definition: Journal Entry is a transaction in which:
- There are at least two parts - a Debit and a Credit - called distribution lines.
- Each distribution line has an account from the Chart of Accounts.
- The total of the Debit column equals the total of the Credit column.
When you record a transaction with Journal Entry, the QBO UI labels the transaction as JRNL in a
register and General Journal on reports that list transactions.
"""
class_dict = {
"TxnTaxDetail": TxnTaxDetail,
"CurrencyRef": Ref,
}
list_dict = {
"Line": DetailLine
}
detail_dict = {
"DescriptionOnly": DescriptionOnlyLine,
"JournalEntryLineDetail": JournalEntryLine
}
qbo_object_name = "JournalEntry"
def __init__(self):
super(JournalEntry, self).__init__()
self.Adjustment = False
self.TxnDate = ""
#self.TxnSource = ""
self.DocNumber = ""
self.PrivateNote = ""
self.TotalAmt = 0
self.ExchangeRate = 1
self.Line = []
self.TxnTaxDetail = None
self.CurrencyRef = None
def __str__(self):
return str(self.TotalAmt)