Only include active Task Orders in portfolio budget

This commit is contained in:
Patrick Smith 2019-02-08 10:16:51 -05:00
parent 31f8c0f381
commit fd849a801a
2 changed files with 5 additions and 2 deletions

View File

@ -106,13 +106,16 @@ class TaskOrder(Base, mixins.TimestampsMixin):
@property
def is_submitted(self):
return (
self.number is not None
and self.start_date is not None
and self.end_date is not None
)
@property
def is_active(self):
return self.status == Status.ACTIVE
@property
def status(self):
if self.is_submitted:

View File

@ -20,7 +20,7 @@
{{ Icon('info') }}
</button>
<span class='portfolio-header__budget--dollars'>
{{ portfolio.task_orders | sum(attribute='budget') | dollars }}
{{ portfolio.task_orders | selectattr('is_active') | sum(attribute='budget') | dollars }}
</span>
</div>
</div>