Merge pull request #614 from dod-ccpo/budget-is-active-tos-only

Only include active Task Orders in portfolio budget
This commit is contained in:
patricksmithdds 2019-02-08 10:40:58 -05:00 committed by GitHub
commit f461694c78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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>