mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-06 10:46:50 +00:00
inline return else
This commit is contained in:
parent
761719f1bf
commit
a7514e9419
1 changed files with 4 additions and 7 deletions
|
|
@ -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),
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue