Skip to content

Commit 34bd696

Browse files
committed
Updated BillPayment.
1 parent 975b4d8 commit 34bd696

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

quickbooks/objects/billpayment.py

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
from base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin
1+
from base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
2+
QuickbooksTransactionEntity
23

34

45
class CheckPayment(QuickbooksBaseObject):
@@ -17,6 +18,18 @@ def __unicode__(self):
1718
return self.PrintStatus
1819

1920

21+
class BillPaymentCreditCard(QuickbooksBaseObject):
22+
class_dict = {
23+
"CCAccountRef": Ref
24+
}
25+
26+
qbo_object_name = "BillPaymentCreditCard"
27+
28+
def __init__(self):
29+
super(BillPaymentCreditCard, self).__init__()
30+
self.CCAccountRef = None
31+
32+
2033
class BillPaymentLine(QuickbooksBaseObject):
2134
list_dict = {
2235
"LinkedTxn": LinkedTxn
@@ -33,7 +46,7 @@ def __unicode__(self):
3346
return str(self.Amount)
3447

3548

36-
class BillPayment(QuickbooksManagedObject, LinkedTxnMixin):
49+
class BillPayment(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
3750
"""
3851
QBO definition: A BillPayment entity represents the financial transaction of payment of bills that the
3952
business owner receives from a vendor for goods or services purchased from the vendor. QuickBooks Online
@@ -47,7 +60,10 @@ class BillPayment(QuickbooksManagedObject, LinkedTxnMixin):
4760
class_dict = {
4861
"VendorRef": Ref,
4962
"CheckPayment": CheckPayment,
63+
"CreditCardPayment": BillPaymentCreditCard,
5064
"APAccountRef": Ref,
65+
"DepartmentRef": Ref,
66+
5167
}
5268

5369
list_dict = {
@@ -62,12 +78,16 @@ def __init__(self):
6278
self.TotalAmt = 0
6379
self.TxnDate = ""
6480
self.PrivateNote = ""
81+
self.DocNumber = ""
82+
self.ProcessBillPayment = False
6583

6684
self.VendorRef = None
6785
self.CheckPayment = None
6886
self.APAccountRef = None
87+
self.DepartmentRef = None
88+
self.CreditCardPayment = None
6989

7090
self.Line = []
7191

7292
def __unicode__(self):
73-
return str(self.TotalAmt)
93+
return str(self.TotalAmt)

tests/unit/objects/test_billpayment.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22

3-
from quickbooks.objects.billpayment import BillPayment, BillPaymentLine, CheckPayment
3+
from quickbooks.objects.billpayment import BillPayment, BillPaymentLine, CheckPayment, BillPaymentCreditCard
44

55

66
class CheckPaymentTests(unittest.TestCase):
@@ -25,3 +25,10 @@ def test_unicode(self):
2525
bill_payment.TotalAmt = 1000
2626

2727
self.assertEquals(unicode(bill_payment), "1000")
28+
29+
30+
class BillPaymentCreditCardTests(unittest.TestCase):
31+
def test_init(self):
32+
bill_payment_cc = BillPaymentCreditCard()
33+
34+
self.assertEquals(bill_payment_cc.CCAccountRef, None)

0 commit comments

Comments
 (0)