Remove non-MVP reporting elements
- Edits views to only show spending at the portfolio level -- no longer broken out by JEDI CLIN - Removes Monthly Spending table -- keeps the template, just no longer uses it. - Removes amount unspent from the expired funding table
This commit is contained in:
parent
63cb05249f
commit
4a78aa07c9
@ -34,10 +34,17 @@ def create_portfolio():
|
|||||||
@user_can(Permissions.VIEW_PORTFOLIO_REPORTS, message="view portfolio reports")
|
@user_can(Permissions.VIEW_PORTFOLIO_REPORTS, message="view portfolio reports")
|
||||||
def reports(portfolio_id):
|
def reports(portfolio_id):
|
||||||
portfolio = Portfolios.get(g.current_user, portfolio_id)
|
portfolio = Portfolios.get(g.current_user, portfolio_id)
|
||||||
|
spending = Reports.get_portfolio_spending(portfolio)
|
||||||
|
obligated = portfolio.total_obligated_funds
|
||||||
|
remaining = obligated - (spending["invoiced"] + spending["estimated"])
|
||||||
|
|
||||||
current_obligated_funds = Reports.obligated_funds_by_JEDI_clin(portfolio)
|
current_obligated_funds = {
|
||||||
|
**spending,
|
||||||
|
"obligated": obligated,
|
||||||
|
"remaining": remaining,
|
||||||
|
}
|
||||||
|
|
||||||
if any(map(lambda clin: clin["remaining"] < 0, current_obligated_funds)):
|
if current_obligated_funds["remaining"] < 0:
|
||||||
flash("insufficient_funds")
|
flash("insufficient_funds")
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
@ -47,6 +54,5 @@ def reports(portfolio_id):
|
|||||||
total_portfolio_value=str(portfolio.total_obligated_funds),
|
total_portfolio_value=str(portfolio.total_obligated_funds),
|
||||||
current_obligated_funds=current_obligated_funds,
|
current_obligated_funds=current_obligated_funds,
|
||||||
expired_task_orders=Reports.expired_task_orders(portfolio),
|
expired_task_orders=Reports.expired_task_orders(portfolio),
|
||||||
monthly_spending=Reports.monthly_spending(portfolio),
|
|
||||||
retrieved=datetime.now(), # mocked datetime of reporting data retrival
|
retrieved=datetime.now(), # mocked datetime of reporting data retrival
|
||||||
)
|
)
|
||||||
|
@ -16,13 +16,12 @@
|
|||||||
<th>PoP</th>
|
<th>PoP</th>
|
||||||
<th>CLIN Value</th>
|
<th>CLIN Value</th>
|
||||||
<th>Amount Obligated</th>
|
<th>Amount Obligated</th>
|
||||||
<th>Amount Unspent</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for task_order in expired_task_orders %}
|
{% for task_order in expired_task_orders %}
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="5">
|
<td colspan="4">
|
||||||
<span class="h4 reporting-expended-funding__header">Task Order</span> <a href="{{ url_for("task_orders.view_task_order", task_order_id=task_order.id) }}">
|
<span class="h4 reporting-expended-funding__header">Task Order</span> <a href="{{ url_for("task_orders.view_task_order", task_order_id=task_order.id) }}">
|
||||||
{{ task_order.number }} {{ Icon("caret_right", classes="icon--tiny icon--blue" ) }}
|
{{ task_order.number }} {{ Icon("caret_right", classes="icon--tiny icon--blue" ) }}
|
||||||
</a>
|
</a>
|
||||||
@ -39,9 +38,8 @@
|
|||||||
-
|
-
|
||||||
{{ clin.end_date | formattedDate(formatter="%b %d, %Y") }}
|
{{ clin.end_date | formattedDate(formatter="%b %d, %Y") }}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ clin.total_amount | dollars }}</td>
|
<td class="table-cell--align-right">{{ clin.total_amount | dollars }}</td>
|
||||||
<td>{{ clin.obligated_amount | dollars }}</td>
|
<td class="table-cell--align-right">{{ clin.obligated_amount | dollars }}</td>
|
||||||
<td>{{ 0 | dollars }}</td>
|
|
||||||
<tr>
|
<tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -13,7 +13,5 @@
|
|||||||
<hr>
|
<hr>
|
||||||
{% include "portfolios/reports/obligated_funds.html" %}
|
{% include "portfolios/reports/obligated_funds.html" %}
|
||||||
{% include "portfolios/reports/expired_task_orders.html" %}
|
{% include "portfolios/reports/expired_task_orders.html" %}
|
||||||
<hr>
|
|
||||||
{% include "portfolios/reports/application_and_env_spending.html" %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -7,35 +7,31 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class='panel'>
|
<div class='panel'>
|
||||||
<div class='panel__content jedi-clin-funding'>
|
<div class='panel__content jedi-clin-funding'>
|
||||||
{% for JEDI_clin in current_obligated_funds | sort(attribute='name')%}
|
|
||||||
<div class="jedi-clin-funding__clin-wrapper">
|
<div class="jedi-clin-funding__clin-wrapper">
|
||||||
<h3 class="h5 jedi-clin-funding__header">
|
<h3 class="h5 jedi-clin-funding__header">
|
||||||
{{ "JEDICLINType.{}".format(JEDI_clin.name) | translate }}
|
Total obligated amount: {{ current_obligated_funds.obligated | dollars }}
|
||||||
</h3>
|
</h3>
|
||||||
<p class="jedi-clin-funding__subheader">Total obligated amount: {{ JEDI_clin.obligated | dollars }}</p>
|
|
||||||
<div class="jedi-clin-funding__graph">
|
<div class="jedi-clin-funding__graph">
|
||||||
{% if JEDI_clin.remaining < 0 %}
|
{% if current_obligated_funds.remaining < 0 %}
|
||||||
<span style="width:100%" class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--insufficient"></span>
|
<span style="width:100%" class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--insufficient"></span>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set invoiced_width = (JEDI_clin.invoiced, JEDI_clin.obligated) | obligatedFundingGraphWidth %}
|
{% set invoiced_width = (current_obligated_funds.invoiced, current_obligated_funds.obligated) | obligatedFundingGraphWidth %}
|
||||||
{% if invoiced_width %}
|
{% if invoiced_width %}
|
||||||
<span style="width:{{ invoiced_width }}%"
|
<span style="width:{{ invoiced_width }}%"
|
||||||
class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--invoiced">
|
class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--invoiced">
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% set estimated_width = (JEDI_clin.estimated, JEDI_clin.obligated) | obligatedFundingGraphWidth %}
|
{% set estimated_width = (current_obligated_funds.estimated, current_obligated_funds.obligated) | obligatedFundingGraphWidth %}
|
||||||
{% if estimated_width %}
|
{% if estimated_width %}
|
||||||
<span style="width:{{ (JEDI_clin.estimated, JEDI_clin.obligated) | obligatedFundingGraphWidth }}%"
|
<span style="width:{{ (current_obligated_funds.estimated, current_obligated_funds.obligated) | obligatedFundingGraphWidth }}%"
|
||||||
class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--estimated">
|
class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--estimated">
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<span style="width:{{ (JEDI_clin.remaining, JEDI_clin.obligated) | obligatedFundingGraphWidth }}%"
|
<span style="width:{{ (current_obligated_funds.remaining, current_obligated_funds.obligated) | obligatedFundingGraphWidth }}%"
|
||||||
class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--remaining">
|
class="jedi-clin-funding__graph-bar jedi-clin-funding__graph-bar--remaining">
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="jedi-clin-funding__graph-values">
|
<div class="jedi-clin-funding__graph-values">
|
||||||
<div class="jedi-clin-funding__meta">
|
<div class="jedi-clin-funding__meta">
|
||||||
@ -43,25 +39,24 @@
|
|||||||
<span class="jedi-clin-funding__meta-key jedi-clin-funding__meta-key--invoiced"></span>
|
<span class="jedi-clin-funding__meta-key jedi-clin-funding__meta-key--invoiced"></span>
|
||||||
Invoiced expended funds:
|
Invoiced expended funds:
|
||||||
</p>
|
</p>
|
||||||
<p class="h3 jedi-clin-funding__meta-value">{{ JEDI_clin.invoiced | dollars }}</p>
|
<p class="h3 jedi-clin-funding__meta-value">{{ current_obligated_funds.invoiced | dollars }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="jedi-clin-funding__meta">
|
<div class="jedi-clin-funding__meta">
|
||||||
<p class="jedi-clin-funding__meta-header">
|
<p class="jedi-clin-funding__meta-header">
|
||||||
<span class="jedi-clin-funding__meta-key jedi-clin-funding__meta-key--estimated"></span>
|
<span class="jedi-clin-funding__meta-key jedi-clin-funding__meta-key--estimated"></span>
|
||||||
Estimated expended funds:
|
Estimated expended funds:
|
||||||
</p>
|
</p>
|
||||||
<p class="h3 jedi-clin-funding__meta-value">{{ JEDI_clin.estimated | dollars }}</p>
|
<p class="h3 jedi-clin-funding__meta-value">{{ current_obligated_funds.estimated | dollars }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="jedi-clin-funding__meta">
|
<div class="jedi-clin-funding__meta">
|
||||||
<p class="jedi-clin-funding__meta-header">
|
<p class="jedi-clin-funding__meta-header">
|
||||||
<span class="jedi-clin-funding__meta-key jedi-clin-funding__meta-key--{{"remaining" if JEDI_clin.remaining > 0 else "insufficient"}}"></span>
|
<span class="jedi-clin-funding__meta-key jedi-clin-funding__meta-key--{{"remaining" if current_obligated_funds.remaining > 0 else "insufficient"}}"></span>
|
||||||
Remaining funds:
|
Remaining funds:
|
||||||
</p>
|
</p>
|
||||||
<p class="h3 jedi-clin-funding__meta-value {% if JEDI_clin.remaining < 0 %}text-danger{% endif %}">{{ JEDI_clin.remaining | dollars }}</p>
|
<p class="h3 jedi-clin-funding__meta-value {% if current_obligated_funds.remaining < 0 %}text-danger{% endif %}">{{ current_obligated_funds.remaining | dollars }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
|
||||||
<div class="jedi-clin-funding__active-task-orders">
|
<div class="jedi-clin-funding__active-task-orders">
|
||||||
<h3 class="h4">
|
<h3 class="h4">
|
||||||
Active Task Orders
|
Active Task Orders
|
||||||
|
Loading…
x
Reference in New Issue
Block a user