Skip to content

Commit

Permalink
Fix PnL summary report
Browse files Browse the repository at this point in the history
  • Loading branch information
hsyyid committed Jul 19, 2024
1 parent 4ffc40d commit 607bb20
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ def sync(self, catalog_entry):
"accounting_method": "Accrual"
}

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

# Get column metadata.
columns = self._get_column_metadata(resp)
columns += ["Account"]

# Recursively get row data.
row_group = resp.get("Rows")
Expand All @@ -161,7 +162,7 @@ def sync(self, catalog_entry):
# Zip columns and row data.
for raw_row in output:
row = dict(zip(columns, raw_row))
if not row.get("Amount"):
if not row.get("Total"):
# If a row is missing the amount, skip it
continue

Expand Down

0 comments on commit 607bb20

Please sign in to comment.