diff --git a/atst/domain/csp/reports.py b/atst/domain/csp/reports.py index 2d42fede..4b69e904 100644 --- a/atst/domain/csp/reports.py +++ b/atst/domain/csp/reports.py @@ -308,20 +308,37 @@ class MockReportingProvider(ReportingInterface): return {} def get_expired_task_orders(self, portfolio): - return [ - { - "id": task_order.id, - "number": task_order.number, + def sorted_task_orders(to_list): + return sorted(to_list, key=lambda to: to["number"]) + + def sorted_clins(clin_list): + return sorted(clin_list, key=lambda clin: clin["number"]) + + def serialize_clin(clin): + return { + "number": clin.number, + "jedi_clin_type": clin.jedi_clin_type, "period_of_performance": { - "start_date": task_order.start_date, - "end_date": task_order.end_date, + "start_date": clin.start_date, + "end_date": clin.end_date, }, - "total_obligated_funds": task_order.total_obligated_funds, + "total_value": clin.total_amount, + "total_obligated_funds": clin.obligated_amount, "expended_funds": ( - task_order.total_obligated_funds - * Decimal(self.MOCK_PERCENT_EXPENDED_FUNDS) + clin.obligated_amount * Decimal(self.MOCK_PERCENT_EXPENDED_FUNDS) ), } - for task_order in portfolio.task_orders - if task_order.is_expired - ] + + return sorted_task_orders( + [ + { + "id": task_order.id, + "number": task_order.number, + "clins": sorted_clins( + [serialize_clin(clin) for clin in task_order.clins] + ), + } + for task_order in portfolio.task_orders + if task_order.is_expired + ] + ) diff --git a/styles/sections/_reports.scss b/styles/sections/_reports.scss index f80a7750..0cd737c8 100644 --- a/styles/sections/_reports.scss +++ b/styles/sections/_reports.scss @@ -87,4 +87,32 @@ font-size: $lead-font-size; } } + + .reporting-expended-funding { + &__header { + margin: 0; + } + &__content { + padding: 0; + border-top: 1px solid $color-gray-lighter; + } + } + + .reporting-spend-table { + &__env-row { + &-label { + margin-left: $gap * 5; + } + &--last { + & > td { + border-bottom: 1px solid black; + } + &:last-of-type { + & > td { + border-bottom: none; + } + } + } + } + } } diff --git a/templates/components/accordion.html b/templates/components/accordion.html index 8e508321..3fd38e01 100644 --- a/templates/components/accordion.html +++ b/templates/components/accordion.html @@ -1,23 +1,30 @@ -{% macro Accordion(title, id, heading_level="h2") %} - -
- <{{heading_level}}> - - -
- {{ caller() }} -
-
-
+{% macro Accordion( + title, + id, + wrapper_tag="div", + wrapper_classes="", + heading_tag="h2", + heading_classes="", + content_tag="div", + content_classes="") %} + + <{{wrapper_tag}} class="{{ wrapper_classes }}"> + <{{heading_tag}} class="{{ heading_classes }}"> + + + <{{content_tag}} + id="{{ id }}" + class="usa-accordion-content {{ content_classes }}" + v-bind:aria-hidden="isVisible ? 'false' : 'true'"> + {{ caller() }} + + + {% endmacro %} \ No newline at end of file diff --git a/templates/portfolios/reports/application_and_env_spending.html b/templates/portfolios/reports/application_and_env_spending.html index d969a767..e43ebf0c 100644 --- a/templates/portfolios/reports/application_and_env_spending.html +++ b/templates/portfolios/reports/application_and_env_spending.html @@ -59,9 +59,13 @@ - + - + diff --git a/templates/portfolios/reports/expired_task_orders.html b/templates/portfolios/reports/expired_task_orders.html index d7dd843a..4d8da3f6 100644 --- a/templates/portfolios/reports/expired_task_orders.html +++ b/templates/portfolios/reports/expired_task_orders.html @@ -1,34 +1,51 @@ {% from "components/accordion.html" import Accordion %} +{% from "components/icon.html" import Icon %}
- {% call Accordion("Expired Task Orders", "expired_task_orders", "h3") %} - {% for task_order in expired_task_orders %} - - Task Order {{ task_order["number"] }} - -
-

Period of Performance

-

- {{ task_order["period_of_performance"].start_date | formattedDate(formatter="%B %d, %Y") }} - - - {{ task_order["period_of_performance"].end_date | formattedDate(formatter="%B %d, %Y") }} -

-
-
-

Total Obligated

-

{{ task_order["total_obligated_funds"] | dollars }}

-
-
-

Total Expended

-

{{ task_order["expended_funds"] | dollars }}

-
-
-

Total Unused

-

{{ (task_order["total_obligated_funds"] - task_order["expended_funds"]) | dollars }}

-
- {% endfor %} + {% call Accordion( + "Expired funding", + "expired_funding", + heading_classes="reporting-expended-funding__header", + content_tag="table", + content_classes="atat-table reporting-expended-funding__content") %} + + + TO CLIN + PoP + CLIN Value + Amount Obligated + Amount Unspent + + + + {% for task_order in expired_task_orders %} + + + Task Order + {{ task_order.number }} {{ Icon("caret_right", classes="icon--tiny icon--blue" ) }} + + + + {% for clin in task_order.clins %} + + +
{{ clin.number }}
+
{{ ("{}".format(clin.jedi_clin_type) | translate)[15:] }}
+ + + {{ clin.period_of_performance.start_date | formattedDate(formatter="%b %d, %Y") }} + - + {{ clin.period_of_performance.end_date | formattedDate(formatter="%b %d, %Y") }} + + {{ clin.total_value | dollars }} + {{ clin.total_obligated_funds | dollars }} + {{ (clin.total_obligated_funds - clin.expended_funds) | dollars }} + + {% endfor %} + {% endfor %} + {% endcall %}