From 2390ebdd4fe24cee177c47f34016aa999f4221c2 Mon Sep 17 00:00:00 2001 From: Christian Butterweck Date: Mon, 1 Jan 2024 21:08:38 +0100 Subject: [PATCH] Update controller.sh --- scripts/controller.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/controller.sh b/scripts/controller.sh index f1b364c..0292de7 100644 --- a/scripts/controller.sh +++ b/scripts/controller.sh @@ -195,9 +195,9 @@ elif [ "$price_unit" = "total" ]; then print total }' "$file" > "$output_file" elif [ "$price_unit" = "tax" ]; then - awk -v vat_rate="$vat_rate" '/data_price_hour_rel_.*_amount: / { + awk -v vat_rate="$vat_rate" -v energy_fee="$energy_fee" '/data_price_hour_rel_.*_amount: / { amount = substr($0, index($0, ":") + 2) - tax = amount * (1 + vat_rate) + tax = (amount * vat_rate) + energy_fee print tax }' "$file" > "$output_file" else