Skip to content

Commit 9c0a020

Browse files
committed
Removed duplicate objects.
1 parent b2fca0a commit 9c0a020

File tree

14 files changed

+42
-117
lines changed

14 files changed

+42
-117
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
========
33

4+
* 0.5.5 (January 4th, 2017)
5+
* Imported QuickBooks objects into __init__.py for easier imports
6+
* Removed duplicate class AttachableRef from deposit.py
7+
* Removed duplicate class DescriptionLineDetail from journalentry.py
8+
* Removed duplicate class DescriptionOnlyLine from journalentry.py
9+
410
* 0.5.4 (November 29th, 2016)
511
* Added quickbooks client parameter to QuickbooksPdfDownloadable mixin.
612

quickbooks/objects/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717
from .customer import Customer
1818
from .department import Department
1919
from .deposit import (
20-
AttachableRef, CashBackInfo, DepositLineDetail, DepositLine, Deposit
20+
CashBackInfo, DepositLineDetail, DepositLine, Deposit
2121
)
2222
from .detailline import (
2323
DetailLine, DiscountOverride, DiscountLineDetail, DiscountLine,
2424
SubtotalLineDetail, SubtotalLine, DescriptionLineDetail, DescriptionLine,
2525
SalesItemLineDetail, SalesItemLine, GroupLineDetail, GroupLine,
26-
DescriptionLineDetail, DescriptionOnlyLine,
27-
AccountBasedExpenseLineDetail, AccountBasedExpenseLine,
26+
DescriptionOnlyLine, AccountBasedExpenseLineDetail, AccountBasedExpenseLine,
2827
ItemBasedExpenseLineDetail, ItemBasedExpenseLine,
2928

3029
)
@@ -33,8 +32,7 @@
3332
from .invoice import DeliveryInfo, Invoice
3433
from .item import Item
3534
from .journalentry import (
36-
Entity, JournalEntryLineDetail, JournalEntryLine, DescriptionLineDetail,
37-
DescriptionOnlyLine, JournalEntry
35+
Entity, JournalEntryLineDetail, JournalEntryLine, JournalEntry
3836
)
3937
from .payment import PaymentLine, Payment
4038
from .paymentmethod import PaymentMethod

quickbooks/objects/deposit.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,6 @@
11
from six import python_2_unicode_compatible
22
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, LinkedTxnMixin, \
3-
QuickbooksTransactionEntity, CustomField
4-
5-
6-
class AttachableRef(QuickbooksBaseObject):
7-
class_dict = {
8-
"EntityRef": Ref,
9-
}
10-
11-
list_dict = {
12-
"CustomField": CustomField
13-
}
14-
15-
def __init__(self):
16-
super(AttachableRef, self).__init__()
17-
self.LineInfo = ""
18-
self.IncludeOnSend = False
19-
self.Inactive = False
20-
self.NoRefOnly = False
21-
self.EntityRef = None
22-
23-
self.CustomField = []
3+
QuickbooksTransactionEntity, CustomField, AttachableRef
244

255

266
class CashBackInfo(QuickbooksBaseObject):

quickbooks/objects/detailline.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -161,17 +161,6 @@ def __init__(self):
161161
self.SalesItemLineDetail = None
162162

163163

