diff --git a/src/utils/arithmetic.ts b/src/utils/arithmetic.ts index 0864fd3b..912b3d0b 100644 --- a/src/utils/arithmetic.ts +++ b/src/utils/arithmetic.ts @@ -55,9 +55,12 @@ export function calculatePrice( // Calculate before VAT const beforeVat = vatIncluded ? precisionRound(price / (1 + vat)) : price; - // Return based on output selection - if (output === 'vat') return calculatedVat; - if (output === 'total') return total; - if (output === 'beforeVat') return beforeVat; - return 0; + switch (output) { + case 'vat': + return calculatedVat; + case 'total': + return total; + case 'beforeVat': + return beforeVat; + } }