Skip to content

Commit

Permalink
Merge pull request #175 from closup/dev
Browse files Browse the repository at this point in the history
Domain change
  • Loading branch information
lucakato authored Jan 21, 2025
2 parents 198292f + 4b8a0f2 commit c771fe3
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 27 deletions.
26 changes: 24 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,18 @@
- PR: #40
- 36 template fixes
- PR: #41
- 30 support for new tables
- PR: #33
- Update dev
- PR: #45
- Merge pull request #45 from closup/main
- PR: #46
- update for template
- PR: #47
- 30 support for new tables
- PR: #49
- 7 sessions
- PR: #51
- 28 image handling
- PR: #38
- #54 implemented custom line items
- PR: #55
- 52 add back button
Expand Down Expand Up @@ -88,6 +94,8 @@
- PR: #123
- Move all partial fixes to dev branch
- PR: #124
- Revert changes to make main functional
- PR: #130
- Update .gitignore
- PR: #135
- flask key .env deleted (only local on Luca pc rn)
Expand Down Expand Up @@ -132,4 +140,18 @@
- PR: #167
- 158 dev review
- PR: #168
- Dev
- PR: #158
- Create TEMPLATE-README
- PR: #169
- Update README.md
- PR: #170
- Add 'more information' button
- PR: #171
- Update with patches and documentation
- PR: #174
- 165 domain issues
- PR: #173
- Member should be an element, not text
- PR: #176

13 changes: 4 additions & 9 deletions app/models/dimension.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,24 @@ def __init__(self, col_name : str, type = None):
self._member_name = get_col_no_spaces(col_name) # Default value
self._member_type = "typed" # Default type
self._axis = "Default"
self._domain = "Default"

if col_name in axis_dict:
self._member_type = "explicit"
self._axis, self._domain, self._member_name = axis_dict[col_name]
self._axis, self._member_name = axis_dict[col_name]
elif type == "gov":
# custom gov funds
self._axis, self._domain = "FundIdentifier", "FundIdentifier"
self._axis = "FundIdentifier"
elif type == "prop":
# custom proprietary funds
self._axis, self._domain = "TypeOfActivitiesProprietaryFunds", "ProprietaryFunds"
self._axis = "TypeOfActivitiesProprietaryFunds"
elif type == "custom":
# Custom line item
self._axis, self._domain = "DisaggregationLineItem", ""
self._axis = "DisaggregationLineItem"

@property
def axis(self):
return f"acfr:{self._axis}Axis"

@property
def domain(self):
return f"acfr:{self._domain}Domain"

@property
def member_name(self):
return f"acfr:{self._member_name}Member"
Expand Down
5 changes: 5 additions & 0 deletions app/templates/site/base_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ <h1><span>Inline XBRL Conversion Tool</span></h1>
<div class="alert alert-warning text-center">
This product is in-development. As such, errors are to be expected along with frequent changes in functionality.<br>
This product should not be used for actual production of financial reports.
<div class="mt-2">
<a href="https://closup.umich.edu/acfr-tool" class="btn btn-warning fw-bold" target="_blank">
More Information
</a>
</div>
</div>
</div>
</body>
Expand Down
6 changes: 2 additions & 4 deletions app/templates/xbrl/contexts.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
<xbrli:segment>
{% for dim in context.dims() %}
<xbrldi:{{dim.member_type}}Member dimension="{{dim.axis}}">
{% if dim.domain %}<{{ dim.domain }}>{% endif %}
{{ dim.member_name }}
{% if dim.domain %}</{{ dim.domain }}>{% endif %}
<{{ dim.member_name }}>
</xbrldi:{{dim.member_type}}Member>
{% endfor %}
</xbrli:segment>
Expand All @@ -24,4 +22,4 @@
{% endfor %}

<!-- Word contexts -->
{% include 'xbrl/word_contexts.html' %}
{% include 'xbrl/word_contexts.html' %}
24 changes: 12 additions & 12 deletions app/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
"capital_grants_and_contributions"],
"GovernmentalFunds" : ["total", "general_fund"] }

# Dimension axis, domain, and member name by column name in Excel template
axis_dict = {"governmental_activities" : ("TypeOfGovernmentUnit", None, "GovernmentalActivities"),
"business-type_activities" : ("TypeOfGovernmentUnit", None, "BusinessTypeActivities"),
"total_primary_government" : ("TypeOfGovernmentUnit", None, "PrimaryGovernmentActivities"),
"component_units" : ("TypeOfGovernmentUnit", None, "ComponentUnitDiscretelyPresented"),
"charges_for_services" : ("TypeOfProgramRevenues", None, "ProgramRevenuesFromChargesForServices"),
"operating_grants_and_contributions" : ("TypeOfProgramRevenues", None, "ProgramRevenuesFromOperatingGrantsAndContributions"),
"capital_grants_and_contributions" : ("TypeOfProgramRevenues", None, "ProgramRevenuesFromCapitalGrantsAndContributions"),
# Dimension axis and member name by column name in Excel template
axis_dict = {"governmental_activities" : ("TypeOfGovernmentUnit", "GovernmentalActivities"),
"business-type_activities" : ("TypeOfGovernmentUnit", "BusinessTypeActivities"),
"total_primary_government" : ("TypeOfGovernmentUnit", "PrimaryGovernmentActivities"),
"component_units" : ("TypeOfGovernmentUnit", "ComponentUnitDiscretelyPresented"),
"charges_for_services" : ("TypeOfProgramRevenues", "ProgramRevenuesFromChargesForServices"),
"operating_grants_and_contributions" : ("TypeOfProgramRevenues", "ProgramRevenuesFromOperatingGrantsAndContributions"),
"capital_grants_and_contributions" : ("TypeOfProgramRevenues", "ProgramRevenuesFromCapitalGrantsAndContributions"),
# gov funds
"general_fund" : ("GovernmentalFunds", None, "GeneralFund"),
"total_governmental_funds" : ("GovernmentalFunds", None, "GovernmentalFunds"),
"general_fund" : ("GovernmentalFunds", "GeneralFund"),
"total_governmental_funds" : ("GovernmentalFunds", "GovernmentalFunds"),
# Prop funds
"total_enterprise_funds" : ("TypeOfActivitiesProprietaryFunds", "ProprietaryFunds", "BusinessTypeActivitiesEnterpriseFunds"),
"internal_service_funds" : ("TypeOfActivitiesProprietaryFunds", "ProprietaryFunds", "InternalServiceFunds")}
"total_enterprise_funds" : ("TypeOfActivitiesProprietaryFunds", "BusinessTypeActivitiesEnterpriseFunds"),
"internal_service_funds" : ("TypeOfActivitiesProprietaryFunds", "InternalServiceFunds")}

# =============================================================
# Mammoth style conversions from Word
Expand Down

0 comments on commit c771fe3

Please sign in to comment.