feat: add scenarios list page with metrics and quick actions
Some checks failed
CI / test (push) Has been skipped
CI / build (push) Has been skipped
CI / lint (push) Failing after 15s
CI / deploy (push) Has been skipped

- Introduced a new template for listing scenarios associated with a project.
- Added metrics for total, active, draft, and archived scenarios.
- Implemented quick actions for creating new scenarios and reviewing project overview.
- Enhanced navigation with breadcrumbs for better user experience.

refactor: update Opex and Profitability templates for consistency

- Changed titles and button labels for clarity in Opex and Profitability templates.
- Updated form IDs and action URLs for better alignment with new naming conventions.
- Improved navigation links to include scenario and project overviews.

test: add integration tests for Opex calculations

- Created new tests for Opex calculation HTML and JSON flows.
- Validated successful calculations and ensured correct data persistence.
- Implemented tests for currency mismatch and unsupported frequency scenarios.

test: enhance project and scenario route tests

- Added tests to verify scenario list rendering and calculator shortcuts.
- Ensured scenario detail pages link back to the portfolio correctly.
- Validated project detail pages show associated scenarios accurately.
This commit is contained in:
2025-11-13 16:21:36 +01:00
parent 4f00bf0d3c
commit 522b1e4105
54 changed files with 3419 additions and 700 deletions

View File

@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% block title %}Initial Capex Planner · CalMiner{% endblock %}
{% block title %}Capex Planner · CalMiner{% endblock %}
{% block content %}
<nav class="breadcrumb">
@@ -10,17 +10,24 @@
{% if scenario %}
<a href="{{ url_for('scenarios.view_scenario', scenario_id=scenario.id) }}">{{ scenario.name }}</a>
{% endif %}
<span aria-current="page">Initial Capex Planner</span>
<span aria-current="page">Capex Planner</span>
</nav>
<header class="page-header">
<div>
<h1>Initial Capex Planner</h1>
<p class="text-muted">Capture upfront capital requirements and review categorized totals.</p>
<h1>Capex Planner</h1>
<p class="text-muted">Plan capital requirements for {{ scenario.name if scenario else 'this scenario' }}.</p>
</div>
<div class="header-actions">
{% if cancel_url %}
<a class="btn" href="{{ cancel_url }}">Cancel</a>
{% if scenario_url %}
<a class="btn" href="{{ scenario_url }}">Scenario Overview</a>
{% elif project_url %}
<a class="btn" href="{{ project_url }}">Project Overview</a>
{% elif cancel_url %}
<a class="btn" href="{{ cancel_url }}">Back</a>
{% endif %}
{% if scenario_portfolio_url %}
<a class="btn" href="{{ scenario_portfolio_url }}">Scenario Portfolio</a>
{% endif %}
<button class="btn primary" type="submit" form="capex-form">Save &amp; Calculate</button>
</div>
@@ -188,7 +195,7 @@
{% if result %}
<div class="report-grid">
<article class="report-card">
<h3>Total Initial Capex</h3>
<h3>Total Capex</h3>
<p class="metric">
<strong>{{ result.totals.overall | currency_display(result.currency) }}</strong>
</p>
@@ -249,7 +256,7 @@
</table>
{% endif %}
{% else %}
<p class="muted">Provide component details and calculate to see initial capex totals.</p>
<p class="muted">Provide component details and calculate to see capex totals.</p>
{% endif %}
</section>

View File

