From 6ae878ca6eb352abc97b7916181a9ab62a5a6644 Mon Sep 17 00:00:00 2001 From: Shwetabh Kumar Date: Thu, 25 Apr 2024 14:21:32 +0530 Subject: [PATCH] Add Support for Tax Detail Override and Tax Detail List for Bills (#125) * Add Support for Tax Detail Override and Tax Detail List for Bills * update version --------- Co-authored-by: ruuushhh --- netsuitesdk/api/vendor_bills.py | 9 +++++++++ netsuitesdk/internal/netsuite_types.py | 2 ++ setup.py | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/netsuitesdk/api/vendor_bills.py b/netsuitesdk/api/vendor_bills.py index 5e446b6..02132e8 100644 --- a/netsuitesdk/api/vendor_bills.py +++ b/netsuitesdk/api/vendor_bills.py @@ -121,6 +121,15 @@ def post(self, data) -> OrderedDict: if 'entity' in data: vb['entity'] = self.ns_client.RecordRef(**(data['entity'])) + if 'taxDetailsOverride' in data: + vb['taxDetailsOverride'] = data['taxDetailsOverride'] + + if 'taxDetailsList' in data: + tax_details_list = [] + for tdl in data['taxDetailsList']['taxDetails']: + tax_details_list.append(self.ns_client.TaxDetails(**tdl)) + vb['taxDetailsList'] = self.ns_client.TaxDetailsList(taxDetails=tax_details_list) + logger.debug('able to create vb = %s', vb) res = self.ns_client.upsert(vb, 'bills') return self._serialize(res) diff --git a/netsuitesdk/internal/netsuite_types.py b/netsuitesdk/internal/netsuite_types.py index 57322c8..5408715 100644 --- a/netsuitesdk/internal/netsuite_types.py +++ b/netsuitesdk/internal/netsuite_types.py @@ -66,6 +66,8 @@ 'CustomListSearchBasic', 'TermSearchBasic', 'DepartmentSearchBasic', + 'TaxDetails', + 'TaxDetailsList', 'ItemSearchBasic', 'ItemSearchRowBasic', 'ClassificationSearchBasic', 'CurrencyRateSearchBasic', diff --git a/setup.py b/setup.py index 30b61c7..e363008 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='netsuitesdk', - version='2.21.0', + version='2.21.1', author='Siva Narayanan', author_email='siva@fyle.in', description='Python SDK for accessing the NetSuite SOAP webservice',