Search in sources :

Example 1 with AirbnbEarningsCalculator

use of com.github.drbookings.model.AirbnbEarningsCalculator in project drbookings by DrBookings.

the class BookingEntries method getEarningsAirbnb.

public static float getEarningsAirbnb(final Collection<? extends BookingEntry> bookings, boolean netEarnings, boolean paymentDone) {
    final BookingsByOrigin<BookingEntry> bo = new BookingsByOrigin<>(bookings);
    AirbnbEarningsCalculator aec = new AirbnbEarningsCalculator().filterForNetEarnings(netEarnings).filterForPaymentDone(paymentDone);
    return aec.calculateEarnings(BookingEntries.toBookings(bo.getAirbnbBookings()));
}
Also used : AirbnbEarningsCalculator(com.github.drbookings.model.AirbnbEarningsCalculator) BookingsByOrigin(com.github.drbookings.ui.BookingsByOrigin) BookingEntry(com.github.drbookings.ui.BookingEntry)

Aggregations

AirbnbEarningsCalculator (com.github.drbookings.model.AirbnbEarningsCalculator)1 BookingEntry (com.github.drbookings.ui.BookingEntry)1 BookingsByOrigin (com.github.drbookings.ui.BookingsByOrigin)1