Skip to content

Commit

Permalink
Adds flag reports_full_sync to allow full sync on all reports (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
vmesel authored Dec 20, 2023
1 parent c34b249 commit 063c088
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions tap_quickbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@ def main_impl():
api_type='REST',
realm_id = CONFIG.get('realmId'),
report_period_days = CONFIG.get('report_period_days'),
reports_full_sync = CONFIG.get('reports_full_sync', False),
gl_full_sync = CONFIG.get('gl_full_sync'),
gl_weekly = CONFIG.get('gl_weekly', False),
gl_daily = CONFIG.get('gl_daily', False),
Expand Down
7 changes: 6 additions & 1 deletion tap_quickbooks/quickbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ def __init__(self,
default_start_date=None,
api_type=None,
report_period_days = None,
reports_full_sync = None,
gl_full_sync = None,
gl_weekly = None,
gl_daily = None,
Expand All @@ -247,6 +248,7 @@ def __init__(self,
self.api_type = api_type.upper() if api_type else None
self.report_period_days = report_period_days
self.gl_full_sync = gl_full_sync
self.reports_full_sync = reports_full_sync
self.gl_weekly = gl_weekly
self.gl_daily = gl_daily
self.gl_basic_fields = gl_basic_fields
Expand Down Expand Up @@ -370,7 +372,7 @@ def login(self):
self.access_token = auth['access_token']

new_refresh_token = auth['refresh_token']

# persist access_token
parser = argparse.ArgumentParser()
parser.add_argument('-c', '--config', help='Config file', required=True)
Expand Down Expand Up @@ -468,6 +470,9 @@ def query(self, catalog_entry, state, state_passed):

def query_report(self, catalog_entry, state, state_passed):
start_date = singer_utils.strptime_with_tz(self.get_start_date(state, catalog_entry))
if self.reports_full_sync:
state_passed = None

if catalog_entry["stream"] == "BalanceSheetReport":
reader = BalanceSheetReport(self, start_date, state_passed)
elif catalog_entry["stream"] == "MonthlyBalanceSheetReport":
Expand Down

0 comments on commit 063c088

Please sign in to comment.