import React, { useState } from "react";
import { Card, CardContent } from "@/components/ui/card";
import { Input } from "@/components/ui/input";
import { Button } from "@/components/ui/button";
export default function EfficiencyCalculator() {
const [omzet, setOmzet] = useState("");
const [winst, setWinst] = useState("");
const [bank, setBank] = useState("");
const [score, setScore] = useState(null);
const calculateEfficiency = () => {
const O = parseFloat(omzet);
const W = parseFloat(winst);
const B = parseFloat(bank);
if (isNaN(O) || isNaN(W) || isNaN(B) || O <= 0 || W <= 0 || B < 0) {
setScore("Ongeldige invoer. Vul correcte getallen in.");
return;
}
const winstMarge = Math.min((W / O) * 40, 40);
const cashRatio = Math.min((B / W) * 40, 40);
const cashOpbrengst = Math.min((B / O) * 20, 20);
const totaal = winstMarge + cashRatio + cashOpbrengst;
setScore(totaal.toFixed(1));
};
return (
)}
);
}
Boekhoud Efficiëntie Calculator
setOmzet(e.target.value)} /> setWinst(e.target.value)} /> setBank(e.target.value)} /> {score && (Efficiëntieratio:
{isNaN(score) ? score : `${score}%`}
{!isNaN(score) && (Een score onder de 60% wijst vaak op gemiste fiscale of cashflowoptimalisaties. Onze experts kunnen je helpen om hier winst te boeken.
)}