Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set adjusted_gain_loss in PnL report using pnl_adjusted_gain_loss flag #78

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
88790a2
Set adjusted_gain_loss in PnL report using pnl_adjusted_gain_loss flag
xacadil Nov 20, 2023
7c14db2
Fix for parsing unrealized row for PnLDetail report
xacadil Nov 22, 2023
4d680e8
Removed debug code for PnL detail report
xacadil Nov 22, 2023
ff0e69d
Process header and summary as rows for BalanceSheetReport
xacadil Nov 22, 2023
5192bdd
Fix issue with PnL
hsyyid Nov 23, 2023
7ab62fd
fix datetime type
hsyyid Nov 23, 2023
f59940c
Update ProfitAndLossDetailReport.py (#81)
tark-dt Nov 23, 2023
5771008
fix
hsyyid Nov 23, 2023
fd37f91
disable
hsyyid Nov 23, 2023
1cc571f
fix
hsyyid Nov 23, 2023
f9435fe
Missing and duplicate values fix for BalanceSheet and MonthlyBalanceS…
xacadil Nov 24, 2023
ac60cd6
Monthly report support for ProfitAndLossDetailreport stream
xacadil Nov 24, 2023
7e5b013
Adds new flags for P/L Detail Report and Monthly Balance Sheet (#79)
vmesel Nov 30, 2023
c06bb62
fix offset calculation
keyn4 Dec 8, 2023
26339f2
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Dec 11, 2023
62bd9cc
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Dec 11, 2023
bd64534
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Dec 13, 2023
8efd41a
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Dec 20, 2023
655c2dc
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Jan 9, 2024
ec07387
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Jan 10, 2024
c311ee8
Merge branch 'master' into pnl-adjust-gainloss
hsyyid Jan 16, 2024
06757ea
Response exception message and handling. (#100)
xacadil Apr 8, 2024
e49a6b4
Additional logs. (#103)
xacadil May 15, 2024
df74975
Suppliers for GeneralLedgerAccrualReport stream (#108)
xacadil Jul 3, 2024
0b77c81
add aging_method and report_date to aging report (#110)
keyn4 Jul 22, 2024
70416bb
Add config ar_aging_report_dates for ar aging report to sync data for…
lomashs09 Aug 7, 2024
14c3ff7
Add stream AR Aging Detail report (#113)
lomashs09 Aug 14, 2024
39a2e4c
Add column number in araging detailed report (#117)
lomashs09 Sep 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion tap_quickbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,9 @@ def main_impl():
gl_full_sync = CONFIG.get('gl_full_sync'),
gl_weekly = CONFIG.get('gl_weekly', False),
gl_daily = CONFIG.get('gl_daily', False),
gl_basic_fields = CONFIG.get('gl_basic_fields', False))
gl_basic_fields = CONFIG.get('gl_basic_fields', False),
pnl_adjusted_gain_loss = CONFIG.get('pnl_adjusted_gain_loss', False)
)
qb.login()

if args.discover:
Expand Down
7 changes: 5 additions & 2 deletions tap_quickbooks/quickbooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,9 @@ def __init__(self,
gl_weekly = None,
gl_daily = None,
gl_basic_fields = None,
realm_id=None):
realm_id=None,
pnl_adjusted_gain_loss = None
):
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
Expand All @@ -258,6 +260,7 @@ def __init__(self,
self.qb_client_secret = qb_client_secret
self.session = requests.Session()
self.access_token = None
self.pnl_adjusted_gain_loss = pnl_adjusted_gain_loss

self.base_url = "https://sandbox-quickbooks.api.intuit.com/v3/company/" if is_sandbox is True else 'https://quickbooks.api.intuit.com/v3/company/'

Expand Down Expand Up @@ -485,5 +488,5 @@ def query_report(self, catalog_entry, state, state_passed):
elif catalog_entry["stream"] == "TransactionListReport":
reader = TransactionListReport(self, start_date, state_passed)
else:
reader = ProfitAndLossDetailReport(self, start_date, state_passed)
reader = ProfitAndLossDetailReport(self, start_date, state_passed,pnl_adjusted_gain_loss=self.pnl_adjusted_gain_loss)
return reader.sync(catalog_entry)
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ class ProfitAndLossDetailReport(QuickbooksStream):
replication_method: ClassVar[str] = 'FULL_TABLE'
current_account = {}

def __init__(self, qb, start_date, state_passed):
def __init__(self, qb, start_date, state_passed,pnl_adjusted_gain_loss=None):
self.qb = qb
self.start_date = start_date
self.state_passed = state_passed
self.pnl_adjusted_gain_loss = pnl_adjusted_gain_loss

def _get_column_metadata(self, resp):
columns = []
Expand Down Expand Up @@ -117,6 +118,8 @@ def sync(self, catalog_entry):
"accounting_method": "Accrual",
"columns": ",".join(cols)
}
if self.pnl_adjusted_gain_loss:
params.update({"adjusted_gain_loss":self.pnl_adjusted_gain_loss})

LOGGER.info(f"Fetch Journal Report for period {params['start_date']} to {params['end_date']}")
resp = self._get(report_entity='ProfitAndLossDetail', params=params)
Expand Down