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 @property
def is_submitted(self): def is_submitted(self):
return ( return (
self.number is not None self.number is not None
and self.start_date is not None and self.start_date is not None
and self.end_date is not None and self.end_date is not None
) )
@property
def is_active(self):
return self.status == Status.ACTIVE
@property @property
def status(self): def status(self):
if self.is_submitted: if self.is_submitted:

View File

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