Skip to content

Commit 2384a90

Browse files
authored
Merge pull request ej2#196 from ej2/companycurrency
Updates and bug fixes
2 parents e875cef + 49fab19 commit 2384a90

File tree

17 files changed

+24212
-11
lines changed

17 files changed

+24212
-11
lines changed

CHANGELOG.rst

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

4+
* 0.8.3 (August 24, 2020)
5+
* Fixed issue with CompanyCurrency object
6+
* Added to_ref method to the Term object
7+
* Fixed issues with RefundReceipt
8+
* Added RefundReceiptCheckPayment object to RefundReceipt object
9+
* Added from_json to MetaData
10+
411
* 0.8.2 (April 22nd, 2020)
512
* Added PrimaryTaxIdentifier to Customer object
613
* Fixed issue with PaymentMethod to_ref

Pipfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[[source]]
2+
name = "pypi"
3+
url = "https://pypi.org/simple"
4+
verify_ssl = true
5+
6+
[dev-packages]
7+
8+
[packages]
9+
intuit-oauth = "==1.2.3"
10+
rauth = ">=0.7.1"
11+
requests = ">=2.19.1"
12+
simplejson = ">=3.17.0"
13+
six = ">=1.14.0"
14+
nose = "*"
15+
authclient = "*"
16+
coverage = "*"
17+
18+
[requires]
19+
python_version = "3.8"

Pipfile.lock

Lines changed: 342 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

get-pip.py

Lines changed: 23682 additions & 0 deletions
Large diffs are not rendered by default.

quickbooks/mixins.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from future.moves.urllib.parse import quote
22

3-
import simplejson as json
3+
try: import simplejson as json
4+
except ImportError: import json
5+
46
import six
57
from .utils import build_where_clause, build_choose_clause
68
from .client import QuickBooks

quickbooks/objects/attachable.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def save(self, qb=None):
5555
if not qb:
5656
qb = QuickBooks()
5757

58-
if self.Id and self.Id > 0:
58+
if self.Id and int(self.Id) > 0:
5959
json_data = qb.update_object(self.qbo_object_name, self.to_json(), _file_path=self._FilePath)
6060
else:
6161
json_data = qb.create_object(self.qbo_object_name, self.to_json(), _file_path=self._FilePath)

quickbooks/objects/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class QuickbooksReadOnlyObject(QuickbooksBaseObject, ReadMixin, ListMixin):
2525

2626

2727
@python_2_unicode_compatible
28-
class MetaData:
28+
class MetaData(FromJsonMixin):
2929
def __init__(self):
3030
self.CreateTime = ""
3131
self.LastUpdatedTime = ""

quickbooks/objects/refundreceipt.py

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
11
from six import python_2_unicode_compatible
2+
3+
from quickbooks.objects import CreditCardPayment
24
from .base import Ref, CustomField, QuickbooksManagedObject, \
3-
LinkedTxnMixin, QuickbooksTransactionEntity, LinkedTxn, Address, EmailAddress
5+
LinkedTxnMixin, QuickbooksTransactionEntity, LinkedTxn, Address, EmailAddress, QuickbooksBaseObject, CustomerMemo
46
from .tax import TxnTaxDetail
57
from .detailline import DetailLine
68
from ..mixins import DeleteMixin
79

810

11+
@python_2_unicode_compatible
12+
class RefundReceiptCheckPayment(QuickbooksBaseObject):
13+
qbo_object_name = "CheckPayment"
14+
15+
def __init__(self):
16+
super(RefundReceiptCheckPayment, self).__init__()
17+
self.CheckNum = ""
18+
self.Status = ""
19+
self.NameOnAcct = ""
20+
self.AcctNum = ""
21+
self.BankName = ""
22+
23+
def __str__(self):
24+
return self.CheckNum
25+
26+
927
@python_2_unicode_compatible
1028
class RefundReceipt(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionEntity, LinkedTxnMixin):
1129
"""
@@ -22,6 +40,9 @@ class RefundReceipt(DeleteMixin, QuickbooksManagedObject, QuickbooksTransactionE
2240
"ClassRef": Ref,
2341
"BillEmail": EmailAddress,
2442
"PaymentMethodRef": Ref,
43+
"CheckPayment": RefundReceiptCheckPayment,
44+
"CreditCardPayment": CreditCardPayment,
45+
"CustomerMemo": CustomerMemo,
2546
}
2647

2748
list_dict = {
@@ -41,17 +62,16 @@ def __init__(self):
4162
self.DocNumber = ""
4263
self.TotalAmt = 0
4364
self.ApplyTaxAfterDiscount = False
44-
self.PrintStatus = ""
65+
self.PrintStatus = "NotSet"
4566
self.Balance = 0
4667
self.PaymentRefNum = ""
4768
self.TxnDate = ""
4869
self.ExchangeRate = 1
4970
self.PrivateNote = ""
50-
self.CustomerMemo = ""
71+
5172
self.PaymentRefNum = ""
5273
self.PaymentType = ""
53-
self.CheckPayment = ""
54-
self.CreditCardPayment = ""
74+
5575
self.TxnSource = None
5676
self.GlobalTaxCalculation = "TaxExcluded"
5777

@@ -65,6 +85,9 @@ def __init__(self):
6585
self.ClassRef = None
6686
self.BillEmail = None
6787
self.PaymentMethodRef = None
88+
self.CheckPayment = None
89+
self.CreditCardPayment = None
90+
self.CustomerMemo = None
6891

6992
self.CustomField = []
7093
self.Line = []

quickbooks/objects/term.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from six import python_2_unicode_compatible
2-
from .base import QuickbooksManagedObject, QuickbooksTransactionEntity
2+
from .base import QuickbooksManagedObject, QuickbooksTransactionEntity, Ref
33

44

55
@python_2_unicode_compatible
@@ -29,3 +29,13 @@ def __init__(self):
2929

3030
def __str__(self):
3131
return self.Name
32+
33+
def to_ref(self):
34+
ref = Ref()
35+
36+
ref.name = self.Name
37+
ref.type = self.qbo_object_name
38+
ref.value = self.Id
39+
40+
return ref
41+

tests/integration/test_attachable.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def test_create_file(self):
5454
attachable.ContentType = 'text/plain'
5555

5656
attachable.save(qb=self.qb_client)
57+
5758
query_attachable = Attachable.get(attachable.Id, qb=self.qb_client)
5859

5960
self.assertEquals(query_attachable.AttachableRef[0].EntityRef.value, vendor.Id)

0 commit comments

Comments
 (0)