diff --git a/hub/services/static/css/roi-calculator.css b/hub/services/static/css/roi-calculator.css
index d441efe..d93efa5 100644
--- a/hub/services/static/css/roi-calculator.css
+++ b/hub/services/static/css/roi-calculator.css
@@ -495,4 +495,80 @@
.table th, .table td {
padding: 0.5rem 0.25rem;
}
+}
+
+/* Monthly Breakdown Filter Controls */
+.breakdown-filters {
+ background: #f8f9fa;
+ border-radius: 6px;
+ padding: 1rem;
+ margin-bottom: 1rem;
+}
+
+.breakdown-filters .form-check {
+ margin-bottom: 0.25rem;
+}
+
+.breakdown-filters .form-check-input:checked {
+ background-color: #0d6efd;
+ border-color: #0d6efd;
+}
+
+.breakdown-filters .form-check-label {
+ cursor: pointer;
+ user-select: none;
+ font-size: 0.875rem;
+}
+
+/* Responsive breakdown filters */
+@media (max-width: 768px) {
+ .breakdown-filters {
+ padding: 0.75rem;
+ }
+
+ .breakdown-filters .d-flex {
+ flex-direction: column;
+ gap: 0.5rem !important;
+ }
+}
+
+/* Enhanced sticky header for monthly breakdown table */
+.table-responsive {
+ position: relative;
+}
+
+.table-responsive .sticky-top {
+ position: sticky;
+ top: 0;
+ z-index: 10;
+ background-color: #212529 !important; /* Ensure dark background stays */
+}
+
+.table-responsive .sticky-top th {
+ background-color: #212529 !important;
+ border-color: #454d55 !important;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.1);
+}
+
+/* Ensure sticky header works in scrollable containers */
+.table-responsive[style*="max-height"] .sticky-top {
+ position: sticky;
+ top: 0;
+ z-index: 20;
+}
+
+/* Additional styling for better visibility */
+.table-dark th {
+ font-weight: 600;
+ font-size: 0.875rem;
+ white-space: nowrap;
+ text-align: center;
+}
+
+.table-dark th:first-child {
+ text-align: center;
+}
+
+.table-dark th:nth-child(n+4) {
+ text-align: right;
}
\ No newline at end of file
diff --git a/hub/services/static/js/roi-calculator/roi-calculator-app.js b/hub/services/static/js/roi-calculator/roi-calculator-app.js
index 6c40b18..ba5281b 100644
--- a/hub/services/static/js/roi-calculator/roi-calculator-app.js
+++ b/hub/services/static/js/roi-calculator/roi-calculator-app.js
@@ -402,6 +402,16 @@ class ROICalculatorApp {
// toggleInvestmentModel removed - both models are now calculated simultaneously
+ updateMonthlyBreakdownFilters() {
+ try {
+ if (this.uiManager) {
+ this.uiManager.updateMonthlyBreakdown();
+ }
+ } catch (error) {
+ console.error('Error updating monthly breakdown filters:', error);
+ }
+ }
+
logout() {
if (!confirm('Are you sure you want to logout?')) {
return;
diff --git a/hub/services/static/js/roi-calculator/ui-manager.js b/hub/services/static/js/roi-calculator/ui-manager.js
index c31493c..cb0943e 100644
--- a/hub/services/static/js/roi-calculator/ui-manager.js
+++ b/hub/services/static/js/roi-calculator/ui-manager.js
@@ -131,12 +131,21 @@ class UIManager {
tbody.innerHTML = '';
+ // Get filter settings
+ const filters = this.getMonthlyBreakdownFilters();
+
// Combine all monthly data and sort by month, then scenario, then model
const allData = [];
Object.keys(this.calculator.monthlyData).forEach(resultKey => {
this.calculator.monthlyData[resultKey].forEach(monthData => {
const model = resultKey.includes('_loan') ? 'loan' : 'direct';
const scenario = resultKey.replace('_direct', '').replace('_loan', '');
+
+ // Apply filters
+ if (!filters.models[model] || !filters.scenarios[scenario.toLowerCase()]) {
+ return; // Skip this entry if filtered out
+ }
+
allData.push({
...monthData,
model: model,
@@ -176,6 +185,7 @@ class UIManager {
${data.totalInstances ? data.totalInstances.toLocaleString() : '0'} |
${this.formatCurrencyDetailed(data.monthlyRevenue || 0)} |
${this.formatCurrencyDetailed(data.cspRevenue || 0)} |
+ ${this.formatCurrencyDetailed(data.servalaRevenue || 0)} |
${this.formatCurrencyDetailed(data.netPosition || 0)} |
`;
});
@@ -253,4 +263,27 @@ class UIManager {
default: return '#6c757d';
}
}
+
+ getMonthlyBreakdownFilters() {
+ try {
+ return {
+ models: {
+ direct: document.getElementById('breakdown-direct-enabled')?.checked ?? true,
+ loan: document.getElementById('breakdown-loan-enabled')?.checked ?? true
+ },
+ scenarios: {
+ conservative: document.getElementById('breakdown-conservative-enabled')?.checked ?? true,
+ moderate: document.getElementById('breakdown-moderate-enabled')?.checked ?? true,
+ aggressive: document.getElementById('breakdown-aggressive-enabled')?.checked ?? true
+ }
+ };
+ } catch (error) {
+ console.error('Error getting monthly breakdown filters:', error);
+ // Return default filters if there's an error
+ return {
+ models: { direct: true, loan: true },
+ scenarios: { conservative: true, moderate: true, aggressive: true }
+ };
+ }
+ }
}
\ No newline at end of file
diff --git a/hub/services/templates/calculator/csp_roi_calculator.html b/hub/services/templates/calculator/csp_roi_calculator.html
index 7e56dd1..cc79b4c 100644
--- a/hub/services/templates/calculator/csp_roi_calculator.html
+++ b/hub/services/templates/calculator/csp_roi_calculator.html
@@ -36,6 +36,7 @@ function updateScenarioChurn(scenarioKey, churnRate) { window.ROICalculatorApp?.
function updateScenarioPhase(scenarioKey, phaseIndex, newInstancesPerMonth) { window.ROICalculatorApp?.updateScenarioPhase(scenarioKey, phaseIndex, newInstancesPerMonth); }
function resetAdvancedParameters() { window.ROICalculatorApp?.resetAdvancedParameters(); }
function toggleScenario(scenarioKey) { window.ROICalculatorApp?.toggleScenario(scenarioKey); }
+function updateMonthlyBreakdownFilters() { window.ROICalculatorApp?.updateMonthlyBreakdownFilters(); }
function toggleCollapsible(elementId) { window.ROICalculatorApp?.toggleCollapsible(elementId); }
function resetCalculator() { window.ROICalculatorApp?.resetCalculator(); }
// toggleInvestmentModel function removed - both models calculated simultaneously
@@ -392,12 +393,49 @@ document.addEventListener('DOMContentLoaded', function() {
Monthly Financial Breakdown
-
-
-
- This table shows month-by-month progression for all enabled scenarios and both investment models.
- Use the scenario checkboxes above to filter results.
-
+
+
+
@@ -409,6 +447,7 @@ document.addEventListener('DOMContentLoaded', function() {
| Instances |
Monthly Revenue |
Your Share |
+ Servala Share |
Cumulative Net Position |
diff --git a/hub/services/templates/calculator/roi_calculator_help.html b/hub/services/templates/calculator/roi_calculator_help.html
index e79ccec..4544cd3 100644
--- a/hub/services/templates/calculator/roi_calculator_help.html
+++ b/hub/services/templates/calculator/roi_calculator_help.html
@@ -133,13 +133,13 @@ html {
Overview
-
The ROI Calculator helps you analyze potential returns from partnering with Servala through two distinct investment models:
+
The ROI Calculator provides simultaneous comparison of both investment models, showing real-time results for each scenario. You can instantly see how both models perform without switching between them.
Loan Model
-
3-7% Annual Returns
+
3-8% Annual Returns
Fixed interest lending with guaranteed monthly payments. Low risk, predictable returns.
@@ -160,21 +160,21 @@ html {
How It Works
You lend capital to Servala at a fixed interest rate, receiving guaranteed monthly payments regardless of business performance.
-
Key Features:
+
Key Features
- Investment Range: CHF 100,000 - CHF 2,000,000
- - Interest Rates: Typically 3-7% annually
+ - Interest Rates: 3-8% annually
- Payment Schedule: Fixed monthly payments
- Risk Level: Very low - contractually guaranteed
- Break-even: Typically 12-18 months
-
Payment Calculation:
+
Payment Calculation
Monthly payments use standard amortization:
Monthly Payment = P × [r(1+r)^n] / [(1+r)^n - 1]
Where P = Principal, r = Monthly rate, n = Total payments
-
Best For:
+
Best For
- CSPs prioritizing predictable, guaranteed returns
- Limited capacity for active sales involvement
@@ -190,7 +190,7 @@ html {
How It Works
Invest directly in Servala's operations and earn returns through revenue sharing that scales with performance and investment size.
- Progressive Scaling Benefits:
+ Progressive Scaling Benefits
@@ -224,7 +224,7 @@ html {
- Grace Period Benefits:
+ Grace Period Benefits
Larger investments get longer periods of 100% revenue retention:
- CHF 500,000: 6 months grace period
@@ -232,10 +232,19 @@ html {
- CHF 2,000,000: 12 months grace period
- Performance Bonuses:
- CSPs exceeding 110% of baseline performance receive up to 15% additional revenue share.
+ Performance Bonuses
+ CSPs exceeding 110% of baseline performance receive up to 15% additional revenue share. This is automatically calculated based on your actual vs. expected instance growth.
+
+ Performance Multiplier (Automatic)
+ This metric shows how your actual performance compares to baseline expectations:
+
+ - 1.0x: Meeting baseline expectations
+ - 1.5x: 50% better than baseline (triggers performance bonuses)
+ - 2.0x: Double the baseline performance
+
+ This is calculated automatically based on your investment scaling and cannot be manually configured.
- Best For:
+ Best For
- CSPs wanting to maximize return potential
- Ability to actively promote managed services
@@ -284,24 +293,44 @@ html {
Using the Calculator
-
Key Parameters:
+
Key Parameters
-
Investment Settings:
+
Primary Settings
- - Investment Amount: CHF 100K - 2M
+ - Initial Investment: CHF 100K - 2M (with slider)
- Timeframe: 1-5 years
- - Investment Model: Loan vs Direct
- - Revenue/Instance: Monthly income per managed service
+ - Revenue/Instance: Monthly income per managed service (CHF 20-200)
+ - Growth Scenarios: Conservative, Moderate, Aggressive
-
Advanced Controls:
+
Advanced Controls (Optional)
- - Loan Rate: Annual interest (3-8%)
- - Servala Share: Revenue split percentage
- - Grace Period: 100% revenue retention period
- - Churn Rates: Customer loss percentages
+ - Loan Rate: Annual interest (3-8%) - affects loan model calculations
+ - Servala Share: Revenue split percentage (10-40%) for direct investment
+ - Grace Period: 100% revenue retention period (0-24 months, direct investment)
+ - Churn Rates: Customer loss percentages by scenario (0-15%)
+
+
+
+
+
Understanding the Results
+
+
+
Real-time Metrics
+
+ - Net Position: Your profit after subtracting initial investment
+ - ROI Percentage: Return on investment as a percentage
+ - Performance Multiplier: How actual results compare to baseline (automatic)
+
+
+
+
Detailed Analysis
+
+ - Scenario Comparison: See results for all enabled growth scenarios
+ - Model Distinction: Clear separation between Loan and Direct investment results
+ - Monthly Breakdown: Month-by-month financial progression
@@ -356,16 +385,25 @@ html {
Understanding the Charts
1. ROI Progression Over Time
-
Shows when your investment becomes profitable (crosses zero line) and how returns develop month by month.
+
Shows when your investment becomes profitable (crosses zero line) and how returns develop month by month. Both models are shown with solid lines for Direct Investment and dashed lines for Loan Model.
-
2. Net Financial Position
-
Your cumulative profit/loss over time. Above zero = profitable, below zero = still recovering initial investment.
+
2. Net Financial Position (Break-Even Analysis)
+
Your cumulative profit/loss over time. Above zero = profitable, below zero = still recovering initial investment. Both models displayed with different styling to distinguish between them.
-
3. Performance Comparison
-
ROI percentages across different growth scenarios, helping you understand best and worst-case outcomes.
+
3. Performance Comparison (ROI %)
+
ROI percentages across different growth scenarios, helping you understand best and worst-case outcomes. Shows both models side-by-side for each scenario.
-
4. Investment Model Comparison
-
Direct comparison of total returns between loan and direct investment models for your specific parameters.
+
4. Investment Model Comparison (Net Profit)
+
Direct comparison of total net profit between loan and direct investment models across all scenarios. Makes it easy to see which model performs better in each growth scenario.
+
+
Chart Legend
+
+ - Solid Lines/Bars: Direct Investment Model
+ - Dashed Lines/Different Color: Loan Model
+ - Green: Conservative Scenario
+ - Yellow: Moderate Scenario
+ - Red: Aggressive Scenario
+
@@ -376,9 +414,15 @@ html {
Your final financial position: total CSP revenue minus your initial investment. Positive values indicate profitable investment.
How are performance bonuses calculated?
- Bonuses apply when you exceed 110% of baseline instance growth, providing up to 15% additional revenue share.
+ Bonuses apply when you exceed 110% of baseline instance growth, providing up to 15% additional revenue share. The system automatically tracks your performance multiplier (actual vs. baseline instances) and applies bonuses accordingly.
+
+ What is the Performance Multiplier?
+ The Performance Multiplier is an automatically calculated metric showing how your actual results compare to baseline expectations. For example, 1.5x means you're performing 50% better than the baseline scenario. This cannot be manually configured - it's calculated based on your investment scaling factors.
- Can I switch between models?
+ Do I need to choose between models?
+ No! The calculator now shows both models simultaneously, so you can compare them in real-time. You can see exactly how each model performs under different scenarios without switching between them.
+
+ Can I change my investment model after starting?
Model changes require mutual agreement and may involve restructuring. Generally evaluated at renewal periods.
What happens during the grace period?