Add funding status alerts
This commit is contained in:
parent
db1c712c8b
commit
2cbfa59b92
@ -1,4 +1,5 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
from datetime import date
|
||||||
|
|
||||||
import pendulum
|
import pendulum
|
||||||
from sqlalchemy import Column, Numeric, String, ForeignKey, Date, Integer
|
from sqlalchemy import Column, Numeric, String, ForeignKey, Date, Integer
|
||||||
@ -111,6 +112,11 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
|||||||
def display_status(self):
|
def display_status(self):
|
||||||
return self.status.value
|
return self.status.value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def days_to_expiration(self):
|
||||||
|
if self.end_date:
|
||||||
|
return (self.end_date - date.today()).days
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def budget(self):
|
def budget(self):
|
||||||
return sum(
|
return sum(
|
||||||
|
@ -22,6 +22,7 @@ def portfolio_funding(portfolio_id):
|
|||||||
"start_date",
|
"start_date",
|
||||||
"end_date",
|
"end_date",
|
||||||
"display_status",
|
"display_status",
|
||||||
|
"days_to_expiration",
|
||||||
"balance",
|
"balance",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -46,8 +46,8 @@ export default {
|
|||||||
displayName: 'Period of Performance',
|
displayName: 'Period of Performance',
|
||||||
attr: 'start_date',
|
attr: 'start_date',
|
||||||
sortFunc: numericSort,
|
sortFunc: numericSort,
|
||||||
width: "50%",
|
width: '50%',
|
||||||
class: "period-of-performance"
|
class: 'period-of-performance',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
displayName: 'Initial Value',
|
displayName: 'Initial Value',
|
||||||
|
@ -126,5 +126,27 @@
|
|||||||
.label--expired {
|
.label--expired {
|
||||||
background-color: $color-gray-light;
|
background-color: $color-gray-light;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.to-expiring-soon {
|
||||||
|
font-weight: $font-bold;
|
||||||
|
font-size: 1.5rem;
|
||||||
|
margin-left: $gap;
|
||||||
|
|
||||||
|
&.funded {
|
||||||
|
color: $color-blue;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
@include icon-color($color-blue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.unfunded {
|
||||||
|
color: $color-red;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
@include icon-color($color-red);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,17 @@
|
|||||||
v-bind:timestamp="taskOrder.end_date"
|
v-bind:timestamp="taskOrder.end_date"
|
||||||
format="M/D/YYYY">
|
format="M/D/YYYY">
|
||||||
</local-datetime>
|
</local-datetime>
|
||||||
|
<span
|
||||||
|
v-if="taskOrder.display_status ==='Active' && (taskOrder.days_to_expiration > 0 && taskOrder.days_to_expiration <= 30) && taskOrders.length > 1"
|
||||||
|
class="to-expiring-soon funded">
|
||||||
|
{{ Icon('ok') }} Period ending in !{ taskOrder.days_to_expiration } days, but new period funded
|
||||||
|
</span>
|
||||||
|
<span
|
||||||
|
v-if="taskOrder.display_status ==='Active' && (taskOrder.days_to_expiration > 0 && taskOrder.days_to_expiration <= 30) && taskOrders.length === 1"
|
||||||
|
class="to-expiring-soon unfunded">
|
||||||
|
{{ Icon('alert') }} Period ends in !{ taskOrder.days_to_expiration } days, submit a new task order
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="table-cell--align-right">
|
<td class="table-cell--align-right">
|
||||||
<span v-html='formatDollars(taskOrder.budget)'></span>
|
<span v-html='formatDollars(taskOrder.budget)'></span>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user