From 520d54b4d20950fe619dc5ec5281aef9233da9c6 Mon Sep 17 00:00:00 2001 From: andig Date: Sun, 27 Oct 2024 22:41:29 +0100 Subject: [PATCH] Tariff: add margins and uplifts (#16855) --- tariff/embed.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tariff/embed.go b/tariff/embed.go index 5b171e220..50dad0744 100644 --- a/tariff/embed.go +++ b/tariff/embed.go @@ -1,10 +1,12 @@ package tariff type embed struct { + Margin float64 `mapstructure:"margin"` Charges float64 `mapstructure:"charges"` Tax float64 `mapstructure:"tax"` + Uplifts float64 `mapstructure:"uplifts"` } func (t *embed) totalPrice(price float64) float64 { - return (price + t.Charges) * (1 + t.Tax) + return (price*(1+t.Margin)+t.Charges)*(1+t.Tax) + t.Uplifts }