Skip to content

Commit 8621279

Browse files
committed
Updated term.
1 parent 06c1d86 commit 8621279

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

quickbooks/objects/term.py

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,30 @@
1-
from base import QuickbooksManagedObject
1+
from base import QuickbooksBaseObject, QuickbooksManagedObject, QuickbooksTransactionEntity, Ref, CustomField
22

33

4-
class Term(QuickbooksManagedObject):
4+
class AttachableRef(QuickbooksBaseObject):
5+
class_dict = {
6+
"EntityRef": Ref
7+
}
8+
9+
list_dict = {
10+
"CustomField": CustomField
11+
}
12+
13+
qbo_object_name = "AttachableRef"
14+
15+
def __init__(self):
16+
super(AttachableRef, self).__init__()
17+
18+
self.LineInfo = ""
19+
self.IncludeOnSend = False
20+
self.Inactive = False
21+
self.NoRefOnly = False
22+
23+
self.EntityRef = None
24+
self.CustomField = []
25+
26+
27+
class Term(QuickbooksManagedObject, QuickbooksTransactionEntity):
528
"""
629
QBO definition: The Term entity represents the terms under which a sale is made, typically expressed in the
730
form of days due after the goods are received. Optionally, a discount of the total amount may be applied if
@@ -19,8 +42,10 @@ def __init__(self):
1942
self.Name = ""
2043
self.Type = ""
2144
self.DiscountPercent = 0
45+
self.DueDays = 0
2246
self.DayOfMonthDue = 0
2347
self.DueNextMonthDays = 0
48+
self.DiscountDays = 0
2449
self.DiscountDayOfMonth = 0
2550
self.Active = True
2651

tests/unit/objects/test_term.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
import unittest
22

3-
from quickbooks.objects.term import Term
3+
from quickbooks.objects.term import Term, AttachableRef
44

55

66
class TermTests(unittest.TestCase):
77
def test_unicode(self):
8-
deposit = Term()
9-
deposit.Name = "test"
8+
term = Term()
9+
term.Name = "test"
1010

11-
self.assertEquals(unicode(deposit), "test")
11+
self.assertEquals(unicode(term), "test")
12+
13+
14+
class AttachableRefTests(unittest.TestCase):
15+
def test_init(self):
16+
attachable = AttachableRef()
17+
attachable.Name = "test"
18+
19+
self.assertEquals(attachable.LineInfo, "")
20+
self.assertEquals(attachable.IncludeOnSend, False)
21+
self.assertEquals(attachable.Inactive, False)
22+
self.assertEquals(attachable.NoRefOnly, False)
23+
self.assertEquals(attachable.EntityRef, None)

0 commit comments

Comments
 (0)