- ROI payback now returns raw months; template branches to 'moins d'un mois'
for sub-month paybacks and 'Payable dès la première année' when savings≤0
(was rounding up to 'Payback : 1 mois' for ~95% of slider combos)
- Cap sliders: users 1..25 (was 50), hours 0.5..4 (was 8) to keep displayed
savings in a defensible band (~8.8 M$/yr max instead of 35 M$)
- pricing_card href uses cta_url.rstrip('/') to avoid double-slash if caller
passes a trailing slash (preempts A-2.8 / B-2.7 regression)
- aria-live polite + aria-atomic on the savings paragraph so screen readers
announce slider updates
- Cleaner JS module pattern: single window.roiCalculator = function() {...}
- Tests updated for payback ternary; new tests for slider caps, aria-live,
and double-slash guard
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
22 lines
687 B
JavaScript
22 lines
687 B
JavaScript
// ROI calculator for DictIA pricing section.
|
||
// Hypotheses transparentes (cf. footnote dans landing.html) :
|
||
// - 80% du temps de transcription manuelle est économisé
|
||
// - 220 jours ouvrables/an
|
||
// - Coût annuel comparé = DictIA 16 = 5 750 $ + (201 $ × 12) = 8 162 $
|
||
window.roiCalculator = function roiCalculator() {
|
||
return {
|
||
users: 5,
|
||
hours: 2,
|
||
rate: 200,
|
||
get savings() {
|
||
const hoursSaved = this.users * this.hours * 0.8 * 220;
|
||
return Math.round(hoursSaved * this.rate);
|
||
},
|
||
get payback() {
|
||
const annualCost = 5750 + (201 * 12);
|
||
if (this.savings <= 0) return null;
|
||
return (annualCost / this.savings) * 12;
|
||
}
|
||
};
|
||
};
|