From 611a471bf1582997d069a6301e860ff987057adb Mon Sep 17 00:00:00 2001 From: Jakob Date: Mon, 23 Mar 2026 16:08:13 +0100 Subject: [PATCH] Exclude Swedish VAT (25%) from prices and amounts in HTML output Multiply price and amount by 0.8 before generating HTML. Original CSV and TXT files remain unchanged. --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2690c3c..ed61b77 100644 --- a/src/main.rs +++ b/src/main.rs @@ -124,9 +124,9 @@ impl PreparedCustomer { .map(|t| FormattedTransaction { date: t.date.format("%Y-%m-%d %H:%M").to_string(), quality_name: t.quality_name, - price: fmt(t.price), + price: fmt(t.price * 0.8), volume: fmt(t.volume), - amount: fmt(t.amount), + amount: fmt(t.amount * 0.8), receipt: t.receipt, }) .collect(); @@ -158,7 +158,7 @@ impl PreparedCustomer { for card in &cards { for tx in &card.transactions { let volume: f64 = tx.volume.parse().unwrap(); - let amount: f64 = tx.amount.parse().unwrap(); + let amount: f64 = tx.amount.parse::().unwrap(); let entry = product_totals .entry(tx.quality_name.clone()) .or_insert((0.0, 0.0));