{% extends "base.html" %} {% block title %}Contract Detail - ICDEV™{% endblock %} {% block content %} {% from "includes/classification_macros.html" import design_classification_banner %} {{ design_classification_banner(contract) }}
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

Milestones

{% for m in milestones %} {% else %} {% endfor %}
# Milestone WBS Baseline Forecast Actual Status SPI Variance
{{ loop.index }} {{ m.title or '---' }} {% if m.description %}
{{ m.description[:80] }}{% endif %}
{{ m.wbs_number or '---' }} {{ m.baseline_date or '---' }} {{ m.forecast_date or m.baseline_date or '---' }} {{ m.actual_date or '---' }} {% set ms_colors = {'pending': 'info', 'in_progress': 'warning', 'complete': 'success', 'missed': 'error', 'on_hold': 'warning'} %} {{ (m.status or 'pending') | replace('_', ' ') | title }} {% if m.evm_spi is not none and m.evm_spi %} {% set spi_color = 'text-danger' if m.evm_spi < 0.9 else ('text-warning' if m.evm_spi < 1.0 else '') %} {{ m.evm_spi | round(2) }} {% else %} --- {% endif %} {% set fd = m.forecast_date or m.baseline_date %} {% set bd = m.baseline_date %} {% if fd and bd %} {% if fd > bd %} Late {% elif fd < bd %} Early {% else %} On Track {% endif %} {% else %} --- {% endif %}
No milestones defined.
{% if milestones | length > 0 %}
Milestone Schedule (Gantt-Lite)
◆ Baseline   ◯ Forecast   ● Actual   | Today
{% endif %}
{% 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.

Contract Modifications

Loading...
{% set rm = risk_matrix | default({}) %} {% set rms = rm.summary | default({}) %}
{{ rms.total | default(0) }}
Total Risks
{{ rms.open | default(0) }}
Open
{{ rms.critical | default(0) }}
Critical
{{ rms.high | default(0) }}
High
5×5 Risk Matrix (Probability × Impact)
{% set rmatrix = rm.matrix | default({}) %} {% set exposure_colors = {1: '#1e3a2f', 2: '#1e3a2f', 3: '#1e3a2f', 4: '#1e3a2f', 5: '#1e3a2f', 6: '#3a3010', 7: '#3a3010', 8: '#3a3010', 9: '#3a3010', 10: '#3a3010', 11: '#3a1e0f', 12: '#3a1e0f', 13: '#3a1e0f', 14: '#3a1e0f', 15: '#3a1e0f', 16: '#3a1020', 17: '#3a1020', 18: '#3a1020', 19: '#3a1020', 20: '#3a1020', 21: '#3a1020', 22: '#3a1020', 23: '#3a1020', 24: '#3a1020', 25: '#3a1020'} %}
Prob ▲
{% for imp in range(1, 6) %}
Impact {{ imp }}
{% endfor %}
{% for prob in range(5, 0, -1) %}
P={{ prob }}
{% for imp in range(1, 6) %} {% set exp = prob * imp %} {% set cell_items = rmatrix.get(prob|string, {}).get(imp|string, []) if rmatrix else [] %} {% set exp_class = 'exposure-critical' if exp >= 16 else ('exposure-high' if exp >= 11 else ('exposure-medium' if exp >= 6 else 'exposure-low')) %}
{{ exp }}
{% if cell_items|length > 0 %}
{{ cell_items|length }}
{% endif %}
{% endfor %}
{% endfor %}
Low (1–5) Medium (6–10) High (11–15) Critical (16–25)

Risk Register

{% for r in risks %} {% set exp = r.exposure | default(r.probability * r.impact) %} {% set exp_badge = 'badge-error' if exp >= 16 else ('badge-warning' if exp >= 11 else ('badge-warning' if exp >= 6 else 'badge-success')) %} {% else %} {% endfor %}
# Title Category P I Exposure Status Owner Linked Milestone Mitigation
{{ loop.index }} {{ r.title or '---' }} {% set cat_colors = {'cost': 'warning', 'schedule': 'warning', 'technical': 'info', 'cyber': 'error', 'supply_chain': 'warning', 'compliance': 'error', 'staffing': 'info', 'other': 'info'} %} {{ (r.category or 'other') | replace('_', ' ') | title }} {{ r.probability | default(3) }} {{ r.impact | default(3) }} {{ exp }} {% set st_colors = {'open': 'error', 'mitigating': 'warning', 'accepted': 'warning', 'closed': 'success', 'transferred': 'info'} %} {{ (r.status or 'open') | replace('_', ' ') | title }} {{ r.owner or '---' }} {% if r.milestone_title %} {{ r.milestone_title[:40] }} {% else %} {% endif %} {% if r.mitigation %}{{ r.mitigation[:80] }}{% if r.mitigation|length > 80 %}…{% endif %}{% else %}—{% endif %}
No risks registered for this contract.
{% endblock %}