Tariff: add margins and uplifts (#16855)
This commit is contained in:
parent
98d2dc556b
commit
520d54b4d2
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue