diff --git a/fyle_netsuite_api/utils.py b/fyle_netsuite_api/utils.py index f4cc03f5..c70de7a2 100644 --- a/fyle_netsuite_api/utils.py +++ b/fyle_netsuite_api/utils.py @@ -45,6 +45,9 @@ def generate_netsuite_export_url(response_logs : OrderedDict, netsuite_credentia if response_logs: try: ns_account_id = netsuite_credentials.ns_account_id.lower() + if '_sb' in ns_account_id: + ns_account_id = ns_account_id.replace('_sb', '-sb') + export_type = response_logs['type'] if 'type' in response_logs and response_logs['type'] else 'chargeCard' internal_id = response_logs['internalId'] redirection = EXPORT_TYPE_REDIRECTION[export_type] diff --git a/scripts/sql/scripts/029-update-sandbox-export-urls.sql b/scripts/sql/scripts/029-update-sandbox-export-urls.sql new file mode 100644 index 00000000..b42c67ad --- /dev/null +++ b/scripts/sql/scripts/029-update-sandbox-export-urls.sql @@ -0,0 +1,17 @@ +rollback; +begin; + +-- These values should be swapped after running the script +-- netsuite=> select count(export_url) from expense_groups where export_url like '%_sb%'; +-- count +-- ------- +-- 240 +-- (1 row) + +-- netsuite=> select count(export_url) from expense_groups where export_url like '%-sb%'; +-- count +-- ------- +-- 0 +-- (1 row) + +update expense_groups set export_url = replace(export_url, '_sb', '-sb');