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:
graham-dds
2020-02-06 14:45:44 -05:00
parent 63cb05249f
commit 4a78aa07c9
4 changed files with 56 additions and 59 deletions

View File

@@ -34,10 +34,17 @@ def create_portfolio():
@user_can(Permissions.VIEW_PORTFOLIO_REPORTS, message="view portfolio reports")
def reports(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")
return render_template(
@@ -47,6 +54,5 @@ def reports(portfolio_id):
total_portfolio_value=str(portfolio.total_obligated_funds),
current_obligated_funds=current_obligated_funds,
expired_task_orders=Reports.expired_task_orders(portfolio),
monthly_spending=Reports.monthly_spending(portfolio),
retrieved=datetime.now(), # mocked datetime of reporting data retrival
)