{% extends "base.html" %} {% block title %}Contract Detail - ICDEV™{% endblock %} {% block content %}
Contract #
{{ contract.contract_number }}
Agency
{{ contract.agency or '---' }}
Type
{% set type_colors = {'FFP': 'success', 'T&M': 'warning', 'CPFF': 'info', 'CPIF': 'info', 'IDIQ': 'warning'} %} {{ contract.contract_type or '---' }}
Status
{% set status_colors = {'active': 'success', 'awarded': 'success', 'pending': 'warning', 'closeout': 'warning', 'closed': 'info', 'terminated': 'error'} %} {{ (contract.status or 'unknown') | replace('_', ' ') | title }}
POP Start
{{ contract.pop_start or '---' }}
POP End
{{ contract.pop_end or '---' }}
COR Name
{{ contract.cor_name or '---' }}
COR Email
{{ contract.cor_email or '---' }}
NAICS
{{ contract.naics_code or '---' }}
Total Value
{% if contract.total_value %}${{ contract.total_value|round(0)|int|string }}{% else %}---{% endif %}
Funded Value
{% if contract.funded_value %}${{ contract.funded_value|round(0)|int|string }}{% else %}---{% endif %}
Ceiling Value
{% if contract.ceiling_value %}${{ contract.ceiling_value|round(0)|int|string }}{% else %}---{% endif %}
Funding Status
{% set funded = contract.funded_value or 0 %} {% set total = contract.total_value or 1 %} {% set fund_pct = ((funded / total) * 100)|round(1) if total > 0 else 0 %} {% set gauge_color = '#28a745' if fund_pct >= 75 else ('#ffc107' if fund_pct >= 50 else '#dc3545') %}
${{ funded|round(0)|int }} / ${{ total|round(0)|int }} ({{ fund_pct }}%)
{{ clins|length }}
CLINs
{{ wbs_elements|length }}
WBS Elements
{{ deliverables|length }} {% set overdue_count = deliverables|selectattr('days_overdue', 'defined')|selectattr('days_overdue', 'gt', 0)|list|length %} {% if overdue_count > 0 %} ({{ overdue_count }} overdue) {% endif %}
Deliverables
{{ subcontractors|length }}
Subcontractors
Contract Status Timeline
{% set statuses = ['awarded', 'active', 'closeout', 'closed'] %} {% set current_status = contract.status or 'active' %} {% set current_idx = statuses.index(current_status) if current_status in statuses else 1 %}
{% for s in statuses %} {% if not loop.first %}
{% endif %}
{{ s|title }}
{% endfor %}
{% for clin in clins %} {% else %} {% endfor %}
CLIN # Description Type Total Value Funded Billed Remaining
{{ clin.clin_number }} {{ clin.description or '---' }} {{ clin.type or '---' }} {% if clin.total_value %}${{ clin.total_value|round(0)|int }}{% else %}---{% endif %} {% if clin.funded_value is defined %}${{ clin.funded_value|round(0)|int }}{% else %}---{% endif %} {% if clin.billed_value is defined %}${{ clin.billed_value|round(0)|int }}{% else %}---{% endif %} {% if clin.total_value is defined and clin.billed_value is defined %} {% set remaining = (clin.total_value or 0) - (clin.billed_value or 0) %} ${{ remaining|round(0)|int }} {% else %} --- {% endif %}
No CLINs defined.
{% for wbs in wbs_elements %} {% else %} {% endfor %}
WBS # Title Level BAC % Complete CPI SPI
{{ wbs.wbs_number }} {{ wbs.title or '---' }} --- {% if wbs.budget_at_completion %}${{ wbs.budget_at_completion|round(0)|int }}{% else %}---{% endif %} {% if wbs.percent_complete is not none %}{{ wbs.percent_complete|round(1) }}%{% else %}---{% endif %} {% set wbs_ev = wbs.ev_cumulative or 0 %} {% set wbs_ac = wbs.ac_cumulative or 0 %} {% if wbs_ac > 0 %} {% set wbs_cpi = wbs_ev / wbs_ac %} {% set cpi_color = 'text-danger' if wbs_cpi < 0.9 else ('text-warning' if wbs_cpi < 1.0 else '') %} {{ wbs_cpi|round(2) }} {% else %} --- {% endif %} {% set wbs_pv = wbs.pv_cumulative or 0 %} {% if wbs_pv > 0 %} {% set wbs_spi = wbs_ev / wbs_pv %} {% set spi_color = 'text-danger' if wbs_spi < 0.9 else ('text-warning' if wbs_spi < 1.0 else '') %} {{ wbs_spi|round(2) }} {% else %} --- {% endif %}
No WBS elements defined.
{% for d in deliverables %} {% else %} {% endfor %}
CDRL # Title Type Due Date Status Days Overdue Generated By
{{ d.cdrl_number or '---' }} {{ d.title or '---' }} {{ d.type or '---' }} {{ d.due_date or '---' }} {% set del_colors = {'not_started': 'info', 'in_progress': 'warning', 'draft': 'warning', 'in_review': 'warning', 'submitted': 'success', 'accepted': 'success', 'rejected': 'error', 'overdue': 'error'} %} {{ (d.status or 'unknown') | replace('_', ' ') | title }} {% if d.days_overdue is defined and d.days_overdue > 0 %} {{ d.days_overdue }} {% else %} --- {% endif %} {{ d.generated_by_tool or '---' }}
No deliverables defined.
{% if deliverables|length > 0 %}
Deliverable Status Pipeline
{% set pipeline_statuses = ['not_started', 'in_progress', 'draft', 'in_review', 'submitted', 'accepted'] %} {% for d in deliverables[:5] %} {% set d_status = d.status or 'not_started' %} {% set d_idx = pipeline_statuses.index(d_status) if d_status in pipeline_statuses else 0 %}
{{ d.cdrl_number or d.title }}
{% for ps in pipeline_statuses %} {% if not loop.first %}
{% endif %}
{% endfor %}
{% endfor %}
{% endif %}
{% set cpi_val = evm.cpi if evm.cpi is defined else 0 %} {% set cpi_color = '#dc3545' if cpi_val < 0.9 else ('#ffc107' if cpi_val < 1.0 else '#28a745') %}
{{ evm.cpi|round(2) if evm.cpi is defined else '---' }}
CPI
{% set spi_val = evm.spi if evm.spi is defined else 0 %} {% set spi_color = '#dc3545' if spi_val < 0.9 else ('#ffc107' if spi_val < 1.0 else '#28a745') %}
{{ evm.spi|round(2) if evm.spi is defined else '---' }}
SPI
{% if evm.eac is defined %}${{ evm.eac|round(0)|int }}{% else %}---{% endif %}
EAC
{% if evm.etc is defined %}${{ evm.etc|round(0)|int }}{% else %}---{% endif %}
ETC
{% set vac_val = evm.vac if evm.vac is defined else 0 %} {% set vac_color = '#dc3545' if vac_val < 0 else '#28a745' %}
{% if evm.vac is defined %}${{ evm.vac|round(0)|int }}{% else %}---{% endif %}
VAC
{% set tcpi_val = evm.tcpi if evm.tcpi is defined else 0 %} {% set tcpi_color = '#dc3545' if tcpi_val > 1.1 else ('#ffc107' if tcpi_val > 1.0 else '#28a745') %}
{{ evm.tcpi|round(2) if evm.tcpi is defined else '---' }}
TCPI
Earned Value S-Curve
S-curve chart will render here
{% for sub in subcontractors %} {% else %} {% endfor %}
Company CAGE UEI Size Value Performance Rating Flow-down Cyber Compliant
{{ sub.company_name or '---' }} {{ sub.cage_code or '---' }} {{ sub.uei or '---' }} {% set size_colors = {'small': 'success', 'large': 'info', 'small_disadvantaged': 'warning', 'wosb': 'warning', 'hubzone': 'warning', 'sdvosb': 'warning'} %} {{ (sub.business_size or '---') | replace('_', ' ') | title }} {% if sub.subcontract_value is defined %}${{ sub.subcontract_value|round(0)|int }}{% else %}---{% endif %} {% if sub.performance_rating is defined %} {% set perf_colors = {'exceptional': 'success', 'very_good': 'success', 'satisfactory': 'info', 'marginal': 'warning', 'unsatisfactory': 'error'} %} {{ (sub.performance_rating or '---') | replace('_', ' ') | title }} {% else %} --- {% endif %} {% if sub.flow_down_complete %} Complete {% else %} Incomplete {% endif %} {% if sub.cybersecurity_compliant %} Yes {% else %} No {% endif %}
No subcontractors defined.
{% if cpars_prediction %}
Current CPARS Prediction
{% set rating_colors = {'exceptional': '#28a745', 'very_good': '#28a745', 'satisfactory': '#4a90d9', 'marginal': '#ffc107', 'unsatisfactory': '#dc3545'} %} {% set pred_rating = cpars_prediction.predicted_rating or 'satisfactory' %}
{{ pred_rating | replace('_', ' ') | title }}
Predicted Overall Rating
{% set dimensions = cpars_prediction.dimensions or {} %} {% for dim_name in ['quality', 'schedule', 'cost', 'management', 'small_business'] %} {% set dim_score = dimensions.get(dim_name, 0) %} {% set dim_pct = (dim_score / 5 * 100)|round(0)|int if dim_score is not none else 0 %} {% set dim_color = '#dc3545' if dim_score < 2 else ('#ffc107' if dim_score < 3 else ('#4a90d9' if dim_score < 4 else '#28a745')) %}
{{ dim_name | replace('_', ' ') | title }}
{{ dim_score|round(1) if dim_score is not none else '---' }}
{% endfor %}
{% endif %}

Assessment History

{% for a in cpars_assessments %} {% else %} {% endfor %}
Period Quality Schedule Cost Management Small Business Overall Status
{{ a.period_start or '---' }} — {{ a.period_end or '' }} {% set q_colors = {'exceptional': 'success', 'very_good': 'success', 'satisfactory': 'info', 'marginal': 'warning', 'unsatisfactory': 'error'} %} {{ (a.quality_rating or '---') | replace('_', ' ') | title }} {{ (a.schedule_rating or '---') | replace('_', ' ') | title }} {{ (a.cost_rating or '---') | replace('_', ' ') | title }} {{ (a.management_rating or '---') | replace('_', ' ') | title }} {{ (a.small_business_rating or '---') | replace('_', ' ') | title }} {{ (a.overall_rating or '---') | replace('_', ' ') | title }} {% set as_colors = {'draft': 'warning', 'submitted': 'info', 'acknowledged': 'success', 'contested': 'error', 'final': 'success'} %} {{ (a.status or '---') | replace('_', ' ') | title }}
No CPARS assessments recorded.
{% endblock %}