diff --git a/internal/booking/service.go b/internal/booking/service.go index ad39128..911f471 100644 --- a/internal/booking/service.go +++ b/internal/booking/service.go @@ -92,13 +92,11 @@ func (l Line) InvoiceNumber(hc *config.Host) string { return fmt.Sprintf("%s%04s", hc.InvoicePrefix, strconv.Itoa(l.Id+hc.CustomerSeed)) } -func (l Line) Fee() (f float64) { +func (l Line) Fee() float64 { if l.Platform == "Other" { - f = l.Total * 5 / 100 - } else { - f = l.Total * 10 / 100 + return l.Total * 5 / 100 } - return f + return l.Total * 10 / 100 } func (l Line) Profit() float64 { @@ -152,9 +150,8 @@ func (bs Service) BuildReport(period string, month, year int) *Report { BookingFees: u.Reduce(lines, func(l *Line, sum float64) float64 { if l.Platform == "Booking" { return sum + l.PlatformFees - } else { - return sum } + return sum }, 0.0), } }