show financial verification link for requests that need task order changes
This commit is contained in:
parent
31d6bd3663
commit
8f5d6defce
@ -190,6 +190,10 @@ class Requests(object):
|
|||||||
def is_pending_financial_verification(cls, request):
|
def is_pending_financial_verification(cls, request):
|
||||||
return request.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION
|
return request.status == RequestStatus.PENDING_FINANCIAL_VERIFICATION
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def is_pending_financial_verification_changes(cls, request):
|
||||||
|
return request.status == RequestStatus.CHANGES_REQUESTED_TO_FINVER
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def is_pending_ccpo_acceptance(cls, request):
|
def is_pending_ccpo_acceptance(cls, request):
|
||||||
return request.status == RequestStatus.PENDING_CCPO_ACCEPTANCE
|
return request.status == RequestStatus.PENDING_CCPO_ACCEPTANCE
|
||||||
|
@ -57,6 +57,26 @@ class RequestsIndex(object):
|
|||||||
"extended_view": False,
|
"extended_view": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def _edit_link_for_request(self, viewing_role, request):
|
||||||
|
if viewing_role == "ccpo":
|
||||||
|
return url_for("requests.approval", request_id=request.id)
|
||||||
|
elif Requests.is_pending_financial_verification(request):
|
||||||
|
return url_for(
|
||||||
|
"requests.financial_verification", request_id=request.id
|
||||||
|
)
|
||||||
|
elif Requests.is_pending_financial_verification_changes(request):
|
||||||
|
return url_for(
|
||||||
|
"requests.financial_verification", request_id=request.id, extended=True
|
||||||
|
)
|
||||||
|
elif Requests.is_pending_ccpo_acceptance(
|
||||||
|
request
|
||||||
|
) or Requests.is_pending_ccpo_approval(request):
|
||||||
|
return url_for("requests.view_pending_request", request_id=request.id)
|
||||||
|
else:
|
||||||
|
return url_for(
|
||||||
|
"requests.requests_form_update", screen=1, request_id=request.id
|
||||||
|
)
|
||||||
|
|
||||||
def _map_request(self, request, viewing_role):
|
def _map_request(self, request, viewing_role):
|
||||||
time_created = pendulum.instance(request.time_created)
|
time_created = pendulum.instance(request.time_created)
|
||||||
is_new = time_created.add(days=1) > pendulum.now()
|
is_new = time_created.add(days=1) > pendulum.now()
|
||||||
@ -65,21 +85,6 @@ class RequestsIndex(object):
|
|||||||
)
|
)
|
||||||
annual_usage = request.annual_spend
|
annual_usage = request.annual_spend
|
||||||
|
|
||||||
if viewing_role == "ccpo":
|
|
||||||
edit_link = url_for("requests.approval", request_id=request.id)
|
|
||||||
elif Requests.is_pending_financial_verification(request):
|
|
||||||
edit_link = url_for(
|
|
||||||
"requests.financial_verification", request_id=request.id
|
|
||||||
)
|
|
||||||
elif Requests.is_pending_ccpo_acceptance(
|
|
||||||
request
|
|
||||||
) or Requests.is_pending_ccpo_approval(request):
|
|
||||||
edit_link = url_for("requests.view_pending_request", request_id=request.id)
|
|
||||||
else:
|
|
||||||
edit_link = url_for(
|
|
||||||
"requests.requests_form_update", screen=1, request_id=request.id
|
|
||||||
)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"workspace_id": request.workspace.id if request.workspace else None,
|
"workspace_id": request.workspace.id if request.workspace else None,
|
||||||
"order_id": request.id,
|
"order_id": request.id,
|
||||||
@ -90,7 +95,7 @@ class RequestsIndex(object):
|
|||||||
"last_edited_timestamp": request.latest_revision.time_updated,
|
"last_edited_timestamp": request.latest_revision.time_updated,
|
||||||
"full_name": request.creator.full_name,
|
"full_name": request.creator.full_name,
|
||||||
"annual_usage": annual_usage,
|
"annual_usage": annual_usage,
|
||||||
"edit_link": edit_link,
|
"edit_link": self._edit_link_for_request(viewing_role, request),
|
||||||
"action_required": request.action_required_by == viewing_role,
|
"action_required": request.action_required_by == viewing_role,
|
||||||
"dod_component": request.latest_revision.dod_component,
|
"dod_component": request.latest_revision.dod_component,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user