@@ -13,28 +13,36 @@
</nav>
<header class="page-header">
{% set profitability_href = url_for('calculations.profitability_form') %}
{% set processing_opex_href = url_for('calculations.processing_opex_form') %}
{% set profitability_href = '/calculations/profitability' %}
{% set opex_href = url_for('calculations.opex_form') %}
{% set capex_href = url_for('calculations.capex_form') %}
{% set scenario_list_href = url_for('scenarios.project_scenario_list', project_id=project.id) %}
{% if project and scenario %}
{% set profitability_href = profitability_href ~ '?project_id=' ~ project.id ~ '&scenario_id=' ~ scenario.id %}
{% set processing_opex_href = processing_opex_href ~ '?project_id=' ~ project.id ~ '&scenario_id=' ~ scenario.id %}
{% set profitability_href = url_for('calculations.profitability_form', project_id=project.id, scenario_id=scenario.id) %}
{% set opex_href = opex_href ~ '?project_id=' ~ project.id ~ '&scenario_id=' ~ scenario.id %}
{% set capex_href = capex_href ~ '?project_id=' ~ project.id ~ '&scenario_id=' ~ scenario.id %}
{% endif %}
<div>
<h1>{{ scenario.name }}</h1>
<p class="text-muted">Status: {{ scenario.status.value.title() }}</p>
<p class="text-muted">
Part of <a href="{{ url_for('projects.view_project', project_id=project.id) }}">{{ project.name }}</a>
</p>
</div>
<div class="header-actions">
<a class="btn" href="{{ url_for('projects.view_project', project_id=project.id) }}">Back to Project</a>
<a class="btn" href="{{ scenario_list_href }}">Scenario Portfolio</a>
<a class="btn" href="{{ profitability_href }}">Profitability Calculator</a>
<a class="btn" href="{{ processing_opex_href }}">Processing Opex Planner</a>
<a class="btn" href="{{ capex_href }}">Initial Capex Planner</a>
<a class="btn" href="{{ opex_href }}">Opex Planner</a>
<a class="btn" href="{{ capex_href }}">Capex Planner</a>
<a class="btn primary" href="{{ url_for('scenarios.edit_scenario_form', scenario_id=scenario.id) }}">Edit Scenario</a>
</div>
</header>
<section class="scenario-metrics">
<article class="metric-card">
<h2>Status</h2>
<p class="metric-value status-pill status-pill--{{ scenario.status.value }}">{{ scenario.status.value.title() }}</p>
<span class="metric-caption">Lifecycle state</span>
</article>
<article class="metric-card">
<h2>Financial Inputs</h2>
<p class="metric-value">{{ scenario_metrics.financial_count }}</p>
@@ -50,37 +58,54 @@
<p class="metric-value">{{ scenario_metrics.currency or '—' }}</p>
<span class="metric-caption">Financial reporting</span>
</article>
<article class="metric-card">
<h2>Primary Resource</h2>
<p class="metric-value">{{ scenario_metrics.primary_resource or '—' }}</p>
<span class="metric-caption">Scenario focus</span>
</article>
</section>
<div class="scenario-layout">
<section class="card">
<h2>Scenario Details</h2>
<dl class="definition-list">
<div>
<dt>Description</dt>
<dd>{{ scenario.description or 'No description provided.' }}</dd>
</div>
<div>
<dt>Timeline</dt>
<dd>
{{ scenario.start_date or '—' }} → {{ scenario.end_date or '—' }}
</dd>
</div>
<div>
<dt>Discount Rate</dt>
<dd>{{ scenario.discount_rate or '—' }}</dd>
</div>
<div>
<dt>Last Updated</dt>
<dd>{{ scenario.updated_at.strftime('%Y-%m-%d %H:%M') if scenario.updated_at else '—' }}</dd>
</div>
</dl>
</section>
<div class="scenario-column">
<section class="card">
<h2>Scenario Overview</h2>
<dl class="definition-list">
<div>
<dt>Description</dt>
<dd>{{ scenario.description or 'No description provided.' }}</dd>
</div>
<div>
<dt>Timeline</dt>
<dd>{{ scenario.start_date or '—' }} → {{ scenario.end_date or '—' }}</dd>
</div>
<div>
<dt>Discount Rate</dt>
<dd>{{ scenario.discount_rate or '—' }}</dd>
</div>
<div>
<dt>Primary Resource</dt>
<dd>{{ scenario_metrics.primary_resource or '—' }}</dd>
</div>
<div>
<dt>Last Updated</dt>
<dd>{{ scenario.updated_at.strftime('%Y-%m-%d %H:%M') if scenario.updated_at else '—' }}</dd>
</div>
</dl>
</section>
<section class="card quick-actions-card">
<h2>Next Steps</h2>
<ul class="quick-link-list">
<li>
<a href="{{ profitability_href }}">Run profitability analysis</a>
<p>Uses this scenarios assumptions as defaults.</p>
</li>
<li>
<a href="{{ scenario_list_href }}">Browse all project scenarios</a>
<p>Compare assumption sets and launch calculators in context.</p>
</li>
<li>
<a href="{{ url_for('scenarios.edit_scenario_form', scenario_id=scenario.id) }}">Update scenario assumptions</a>
<p>Adjust dates, status, or drivers before recalculations.</p>
</li>
</ul>
</section>
</div>
<section class="card">
<h2>Financial Inputs</h2>