164-
class DescriptionLineDetail(QuickbooksBaseObject):
165-
class_dict = {
166-
"TaxCodeRef": Ref,
167-
}
168-
169-
def __init__(self):
170-
super(DescriptionLineDetail, self).__init__()
171-
self.ServiceDate = ""
172-
self.TaxCodeRef = None
173-
174-
175164
class DescriptionOnlyLine(DetailLine):
176165
class_dict = {
177166
"DescriptionLineDetail": DescriptionLineDetail

quickbooks/objects/journalentry.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from .base import QuickbooksBaseObject, Ref, QuickbooksManagedObject, QuickbooksTransactionEntity, \
33
LinkedTxnMixin
44
from .tax import TxnTaxDetail
5-
from .detailline import DetailLine
5+
from .detailline import DetailLine, DescriptionOnlyLine
66

77

88
class Entity(QuickbooksBaseObject):
@@ -50,26 +50,6 @@ def __init__(self):
5050
self.JournalEntryLineDetail = None
5151

5252

53-
class DescriptionLineDetail(QuickbooksBaseObject):
54-
class_dict = {
55-
"TaxCodeRef": Ref
56-
}
57-
58-
def __init__(self):
59-
super(DescriptionLineDetail, self).__init__()
60-
self.ServiceDate = ""
61-
62-
63-
class DescriptionOnlyLine(DetailLine):
64-
class_dict = {
65-
"DescriptionLineDetail": DescriptionLineDetail
66-
}
67-
68-
def __init__(self):
69-
super(DescriptionOnlyLine, self).__init__()
70-
self.DetailType = "DescriptionOnly"
71-
72-
7353
@python_2_unicode_compatible
7454
class JournalEntry(QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
7555
"""

quickbooks/objects/payment.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from six import python_2_unicode_compatible
2-
from .base import QuickbooksBaseObject, Ref, LinkedTxn, QuickbooksManagedObject, QuickbooksTransactionEntity
2+
from .base import QuickbooksBaseObject, Ref, LinkedTxn, \
3+
QuickbooksManagedObject, QuickbooksTransactionEntity
34
from .creditcardpayment import CreditCardPayment
45

56

@@ -21,18 +22,19 @@ def __str__(self):
2122
@python_2_unicode_compatible
2223
class Payment(QuickbooksManagedObject, QuickbooksTransactionEntity):
2324
"""
24-
QBO definition: A Payment entity records a payment in QuickBooks. The payment can be applied for a particular
25-
customer against multiple Invoices and Credit Memos. It can also be created without any Invoice or Credit Memo,
26-
by just specifying an amount.
25+
QBO definition: A Payment entity records a payment in QuickBooks. The payment can be
26+
applied for a particular customer against multiple Invoices and Credit Memos. It can also
27+
be created without any Invoice or Credit Memo, by just specifying an amount.
2728
2829
- A Payment can be updated as a full update or a sparse update.
2930
- A Payment can be linked to multiple Invoices and Credit Memos
30-
- A Payment can be created as unapplied to any Invoice or Credit Memo, in which case it is recorded as a credit.
31-
- If any element in any line needs to be updated, all the Lines of a Payment have to be provided. This is true
32-
for full or sparse update. Lines can be updated only ALL or NONE.
31+
- A Payment can be created as unapplied to any Invoice or Credit Memo, in which case
32+
it is recorded as a credit.
33+
- If any element in any line needs to be updated, all the Lines of a Payment have to be
34+
provided. This is true for full or sparse update. Lines can be updated only ALL or NONE.
3335
- To remove all lines, send an empty Lines tag.
34-
- To remove some of the lines, send all the Lines that need to be present MINUS the lines that need to
35-
be removed.
36+
- To remove some of the lines, send all the Lines that need to be present MINUS the
37+
lines that need to be removed.
3638
- To add some lines, send all existing and new Lines that need to be present.
3739
- The sequence in which the Lines are received is the sequence in which lines are preserved.
3840
"""

setup.cfg

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
[metadata]
2-
description-file = README.md
2+
description-file = README.md
3+
4+
[flake8]
5+
max-line-length = 100
6+
max-complexity = 10
7+
filename = *.py
8+
format = default
9+
exclude =/objects/__init__.py

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def read(*parts):
1010
return fp.read()
1111

1212

13-
VERSION = (0, 5, 4)
13+
VERSION = (0, 5, 5)
1414
version = '.'.join(map(str, VERSION))
1515

1616
setup(

tests/integration/test_estimate.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import unittest
33
from datetime import datetime
44

5-
from quickbooks.objects.detailline import DetailLine, SalesItemLineDetail, DiscountLineDetail, SalesItemLine
5+
from quickbooks.objects.detailline import DetailLine, SalesItemLineDetail, \
6+
DiscountLineDetail, SalesItemLine
67

78
from quickbooks.objects.tax import TxnTaxDetail
89

@@ -110,20 +111,14 @@ def test_create(self):
110111
self.assertEqual(query_estimate.ApplyTaxAfterDiscount, estimate.ApplyTaxAfterDiscount)
111112
self.assertEqual(query_estimate.PrintStatus, estimate.PrintStatus)
112113
self.assertEqual(query_estimate.EmailStatus, estimate.EmailStatus)
113-
# self.assertEqual(query_estimate.BillAddr.Id, estimate.BillAddr.Id)
114114
self.assertEqual(query_estimate.BillAddr.Line1, estimate.BillAddr.Line1)
115115
self.assertEqual(query_estimate.BillAddr.City, estimate.BillAddr.City)
116116
self.assertEqual(query_estimate.BillAddr.CountrySubDivisionCode, estimate.BillAddr.CountrySubDivisionCode)
117117
self.assertEqual(query_estimate.BillAddr.PostalCode, estimate.BillAddr.PostalCode)
118-
# self.assertEqual(query_estimate.BillAddr.Lat, estimate.BillAddr.Lat)
119-
# self.assertEqual(query_estimate.BillAddr.Long, estimate.BillAddr.Long)
120-
# self.assertEqual(query_estimate.ShipAddr.Id, estimate.ShipAddr.Id)
121118
self.assertEqual(query_estimate.ShipAddr.Line1, estimate.ShipAddr.Line1)
122119
self.assertEqual(query_estimate.ShipAddr.City, estimate.ShipAddr.City)
123120
self.assertEqual(query_estimate.ShipAddr.CountrySubDivisionCode, estimate.ShipAddr.CountrySubDivisionCode)
124121
self.assertEqual(query_estimate.ShipAddr.PostalCode, estimate.ShipAddr.PostalCode)
125-
# self.assertEqual(query_estimate.ShipAddr.Lat, estimate.ShipAddr.Lat)
126-
# self.assertEqual(query_estimate.ShipAddr.Long, estimate.ShipAddr.Long)
127122
self.assertEqual(query_estimate.BillEmail.Address, estimate.BillEmail.Address)
128123
self.assertEqual(query_estimate.CustomerMemo.value, estimate.CustomerMemo.value)
129124
self.assertEqual(query_estimate.CustomerRef.value, estimate.CustomerRef.value)
@@ -132,6 +127,3 @@ def test_create(self):
132127
self.assertEqual(query_estimate.Line[0].LineNum, estimate.Line[0].LineNum)
133128
self.assertEqual(query_estimate.Line[0].Description, estimate.Line[0].Description)
134129
self.assertEqual(query_estimate.Line[0].Amount, estimate.Line[0].Amount)
135-
# self.assertEqual(query_estimate.Line[0].SalesItemLineDetail.UnitPrice,
136-
# estimate.Line[0].SalesItemLineDetail.UnitPrice)
137-
# self.assertEqual(query_estimate.Line[0].SalesItemLineDetail.Qty, estimate.Line[0].SalesItemLineDetail.Qty)

tests/unit/objects/test_attachable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def test_valid_object_name(self):
2727
client = QuickBooks()
2828
result = client.isvalid_object_name(attachable.qbo_object_name)
2929

30-
self.assertTrue(result)
30+
self.assertTrue(result)

0 commit comments

Comments
 (0)