class methods for oblig. and contract amount total
This commit is contained in:
parent
8c1a1ac33e
commit
73a4b669ac
@ -6,7 +6,6 @@ from sqlalchemy.ext.hybrid import hybrid_property
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from atst.models import Attachment, Base, mixins, types
|
||||
from atst.models.clin import JEDICLINType
|
||||
from atst.utils.clock import Clock
|
||||
|
||||
|
||||
@ -148,10 +147,7 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
||||
def total_obligated_funds(self):
|
||||
total = 0
|
||||
for clin in self.clins:
|
||||
if clin.obligated_amount is not None and clin.jedi_clin_type in [
|
||||
JEDICLINType.JEDI_CLIN_1,
|
||||
JEDICLINType.JEDI_CLIN_3,
|
||||
]:
|
||||
if clin.obligated_amount is not None:
|
||||
total += clin.obligated_amount
|
||||
return total
|
||||
|
||||
@ -159,8 +155,8 @@ class TaskOrder(Base, mixins.TimestampsMixin):
|
||||
def total_contract_amount(self):
|
||||
total = 0
|
||||
for clin in self.clins:
|
||||
if clin.obligated_amount is not None:
|
||||
total += clin.obligated_amount
|
||||
if clin.total_amount is not None:
|
||||
total += clin.total_amount
|
||||
return total
|
||||
|
||||
@property
|
||||
|
@ -159,7 +159,6 @@ export default {
|
||||
|
||||
_isValid: function(value) {
|
||||
let valid = this._validate(value)
|
||||
|
||||
if (!this.modified && this.initialErrors && this.initialErrors.length) {
|
||||
valid = false
|
||||
} else if (this.optional && value === '') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user