diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8654075..4818f49 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,5 +1,9 @@ Changelog ========= +* 0.9.7 (May 20, 2024) + * Added ItemAccountRef to SalesItemLineDetail + * Updated from_json example in readme + * 0.9.7 (March 12, 2024) * Update intuit-oauth dependency * Updated CompanyCurrency to ref to use Code instead of Id diff --git a/README.md b/README.md index b0ae95b..45a2293 100644 --- a/README.md +++ b/README.md @@ -277,10 +277,10 @@ Converting an object to JSON data: Loading JSON data into a quickbooks object: - account = Account() - account.from_json( + account = Account.from_json( { "AccountType": "Accounts Receivable", + "AcctNum": "123123", "Name": "MyJobs" } ) diff --git a/quickbooks/objects/detailline.py b/quickbooks/objects/detailline.py index f27449f..cf4ef57 100644 --- a/quickbooks/objects/detailline.py +++ b/quickbooks/objects/detailline.py @@ -102,6 +102,7 @@ def __init__(self): class SalesItemLineDetail(QuickbooksBaseObject): class_dict = { "ItemRef": Ref, + "ItemAccountRef": Ref, "ClassRef": Ref, "TaxCodeRef": Ref, "PriceLevelRef": Ref, @@ -117,6 +118,7 @@ def __init__(self): self.MarkupInfo = None self.ItemRef = None + self.ItemAccountRef = None self.ClassRef = None self.TaxCodeRef = None self.PriceLevelRef = None diff --git a/setup.py b/setup.py index 55f0654..e0b4c70 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ def read(*parts): return fp.read() -VERSION = (0, 9, 7) +VERSION = (0, 9, 8) version = '.'.join(map(str, VERSION)) setup( diff --git a/tests/integration/test_account.py b/tests/integration/test_account.py index 4efde66..78d5b46 100644 --- a/tests/integration/test_account.py +++ b/tests/integration/test_account.py @@ -32,3 +32,12 @@ def test_update(self): query_account = Account.get(account.Id, qb=self.qb_client) self.assertEqual(query_account.Name, "Updated Name {0}".format(self.account_number)) + + def test_create_using_from_json(self): + account = Account.from_json({ + "AcctNum": self.account_number, + "Name": self.name, + "AccountSubType": "CashOnHand" + }) + + account.save(qb=self.qb_client)