View File

@@ -16,76 +16,133 @@
{% endif %}
</nav>
<header class="page-header">
<div>
<h1>{% if scenario %}Edit Scenario{% else %}Create Scenario{% endif %}</h1>
<p class="text-muted">Configure assumptions and metadata for this scenario.</p>
</div>
<div class="header-actions">
<a class="btn" href="{{ cancel_url }}">Cancel</a>
<button class="btn primary" type="submit">Save Scenario</button>
</div>
</header>
{% set error = error | default(None) %}
{% set error_field = error_field | default(None) %}
{% set currency_error = error if error_field == 'currency' else None %}
{% set name_error = error if error_field == 'name' else None %}
{% if error %}
{% if error and not error_field %}
<div class="alert alert-error">{{ error }}</div>
{% endif %}
<form class="form scenario-form" method="post" action="{{ form_action }}">
<div class="form-grid">
<div class="form-group">
<label for="name">Name</label>
<input id="name" name="name" type="text" required value="{{ scenario.name if scenario else '' }}" />
<header class="page-header">
<div>
<h1>{% if scenario %}Edit Scenario{% else %}Create Scenario{% endif %}</h1>
<p class="text-muted">Scenarios inherit pricing defaults from <strong>{{ project.name }}</strong>.</p>
</div>
<div class="header-actions">
<a class="btn" href="{{ cancel_url }}">Cancel</a>
<button class="btn primary" type="submit">Save Scenario</button>
</div>
</header>
<section class="card scenario-context-card">
<h2>Project Context</h2>
<p class="field-help">Defaults below come from project pricing. Leave optional fields blank to reuse shared assumptions.</p>
<dl class="definition-list">
<div>
<dt>Project</dt>
<dd><a href="{{ url_for('projects.view_project', project_id=project.id) }}">{{ project.name }}</a></dd>
</div>
<div>
<dt>Operation Type</dt>
<dd>{{ project.operation_type.value.replace('_', ' ') | title }}</dd>
</div>
<div>
<dt>Default Currency</dt>
<dd>{{ default_currency or 'Not configured' }}</dd>
</div>
</dl>
<ul class="scenario-defaults">
<li>
<strong>Status Guidance</strong>
<span>Draft scenarios remain internal; switch to Active once this represents your baseline, and Archive when retiring assumptions.</span>
</li>
<li>
<strong>Baseline Reminder</strong>
<span>Keep a single Active scenario to serve as the default baseline when launching profitability or planner workflows.</span>
</li>
<li>
<strong>Currency Tip</strong>
<span>If you leave currency empty, CalMiner applies the project default shown above.</span>
</li>
</ul>
</section>
<section class="card">
<h2>Scenario Overview</h2>
<div class="form-grid">
<div class="form-group{% if name_error %} form-group--error{% endif %}">
<label for="name">Name</label>
<input id="name" name="name" type="text" required value="{{ scenario.name if scenario else '' }}" {% if name_error %}aria-invalid="true"{% endif %} />
{% if name_error %}
<p class="field-error">{{ name_error }}</p>
{% else %}
<p class="field-help">Name must be unique within {{ project.name }}.</p>
{% endif %}
</div>
<div class="form-group">
<label for="status">Status</label>
<select id="status" name="status">
{% for value, label in scenario_statuses %}
<option value="{{ value }}" {% if scenario and scenario.status.value == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
<p class="field-help">Use Draft while iterating, set Active for your go-to baseline, and Archive to keep historical context.</p>
</div>
<div class="form-group{% if currency_error %} form-group--error{% endif %}">
<label for="currency">Currency</label>
{% set currency_prefill = scenario.currency if scenario and scenario.currency else default_currency %}
<input id="currency" name="currency" type="text" maxlength="3" value="{{ currency_prefill or '' }}" placeholder="{{ default_currency or '' }}" {% if currency_error %}aria-invalid="true"{% endif %} />
{% if currency_error %}
<p class="field-error">{{ currency_error }}</p>
{% else %}
<p class="field-help">Use a three-letter ISO code (e.g., USD). Defaults to {{ default_currency or 'the project currency' }}.</p>
{% endif %}
</div>
<div class="form-group">
<label for="primary_resource">Primary Resource</label>
<select id="primary_resource" name="primary_resource">
<option value=""></option>
{% for value, label in resource_types %}
<option value="{{ value }}" {% if scenario and scenario.primary_resource and scenario.primary_resource.value == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
<p class="field-help">Optional. Helps planners prioritise inputs tied to this commodity.</p>
</div>
</div>
</section>
<section class="card">
<h2>Assumptions & Timeline</h2>
<div class="form-grid">
<div class="form-group">
<label for="start_date">Start Date</label>
<input id="start_date" name="start_date" type="date" value="{{ scenario.start_date if scenario else '' }}" />
<p class="field-help">Optional. Use to align calculations with anticipated project kickoff.</p>
</div>
<div class="form-group">
<label for="end_date">End Date</label>
<input id="end_date" name="end_date" type="date" value="{{ scenario.end_date if scenario else '' }}" />
<p class="field-help">Optional. Leave blank for open-ended scenarios.</p>
</div>
<div class="form-group">
<label for="discount_rate">Discount Rate (%)</label>
<input id="discount_rate" name="discount_rate" type="number" step="0.01" value="{{ scenario.discount_rate if scenario else '' }}" />
<p class="field-help">Leave empty to reuse the project default during profitability calculations.</p>
</div>
</div>
<div class="form-group">
<label for="status">Status</label>
<select id="status" name="status">
{% for value, label in scenario_statuses %}
<option value="{{ value }}" {% if scenario and scenario.status.value == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
<label for="description">Description</label>
<textarea id="description" name="description" rows="5" placeholder="Describe the key drivers or differences for this scenario.">{{ scenario.description if scenario else '' }}</textarea>
<p class="field-help">Summarise what distinguishes this scenario for collaborators and future audits.</p>
</div>
<div class="form-group">
<label for="currency">Currency</label>
{% set currency_prefill = scenario.currency if scenario and scenario.currency else default_currency %}
<input id="currency" name="currency" type="text" maxlength="3" value="{{ currency_prefill or '' }}" placeholder="{{ default_currency or '' }}" />
{% if default_currency %}
<p class="field-help">Defaults to {{ default_currency }} when left blank.</p>
{% endif %}
</div>
<div class="form-group">
<label for="primary_resource">Primary Resource</label>
<select id="primary_resource" name="primary_resource">
<option value=""></option>
{% for value, label in resource_types %}
<option value="{{ value }}" {% if scenario and scenario.primary_resource and scenario.primary_resource.value == value %}selected{% endif %}>{{ label }}</option>
{% endfor %}
</select>
</div>
</div>
<div class="form-grid">
<div class="form-group">
<label for="start_date">Start Date</label>
<input id="start_date" name="start_date" type="date" value="{{ scenario.start_date if scenario else '' }}" />
</div>
<div class="form-group">
<label for="end_date">End Date</label>
<input id="end_date" name="end_date" type="date" value="{{ scenario.end_date if scenario else '' }}" />
</div>
<div class="form-group">
<label for="discount_rate">Discount Rate (%)</label>
<input id="discount_rate" name="discount_rate" type="number" step="0.01" value="{{ scenario.discount_rate if scenario else '' }}" />
</div>
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea id="description" name="description" rows="5">{{ scenario.description if scenario else '' }}</textarea>
</div>
</section>
<div class="form-actions">
<a class="btn" href="{{ cancel_url }}">Cancel</a>

View File

@@ -0,0 +1,142 @@
{% extends "base.html" %}
{% block title %}Scenarios · {{ project.name }} · CalMiner{% endblock %}
{% block head_extra %}
<link rel="stylesheet" href="/static/css/scenarios.css" />
{% endblock %}
{% block content %}
<nav class="breadcrumb">
<a href="{{ url_for('projects.project_list_page') }}">Projects</a>
<a href="{{ url_for('projects.view_project', project_id=project.id) }}">{{ project.name }}</a>
<span aria-current="page">Scenarios</span>
</nav>
<header class="page-header">
<div>
<h1>Scenarios</h1>
<p class="text-muted">Assumption sets and calculators for {{ project.name }}</p>
</div>
<div class="header-actions">
<a class="btn" href="{{ url_for('projects.view_project', project_id=project.id) }}">Project Overview</a>
<a class="btn primary" href="{{ url_for('scenarios.create_scenario_form', project_id=project.id) }}">New Scenario</a>
</div>
</header>
<section class="scenario-metrics">
<article class="metric-card">
<h2>Total Scenarios</h2>
<p class="metric-value">{{ scenario_totals.total }}</p>
<span class="metric-caption">Across this project</span>
</article>
<article class="metric-card">
<h2>Active</h2>
<p class="metric-value">{{ scenario_totals.active }}</p>
<span class="metric-caption">Currently live analyses</span>
</article>
<article class="metric-card">
<h2>Draft</h2>
<p class="metric-value">{{ scenario_totals.draft }}</p>
<span class="metric-caption">Awaiting validation</span>
</article>
<article class="metric-card">
<h2>Archived</h2>
<p class="metric-value">{{ scenario_totals.archived }}</p>
<span class="metric-caption">Historical references</span>
</article>
</section>
<div class="scenario-layout">
<div class="scenario-column">
<section class="card">
<h2>Project Context</h2>
<dl class="definition-list">
<div>
<dt>Project</dt>
<dd>{{ project.name }}</dd>
</div>
<div>
<dt>Operation Type</dt>
<dd>{{ project.operation_type.value.replace('_', ' ') | title }}</dd>
</div>
<div>
<dt>Location</dt>
<dd>{{ project.location or '—' }}</dd>
</div>
<div>
<dt>Latest Update</dt>
<dd>{{ scenario_totals.latest_update.strftime('%Y-%m-%d %H:%M') if scenario_totals.latest_update else '—' }}</dd>
</div>
</dl>
</section>
<section class="card quick-actions-card">
<h2>Quick Actions</h2>
<ul class="quick-link-list">
<li>
<a href="{{ url_for('scenarios.create_scenario_form', project_id=project.id) }}">Capture a new scenario</a>
<p>Add additional assumption sets for profitability planning.</p>
</li>
<li>
<a href="{{ url_for('projects.view_project', project_id=project.id) }}">Review project overview</a>
<p>Cross-check project metadata before running calculators.</p>
</li>
</ul>
</section>
</div>
<section class="card scenario-portfolio">
<header class="scenario-portfolio__header">
<div>
<h2>Scenario Portfolio</h2>
<p class="text-muted">Each scenario below inherits pricing defaults and links directly into calculators.</p>
</div>
<a class="btn" href="{{ url_for('scenarios.create_scenario_form', project_id=project.id) }}">Add Scenario</a>
</header>
{% if scenarios %}
<ul class="scenario-list">
{% for scenario in scenarios %}
{% set profitability_href = url_for('calculations.profitability_form', project_id=project.id, scenario_id=scenario.id) %}
{% set opex_href = url_for('calculations.opex_form') ~ '?project_id=' ~ project.id ~ '&scenario_id=' ~ scenario.id %}
{% set capex_href = url_for('calculations.capex_form') ~ '?project_id=' ~ project.id ~ '&scenario_id=' ~ scenario.id %}
<li class="scenario-item">
<div class="scenario-item__body">
<div class="scenario-item__header">
<h3><a href="{{ url_for('scenarios.view_scenario', scenario_id=scenario.id) }}">{{ scenario.name }}</a></h3>
<span class="status-pill status-pill--{{ scenario.status.value }}">{{ scenario.status.value.title() }}</span>
</div>
<dl class="scenario-item__meta">
<div>
<dt>Currency</dt>
<dd>{{ scenario.currency or '—' }}</dd>
</div>
<div>
<dt>Primary Resource</dt>
<dd>{{ scenario.primary_resource.value.replace('_', ' ') | title if scenario.primary_resource else '—' }}</dd>
</div>
<div>
<dt>Timeline</dt>
<dd>{{ scenario.start_date or '—' }} → {{ scenario.end_date or '—' }}</dd>
</div>
<div>
<dt>Updated</dt>
<dd>{{ (scenario.updated_at or scenario.created_at).strftime('%Y-%m-%d %H:%M') if scenario.updated_at or scenario.created_at else '—' }}</dd>
</div>
</dl>
</div>
<div class="scenario-item__actions">
<a class="btn btn-link" href="{{ url_for('scenarios.view_scenario', scenario_id=scenario.id) }}">View</a>
<a class="btn btn-link" href="{{ url_for('scenarios.edit_scenario_form', scenario_id=scenario.id) }}">Edit</a>
<a class="btn btn-link" href="{{ profitability_href }}">Profitability</a>
<a class="btn btn-link" href="{{ opex_href }}">Opex</a>
<a class="btn btn-link" href="{{ capex_href }}">Capex</a>
</div>
</li>
{% endfor %}
</ul>
{% else %}
<p class="empty-state">No scenarios yet. <a href="{{ url_for('scenarios.create_scenario_form', project_id=project.id) }}">Create the first scenario.</a></p>
{% endif %}
</section>
</div>
{% endblock %}

View File

@@ -1,5 +1,5 @@
{% extends "base.html" %}
{% block title %}Processing Opex Planner · CalMiner{% endblock %}
{% block title %}Opex Planner · CalMiner{% endblock %}
{% block content %}
<nav class="breadcrumb">
@@ -10,19 +10,26 @@
{% if scenario %}
<a href="{{ url_for('scenarios.view_scenario', scenario_id=scenario.id) }}">{{ scenario.name }}</a>
{% endif %}
<span aria-current="page">Processing Opex Planner</span>
<span aria-current="page">Opex Planner</span>
</nav>
<header class="page-header">
<div>
<h1>Processing Opex Planner</h1>
<h1>Opex Planner</h1>
<p class="text-muted">Capture recurring operational costs and review annual totals with escalation assumptions.</p>
</div>
<div class="header-actions">
{% if cancel_url %}
<a class="btn" href="{{ cancel_url }}">Cancel</a>
{% if scenario_url %}
<a class="btn" href="{{ scenario_url }}">Scenario Overview</a>
{% elif project_url %}
<a class="btn" href="{{ project_url }}">Project Overview</a>
{% elif cancel_url %}
<a class="btn" href="{{ cancel_url }}">Back</a>
{% endif %}
<button class="btn primary" type="submit" form="processing-opex-form">Save &amp; Calculate</button>
{% if scenario_portfolio_url %}
<a class="btn" href="{{ scenario_portfolio_url }}">Scenario Portfolio</a>
{% endif %}
<button class="btn primary" type="submit" form="opex-form">Save &amp; Calculate</button>
</div>
</header>
@@ -47,7 +54,7 @@
</div>
{% endif %}
<form id="processing-opex-form" class="form scenario-form" method="post" action="{{ form_action }}">
<form id="opex-form" class="form scenario-form" method="post" action="{{ form_action }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token or '' }}" />
<input type="hidden" name="options[persist]" value="{{ '1' if options and options.persist else '' }}" />

View File

@@ -19,8 +19,15 @@
<p class="text-muted">Evaluate revenue, costs, and key financial metrics for a scenario.</p>
</div>
<div class="header-actions">
{% if cancel_url %}
<a class="btn" href="{{ cancel_url }}">Cancel</a>
{% if scenario_url %}
<a class="btn" href="{{ scenario_url }}">Scenario Overview</a>
{% elif project_url %}
<a class="btn" href="{{ project_url }}">Project Overview</a>
{% elif cancel_url %}
<a class="btn" href="{{ cancel_url }}">Back</a>
{% endif %}
{% if scenario_portfolio_url %}
<a class="btn" href="{{ scenario_portfolio_url }}">Scenario Portfolio</a>
{% endif %}
<button class="btn primary" type="submit" form="profitability-form">Run Calculation</button>
</div>
@@ -104,8 +111,8 @@
<input id="smelting_charge" name="smelting_charge" type="number" min="0" step="0.01" value="{{ data.smelting_charge }}" />
</div>
<div class="form-group">
<label for="processing_opex">Processing Opex (per period)</label>
<input id="processing_opex" name="processing_opex" type="number" min="0" step="0.01" value="{{ data.processing_opex }}" />
<label for="opex">Opex (per period)</label>
<input id="opex" name="opex" type="number" min="0" step="0.01" value="{{ data.opex }}" />
</div>
</div>
</fieldset>
@@ -172,8 +179,8 @@
<legend>Capital &amp; Discounting</legend>
<div class="form-grid">
<div class="form-group">
<label for="initial_capex">Initial Capex</label>
<input id="initial_capex" name="initial_capex" type="number" min="0" step="0.01" value="{{ data.initial_capex }}" />
<label for="capex">Capex</label>
<input id="capex" name="capex" type="number" min="0" step="0.01" value="{{ data.capex }}" />
</div>
<div class="form-group">
<label for="sustaining_capex">Sustaining Capex (per period)</label>
@@ -261,16 +268,16 @@
<h3>Cost Breakdown</h3>
<ul class="metric-list">
<li>
<span>Processing Opex</span>
<strong>{{ result.costs.processing_opex_total | currency_display(result.currency) }}</strong>
<span>Opex</span>
<strong>{{ result.costs.opex_total | currency_display(result.currency) }}</strong>
</li>
<li>
<span>Sustaining Capex</span>
<strong>{{ result.costs.sustaining_capex_total | currency_display(result.currency) }}</strong>
</li>
<li>
<span>Initial Capex</span>
<strong>{{ result.costs.initial_capex | currency_display(result.currency) }}</strong>
<span>Capex</span>
<strong>{{ result.costs.capex | currency_display(result.currency) }}</strong>
</li>
</ul>
</article>
@@ -304,7 +311,7 @@
<tr>
<th scope="col">Period</th>
<th scope="col">Revenue</th>
<th scope="col">Processing Opex</th>
<th scope="col">Opex</th>
<th scope="col">Sustaining Capex</th>
<th scope="col">Net Cash Flow</th>
</tr>
@@ -314,7 +321,7 @@
<tr>
<th scope="row">{{ entry.period }}</th>
<td>{{ entry.revenue | currency_display(result.currency) }}</td>
<td>{{ entry.processing_opex | currency_display(result.currency) }}</td>
<td>{{ entry.opex | currency_display(result.currency) }}</td>
<td>{{ entry.sustaining_capex | currency_display(result.currency) }}</td>
<td>{{ entry.net | currency_display(result.currency) }}</td>
</tr>