Skip to content

Commit

Permalink
Group filings ending on same date
Browse files Browse the repository at this point in the history
  • Loading branch information
hancush committed Oct 2, 2024
1 parent 99fca26 commit f21a76e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions camp_fin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -945,17 +945,18 @@ def trends(self, since="2010"):
# Balances and debts
summed_filings = """
SELECT
COALESCE(f.total_unpaid_debts, 0) AS total_unpaid_debts,
f.closing_balance AS closing_balance,
SUM(COALESCE(f.total_unpaid_debts, 0)) AS total_unpaid_debts,
SUM(f.closing_balance) AS closing_balance,
fp.end_date,
fp.description
ARRAY_AGG(fp.description) AS description
FROM camp_fin_filing AS f
JOIN camp_fin_filingperiod AS fp
ON f.filing_period_id = fp.id
WHERE f.entity_id = %s
AND fp.exclude_from_cascading = FALSE
AND fp.regular_filing_period_id IS NULL
AND f.filed_date >= '{year}-01-01'
GROUP BY fp.end_date
ORDER BY fp.end_date
""".format(
year=since
Expand Down
2 changes: 1 addition & 1 deletion camp_fin/static/js/chart_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ ChartHelper.netfunds = function(el, title, sourceTxt, yaxisLabel, data, startYea
$.each(this.points, function(i, point) {
if (i === 0) {
s += `
<strong>${point.point.description}</strong><br />
<strong>${point.point.description.join(", ")}</strong><br />
<strong>Period ending ${ChartHelper.toolTipDateFormat("day", this.x)}</strong>
`
}
Expand Down

0 comments on commit f21a76e

Please sign in to comment.