From d77b308ab6c66ab42561b18289c679e2eb8c7877 Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Mon, 20 May 2024 13:40:25 -0500 Subject: [PATCH 1/4] Update readme for from_json --- README.md | 4 ++-- tests/integration/test_account.py | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) 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/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) From 33233633065f41f1c41041fb4963cb4a8d907650 Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Mon, 20 May 2024 13:50:33 -0500 Subject: [PATCH 2/4] Add new field ItemAccountRef to SalesItemLineDetail --- quickbooks/objects/detailline.py | 2 ++ 1 file changed, 2 insertions(+) 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 From 60247530901ae10b43e16b251862c2495ede3ed6 Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Mon, 20 May 2024 15:34:55 -0500 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.rst | 4 ++++ 1 file changed, 4 insertions(+) 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 From 89a38ac337c74f6632250c3ae6fcada5a300706f Mon Sep 17 00:00:00 2001 From: Edward Emanuel Date: Mon, 20 May 2024 15:36:41 -0500 Subject: [PATCH 4/4] Increment version number --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(