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